Skip to main content

Labels

Trait Labels 

Source
pub trait Labels {
    // Required method
    fn attributes(&self) -> Vec<KeyValue>;
}
Expand description

The labels of a metric group: a struct whose fields are the labels. Derive it:

ⓘ
#[derive(Labels)]
struct Outcome {
    method: &'static str,
    status: u16,
}

Required Methods§

Source

fn attributes(&self) -> Vec<KeyValue>

Each label as an attribute, keyed by its name.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§