pub fn spawn<F, T>(f: F) -> JoinHandle<T> where
F: FnOnce() -> T,
F: Send + 'static,
T: Send + 'static, Expand description
Spawns a concurrent task and returns a JoinHandle for it.
The given fn serves as main in spawned task. All other coroutines in that task will be
aborted through panic! when given fn completed.