Skip to main content

spawn_local

Function spawn_local 

Source
pub fn spawn_local<F>(future: F) -> Task<F::Output> ⓘ
where F: Future + 'static, F::Output: 'static,
Expand description

Spawns a task that stays on the calling thread: a worker’s shard, or the thread’s own (where it runs while the thread is inside block_on). The future need not be Send.

§Panics

When this thread’s shard cannot start (its poller cannot be made); task::Builder::spawn_local answers the error instead.