pub struct Immutable { /* private fields */ }
Expand description

Snapshot of a mutable::Storage, that is not capable of registering metrics in a prometheus::Registry on the fly, but still allowing to change their help description on the fly, once they were registered in the mutable::Storage before snapshot.

In comparison with a metrics::Registry, this immutable Storage provides much less overhead of accessing an already registered metric (just a simple HashMap lookup), however, is not capable of registering new metrics on the fly.

Implementations§

Changes the help description of the prometheus Metric identified by its name. No-op if this immutable Storage doesn’t contain it.

Accepts only the following prometheus Metrics:

Intended to be used in metrics::Recorder::describe_counter(), metrics::Recorder::describe_gauge() and metrics::Recorder::describe_histogram() implementations.

Returns a prometheus Metric stored in this immutable Storage and identified by the provided metrics::Key.

Accepts only the following prometheus metrics:

Intended to be used in metrics::Recorder::register_counter(), metrics::Recorder::register_gauge() and metrics::Recorder::register_histogram() implementations.

Errors

If the identified prometheus Metric doesn’t comply with the labeling of the provided metrics::Key.

Trait Implementations§

Formats the value using the given formatter. Read more

Creates a new immutable Storage by draining the referred mutable::Storage and leaving it empty.

Returns a Collection of metric::Bundles stored in this storage. Read more
Returns a Collection of metric::Bundles stored in this storage. Read more
Returns a Collection of metric::Bundles stored in this storage. Read more

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 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.