pub struct EventMetadata {
pub event_name: &'static str,
pub type_id: TypeId,
pub last_dispatch: Instant,
pub dispatch_count: u64,
pub listener_count: usize,
}Expand description
Immutable snapshot of an event type’s metrics.
Returned by crate::EventDispatcher::metrics. Each field reflects
the value at the moment the snapshot was taken; subsequent dispatches
do not mutate it.
Fields§
§event_name: &'static strFully qualified name of the event type, as reported by
std::any::type_name.
type_id: TypeIdTypeId of the event type. Stable for a given type within a
single process run.
last_dispatch: InstantTimestamp of the most recent dispatch of this event type.
dispatch_count: u64Total number of times this event type has been dispatched since the dispatcher was created.
listener_count: usizeNumber of listeners (sync + async) registered for this event type at the moment the snapshot was taken.
Implementations§
Source§impl EventMetadata
impl EventMetadata
Sourcepub fn time_since_last_dispatch(&self) -> Duration
pub fn time_since_last_dispatch(&self) -> Duration
How long ago the most recent dispatch of this event type was.
Trait Implementations§
Source§impl Clone for EventMetadata
impl Clone for EventMetadata
Source§fn clone(&self) -> EventMetadata
fn clone(&self) -> EventMetadata
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for EventMetadata
impl RefUnwindSafe for EventMetadata
impl Send for EventMetadata
impl Sync for EventMetadata
impl Unpin for EventMetadata
impl UnsafeUnpin for EventMetadata
impl UnwindSafe for EventMetadata
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