pub trait Metrics: MaybeSend + MaybeSync {
// Required methods
fn incr(&self, name: &'static str, labels: &[(&'static str, &str)], by: u64);
fn observe_ms(
&self,
name: &'static str,
labels: &[(&'static str, &str)],
ms: f64,
);
// Provided method
fn gauge(
&self,
_name: &'static str,
_labels: &[(&'static str, &str)],
_value: f64,
) { ... }
}Expand description
Metrics sink. Label values are borrowed so a hot path allocates nothing.
Required Methods§
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".