[−][src]Function futures_test_sink::from_iter
pub fn from_iter<Item, FI, SSI, E>(
poll_fallback: FI,
start_send_fallback: SSI
) -> impl Sink<Item, Error = E> where
FI: Iterator<Item = Poll<Result<(), E>>> + Unpin,
SSI: Iterator<Item = Result<(), E>> + Unpin,
E: Unpin,
Item: Unpin,
This method allows to create Sink from iterators.
Any time you call poll_ready
, poll_flush
or push_close
the next method will be called on poll_fallback
iterator.
If iterator return Poll::Pending
the cx.waker().clone().wake()
will be additionally called.
Where cx
is std::task::Context
passed to poll_ready
, poll_flush
or poll_close
function.
Any time you call start_send
the inner implementation will discard item
and return
unwrapped item that start_send_fallback
iterator return.
Panics
If poll_fallback
or start_send_fallback
iterator has no more elements. To prevent this use
cycle method.