referrerpolicy=no-referrer-when-downgrade
pub trait Spawner: DynClone + Send + Sync {
    // Required methods
    fn spawn_blocking(
        &self,
        name: &'static str,
        group: Option<&'static str>,
        future: Pin<Box<dyn Future<Output = ()> + Send>>,
    );
    fn spawn(
        &self,
        name: &'static str,
        group: Option<&'static str>,
        future: Pin<Box<dyn Future<Output = ()> + Send>>,
    );
}
Expand description

A spawner

Required Methods§

fn spawn_blocking( &self, name: &'static str, group: Option<&'static str>, future: Pin<Box<dyn Future<Output = ()> + Send>>, )

Spawn the given blocking future.

The given group and name is used to identify the future in tracing.

fn spawn( &self, name: &'static str, group: Option<&'static str>, future: Pin<Box<dyn Future<Output = ()> + Send>>, )

Spawn the given non-blocking future.

The given group and name is used to identify the future in tracing.

Trait Implementations§

§

impl<'clone> Clone for Box<dyn Spawner + 'clone>

§

fn clone(&self) -> Box<dyn Spawner + 'clone>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl<'clone> Clone for Box<dyn Spawner + Send + 'clone>

§

fn clone(&self) -> Box<dyn Spawner + Send + 'clone>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl<'clone> Clone for Box<dyn Spawner + Send + Sync + 'clone>

§

fn clone(&self) -> Box<dyn Spawner + Send + Sync + 'clone>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl<'clone> Clone for Box<dyn Spawner + Sync + 'clone>

§

fn clone(&self) -> Box<dyn Spawner + Sync + 'clone>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Implementations on Foreign Types§

source§

impl<S> Spawner for SpawnGlue<S>
where S: SpawnNamed + Clone + Send + Sync,

source§

fn spawn_blocking( &self, name: &'static str, group: Option<&'static str>, future: Pin<Box<dyn Future<Output = ()> + Send>>, )

source§

fn spawn( &self, name: &'static str, group: Option<&'static str>, future: Pin<Box<dyn Future<Output = ()> + Send>>, )

Implementors§