[][src]Struct dipstick::Labels

pub struct Labels { /* fields omitted */ }

Base structure to carry metric labels from the application to the metric backend(s). Can carry both one-off labels and exported context labels (if async metrics are enabled). Used in applications through the labels!() macro.

Methods

impl Labels[src]

pub fn save_context(&mut self)[src]

Used to save metric context before enqueuing value for async output.

pub fn lookup(&self, key: &str) -> Option<Arc<String>>[src]

Generic label lookup function. Searches provided labels, provided scopes or default scopes.

pub fn into_map(self) -> HashMap<String, Arc<String>>[src]

Export current state of labels to a map. Note: An iterator would still need to allocate to check for uniqueness of keys.

Trait Implementations

impl Clone for Labels[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl From<HashMap<String, Arc<String>, RandomState>> for Labels[src]

impl Default for Labels[src]

fn default() -> Self[src]

Create empty labels. Only Thread and App labels will be used for lookups.

impl Debug for Labels[src]

Auto Trait Implementations

impl Sync for Labels

impl Unpin for Labels

impl Send for Labels

impl RefUnwindSafe for Labels

impl UnwindSafe for Labels

Blanket Implementations

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

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

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

type Owned = T

The resulting type after obtaining ownership.

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.

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

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

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

impl<T> Erased for T