Trait radium::marker::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§