pub fn poll_future<'a, T, Item, Error>(
future: &mut T,
poll_fns: &'a [&'a dyn for<'b> Fn(&'b mut T) -> Poll<Item, Error>],
) -> Poll<Item, Error>where
T: Future<Item = Item, Error = Error>,Expand description
The body of a futures::future::Future::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 Future for Foo {
type Item = ();
type Error = ();
fn poll(&mut self) -> futures::Poll<Self::Item, Self::Error> {
component_future::poll_future(self, Self::POLL_FNS)
}
}