mz_ore::task

Trait JoinSetExt

Source
pub trait JoinSetExt<T> {
    // Required method
    fn spawn_named<Fut, Name, NameClosure>(
        &mut self,
        nc: NameClosure,
        future: Fut,
    ) -> AbortHandle
       where Name: AsRef<str>,
             NameClosure: FnOnce() -> Name,
             Fut: Future<Output = T> + Send + 'static,
             T: Send + 'static;
}
Available on crate feature async only.
Expand description

Extension methods for tokio::task::JoinSet.

See the module docs for more information.

Required Methods§

Source

fn spawn_named<Fut, Name, NameClosure>( &mut self, nc: NameClosure, future: Fut, ) -> AbortHandle
where Name: AsRef<str>, NameClosure: FnOnce() -> Name, Fut: Future<Output = T> + Send + 'static, T: Send + 'static,

Spawns a new asynchronous task with a name.

See tokio::task::spawn and the module docs for more information.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T> JoinSetExt<T> for JoinSet<T>

Source§

fn spawn_named<Fut, Name, NameClosure>( &mut self, nc: NameClosure, future: Fut, ) -> AbortHandle
where Name: AsRef<str>, NameClosure: FnOnce() -> Name, Fut: Future<Output = T> + Send + 'static, T: Send + 'static,

Implementors§