Skip to main content

Module exec

Module exec 

Source
Expand description

A dependency-free executor for backends whose futures are already ready.

crate::fs::ReadStorage is async so genuinely async backends fit, but the common native case — crate::fs::StdFs — produces futures that complete on the first poll. block_on drives such a future without pulling in a runtime: a no-op waker and a poll loop. It works for any future that makes progress when polled (it busy-polls; it is not a fair scheduler), which makes it suitable for CLIs and tests, not for I/O multiplexing.

Functions§

block_on
Drive future to completion on the current thread by polling in a loop with a no-op waker.