JoinSetExt

Trait JoinSetExt 

Source
pub trait JoinSetExt<T> {
    // Required methods
    fn spawn_traced<F>(&mut self, f: F) -> AbortHandle
       where F: Future<Output = T> + Send + 'static,
             T: Send + 'static;
    fn spawn_traced_named<S, F>(&mut self, name: S, f: F) -> AbortHandle
       where S: Into<String>,
             F: Future<Output = T> + Send + 'static,
             T: Send + 'static;
}
Expand description

Helper trait for providing traced spawning when using JoinSet<T>.

Required Methods§

Source

fn spawn_traced<F>(&mut self, f: F) -> AbortHandle
where F: Future<Output = T> + Send + 'static, T: Send + 'static,

Spawns a new asynchronous task, returning an AbortHandle for it.

This is meant to be a thin wrapper over task management types like JoinSet, and provides implicit “tracing” for spawned futures by ensuring that the task is attached to the current tracing span and the current allocation component.

Source

fn spawn_traced_named<S, F>(&mut self, name: S, f: F) -> AbortHandle
where S: Into<String>, F: Future<Output = T> + Send + 'static, T: Send + 'static,

Spawns a new named asynchronous task, returning an AbortHandle for it.

This is meant to be a thin wrapper over task management types like JoinSet, and provides implicit “tracing” for spawned futures by ensuring that the task is attached to the current tracing span and the current allocation component.

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_traced<F>(&mut self, f: F) -> AbortHandle
where F: Future<Output = T> + Send + 'static, T: Send + 'static,

Source§

fn spawn_traced_named<S, F>(&mut self, name: S, f: F) -> AbortHandle
where S: Into<String>, F: Future<Output = T> + Send + 'static, T: Send + 'static,

Implementors§