pub struct BlockBuilder {
buffer: Vec<u8>,
restarts: Vec<u32>,
counter: usize,
last_key: Vec<u8>,
}Fields§
§buffer: Vec<u8>The raw byte buffer where we write our entries.
restarts: Vec<u32>Array of offsets in buffer where a restart point begins.
counter: usizeThe number of entries added since the last restart point.
last_key: Vec<u8>The key of the last entry added (used to calculate prefix overlap).
Implementations§
Source§impl BlockBuilder
impl BlockBuilder
pub fn new() -> Self
Sourcepub fn add(&mut self, key: &[u8], value: &[u8])
pub fn add(&mut self, key: &[u8], value: &[u8])
Adds a key-value pair to the block. Keys MUST be added in strictly increasing order.
pub fn finish(&mut self) -> &[u8] ⓘ
pub fn is_block_maxed(&self) -> bool
pub fn last_key(&self) -> Vec<u8> ⓘ
pub fn buffer_len(&self) -> usize
Auto Trait Implementations§
impl Freeze for BlockBuilder
impl RefUnwindSafe for BlockBuilder
impl Send for BlockBuilder
impl Sync for BlockBuilder
impl Unpin for BlockBuilder
impl UnsafeUnpin for BlockBuilder
impl UnwindSafe for BlockBuilder
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