MetricVec

Trait MetricVec 

Source
pub trait MetricVec: Sealed {
    type Metric: Metric;

    // Required method
    fn get_metric_with<S: BuildHasher>(
        &self,
        labels: &HashMap<&str, &str, S>,
    ) -> Result<Self::Metric>;
}
Expand description

Required Associated Types§

Source

type Metric: Metric

Type of prometheus::Metrics forming this MetricVec.

Required Methods§

Source

fn get_metric_with<S: BuildHasher>( &self, labels: &HashMap<&str, &str, S>, ) -> Result<Self::Metric>

Calls prometheus::MetricVec::get_metric_with() method of this MetricVec.

§Errors

If a prometheus::Metric cannot be identified or created for the provided label values.

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.

Implementations on Foreign Types§

Source§

impl<M, B> MetricVec for MetricVec<B>
where M: Metric, B: MetricVecBuilder<M = M>,

Source§

type Metric = M

Source§

fn get_metric_with<S: BuildHasher>( &self, labels: &HashMap<&str, &str, S>, ) -> Result<M>

Implementors§