[−][src]Enum metrics::Key
Represents the identifier of a metric.
Key
holds either an owned or static reference variant of KeyData
.
This allows for flexibility in the ways that KeyData
can be passed around
and reused, enabling performance improvements in specific situations.
Variants
Borrowed(&'static KeyData)
A statically borrowed KeyData
.
If you are capable of keeping a static KeyData
around, this variant can
be used to reduce allocations and improve performance.
The reference is read-only, so you can't modify the underlying data.
Owned(KeyData)
An owned KeyData
.
Useful when you need to modify a borrowed KeyData
in-flight, or when
there's no way to keep around a static KeyData
reference.
Implementations
impl Key
[src]
pub fn into_owned(self) -> KeyData
[src]
Methods from Deref<Target = KeyData>
pub fn name(&self) -> &ScopedString
[src]
Name of this key.
pub fn labels(&self) -> Iter<'_, Label>
[src]
Labels of this key, if they exist.
pub fn with_extra_labels(&self, extra_labels: Vec<Label>) -> Self
[src]
Returns a clone of this key with some additional labels.
Trait Implementations
impl AsRef<KeyData> for Key
[src]
impl Clone for Key
[src]
impl Debug for Key
[src]
impl Deref for Key
[src]
type Target = KeyData
The resulting type after dereferencing.
#[must_use]fn deref(&self) -> &Self::Target
[src]
impl Display for Key
[src]
impl Eq for Key
[src]
impl From<&'static KeyData> for Key
[src]
impl From<KeyData> for Key
[src]
impl Hash for Key
[src]
fn hash<H: Hasher>(&self, state: &mut H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<Key> for Key
[src]
Auto Trait Implementations
impl RefUnwindSafe for Key
impl Send for Key
impl Sync for Key
impl Unpin for Key
impl UnwindSafe for Key
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,