pub fn spawn_blocking<Function, Output, Name, NameClosure>(
    _nc: NameClosure,
    function: Function
) -> JoinHandle<Output> where
    Name: AsRef<str>,
    NameClosure: FnOnce() -> Name,
    Function: FnOnce() -> Output + Send + 'static,
    Output: Send + 'static, 
Available on crate feature task only.
Expand description

Runs the provided closure with a name on a thread where blocking is acceptable.

See tokio::task::spawn_blocking and the module docs for more information.