Function wasm_bindgen_futures::spawn_local

source ·
pub fn spawn_local<F>(future: F)
where F: Future<Output = ()> + 'static,
Expand description

Runs a Rust Future on the current thread.

The future must be 'static because it will be scheduled to run in the background and cannot contain any stack references.

The future will always be run on the next microtask tick even if it immediately returns Poll::Ready.


This function has the same panic behavior as future_to_promise.