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, Global>>
    );
    fn spawn(
        &self,
        name: &'static str,
        group: Option<&'static str>,
        future: Pin<Box<dyn Future<Output = ()> + Send, Global>>
    );
}
Expand description

A spawner

Required Methods§

source

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

Spawn the given blocking future.

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

source

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

Spawn the given non-blocking future.

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

Trait Implementations§

source§

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

source§

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

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
source§

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

source§

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

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
source§

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

source§

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

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
source§

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

source§

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

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

Implementors§