pub struct Publisher { /* private fields */ }
Expand description
A Publisher
acts as broker, implementing [tracing::Subscriber
] to receive diagnostic
events from a component, and then forwarding that data on to a diagnostics service.
Implementations§
Source§impl Publisher
impl Publisher
Sourcepub fn new(opts: PublisherOptions<'_>) -> Result<Self, PublishError>
pub fn new(opts: PublisherOptions<'_>) -> Result<Self, PublishError>
Construct a new Publisher
using the given options.
Should be called only once.
Sourcepub fn event_for_testing(&self, record: TestRecord<'_>)
pub fn event_for_testing(&self, record: TestRecord<'_>)
Publish the provided event for testing.
Sourcepub fn set_interest_listener<T>(&self, listener: T)
pub fn set_interest_listener<T>(&self, listener: T)
Registers an interest listener
Trait Implementations§
Source§impl Subscriber for Publisher
impl Subscriber for Publisher
Source§fn record_follows_from(&self, span: &Id, follows: &Id)
fn record_follows_from(&self, span: &Id, follows: &Id)
Source§fn register_callsite(&self, _metadata: &'static Metadata<'static>) -> Interest
fn register_callsite(&self, _metadata: &'static Metadata<'static>) -> Interest
Source§fn clone_span(&self, id: &Id) -> Id
fn clone_span(&self, id: &Id) -> Id
Source§fn current_span(&self) -> Current
fn current_span(&self) -> Current
Returns a type representing this subscriber’s view of the current span. Read more
§fn on_register_dispatch(&self, subscriber: &Dispatch)
fn on_register_dispatch(&self, subscriber: &Dispatch)
Invoked when this subscriber becomes a [
Dispatch
]. Read more§fn max_level_hint(&self) -> Option<LevelFilter>
fn max_level_hint(&self) -> Option<LevelFilter>
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 more§fn event_enabled(&self, event: &Event<'_>) -> bool
fn event_enabled(&self, event: &Event<'_>) -> bool
Determine if an [
Event
] should be recorded. Read moreAuto Trait Implementations§
impl Freeze for Publisher
impl RefUnwindSafe for Publisher
impl Send for Publisher
impl Sync for Publisher
impl Unpin for Publisher
impl UnwindSafe for Publisher
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
§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoAny for T
impl<T> IntoAny for T
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> SubscriberInitExt for Twhere
T: Into<Dispatch>,
impl<T> SubscriberInitExt for Twhere
T: Into<Dispatch>,
§fn set_default(self) -> DefaultGuard
fn set_default(self) -> DefaultGuard
Sets
self
as the default subscriber in the current scope, returning a
guard that will unset it when dropped. Read more§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 more§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