Skip to main content

spawn

Function spawn 

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

Spawns a Future<Output = T> that can execute on any thread; returns a Task.

The future will be polled to completion in the background. Awaiting the returned task has no effect when the future is polled. Dropping the task will cancel the future, unless you call Task::detach() first.