Struct fixedbitset::FixedBitSet
[−]
[src]
pub struct FixedBitSet { // some fields omitted }
FixedBitSet is a simple fixed size set of bits that can be enabled (1 / true) or disabled (0 / false).
Methods
impl FixedBitSet
fn with_capacity(bits: usize) -> Self
Create a new FixedBitSet with a specific number of bits, all initially clear.
fn grow(&mut self, bits: usize)
Grow capacity to bits, all new bits initialized to zero
fn len(&self) -> usize
Return the length of the FixedBitSet in bits.
fn contains(&self, bit: usize) -> bool
Return true if the bit is enabled in the FixedBitSet, false otherwise.
Note: bits outside the capacity are always disabled.
fn clear(&mut self)
Clear all bits.
fn insert(&mut self, bit: usize)
Panics if bit is out of bounds.
fn set(&mut self, bit: usize, enabled: bool)
Panics if bit is out of bounds.
fn as_slice(&self) -> &[u32]
View the bitset as a slice of u32
blocks
fn as_mut_slice(&mut self) -> &mut [u32]
View the bitset as a mutable slice of u32
blocks. Writing past the bitlength in the last
will cause contains
to return potentially incorrect results for bits past the bitlength.
Trait Implementations
impl Clone for FixedBitSet
fn clone(&self) -> Self
1.0.0fn clone_from(&mut self, source: &Self)
impl Index<usize> for FixedBitSet
Return true if the bit is enabled in the bitset, or false otherwise.