Struct tracing_subscriber::layer::Layered
source · [−]pub struct Layered<L, I, S = I> { /* private fields */ }Expand description
A Subscriber composed of a Subscriber wrapped by one or more
Layers.
Implementations
sourceimpl<L, S> Layered<L, S>where
L: Layer<S>,
S: Subscriber,
impl<L, S> Layered<L, S>where
L: Layer<S>,
S: Subscriber,
sourcepub fn is<T: Any>(&self) -> bool
pub fn is<T: Any>(&self) -> bool
Returns true if this Subscriber is the same type as T.
sourcepub fn downcast_ref<T: Any>(&self) -> Option<&T>ⓘNotable traits for Option<L>impl<L, S> Layer<S> for Option<L>where
L: Layer<S>,
S: Subscriber,
pub fn downcast_ref<T: Any>(&self) -> Option<&T>ⓘNotable traits for Option<L>impl<L, S> Layer<S> for Option<L>where
L: Layer<S>,
S: Subscriber,
L: Layer<S>,
S: Subscriber,
Returns some reference to this Subscriber value if it is of type T,
or None if it isn’t.
Trait Implementations
sourceimpl<L: Clone, I: Clone, S: Clone> Clone for Layered<L, I, S>
impl<L: Clone, I: Clone, S: Clone> Clone for Layered<L, I, S>
sourcefn clone(&self) -> Layered<L, I, S>ⓘNotable traits for Layered<A, B, S>impl<S, A, B> Layer<S> for Layered<A, B, S>where
A: Layer<S>,
B: Layer<S>,
S: Subscriber,
fn clone(&self) -> Layered<L, I, S>ⓘNotable traits for Layered<A, B, S>impl<S, A, B> Layer<S> for Layered<A, B, S>where
A: Layer<S>,
B: Layer<S>,
S: Subscriber,
A: Layer<S>,
B: Layer<S>,
S: Subscriber,
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresourceimpl<S, A, B> Layer<S> for Layered<A, B, S>where
A: Layer<S>,
B: Layer<S>,
S: Subscriber,
impl<S, A, B> Layer<S> for Layered<A, B, S>where
A: Layer<S>,
B: Layer<S>,
S: Subscriber,
sourcefn on_register_dispatch(&self, subscriber: &Dispatch)
fn on_register_dispatch(&self, subscriber: &Dispatch)
Performs late initialization when installing this layer as a
Subscriber. Read moresourcefn register_callsite(&self, metadata: &'static Metadata<'static>) -> Interest
fn register_callsite(&self, metadata: &'static Metadata<'static>) -> Interest
Registers a new callsite with this layer, returning whether or not
the layer is interested in being notified about the callsite, similarly
to
Subscriber::register_callsite. Read moresourcefn enabled(&self, metadata: &Metadata<'_>, ctx: Context<'_, S>) -> bool
fn enabled(&self, metadata: &Metadata<'_>, ctx: Context<'_, S>) -> bool
Returns
true if this layer is interested in a span or event with the
given metadata in the current Context, similarly to
Subscriber::enabled. Read moresourcefn on_new_span(&self, attrs: &Attributes<'_>, id: &Id, ctx: Context<'_, S>)
fn on_new_span(&self, attrs: &Attributes<'_>, id: &Id, ctx: Context<'_, S>)
sourcefn on_follows_from(&self, span: &Id, follows: &Id, ctx: Context<'_, S>)
fn on_follows_from(&self, span: &Id, follows: &Id, ctx: Context<'_, S>)
Notifies this layer that a span with the ID
span recorded that it
follows from the span with the ID follows. Read moresourcefn event_enabled(&self, event: &Event<'_>, ctx: Context<'_, S>) -> bool
fn event_enabled(&self, event: &Event<'_>, ctx: Context<'_, S>) -> bool
sourcefn on_event(&self, event: &Event<'_>, ctx: Context<'_, S>)
fn on_event(&self, event: &Event<'_>, ctx: Context<'_, S>)
Notifies this layer that an event has occurred.
sourcefn on_enter(&self, id: &Id, ctx: Context<'_, S>)
fn on_enter(&self, id: &Id, ctx: Context<'_, S>)
Notifies this layer that a span with the given ID was entered.
sourcefn on_exit(&self, id: &Id, ctx: Context<'_, S>)
fn on_exit(&self, id: &Id, ctx: Context<'_, S>)
Notifies this layer that the span with the given ID was exited.
sourcefn on_close(&self, id: Id, ctx: Context<'_, S>)
fn on_close(&self, id: Id, ctx: Context<'_, S>)
Notifies this layer that the span with the given ID has been closed.
sourcefn on_id_change(&self, old: &Id, new: &Id, ctx: Context<'_, S>)
fn on_id_change(&self, old: &Id, new: &Id, ctx: Context<'_, S>)
Notifies this layer that a span ID has been cloned, and that the
subscriber returned a different ID. Read more
sourcefn and_then<L>(self, layer: L) -> Layered<L, Self, S>ⓘNotable traits for Layered<A, B, S>impl<S, A, B> Layer<S> for Layered<A, B, S>where
A: Layer<S>,
B: Layer<S>,
S: Subscriber,where
L: Layer<S>,
Self: Sized,
fn and_then<L>(self, layer: L) -> Layered<L, Self, S>ⓘNotable traits for Layered<A, B, S>impl<S, A, B> Layer<S> for Layered<A, B, S>where
A: Layer<S>,
B: Layer<S>,
S: Subscriber,where
L: Layer<S>,
Self: Sized,
A: Layer<S>,
B: Layer<S>,
S: Subscriber,
Composes this layer around the given
Layer, returning a Layered
struct implementing Layer. Read moresourcefn with_subscriber(self, inner: S) -> Layered<Self, S>ⓘNotable traits for Layered<A, B, S>impl<S, A, B> Layer<S> for Layered<A, B, S>where
A: Layer<S>,
B: Layer<S>,
S: Subscriber,where
Self: Sized,
fn with_subscriber(self, inner: S) -> Layered<Self, S>ⓘNotable traits for Layered<A, B, S>impl<S, A, B> Layer<S> for Layered<A, B, S>where
A: Layer<S>,
B: Layer<S>,
S: Subscriber,where
Self: Sized,
A: Layer<S>,
B: Layer<S>,
S: Subscriber,
Composes this
Layer with the given Subscriber, returning a
Layered struct that implements Subscriber. Read moresourcefn with_filter<F>(self, filter: F) -> Filtered<Self, F, S>ⓘNotable traits for Filtered<L, F, S>impl<S, L, F> Layer<S> for Filtered<L, F, S>where
S: Subscriber + for<'span> LookupSpan<'span> + 'static,
F: Filter<S> + 'static,
L: Layer<S>,where
Self: Sized,
F: Filter<S>,
fn with_filter<F>(self, filter: F) -> Filtered<Self, F, S>ⓘNotable traits for Filtered<L, F, S>impl<S, L, F> Layer<S> for Filtered<L, F, S>where
S: Subscriber + for<'span> LookupSpan<'span> + 'static,
F: Filter<S> + 'static,
L: Layer<S>,where
Self: Sized,
F: Filter<S>,
S: Subscriber + for<'span> LookupSpan<'span> + 'static,
F: Filter<S> + 'static,
L: Layer<S>,
Available on crate features
registry and std only.sourceimpl<'a, L, S> LookupSpan<'a> for Layered<L, S>where
S: Subscriber + LookupSpan<'a>,
impl<'a, L, S> LookupSpan<'a> for Layered<L, S>where
S: Subscriber + LookupSpan<'a>,
type Data = <S as LookupSpan<'a>>::Data
type Data = <S as LookupSpan<'a>>::Data
The type of span data stored in this registry.
sourcefn span_data(&'a self, id: &Id) -> Option<Self::Data>ⓘNotable traits for Option<L>impl<L, S> Layer<S> for Option<L>where
L: Layer<S>,
S: Subscriber,
fn span_data(&'a self, id: &Id) -> Option<Self::Data>ⓘNotable traits for Option<L>impl<L, S> Layer<S> for Option<L>where
L: Layer<S>,
S: Subscriber,
L: Layer<S>,
S: Subscriber,
sourcefn register_filter(&mut self) -> FilterId
fn register_filter(&mut self) -> FilterId
Available on crate feature
registry only.sourceimpl<L, S> Subscriber for Layered<L, S>where
L: Layer<S>,
S: Subscriber,
impl<L, S> Subscriber for Layered<L, S>where
L: Layer<S>,
S: Subscriber,
sourcefn register_callsite(&self, metadata: &'static Metadata<'static>) -> Interest
fn register_callsite(&self, metadata: &'static Metadata<'static>) -> Interest
sourcefn max_level_hint(&self) -> Option<LevelFilter>ⓘNotable traits for Option<L>impl<L, S> Layer<S> for Option<L>where
L: Layer<S>,
S: Subscriber,
fn max_level_hint(&self) -> Option<LevelFilter>ⓘNotable traits for Option<L>impl<L, S> Layer<S> for Option<L>where
L: Layer<S>,
S: Subscriber,
L: Layer<S>,
S: Subscriber,
Returns the highest verbosity level that this
Subscriber will
enable, or None, if the subscriber does not implement level-based
filtering or chooses not to implement this method. Read moresourcefn new_span(&self, span: &Attributes<'_>) -> Id
fn new_span(&self, span: &Attributes<'_>) -> Id
sourcefn record_follows_from(&self, span: &Id, follows: &Id)
fn record_follows_from(&self, span: &Id, follows: &Id)
sourcefn event_enabled(&self, event: &Event<'_>) -> bool
fn event_enabled(&self, event: &Event<'_>) -> bool
sourcefn clone_span(&self, old: &Id) -> Id
fn clone_span(&self, old: &Id) -> Id
sourcefn drop_span(&self, id: Id)
fn drop_span(&self, id: Id)
👎Deprecated since 0.1.2: use
Subscriber::try_close insteadThis method is deprecated. Read more
sourcefn current_span(&self) -> Current
fn current_span(&self) -> Current
Returns a type representing this subscriber’s view of the current span. Read more
sourcefn on_register_dispatch(&self, subscriber: &Dispatch)
fn on_register_dispatch(&self, subscriber: &Dispatch)
Auto Trait Implementations
impl<L, I, S> RefUnwindSafe for Layered<L, I, S>where
I: RefUnwindSafe,
L: RefUnwindSafe,
impl<L, I, S> Send for Layered<L, I, S>where
I: Send,
L: Send,
impl<L, I, S> Sync for Layered<L, I, S>where
I: Sync,
L: Sync,
impl<L, I, S> Unpin for Layered<L, I, S>where
I: Unpin,
L: Unpin,
impl<L, I, S> UnwindSafe for Layered<L, I, S>where
I: UnwindSafe,
L: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<S> SubscriberExt for Swhere
S: Subscriber,
impl<S> SubscriberExt for Swhere
S: Subscriber,
sourceimpl<T> SubscriberInitExt for Twhere
T: Into<Dispatch>,
impl<T> SubscriberInitExt for Twhere
T: Into<Dispatch>,
sourcefn set_default(self) -> DefaultGuard
fn set_default(self) -> DefaultGuard
Available on crate feature
std only.Sets
self as the default subscriber in the current scope, returning a
guard that will unset it when dropped. Read moresourcefn try_init(self) -> Result<(), TryInitError>
fn try_init(self) -> Result<(), TryInitError>
Attempts to set
self as the global default subscriber in the current
scope, returning an error if one is already set. Read moresourcefn init(self)
fn init(self)
Attempts to set
self as the global default subscriber in the current
scope, panicking if this fails. Read more