pub struct EventObserverChannel { /* private fields */ }Expand description
Observer implementation that sends observed event contexts to a channel.
Use event_observer_channel when the publish path should only enqueue
telemetry and another thread or task will do slower export work. Sending to
the channel is best-effort: if the receiver has been dropped, publication
still succeeds and the context is discarded.
Implementations§
Source§impl EventObserverChannel
impl EventObserverChannel
Sourcepub fn new(sender: Sender<ObservedEventContext>) -> Self
pub fn new(sender: Sender<ObservedEventContext>) -> Self
Creates a channel observer from an existing sender.
Trait Implementations§
Source§impl Clone for EventObserverChannel
impl Clone for EventObserverChannel
Source§fn clone(&self) -> EventObserverChannel
fn clone(&self) -> EventObserverChannel
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T> EventObserver<T> for EventObserverChannel
impl<T> EventObserver<T> for EventObserverChannel
Source§fn on_event_published(&self, context: &ObservedEventContext)
fn on_event_published(&self, context: &ObservedEventContext)
Called after an event is published.
Auto Trait Implementations§
impl Freeze for EventObserverChannel
impl RefUnwindSafe for EventObserverChannel
impl Send for EventObserverChannel
impl Sync for EventObserverChannel
impl Unpin for EventObserverChannel
impl UnsafeUnpin for EventObserverChannel
impl UnwindSafe for EventObserverChannel
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