Trait WithSubscriber
trait WithSubscriber: Sized
Extension trait allowing futures to be instrumented with
a tracing Subscriber.
Provided Methods
fn with_subscriber<S>(self: Self, subscriber: S) -> WithDispatch<Self> where S: Into<Dispatch>Attaches the provided
Subscriberto this type, returning aWithDispatchwrapper.The attached
Subscriberwill be set as the default when the returnedFutureis polled.Examples
# use NoSubscriber as MySubscriber; # use NoSubscriber as MyOtherSubscriber; # asyncfn with_current_subscriber(self: Self) -> WithDispatch<Self>Attaches the current default
Subscriberto this type, returning aWithDispatchwrapper.The attached
Subscriberwill be set as the default when the returnedFutureis polled.This can be used to propagate the current dispatcher context when spawning a new future that may run on a different thread.
Examples
# # use NoSubscriber as MySubscriber; # async
Implementors
impl<T> WithSubscriber for Entered<'a>impl<T> WithSubscriber for EnteredSpanimpl<T: Sized> WithSubscriber for Timpl<T> WithSubscriber for WithDispatch<T>impl<T> WithSubscriber for Instrumented<T>impl<T> WithSubscriber for Span