pub struct BitVec { /* private fields */ }Expand description
A simple bit vector that does not support rank and select queries. It has a constant memory overhead of 32 bytes on the stack.
Implementations§
source§impl BitVec
impl BitVec
sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create a new empty bit vector with the given capacity. The capacity is measured in bits.
sourcepub fn from_zeros(len: usize) -> Self
pub fn from_zeros(len: usize) -> Self
Create a new bit vector with all zeros and the given length. The length is measured in bits.
sourcepub fn append_bit(&mut self, bit: u64)
pub fn append_bit(&mut self, bit: u64)
Append a bit from a quad-word. The least significant bit is appended to the bit vector. All other bits are ignored.
sourcepub fn append_word(&mut self, word: u64)
pub fn append_word(&mut self, word: u64)
Append a word to the bit vector. The least significant bit is appended first.
sourcepub fn append_bits(&mut self, bits: u64, len: usize)
pub fn append_bits(&mut self, bits: u64, len: usize)
Append multiple bits to the bit vector. The least significant bit is appended first.
The number of bits to append is given by len. The bits are taken from the least
significant bits of bits. All other bits are ignored.
sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Return the length of the bit vector. The length is measured in bits.