pub trait Counter:
Send
+ Sync
+ 'static {
// Required methods
fn inc(&self);
fn inc_by(&self, v: u64);
fn get(&self) -> u64;
}Expand description
Single counter handle (one specific label combination).
Required Methods§
fn inc(&self)
Sourcefn inc_by(&self, v: u64)
fn inc_by(&self, v: u64)
Increment the counter by v.
Implementations must use saturating arithmetic: calling inc_by
when the counter is at or near its maximum value must not wrap around
to zero. Saturation at the maximum representable value is acceptable.
fn get(&self) -> u64
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".