pub struct BitSet { /* private fields */ }Expand description
Bit set providing fast operations on large arrays of bits.
Implementations§
Source§impl BitSet
impl BitSet
Sourcepub fn destroy(&mut self)
pub fn destroy(&mut self)
Release the storage. (b3DestroyBitSet)
Rust would drop the storage automatically; this mirrors the C function so ported call sites read the same.
Sourcepub fn set_bit_count_and_clear(&mut self, bit_count: u32)
pub fn set_bit_count_and_clear(&mut self, bit_count: u32)
(b3SetBitCountAndClear)
Sourcepub fn in_place_union(&mut self, other: &BitSet)
pub fn in_place_union(&mut self, other: &BitSet)
In-place union: self |= other. (b3InPlaceUnion)
Sourcepub fn count_set_bits(&self) -> i32
pub fn count_set_bits(&self) -> i32
Count the number of set bits. (b3CountSetBits, from table.c)
Sourcepub fn set_bit(&mut self, bit_index: u32)
pub fn set_bit(&mut self, bit_index: u32)
Set a bit that must lie within the current block count. (b3SetBit)
Sourcepub fn set_bit_grow(&mut self, bit_index: u32)
pub fn set_bit_grow(&mut self, bit_index: u32)
Set a bit, growing the set if needed. (b3SetBitGrow)
Sourcepub fn clear_bit(&mut self, bit_index: u32)
pub fn clear_bit(&mut self, bit_index: u32)
Clear a bit. Out-of-range indices are ignored. (b3ClearBit)
Sourcepub fn get_bit(&self, bit_index: u32) -> bool
pub fn get_bit(&self, bit_index: u32) -> bool
Get a bit. Out-of-range indices read as false. (b3GetBit)
Sourcepub fn block_count(&self) -> u32
pub fn block_count(&self) -> u32
Number of active 64-bit blocks (blockCount in C). Used together with
BitSet::block to port the C word/CTZ set-bit iteration loops.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BitSet
impl RefUnwindSafe for BitSet
impl Send for BitSet
impl Sync for BitSet
impl Unpin for BitSet
impl UnsafeUnpin for BitSet
impl UnwindSafe for BitSet
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