We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 05c39f7 commit 62eda1eCopy full SHA for 62eda1e
src/poll.rs
@@ -74,6 +74,22 @@ pub enum AsyncSink<T> {
74
NotReady(T),
75
}
76
77
+impl<T> AsyncSink<T> {
78
+ /// Returns whether this is `AsyncSink::NotReady`
79
+ pub fn is_not_ready(&self) -> bool {
80
+ match *self {
81
+ AsyncSink::NotReady(_) => true,
82
+ AsyncSink::Ready => false,
83
+ }
84
85
+
86
+ /// Returns whether this is `AsyncSink::Ready`
87
+ pub fn is_ready(&self) -> bool {
88
+ !self.is_not_ready()
89
90
+}
91
92
93
/// Return type of the `Sink::start_send` method, indicating the outcome of a
94
/// send attempt. See `AsyncSink` for more details.
95
pub type StartSend<T, E> = Result<AsyncSink<T>, E>;
0 commit comments