pub struct Tag(/* private fields */);
Expand description
A metric tag.
Implementations§
Source§impl Tag
impl Tag
Sourcepub const fn from_static(s: &'static str) -> Self
pub const fn from_static(s: &'static str) -> Self
Creates a new tag from a static string.
Sourcepub fn name(&self) -> &str
pub fn name(&self) -> &str
Gets the name of the tag.
For bare tags (e.g. production
), this is simply the tag value itself. For key/value-style tags (e.g.
service:web
), this is the key part of the tag, or service
based on the example.
Sourcepub fn value(&self) -> Option<&str>
pub fn value(&self) -> Option<&str>
Gets the value of the tag.
For bare tags (e.g. production
), this always returns None
. For key/value-style tags (e.g. service:web
),
this is the value part of the tag, or web
based on the example.
Sourcepub fn as_borrowed(&self) -> BorrowedTag<'_>
pub fn as_borrowed(&self) -> BorrowedTag<'_>
Returns a borrowed version of the tag.
Sourcepub fn into_inner(self) -> MetaString
pub fn into_inner(self) -> MetaString
Consumes the tag and returns the inner MetaString
.
Trait Implementations§
Source§impl CheapMetaString for Tag
impl CheapMetaString for Tag
Source§fn try_cheap_clone(&self) -> Option<MetaString>
fn try_cheap_clone(&self) -> Option<MetaString>
Attempts to cheaply clone the string. Read more
Source§impl Extend<Tag> for TagSet
impl Extend<Tag> for TagSet
Source§fn extend<T: IntoIterator<Item = Tag>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = Tag>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl FromIterator<Tag> for TagSet
impl FromIterator<Tag> for TagSet
Source§impl Ord for Tag
impl Ord for Tag
Source§impl PartialOrd for Tag
impl PartialOrd for Tag
impl Eq for Tag
impl StructuralPartialEq for Tag
Auto Trait Implementations§
impl Freeze for Tag
impl RefUnwindSafe for Tag
impl Send for Tag
impl Sync for Tag
impl Unpin for Tag
impl UnwindSafe for Tag
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,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Track for T
impl<T> Track for T
§fn track_allocations(self, token: AllocationGroupToken) -> Tracked<Self>
fn track_allocations(self, token: AllocationGroupToken) -> Tracked<Self>
Instruments this type by attaching the given allocation group token, returning a
Tracked
wrapper. Read more§fn in_current_allocation_group(self) -> Tracked<Self>
fn in_current_allocation_group(self) -> Tracked<Self>
Instruments this type by attaching the current allocation group, returning a
Tracked
wrapper. Read more