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);