pub struct AtomicBitVec<O: Overflow = NoOverflow> { /* private fields */ }Expand description
An atomic bit-vector.
By default the vector has a fixed size, and setting a bit past its end panics.
AtomicBitVec<Growable> instead grows to hold that bit, which appends storage rather than
reallocating it, so that a word handed out to a thread stays valid while another thread grows
the vector.
Implementations§
Source§impl<O: Overflow> AtomicBitVec<O>
impl<O: Overflow> AtomicBitVec<O>
Sourcepub fn new(nbits: u64) -> Self
pub fn new(nbits: u64) -> Self
Creates a new AtomicBitVec holding at least nbits bits, all set to false.
Sourcepub fn test_and_set_range(&self, start_bit: u64, end_bit: u64) -> u64
pub fn test_and_set_range(&self, start_bit: u64, end_bit: u64) -> u64
Sets the bits between start_bit (included) and end_bit (excluded), and returns the
number of bits that were already set. A growable vector grows to hold end_bit.
Auto Trait Implementations§
impl<O> Freeze for AtomicBitVec<O>where
O: Freeze,
impl<O> RefUnwindSafe for AtomicBitVec<O>where
O: RefUnwindSafe,
impl<O> Send for AtomicBitVec<O>where
O: Send,
impl<O> Sync for AtomicBitVec<O>where
O: Sync,
impl<O> Unpin for AtomicBitVec<O>where
O: Unpin,
impl<O> UnsafeUnpin for AtomicBitVec<O>where
O: UnsafeUnpin,
impl<O> UnwindSafe for AtomicBitVec<O>where
O: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more