Function run

Source
pub fn run<F, T>(blocking_fn: F) -> impl Future<Output = T>
where F: FnOnce() -> T + Send + 'static, T: Send + 'static,
Expand description

Executes a task in a new thread, returning a Future to .await the result.

See the crate-level documentation for details.

ยงPanics

Panics if it fails to spawn a thread.