atomic_bitfield
Atomic Bitfield
Provides a bitfield abstraction for the core atomic types. This crate is no_std
compatible
by default, and does not itself use any unsafe
code.
Note: On stable
this crate assumes the presence of the following atomics
which may cause compilation to fail on certain platforms.
Atomic{U,I}32
and smallerAtomic{U,I}size
Atomic{U,I}64
on 64 bit platforms
The nightly
feature of this crate enables target_has_atomic
and uses
that instead to detect which atomic types are available.
Usage Example
use ;
use AtomicBitField as _;
let flags = new;
let prev_state = flags.set_bit;
assert_eq!;
assert_eq!;
let prev_state = flags.toggle_bit;
assert_eq!;
assert_eq!;
let prev_state = flags.swap_bit;
assert_eq!;
assert_eq!;
License: MIT