Skip to main content

spawn

Function spawn 

Source
pub fn spawn<F>(fut: F) -> JoinHandle<F::Output> ⓘ
where F: Future + 'static,
Expand description

Spawns a future on the current native runtime and returns its join handle.

The future and its output need not be Send. Registered task_callbacks wrap the task. Dropping the handle detaches it; completion is not guaranteed if the runtime shuts down.

§Panics

Panics if no native runtime is active on the current thread.