pub trait Atomic<N> {
    // Required methods
    fn inc(&self) -> N;
    fn inc_by(&self, v: N) -> N;
    fn dec(&self) -> N;
    fn dec_by(&self, v: N) -> N;
    fn set(&self, v: N) -> N;
    fn get(&self) -> N;
}
Expand description

Atomic operations for a Gauge value store.

Required Methods§

source

fn inc(&self) -> N

Increase the value by 1.

source

fn inc_by(&self, v: N) -> N

Increase the value.

source

fn dec(&self) -> N

Decrease the value by 1.

source

fn dec_by(&self, v: N) -> N

Decrease the value.

source

fn set(&self, v: N) -> N

Set the value.

source

fn get(&self) -> N

Get the value.

Implementations on Foreign Types§

source§

impl Atomic<i32> for AtomicI32

source§

fn inc(&self) -> i32

source§

fn inc_by(&self, v: i32) -> i32

source§

fn dec(&self) -> i32

source§

fn dec_by(&self, v: i32) -> i32

source§

fn set(&self, v: i32) -> i32

source§

fn get(&self) -> i32

source§

impl Atomic<f64> for AtomicU64

source§

fn inc(&self) -> f64

source§

fn inc_by(&self, v: f64) -> f64

source§

fn dec(&self) -> f64

source§

fn dec_by(&self, v: f64) -> f64

source§

fn set(&self, v: f64) -> f64

source§

fn get(&self) -> f64

source§

impl Atomic<i64> for AtomicI64

source§

fn inc(&self) -> i64

source§

fn inc_by(&self, v: i64) -> i64

source§

fn dec(&self) -> i64

source§

fn dec_by(&self, v: i64) -> i64

source§

fn set(&self, v: i64) -> i64

source§

fn get(&self) -> i64

Implementors§