Struct metrics::KeyData[][src]

pub struct KeyData { /* fields omitted */ }

Inner representation of Key.

While Key is the type that users will interact with via Recorder, KeyData is responsible for the actual storage of the name and label data.

Implementations

impl KeyData[src]

pub fn from_name<N>(name: N) -> Self where
    N: Into<SharedString>, 
[src]

Creates a KeyData from a name.

pub fn from_parts<N, L>(name: N, labels: L) -> Self where
    N: Into<NameParts>,
    L: IntoLabels
[src]

Creates a KeyData from a name and set of labels.

pub fn from_hybrid<L>(name_parts: &'static [SharedString], labels: L) -> Self where
    L: IntoLabels
[src]

Creates a KeyData from a static name and non-static set of labels.

pub const fn from_static_name(name_parts: &'static [SharedString]) -> Self[src]

Creates a KeyData from a static name.

This function is const, so it can be used in a static context.

pub const fn from_static_parts(
    name_parts: &'static [SharedString],
    labels: &'static [Label]
) -> Self
[src]

Creates a KeyData from a static name and static set of labels.

This function is const, so it can be used in a static context.

pub fn name(&self) -> &NameParts[src]

Name parts of this key.

pub fn labels(&self) -> Iter<'_, Label>[src]

Labels of this key, if they exist.

pub fn append_name<S: Into<SharedString>>(self, part: S) -> Self[src]

Appends a part to the name,

pub fn prepend_name<S: Into<SharedString>>(self, part: S) -> Self[src]

Prepends a part to the name.

pub fn into_parts(self) -> (NameParts, Vec<Label>)[src]

Consumes this Key, returning the name parts and any labels.

pub fn with_extra_labels(&self, extra_labels: Vec<Label>) -> Self[src]

Clones this Key, and expands the existing set of labels.

Trait Implementations

impl AsRef<KeyData> for Key[src]

impl Clone for KeyData[src]

impl Debug for KeyData[src]

impl Display for KeyData[src]

impl Eq for KeyData[src]

impl From<&'static KeyData> for Key[src]

impl From<&'static str> for KeyData[src]

impl<N, L> From<(N, L)> for KeyData where
    N: Into<SharedString>,
    L: IntoLabels
[src]

impl From<KeyData> for Key[src]

impl From<String> for KeyData[src]

impl Hash for KeyData[src]

impl Ord for KeyData[src]

impl PartialEq<KeyData> for KeyData[src]

impl PartialOrd<KeyData> for KeyData[src]

impl StructuralEq for KeyData[src]

impl StructuralPartialEq for KeyData[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.