I might be doing something wrong, but it genuinely suspect that the futures::Sink trait would be better off merging the poll_ready and start_send methods.
-
Show this thread
-
New method signature: fn poll_send( mut self: Pin<&mut Self>, waker: &Waker, item: Self::Item ) -> Poll<Result<(), Self::SinkError>> Current: https://docs.rs/futures-preview/0.3.0-alpha.13/futures/prelude/trait.Sink.html …
2 replies 0 retweets 1 likeShow this thread -
Replying to @yoshuawuyts
The problem is that poll_send() consumes the item and doesn't return it back when not ready. If Poll::Pending is returned by the function, it's impossible to recover the item. With poll_ready() and start_send() we pass the item only once when we're sure sending will complete.
2 replies 0 retweets 2 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.