pub trait Metrics:
Clone
+ Send
+ Sync
+ 'static {
// Required methods
fn with_label(&self, label: &str) -> Self;
fn label(&self) -> String;
fn register<N: Into<String>, H: Into<String>>(
&self,
name: N,
help: H,
metric: impl Metric,
);
fn encode(&self) -> String;
}Expand description
Interface to register and encode metrics.
Required Methods§
Sourcefn with_label(&self, label: &str) -> Self
fn with_label(&self, label: &str) -> Self
Create a new instance of Metrics with the given label appended to the end
of the current Metrics label.
This is commonly used to create a nested context for register.
It is not permitted for any implementation to use METRICS_PREFIX as the start of a
label (reserved for metrics for the runtime).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.