radium::marker

Trait 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§