Function spawn

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

Spawns a future for execution, adapting to the target environment.

On WASM (wasm32), it uses wasm_bindgen_futures::spawn_local to avoid blocking the main thread. On other targets, it uses pollster::block_on to synchronously wait for the future to complete.