substrate_prometheus_endpoint

Trait MetricSource

Source
pub trait MetricSource:
    Sync
    + Send
    + Clone {
    type N: Number;

    // Required method
    fn collect(&self, set: impl FnMut(&[&str], Self::N));
}
Expand description

A source of values for a SourcedMetric.

Required Associated Types§

Source

type N: Number

The type of the collected values.

Required Methods§

Source

fn collect(&self, set: impl FnMut(&[&str], Self::N))

Collects the current values of the metrics from the source.

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§