pub struct SharedBitVec { /* private fields */ }Implementations§
pub fn create( path: impl AsRef<Path>, capacity_bits: usize, ) -> Result<Self, BitVecError>
pub fn open( path: impl AsRef<Path>, expected_capacity_bits: usize, ) -> Result<Self, BitVecError>
pub fn capacity_bits(&self) -> usize
pub fn capacity_words(&self) -> usize
Sourcepub fn set(&self, i: usize) -> Result<bool, BitVecError>
pub fn set(&self, i: usize) -> Result<bool, BitVecError>
Set bit i to 1. Returns the previous value at that bit.
Sourcepub fn clear(&self, i: usize) -> Result<bool, BitVecError>
pub fn clear(&self, i: usize) -> Result<bool, BitVecError>
Clear bit i to 0. Returns the previous value at that bit.
Sourcepub fn toggle(&self, i: usize) -> Result<bool, BitVecError>
pub fn toggle(&self, i: usize) -> Result<bool, BitVecError>
Flip bit i. Returns the new value at that bit.
Sourcepub fn set_range(&self, lo: usize, hi: usize) -> Result<(), BitVecError>
pub fn set_range(&self, lo: usize, hi: usize) -> Result<(), BitVecError>
Set all bits in lo..hi (exclusive end). Uses RMW on boundary
words and unconditional store on interior words.
Sourcepub fn clear_range(&self, lo: usize, hi: usize) -> Result<(), BitVecError>
pub fn clear_range(&self, lo: usize, hi: usize) -> Result<(), BitVecError>
Clear all bits in lo..hi (exclusive end). Same RMW-on-
boundary, store-on-interior pattern.
Sourcepub fn count_ones(&self) -> usize
pub fn count_ones(&self) -> usize
Count total number of 1-bits across all words. O(words).
Sourcepub fn count_zeros(&self) -> usize
pub fn count_zeros(&self) -> usize
Count total number of 0-bits in the valid range.
pub fn is_all_set(&self) -> bool
pub fn is_all_clear(&self) -> bool
Sourcepub fn set_all(&self)
pub fn set_all(&self)
Set every bit. Unconditional Release-store on every word, with the last word masked to only valid bits so count_ones stays accurate.
pub fn flush(&self) -> Result<(), BitVecError>
pub fn flush_async(&self) -> Result<(), BitVecError>
Trait Implementations§
fn header(&self) -> &HandshakeHeader
fn ring(&self) -> &ObservationRing
fn make_policy(&self) -> Box<dyn Policy>
Source§fn apply_migration(&self, new_tag: u32)
fn apply_migration(&self, new_tag: u32)
Called by the sidecar when the policy returns a new strategy
tag. Default implementation: just set the tag on the header.
Primitives that need heavier migration (data-layout swap)
override this to perform the swap before (or after) updating
the tag.
Auto Trait Implementations§
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