Struct vers_vecs::bit_vec::fast_rs_vec::RsVectorBuilder
source · pub struct RsVectorBuilder { /* private fields */ }Expand description
A builder for FastBitVector. This is used to efficiently construct a BitVector by appending
bits to it. Once all bits have been appended, the BitVector can be built using the build
method. If the number of bits to be appended is known in advance, it is recommended to use
with_capacity to avoid re-allocations. If bits are already available in little endian u64
words, those words can be appended using append_word.
Implementations§
source§impl RsVectorBuilder
impl RsVectorBuilder
sourcepub fn new() -> RsVectorBuilder
pub fn new() -> RsVectorBuilder
Create a new empty BitVectorBuilder.
sourcepub fn with_capacity(capacity: usize) -> RsVectorBuilder
pub fn with_capacity(capacity: usize) -> RsVectorBuilder
Create a new empty BitVectorBuilder with the specified initial capacity to avoid
re-allocations. The capacity is measured in bits
sourcepub fn append_bit<T>(&mut self, bit: T)where
T: Into<u64>,
pub fn append_bit<T>(&mut self, bit: T)where T: Into<u64>,
Append a bit to the vector.
sourcepub fn append_word(&mut self, word: u64)
pub fn append_word(&mut self, word: u64)
Append a word to the vector. The word is assumed to be in little endian, i.e. the least significant bit is the first bit.
source§impl RsVectorBuilder
impl RsVectorBuilder
A trait to be implemented for each bit vector type to specify how it is built from a
BitVectorBuilder.
Trait Implementations§
source§impl Clone for RsVectorBuilder
impl Clone for RsVectorBuilder
source§fn clone(&self) -> RsVectorBuilder
fn clone(&self) -> RsVectorBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more