Skip to main content

spawn_blocking

Function spawn_blocking 

Source
pub fn spawn_blocking<F, T>(f: F) -> Task<T> ⓘ
where F: FnOnce() -> T + Send + 'static, T: Send + 'static,
Expand description

Runs f on the blocking pool of the runtime this thread is inside, or of the default runtime, so it never holds a shard up.

§Panics

When the default runtime cannot start.