Skip to main content

SpawnFuture

Trait SpawnFuture 

Source
pub trait SpawnFuture<T>:
    Future<Output = T>
    + Send
    + 'static { }
Expand description

A future use_future and spawn can run.

Native polls it on a thread of its own, so it has to be Send; wasm polls it on the one browser thread, so it does not. That is the only difference between the platforms, and it lives here so that user code names one trait.

Implementors§

Source§

impl<T, F: Future<Output = T> + Send + 'static> SpawnFuture<T> for F

Available on non-WebAssembly only.