pub trait HandleExt<T> {
// Required methods
fn spawn_traced<F>(&self, f: F) -> JoinHandle<T>
where F: Future<Output = T> + Send + 'static,
T: Send + 'static;
fn spawn_traced_named<S, F>(&self, name: S, f: F) -> JoinHandle<T>
where S: Into<String>,
F: Future<Output = T> + Send + 'static,
T: Send + 'static;
}
Expand description
Helper trait for providing traced spawning when using Handle
.
Required Methods§
Sourcefn spawn_traced<F>(&self, f: F) -> JoinHandle<T>
fn spawn_traced<F>(&self, f: F) -> JoinHandle<T>
Spawns a new asynchronous task, returning a JoinHandle
for it.
This is meant to be a thin wrapper over task management types like Handle
, 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>(&self, name: S, f: F) -> JoinHandle<T>
fn spawn_traced_named<S, F>(&self, name: S, f: F) -> JoinHandle<T>
Spawns a new named asynchronous task, returning a JoinHandle
for it.
This is meant to be a thin wrapper over task management types like Handle
, 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.