Skip to main content

MetricCell

Trait MetricCell 

Source
pub trait MetricCell: Default + Sealed {
    type Value: Copy;

    // Required methods
    fn get(&self) -> Self::Value;
    fn set(&self, value: Self::Value);
    fn add(&self, value: Self::Value);
}
Expand description

An atomic cell holding a single metric value: AtomicCount or AtomicDuration.

Metrics are written only by the thread running the dataflow and may be read concurrently from other threads, so all operations use Ordering::Relaxed.

Required Associated Types§

Source

type Value: Copy

The plain value type stored in this cell.

Required Methods§

Source

fn get(&self) -> Self::Value

Reads the current value.

Source

fn set(&self, value: Self::Value)

Overwrites the current value.

Source

fn add(&self, value: Self::Value)

Adds value to the current value.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§