[−][src]Struct metrics::KeyData
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]
N: Into<SharedString>,
Creates a KeyData
from a name.
pub fn from_parts<N, L>(name: N, labels: L) -> Self where
N: Into<NameParts>,
L: IntoLabels,
[src]
N: Into<NameParts>,
L: IntoLabels,
Creates a KeyData
from a name and 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]
name_parts: &'static [SharedString],
labels: &'static [Label]
) -> Self
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]
N: Into<SharedString>,
L: IntoLabels,
impl From<KeyData> for Key
[src]
impl From<String> for KeyData
[src]
impl Hash for KeyData
[src]
pub fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<KeyData> for KeyData
[src]
impl StructuralEq for KeyData
[src]
impl StructuralPartialEq for KeyData
[src]
Auto Trait Implementations
impl RefUnwindSafe for KeyData
impl Send for KeyData
impl Sync for KeyData
impl Unpin for KeyData
impl UnwindSafe for KeyData
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,
pub 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.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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>,