Skip to main content

spawn_blocking

Function spawn_blocking 

Source
pub fn spawn_blocking<T: Send + 'static>(
    work: impl FnOnce() -> T + Send + 'static,
) -> impl Future<Output = T>
Expand description

Runs work on a background thread; the returned future resolves on the UI thread with its result.