Trait Bundle

Source
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 single prometheus::Metric that may be stored in this Bundle.

Source

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

Type of 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>,