Function spawn_blocking

Source
pub fn spawn_blocking<F, R>(f: F) -> JoinHandle<F::Output> 
where F: FnOnce() -> R + Send + 'static, R: Send + 'static,
Expand description

Spawns a blocking function in a new thread, and returns an async handle to it’s result.