Trait gclient::ext::sp_core::traits::SpawnNamed

pub trait SpawnNamed:
    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

Something that can spawn tasks (blocking and non-blocking) with an assigned name and optional group.

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 SpawnNamed + 'clone>

§

fn clone(&self) -> Box<dyn SpawnNamed + '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 SpawnNamed + Send + 'clone>

§

fn clone(&self) -> Box<dyn SpawnNamed + 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 SpawnNamed + Send + Sync + 'clone>

§

fn clone(&self) -> Box<dyn SpawnNamed + 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 SpawnNamed + Sync + 'clone>

§

fn clone(&self) -> Box<dyn SpawnNamed + 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 SpawnNamed for Box<dyn SpawnNamed>

§

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

Spawn the given blocking future. Read more
§

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

Spawn the given non-blocking future. Read more

Implementors§