pub fn spawn<T, F>(name: &str, future: F) -> JoinHandle<T> ⓘExpand description
Spawn a named task onto the executor currently running on this thread.
The returned JoinHandle mirrors tokio semantics: awaiting it yields
the task’s output (or a JoinError if the
task was aborted or panicked), dropping it detaches the task, and
JoinHandle::abort cancels it.
§Panics
Panics when called outside Executor::block_on, mirroring
tokio::spawn outside a runtime.