Struct witchcraft_metrics::MetricId
source · [−]pub struct MetricId { /* private fields */ }
Expand description
An identifier of a metric.
It consists of a name as well as a set of tags that can be used to further filter and partition the metrics.
Implementations
sourceimpl MetricId
impl MetricId
sourcepub fn new<T>(name: T) -> MetricId where
T: Into<Cow<'static, str>>,
pub fn new<T>(name: T) -> MetricId where
T: Into<Cow<'static, str>>,
Creates a new metric ID with the specified name and no tags.
sourcepub fn with_tag<K, V>(self, key: K, value: V) -> MetricId where
K: Into<Cow<'static, str>>,
V: Into<Cow<'static, str>>,
pub fn with_tag<K, V>(self, key: K, value: V) -> MetricId where
K: Into<Cow<'static, str>>,
V: Into<Cow<'static, str>>,
A builder-style method adding a tag to the metric ID.
Returns the ID’s tags.
Trait Implementations
sourceimpl Ord for MetricId
impl Ord for MetricId
sourceimpl PartialOrd<MetricId> for MetricId
impl PartialOrd<MetricId> for MetricId
sourcefn partial_cmp(&self, other: &MetricId) -> Option<Ordering>
fn partial_cmp(&self, other: &MetricId) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Eq for MetricId
impl StructuralEq for MetricId
impl StructuralPartialEq for MetricId
Auto Trait Implementations
impl RefUnwindSafe for MetricId
impl Send for MetricId
impl Sync for MetricId
impl Unpin for MetricId
impl UnwindSafe for MetricId
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more