Skip to main content

LocalSpawner

Trait LocalSpawner 

Source
pub trait LocalSpawner {
    // Required method
    fn spawn_local<F>(&self, task: F)
       where F: Future<Output = ()> + 'static;
}
Expand description

Runs a task that is not Send in the background, on a single-threaded executor.

Use it with the *_local_on methods of Deferred. The same requirements as Spawner apply.

§Embassy

Use embassy_spawner! to declare a LocalSpawner for embassy.

Required Methods§

Source

fn spawn_local<F>(&self, task: F)
where F: Future<Output = ()> + 'static,

Runs task in the background.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§