[−][src]Struct metrics_core::Key
A metric key.
A key always includes a name, but can optional include multiple labels used to further describe the metric.
Methods
impl Key
[src]
pub fn from_name<N>(name: N) -> Self where
N: Into<ScopedString>,
[src]
N: Into<ScopedString>,
Creates a Key
from a name.
pub fn from_name_and_labels<N, L>(name: N, labels: L) -> Self where
N: Into<ScopedString>,
L: IntoLabels,
[src]
N: Into<ScopedString>,
L: IntoLabels,
Creates a Key
from a name and vector of Label
s.
pub fn add_labels<L>(&mut self, new_labels: L) where
L: IntoLabels,
[src]
L: IntoLabels,
Adds a new set of labels to this key.
New labels will be appended to any existing labels.
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 map_name<F, S>(self, f: F) -> Self where
F: FnOnce(ScopedString) -> S,
S: Into<ScopedString>,
[src]
F: FnOnce(ScopedString) -> S,
S: Into<ScopedString>,
Maps the name of this Key
to a new name.
pub fn into_parts(self) -> (ScopedString, Vec<Label>)
[src]
Consumes this Key
, returning the name and any labels.
Trait Implementations
impl Clone for Key
[src]
fn clone(&self) -> Key
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq<Key> for Key
[src]
impl From<String> for Key
[src]
impl From<&'static str> for Key
[src]
impl From<Cow<'static, str>> for Key
[src]
fn from(name: ScopedString) -> Key
[src]
impl<K, L> From<(K, L)> for Key where
K: Into<ScopedString>,
L: IntoLabels,
[src]
K: Into<ScopedString>,
L: IntoLabels,
impl Eq for Key
[src]
impl Debug for Key
[src]
impl Display for Key
[src]
impl Hash for Key
[src]
Auto Trait Implementations
impl Sync for Key
impl Unpin for Key
impl Send for Key
impl UnwindSafe for Key
impl RefUnwindSafe for Key
Blanket Implementations
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> From<T> for 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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,