[−][src]Struct metrix::instruments::other_instruments::LastOccurrenceTracker
Tracks how many seconds elapsed since the last occurence
Methods
impl LastOccurrenceTracker
[src]
pub fn new_with_defaults<T: Into<String>>(name: T) -> LastOccurrenceTracker
[src]
pub fn name(&self) -> &str
[src]
Gets the name of this OccurenceTracker
pub fn set_name<T: Into<String>>(&mut self, name: T)
[src]
Set the name if this OccurenceTracker
.
The name is a path segment within a Snapshot
pub fn set_title<T: Into<String>>(&mut self, title: T)
[src]
Sets the title
of this OccurenceTracker
.
A title can be part of a descriptive Snapshot
pub fn set_description<T: Into<String>>(&mut self, description: T)
[src]
Sets the description
of this OccurenceTracker
.
A description can be part of a descriptive Snapshot
pub fn set_invert(&mut self, invert: bool)
[src]
Set whether the current value should be inverted in a snapshot or not
Default is false
pub fn enable_invert(&mut self)
[src]
The current value should be inverted in a snapshot
Same as self.set_invert(true);
pub fn set_make_none_zero(&mut self, make_zero: bool)
[src]
If set to true
possible None
s that would
be returned will instead be 0
.
Hint: This instrument will return None
unless there
was at least one Occurence recorded.
pub fn make_none_zero(&self) -> bool
[src]
return whether make_none_zero
is on or off
pub fn elapsed_since_last_occurrence(&self) -> Option<u64>
[src]
Returns the current state
Trait Implementations
impl Updates for LastOccurrenceTracker
[src]
impl Instrument for LastOccurrenceTracker
[src]
impl Descriptive for LastOccurrenceTracker
[src]
impl PutsSnapshot for LastOccurrenceTracker
[src]
fn put_snapshot(&self, into: &mut Snapshot, descriptive: bool)
[src]
Auto Trait Implementations
impl Send for LastOccurrenceTracker
impl Sync for LastOccurrenceTracker
impl Unpin for LastOccurrenceTracker
impl UnwindSafe for LastOccurrenceTracker
impl RefUnwindSafe for LastOccurrenceTracker
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,