[−][src]Function component_future::poll_stream
pub fn poll_stream<'a, T, Item, Error>(
stream: &mut T,
poll_fns: &'a [&'a dyn Fn(&'b mut T) -> Poll<Option<Item>, Error>]
) -> Poll<Option<Item>, Error> where
T: Stream<Item = Item, Error = Error>,
The body of a futures::stream::Stream::poll
method.
It will repeatedly call the given component poll functions until none of
them returns Ok(Async::Ready(t))
, Ok(Async::DidWork)
, or Err(e)
and
at least one of them returns Ok(Async::NotReady)
.
Panics
Panics if all component poll methods return Ok(Async::NothingToDo)
.
Examples
impl Stream for Foo { type Item = (); type Error = (); fn poll(&mut self) -> futures::Poll<Option<Self::Item>, Self::Error> { component_future::poll_stream(self, Self::POLL_FNS) } }