iroh_metrics

Trait MetricsGroupSet

Source
pub trait MetricsGroupSet {
    // Required methods
    fn name(&self) -> &'static str;
    fn groups_cloned(&self) -> impl Iterator<Item = Arc<dyn MetricsGroup>>;
    fn groups(&self) -> impl Iterator<Item = &dyn MetricsGroup>;

    // Provided method
    fn iter(&self) -> impl Iterator<Item = (&'static str, MetricItem<'_>)> + '_ { ... }
}
Expand description

Trait for a set of structs implementing MetricsGroup.

Required Methods§

Source

fn name(&self) -> &'static str

Returns the name of this metrics group set.

Source

fn groups_cloned(&self) -> impl Iterator<Item = Arc<dyn MetricsGroup>>

Returns an iterator over owned clones of the MetricsGroup in this struct.

Source

fn groups(&self) -> impl Iterator<Item = &dyn MetricsGroup>

Returns an iterator over references to the MetricsGroup in this struct.

Provided Methods§

Source

fn iter(&self) -> impl Iterator<Item = (&'static str, MetricItem<'_>)> + '_

Returns an iterator over all metrics in this metrics group set.

The iterator yields tuples of (&str, MetricItem). The &str is the group name.

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.

Implementors§