yield_now
A future that gives other tasks a turn: it is pending once, then completes.
The first poll wakes the task straight away and returns Pending, so an executor that runs
many tasks can schedule the others before resuming this one. Call it inside a long
computation in an async block to keep it from monopolising its thread.
Import
Section titled “Import”Cargo feature future (enabled by default). To compile only this module:
or in Cargo.toml:
Signature
Section titled “Signature”Returns
Section titled “Returns”impl Future<Output = ()> — A future that completes on its second poll.
