[][src]Function ufut::next_poll

pub async fn next_poll<F>(__arg0: F) -> Result<<F as Future>::Output, F> where
    F: Future

Polls a future once. If it does not succeed, return it to try again

Examples

use futures_micro::*;

let f = poll_state(false, |done: &mut bool, ctx: &mut Context<'_>| {
  if *done { Poll::Ready(1) } else { *done = true; Poll::Pending }
});
let f = next_poll(f).await.unwrap_err();
assert_eq!(f.await, 1);