pub trait PromLabelsExt<'a> {
// Required methods
fn get_from_metric_vec<V: MetricVec_>(&self, vec: &V) -> V::M;
fn remove_from_metric_vec<V: MetricVec_>(
&self,
vec: &V,
) -> Result<(), Error>;
}
Available on crate feature
metrics
only.Expand description
An extension trait for types that are valid (or convertible into) prometheus labels:
slices/vectors of strings, and BTreeMap
s.
Required Methods§
Sourcefn get_from_metric_vec<V: MetricVec_>(&self, vec: &V) -> V::M
fn get_from_metric_vec<V: MetricVec_>(&self, vec: &V) -> V::M
Returns or creates a metric with the given metric label values. Panics if retrieving the metric returns an error.
Sourcefn remove_from_metric_vec<V: MetricVec_>(&self, vec: &V) -> Result<(), Error>
fn remove_from_metric_vec<V: MetricVec_>(&self, vec: &V) -> Result<(), Error>
Removes a metric with these labels from a metrics vector.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.