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§
Sourcefn spawn_traced<F>(&mut self, f: F) -> AbortHandle
fn spawn_traced<F>(&mut self, f: F) -> AbortHandle
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.
Sourcefn spawn_traced_named<S, F>(&mut self, name: S, f: F) -> AbortHandle
fn spawn_traced_named<S, F>(&mut self, name: S, f: F) -> AbortHandle
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.