Macro nb::try_nb
[−]
[src]
macro_rules! try_nb { ($e:expr) => { ... }; }
Future adapter
This is a try operation from a nb::Result
to a futures::Poll
Requirements
This macro must be called within a function / closure that has signature
fn(..) -> futures::Poll<T, E>
.
This macro requires that the futures
crate is in the root of the crate.
Input
An expression $e
that evaluates to nb::Result<T, E>
Early return
Ok(Async::NotReady)
if$e
evaluates toErr(nb::Error::WouldBlock)
Err(e)
if$e
evaluates toErr(nb::Error::Other(e))
Output
t
if $e
evaluates to Ok(t)