Skip to main content

spawn

Function spawn 

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

Spawn a future onto the current thread’s executor.

Must be called from within a block_on_with_spawn or Runtime::block_on context.

§Panics

Panics if called outside of an executor context.