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§
Sourcefn attributes(&self) -> Vec<KeyValue>
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".