Skip to main content

now_or_never

Function now_or_never 

pub fn now_or_never<F>(fut: F) -> Option<<F as Future>::Output>
where F: Future,
Available on crate feature std only.
Expand description

Poll the future once and return Some if it is ready, else None.

If the future wasn’t ready, it future likely can’t be driven to completion any more: the polling uses a no-op waker, so knowledge of what the pending future was waiting for is lost.