pub struct MetricNameTemplate { /* private fields */ }Expand description
A template for a MetricName. It contains a name, group, and description, as
well as all the tags that will be used to create the metric name. Tag values
are omitted from the template, but are filled in at runtime with their
specified values. The order of the tags is maintained so that the metric
names can be compared and sorted lexicographically.
Implementations§
Source§impl MetricNameTemplate
impl MetricNameTemplate
Sourcepub fn new(
name: impl Into<String>,
group: impl Into<String>,
description: impl Into<String>,
tag_names: IndexSet<String>,
) -> Self
pub fn new( name: impl Into<String>, group: impl Into<String>, description: impl Into<String>, tag_names: IndexSet<String>, ) -> Self
Create a new template. The order of the tags is preserved.
name- the name of the metricgroup- the name of the groupdescription- the description of the metrictag_names- the names of the metric tags in the preferred order
Sourcepub fn description(&self) -> &str
pub fn description(&self) -> &str
Get the description of the metric.
Get the ordered set of tag names for the metric.
Trait Implementations§
Source§impl Clone for MetricNameTemplate
impl Clone for MetricNameTemplate
Source§fn clone(&self) -> MetricNameTemplate
fn clone(&self) -> MetricNameTemplate
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MetricNameTemplate
impl Debug for MetricNameTemplate
Source§impl Display for MetricNameTemplate
impl Display for MetricNameTemplate
Source§impl PartialEq for MetricNameTemplate
impl PartialEq for MetricNameTemplate
impl Eq for MetricNameTemplate
Auto Trait Implementations§
impl Freeze for MetricNameTemplate
impl RefUnwindSafe for MetricNameTemplate
impl Send for MetricNameTemplate
impl Sync for MetricNameTemplate
impl Unpin for MetricNameTemplate
impl UnsafeUnpin for MetricNameTemplate
impl UnwindSafe for MetricNameTemplate
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more