Skip to main content

block_on

Function block_on 

Source
pub fn block_on<F, Fut, R>(f: F) -> R
where F: FnOnce(Handle) -> Fut, Fut: Future<Output = R>,
Expand description

Runs a future to completion on the current thread until it completes.

The future is provided a Handle to the runtime so that it may spawn additional tasks to be executed concurrently.