pub trait Bundle: Sealed {
    type Single: Metric;
    type Vec: MetricVec<Metric = Self::Single>;

    // Required method
    fn get_single_metric(&self, key: &Key) -> Result<Self::Single>;
}
Expand description

Bundle of a prometheus::Metrics family.

Either a single prometheus::Metric or a prometheus::MetricVec of them.

Required Associated Types§

source

type Single: Metric

Type of a single prometheus::Metric that may be stored in this Bundle.

source

type Vec: MetricVec<Metric = Self::Single>

Type of a prometheus::MetricVec that may be stored in this Bundle.

Required Methods§

source

fn get_single_metric(&self, key: &Key) -> Result<Self::Single>

Returns a single prometheus::Metric of this Bundle, identified by the provided metrics::Key.

Errors

If the provided metrics::Key cannot identify any prometheus::Metric in this Bundle.

Implementors§

source§

impl<M, B> Bundle for Either<M, MetricVec<B>>
where M: Metric + Clone, B: MetricVecBuilder<M = M>,

§

type Single = M

§

type Vec = MetricVec<B>