Expand description
Runtime-neutral helpers for Futures, built on the standard library only.
No reactor, timer or thread pool is involved, so none of it depends on tokio, async-std or any other
runtime: block_on runs a future on the current thread, join and join_all combine futures on
one task, and now_or_never and yield_now are the small building blocks around them.
Functionsยง
- block_
on - Runs
futureto completion on the current thread and returns its output. - join
- Runs two futures concurrently and completes with both outputs, once both are done.
- join_
all - Runs any number of futures concurrently and completes with all their outputs, in the order the futures were given.
- now_
or_ never - Polls
futureexactly once and returns its output if it was already ready. - yield_
now - A future that gives other tasks a turn: it is pending once, then completes.