pub struct BitVector { /* private fields */ }Expand description
A cache-oblivious succinct bit vector.
Implementations§
Source§impl BitVector
impl BitVector
Sourcepub fn from_parts(
storage: Vec<u64>,
select1_index: Vec<u32>,
select0_index: Vec<u32>,
len: usize,
) -> Result<Self>
pub fn from_parts( storage: Vec<u64>, select1_index: Vec<u32>, select0_index: Vec<u32>, len: usize, ) -> Result<Self>
Reconstruct a BitVector from its internal parts.
This is primarily intended for serialization round-trips.
Sourcepub fn to_bytes(&self) -> Vec<u8> ⓘ
pub fn to_bytes(&self) -> Vec<u8> ⓘ
Serialize this bitvector to a stable binary encoding (little-endian).
Format (versioned):
- magic: 8 bytes (
SBITBV01) - len: u64
- storage_len: u64, then
storage_lenu64 words - select1_len: u64, then
select1_lenu32 words - select0_len: u64, then
select0_lenu32 words
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self>
pub fn from_bytes(bytes: &[u8]) -> Result<Self>
Deserialize a BitVector from to_bytes() output.
Sourcepub fn heap_bytes(&self) -> usize
pub fn heap_bytes(&self) -> usize
Approximate heap memory usage in bytes.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BitVector
impl RefUnwindSafe for BitVector
impl Send for BitVector
impl Sync for BitVector
impl Unpin for BitVector
impl UnsafeUnpin for BitVector
impl UnwindSafe for BitVector
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