pub struct TrackingEventCounter { /* private fields */ }
Expand description
Event counter that tracks rollovers and discontinuities.
Implementations§
source§impl TrackingEventCounter
impl TrackingEventCounter
sourcepub fn set_initial_count(&mut self, count: EventCount)
pub fn set_initial_count(&mut self, count: EventCount)
Sets the initial counter value and reset the rollover tracking.
sourcepub fn update(&mut self, event_count: EventCount) -> Option<DroppedEventCount>
pub fn update(&mut self, event_count: EventCount) -> Option<DroppedEventCount>
Updates the event count handling rollovers. Returns the number of dropped events, if any. NOTE: must be called at least once per event count type (u16) rollover interval
pub fn count(&self) -> u64
Trait Implementations§
source§impl Clone for TrackingEventCounter
impl Clone for TrackingEventCounter
source§fn clone(&self) -> TrackingEventCounter
fn clone(&self) -> TrackingEventCounter
Returns a copy 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 moresource§impl Debug for TrackingEventCounter
impl Debug for TrackingEventCounter
source§impl Display for TrackingEventCounter
impl Display for TrackingEventCounter
source§impl Hash for TrackingEventCounter
impl Hash for TrackingEventCounter
source§impl Ord for TrackingEventCounter
impl Ord for TrackingEventCounter
source§fn cmp(&self, other: &TrackingEventCounter) -> Ordering
fn cmp(&self, other: &TrackingEventCounter) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for TrackingEventCounter
impl PartialEq for TrackingEventCounter
source§fn eq(&self, other: &TrackingEventCounter) -> bool
fn eq(&self, other: &TrackingEventCounter) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for TrackingEventCounter
impl PartialOrd for TrackingEventCounter
source§fn partial_cmp(&self, other: &TrackingEventCounter) -> Option<Ordering>
fn partial_cmp(&self, other: &TrackingEventCounter) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for TrackingEventCounter
impl Eq for TrackingEventCounter
impl StructuralPartialEq for TrackingEventCounter
Auto Trait Implementations§
impl Freeze for TrackingEventCounter
impl RefUnwindSafe for TrackingEventCounter
impl Send for TrackingEventCounter
impl Sync for TrackingEventCounter
impl Unpin for TrackingEventCounter
impl UnwindSafe for TrackingEventCounter
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