Struct metrics_util::recency::Generational
source · [−]pub struct Generational<T> { /* private fields */ }Expand description
Generation tracking for a metric.
Holds a generic interior value, and provides way to access the value such that each access increments the “generation” of the value. This provides a means to understand if the value has been updated since the last time it was observed.
For example, if a gauge was observed to be X at one point in time, and then observed to be X
again at a later point in time, it could have changed in between the two observations. It also
may not have changed, and thus Generational provides a way to determine if either of these
events occurred.
Implementations
Gets the current generation.
Acquires a reference to the inner value, and increments the generation.
Trait Implementations
Performs the conversion.
Performs the conversion.
Performs the conversion.
Auto Trait Implementations
impl<T> RefUnwindSafe for Generational<T> where
T: RefUnwindSafe,
impl<T> Send for Generational<T> where
T: Send,
impl<T> Sync for Generational<T> where
T: Sync,
impl<T> Unpin for Generational<T> where
T: Unpin,
impl<T> UnwindSafe for Generational<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more