Struct measured::MetricVec

source ·
pub struct MetricVec<M: MetricType, L: LabelGroupSet> { /* private fields */ }

Implementations§

source§

impl<M: MetricType, L: LabelGroupSet> MetricVec<M, L>

source

pub fn new_metric_vec(label_set: L, metadata: M::Metadata) -> Self

source

pub fn new_sparse_metric_vec(label_set: L, metadata: M::Metadata) -> Self

Create a new sparse metric vec. Useful if you have a fixed cardinality vec but the cardinality is quite high

source

pub fn metadata(&self) -> &M::Metadata

source

pub fn with_labels<'a>(&'a self, label: L::Group<'a>) -> Option<LabelId<L>>

source

pub fn get_metric<R>( &self, id: LabelId<L>, f: impl for<'a> FnOnce(MetricRef<'a, M>) -> R ) -> R

source§

impl<L: LabelGroupSet> MetricVec<CounterState, L>

source

pub fn new_counter_vec(label_set: L) -> Self

source

pub fn new_sparse_counter_vec(label_set: L) -> Self

source§

impl<M: MetricType, L: LabelGroupSet> MetricVec<M, L>

source

pub fn collect_into<T>(&self, name: impl MetricName, enc: &mut T)
where M: MetricEncoder<T>,

Auto Trait Implementations§

§

impl<M, L> !RefUnwindSafe for MetricVec<M, L>

§

impl<M, L> Send for MetricVec<M, L>
where L: Send, M: Send, <M as MetricType>::Metadata: Send, <L as LabelGroupSet>::Unique: Send,

§

impl<M, L> Sync for MetricVec<M, L>
where L: Sync, M: Sync + Send, <M as MetricType>::Metadata: Sync, <L as LabelGroupSet>::Unique: Sync + Send,

§

impl<M, L> Unpin for MetricVec<M, L>
where L: Unpin, <M as MetricType>::Metadata: Unpin,

§

impl<M, L> UnwindSafe for MetricVec<M, L>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.