radium::marker

Trait BitOps

Source
pub trait BitOps { }
Expand description

Types supporting maybe-atomic bitwise operations.

Types implementing this trait support the fetch_and, fetch_nand, fetch_or, and fetch_xor maybe-atomic operations.

bool and all integer fundamental types implement this.

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

Pointers do not. This will cause a compiler error.

let ptr: AtomicPtr<usize> = Default::default();
Radium::fetch_or(&ptr, ptr::null_mut(), Ordering::Relaxed);

Implementations on Foreign Types§

Source§

impl BitOps for bool

Source§

impl BitOps for i8

Source§

impl BitOps for i16

Source§

impl BitOps for i32

Source§

impl BitOps for i64

Source§

impl BitOps for isize

Source§

impl BitOps for u8

Source§

impl BitOps for u16

Source§

impl BitOps for u32

Source§

impl BitOps for u64

Source§

impl BitOps for usize

Implementors§