🛈 Note: This is pre-release documentation for the upcoming tracing 0.2.0 ecosystem.

For the release documentation, please see docs.rs, instead.

Trait tracing_futures::WithCollector

source ·
pub trait WithCollector: Sized {
    // Provided methods
    fn with_collector<C>(self, collector: C) -> WithDispatch<Self> 
       where C: Into<Dispatch> { ... }
    fn with_current_collector(self) -> WithDispatch<Self>  { ... }
}
Available on crate feature std only.
Expand description

Extension trait allowing futures, streams, and sinks to be instrumented with a tracing collector.

Provided Methods§

source

fn with_collector<C>(self, collector: C) -> WithDispatch<Self>
where C: Into<Dispatch>,

Attaches the provided collector to this type, returning a WithDispatch wrapper.

When the wrapped type is a future, stream, or sink, the attached subscriber will be set as the default while it is being polled. When the wrapped type is an executor, the subscriber will be set as the default for any futures spawned on that executor.

source

fn with_current_collector(self) -> WithDispatch<Self>

Attaches the current default collector to this type, returning a WithDispatch wrapper.

When the wrapped type is a future, stream, or sink, the attached subscriber will be set as the default while it is being polled. When the wrapped type is an executor, the subscriber will be set as the default for any futures spawned on that executor.

This can be used to propagate the current dispatcher context when spawning a new future.

Object Safety§

This trait is not object safe.

Implementors§