Skip to main content

blocking

Function blocking 

Source
pub async fn blocking<T: Send + 'static>(
    operation: &'static str,
    work: impl FnOnce() -> T + Send + 'static,
) -> Result<T, TaskFailed>
Expand description

Run work on the blocking pool. A panic in it, or the runtime dropping it unstarted (ShutdownOutcome::NotRun), comes back as TaskFailed, never as an unwind.