pub struct TracingBus { /* private fields */ }Expand description
Central hub that receives RosaceTrace events and dispatches to all
registered TraceSubscriber implementations.
Access via the TRACING_BUS global singleton. The bus is zero-cost in
production — all trace!() call sites are stripped by #[cfg(debug_assertions)].
Implementations§
Source§impl TracingBus
impl TracingBus
Sourcepub fn add_subscriber(&self, subscriber: Arc<dyn TraceSubscriber + Send + Sync>)
pub fn add_subscriber(&self, subscriber: Arc<dyn TraceSubscriber + Send + Sync>)
Registers a subscriber to receive all future trace events.
Sourcepub fn clear_subscribers(&self)
pub fn clear_subscribers(&self)
Removes all registered subscribers.
Sourcepub fn emit(&self, event: RosaceTrace)
pub fn emit(&self, event: RosaceTrace)
Emits a trace event to all registered subscribers.
The subscriber list lock is released before calling any subscriber so that
subscribers can safely call add_subscriber without deadlocking.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for TracingBus
impl RefUnwindSafe for TracingBus
impl Send for TracingBus
impl Sync for TracingBus
impl Unpin for TracingBus
impl UnsafeUnpin for TracingBus
impl UnwindSafe for TracingBus
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