Skip to main content

MetricTag

Trait MetricTag 

Source
pub trait MetricTag: Sealed {
    // Required method
    fn into_label(self) -> Label;
}
Expand description

A metric tag.

Marker trait for types which can support being used as a metric tag, in order to optimize their internal representation to avoid unnecessary allocations.

This trait is sealed and can’t be implemented outside of this crate.

Required Methods§

Source

fn into_label(self) -> Label

Consumes self and converts it to a tag.

Under the hood, the metrics crate is used, which calls tags “labels” instead, which is where the return type naming comes from.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl MetricTag for &'static str

Source§

impl MetricTag for String

Source§

impl<T> MetricTag for (&'static str, T)
where T: Into<SharedString>,

Implementors§