Skip to main content

SpawnEssentialNamed

Trait SpawnEssentialNamed 

Source
pub trait SpawnEssentialNamed:
    DynClone
    + Send
    + Sync {
    // Required methods
    fn spawn_essential_blocking(
        &self,
        name: &'static str,
        group: Option<&'static str>,
        future: BoxFuture<'static, ()>,
    );
    fn spawn_essential(
        &self,
        name: &'static str,
        group: Option<&'static str>,
        future: BoxFuture<'static, ()>,
    );
}
Expand description

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

Essential tasks are special tasks that should take down the node when they end.

Required Methods§

Source

fn spawn_essential_blocking( &self, name: &'static str, group: Option<&'static str>, future: BoxFuture<'static, ()>, )

Spawn the given blocking future.

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

Source

fn spawn_essential( &self, name: &'static str, group: Option<&'static str>, future: BoxFuture<'static, ()>, )

Spawn the given non-blocking future.

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

Trait Implementations§

Source§

impl SpawnEssentialNamed for Box<dyn SpawnEssentialNamed>

Source§

fn spawn_essential_blocking( &self, name: &'static str, group: Option<&'static str>, future: BoxFuture<'static, ()>, )

Spawn the given blocking future. Read more
Source§

fn spawn_essential( &self, name: &'static str, group: Option<&'static str>, future: BoxFuture<'static, ()>, )

Spawn the given non-blocking future. Read more

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl SpawnEssentialNamed for Box<dyn SpawnEssentialNamed>

Source§

fn spawn_essential_blocking( &self, name: &'static str, group: Option<&'static str>, future: BoxFuture<'static, ()>, )

Source§

fn spawn_essential( &self, name: &'static str, group: Option<&'static str>, future: BoxFuture<'static, ()>, )

Implementors§

Source§

impl SpawnEssentialNamed for TaskExecutor

Available on crate feature std only.