pub trait Metric:
Default
+ Iterable
+ Sized
+ Debug
+ 'static
+ Send
+ Sync {
// Required method
fn name() -> &'static str;
// Provided methods
fn new(registry: &mut Registry) -> Self { ... }
fn with_metric<T, F: FnOnce(&Self) -> T>(f: F) { ... }
fn try_get() -> Option<&'static Self> { ... }
}
Expand description
Description of a group of metrics.
Required Methods§
Provided Methods§
Sourcefn with_metric<T, F: FnOnce(&Self) -> T>(f: F)
fn with_metric<T, F: FnOnce(&Self) -> T>(f: F)
Access to this metrics group to record a metric. Only records if this metric is registered in the global registry.
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.