pub struct MockSubscriber { /* private fields */ }
Expand description
A subscriber which validates the traces it receives.
A MockSubscriber
is constructed with a
MockSubscriberBuilder
. For a detailed description and examples,
see the documentation for that struct and for the subscriber
module.
Trait Implementations§
Source§impl Debug for MockSubscriber
impl Debug for MockSubscriber
Source§impl<C> Subscribe<C> for MockSubscriberwhere
C: Collect + for<'a> LookupSpan<'a>,
impl<C> Subscribe<C> for MockSubscriberwhere
C: Collect + for<'a> LookupSpan<'a>,
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 on_record(&self, _: &Id, _: &Record<'_>, _: Context<'_, C>)
fn on_record(&self, _: &Id, _: &Record<'_>, _: Context<'_, C>)
Notifies this subscriber that a span with the given
Id
recorded the given
values
.Source§fn on_event(&self, event: &Event<'_>, cx: Context<'_, C>)
fn on_event(&self, event: &Event<'_>, cx: Context<'_, C>)
Notifies this subscriber that an event has occurred.
Source§fn on_follows_from(&self, _span: &Id, _follows: &Id, _: Context<'_, C>)
fn on_follows_from(&self, _span: &Id, _follows: &Id, _: 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_new_span(&self, span: &Attributes<'_>, id: &Id, cx: Context<'_, C>)
fn on_new_span(&self, span: &Attributes<'_>, id: &Id, cx: Context<'_, C>)
Notifies this subscriber that a new span was constructed with the given
Attributes
and Id
.Source§fn on_enter(&self, id: &Id, cx: Context<'_, C>)
fn on_enter(&self, id: &Id, cx: Context<'_, C>)
Notifies this subscriber that a span with the given ID was entered.
Source§fn on_exit(&self, id: &Id, cx: Context<'_, C>)
fn on_exit(&self, id: &Id, cx: Context<'_, C>)
Notifies this subscriber that the span with the given ID was exited.
Source§fn on_close(&self, id: Id, cx: Context<'_, C>)
fn on_close(&self, id: Id, cx: 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 on_register_dispatch(&self, collector: &Dispatch)
fn on_register_dispatch(&self, collector: &Dispatch)
Source§fn on_subscribe(&mut self, collector: &mut C)
fn on_subscribe(&mut self, collector: &mut C)
Source§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 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_collector(self, inner: C) -> Layered<Self, C>where
Self: Sized,
fn with_collector(self, inner: C) -> Layered<Self, C>where
Self: Sized,
Source§fn with_filter<F>(self, filter: F) -> Filtered<Self, F, C>
fn with_filter<F>(self, filter: F) -> Filtered<Self, F, C>
Auto Trait Implementations§
impl !Freeze for MockSubscriber
impl RefUnwindSafe for MockSubscriber
impl Send for MockSubscriber
impl Sync for MockSubscriber
impl Unpin for MockSubscriber
impl UnwindSafe for MockSubscriber
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