Skip to main content

Counter

Trait Counter 

Source
pub trait Counter:
    Send
    + Sync
    + Debug
    + DynClone {
    // Required method
    fn add(&self, amount: usize);
}
Expand description

An ever-incrementing counter

Required Methods§

Source

fn add(&self, amount: usize)

Add a value to the counter

Trait Implementations§

Source§

impl MetricsFamily<Box<dyn Counter>> for NoMetrics

Source§

fn create(&self, _: Vec<String>) -> Box<dyn Counter>

Instantiate a metric in this family with a specific label vector. Read more
Source§

fn destroy(&self, _: &[&str])

Remove a metric in this family identified by its label values. Read more

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§