spawn_blocking

Function spawn_blocking 

Source
pub fn spawn_blocking<R, F>(func: F) -> Box<dyn Task<R>>
where R: Send + 'static, F: FnOnce() -> R + Send + 'static,
Expand description

Spawns a blocking task on the global task runner.

This will always spawn a task in a background thread, as local spawning would block the thread.

Only available on native platforms.