pub trait MetricsGroup:
Any
+ Iterable
+ IntoIterable
+ Debug
+ 'static
+ Send
+ Sync {
// Required method
fn name(&self) -> &'static str;
// Provided methods
fn register(&self, registry: &mut Registry) { ... }
fn iter(&self) -> MetricsIter<'_> ⓘ { ... }
}
Expand description
Trait for structs containing metric items.
Required Methods§
Provided Methods§
Sourcefn register(&self, registry: &mut Registry)
Available on crate feature metrics
only.
fn register(&self, registry: &mut Registry)
metrics
only.Registers all metric items in this metrics group to a prometheus_client::registry::Registry
.
Sourcefn iter(&self) -> MetricsIter<'_> ⓘ
fn iter(&self) -> MetricsIter<'_> ⓘ
Returns an iterator over all metric items with their values and helps.