pub struct Layered<S, I, C = I> { /* private fields */ }
Expand description
A collector composed of a collector wrapped by one or more subscribers.
Implementations§
Trait Implementations§
Source§impl<S, C> Collect for Layered<S, C>
impl<S, C> Collect for Layered<S, C>
Source§fn register_callsite(&self, metadata: &'static Metadata<'static>) -> Interest
fn register_callsite(&self, metadata: &'static Metadata<'static>) -> Interest
Source§fn max_level_hint(&self) -> Option<LevelFilter> ⓘ
fn max_level_hint(&self) -> Option<LevelFilter> ⓘ
Returns the highest verbosity level that this
Collector
will
enable, or None
, if the collector does not implement level-based
filtering or chooses not to implement this method. Read moreSource§fn new_span(&self, span: &Attributes<'_>) -> Id
fn new_span(&self, span: &Attributes<'_>) -> Id
Source§fn record_follows_from(&self, span: &Id, follows: &Id)
fn record_follows_from(&self, span: &Id, follows: &Id)
Source§fn event_enabled(&self, event: &Event<'_>) -> bool
fn event_enabled(&self, event: &Event<'_>) -> bool
Source§fn clone_span(&self, old: &Id) -> Id
fn clone_span(&self, old: &Id) -> Id
Source§fn drop_span(&self, id: Id)
fn drop_span(&self, id: Id)
👎Deprecated since 0.1.2: use
Collector::try_close
insteadThis method is deprecated. Read more
Source§fn current_span(&self) -> Current
fn current_span(&self) -> Current
Returns a type representing this collector’s view of the current span. Read more
Source§fn on_register_dispatch(&self, collector: &Dispatch)
fn on_register_dispatch(&self, collector: &Dispatch)
Source§impl<'a, S, C> LookupSpan<'a> for Layered<S, C>where
C: Collect + LookupSpan<'a>,
impl<'a, S, C> LookupSpan<'a> for Layered<S, C>where
C: Collect + LookupSpan<'a>,
Source§impl<C, A, B> Subscribe<C> for Layered<A, B, C>
impl<C, A, B> Subscribe<C> for Layered<A, B, C>
Source§fn on_register_dispatch(&self, collector: &Dispatch)
fn on_register_dispatch(&self, collector: &Dispatch)
Source§fn on_subscribe(&mut self, collect: &mut C)
fn on_subscribe(&mut self, collect: &mut C)
Source§fn register_callsite(&self, metadata: &'static Metadata<'static>) -> Interest
fn register_callsite(&self, metadata: &'static Metadata<'static>) -> Interest
Registers a new callsite with this subscriber, returning whether or not
the subscriber is interested in being notified about the callsite, similarly
to
Collect::register_callsite
. Read moreSource§fn enabled(&self, metadata: &Metadata<'_>, ctx: Context<'_, C>) -> bool
fn enabled(&self, metadata: &Metadata<'_>, ctx: Context<'_, C>) -> bool
Returns
true
if this subscriber is interested in a span or event with the
given metadata
in the current Context
, similarly to
Collect::enabled
. Read moreSource§fn on_new_span(&self, attrs: &Attributes<'_>, id: &Id, ctx: Context<'_, C>)
fn on_new_span(&self, attrs: &Attributes<'_>, id: &Id, ctx: Context<'_, C>)
Notifies this subscriber that a new span was constructed with the given
Attributes
and Id
.Source§fn on_record(&self, span: &Id, values: &Record<'_>, ctx: Context<'_, C>)
fn on_record(&self, span: &Id, values: &Record<'_>, ctx: Context<'_, C>)
Notifies this subscriber that a span with the given
Id
recorded the given
values
.Source§fn on_follows_from(&self, span: &Id, follows: &Id, ctx: Context<'_, C>)
fn on_follows_from(&self, span: &Id, follows: &Id, ctx: Context<'_, C>)
Notifies this subscriber that a span with the ID
span
recorded that it
follows from the span with the ID follows
.Source§fn on_event(&self, event: &Event<'_>, ctx: Context<'_, C>)
fn on_event(&self, event: &Event<'_>, ctx: Context<'_, C>)
Notifies this subscriber that an event has occurred.
Source§fn on_enter(&self, id: &Id, ctx: Context<'_, C>)
fn on_enter(&self, id: &Id, ctx: Context<'_, C>)
Notifies this subscriber that a span with the given ID was entered.
Source§fn on_exit(&self, id: &Id, ctx: Context<'_, C>)
fn on_exit(&self, id: &Id, ctx: Context<'_, C>)
Notifies this subscriber that the span with the given ID was exited.
Source§fn on_close(&self, id: Id, ctx: Context<'_, C>)
fn on_close(&self, id: Id, ctx: Context<'_, C>)
Notifies this subscriber that the span with the given ID has been closed.
Source§fn on_id_change(&self, old: &Id, new: &Id, ctx: Context<'_, C>)
fn on_id_change(&self, old: &Id, new: &Id, ctx: Context<'_, C>)
Notifies this subscriber that a span ID has been cloned, and that the
subscriber returned a different ID.
Source§fn and_then<S>(self, subscriber: S) -> Layered<S, Self, C> ⓘ
fn and_then<S>(self, subscriber: S) -> Layered<S, Self, C> ⓘ
Composes this subscriber around the given collector, returning a
Layered
struct implementing Subscribe
. Read moreSource§fn with_filter<F>(self, filter: F) -> Filtered<Self, F, C> ⓘ
fn with_filter<F>(self, filter: F) -> Filtered<Self, F, C> ⓘ
Available on crate features
registry
and std
only.Auto Trait Implementations§
impl<S, I, C> Freeze for Layered<S, I, C>
impl<S, I, C> RefUnwindSafe for Layered<S, I, C>where
S: RefUnwindSafe,
I: RefUnwindSafe,
impl<S, I, C> Send for Layered<S, I, C>
impl<S, I, C> Sync for Layered<S, I, C>
impl<S, I, C> Unpin for Layered<S, I, C>
impl<S, I, C> UnwindSafe for Layered<S, I, C>where
S: UnwindSafe,
I: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<C> CollectExt for Cwhere
C: Collect,
impl<C> CollectExt for Cwhere
C: Collect,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> SubscriberInitExt for T
impl<T> SubscriberInitExt for T
Source§fn 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 moreSource§fn 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 moreSource§fn init(self)
fn init(self)
Attempts to set
self
as the global default subscriber in the current
scope, panicking if this fails. Read more