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 a reference to the inner value.

Gets the current generation.

Acquires a reference to the inner value, and increments the generation.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Increments the counter by the given amount. Read more

Sets the counter to at least the given amount. Read more

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Increments the gauge by the given amount. Read more

Decrements the gauge by the given amount. Read more

Sets the gauge to the given amount. Read more

Records a value into the histogram.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.