Skip to main content

spawn_local

Function spawn_local 

pub fn spawn_local<F>(future: F) -> JoinHandle<<F as Future>::Output> ⓘ
where F: Future + 'static, <F as Future>::Output: 'static,
Available on crate features dial9 and tokio only.
Expand description

spawn without the Send bounds.

The task is spawned on the calling thread’s LocalSet or LocalRuntime. To target a specific LocalSet, use spawn_local_in.

§Panics

Panics if called outside a LocalSet or LocalRuntime context (same as [tokio::task::spawn_local]).