[][src]Function blocking::block_on

pub fn block_on<T>(future: impl Future<Output = T>) -> T

Blocks the current thread on a future.

Examples

use blocking::block_on;

let val = block_on(async {
    1 + 2
});

assert_eq!(val, 3);