Trait radium::marker::NumericOps

source ·
pub trait NumericOps: BitOps { }
Expand description

Types supporting maybe-atomic arithmetic operations.

Types implementing this trait support the fetch_add and fetch_sub maybe-atomic operations.

The integer types, such as usize and i32, implement this trait.

let num: AtomicUsize = AtomicUsize::new(2);
Radium::fetch_add(&num, 2, Ordering::Relaxed);

bool and pointers do not. This will cause a compiler error.

let bit: AtomicBool = AtomicBool::new(false);
Radium::fetch_add(&bit, true, Ordering::Relaxed);

Implementations on Foreign Types§

source§

impl NumericOps for i8

source§

impl NumericOps for i16

source§

impl NumericOps for i32

source§

impl NumericOps for i64

source§

impl NumericOps for isize

source§

impl NumericOps for u8

source§

impl NumericOps for u16

source§

impl NumericOps for u32

source§

impl NumericOps for u64

source§

impl NumericOps for usize

Implementors§