Skip to main content

Spawner

Trait Spawner 

Source
pub trait Spawner {
    // Required method
    fn spawn<S>(&self, token: SpawnToken<S>) -> Result<(), SpawnError>;
}
Expand description

The trait to replace the embassy_executor::Spawner in code to allow the MockSpawner to be used in its place for tests.

Required Methods§

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl Spawner for Spawner

Source§

fn spawn<S>(&self, token: SpawnToken<S>) -> Result<(), SpawnError>

Spawn a task into an executor.

You obtain the token by calling a task function (i.e. one marked with #[embassy_executor::task]).

Implementors§