Skip to main content

block_on

Function block_on 

Source
pub fn block_on<Fut>(future: Fut) -> Fut::Output
where Fut: Future + Send + 'static, Fut::Output: Send + 'static,
Expand description

Blocks on future.

IO & time related Futures must be handled within their own Context. Wait for the result using a JoinHandle or a channel.

The current thread is blocking and the passed in future is executed.

ยงPanics

This function panics if called within a Context thread.