pub struct SegmentBlocksBuilder { /* private fields */ }Expand description
Builds one segment’s blocks from rows fed in ascending row-key order.
Implementations§
Source§impl SegmentBlocksBuilder
impl SegmentBlocksBuilder
Sourcepub fn new(target_block_bytes: NonZeroUsize) -> Self
pub fn new(target_block_bytes: NonZeroUsize) -> Self
Creates a builder that closes a data block after reaching the target decoded byte size.
Sourcepub fn push<R: Serialize>(
&mut self,
row_key: &str,
filter_key: &str,
row: &R,
) -> Result<(), SstBlockCodecError>
pub fn push<R: Serialize>( &mut self, row_key: &str, filter_key: &str, row: &R, ) -> Result<(), SstBlockCodecError>
Appends one row. filter_key is the lookup prefix point reads will
probe for this row; the caller derives it per family. The row is any
CBOR payload; a segment must hold one row type throughout, named by
the descriptor family that references it.
Sourcepub fn finish(self) -> Result<BuiltSegmentBlocks, SstBlockCodecError>
pub fn finish(self) -> Result<BuiltSegmentBlocks, SstBlockCodecError>
Encodes the remaining rows and assembles the object bytes.
Trait Implementations§
Source§impl Debug for SegmentBlocksBuilder
impl Debug for SegmentBlocksBuilder
Auto Trait Implementations§
impl Freeze for SegmentBlocksBuilder
impl RefUnwindSafe for SegmentBlocksBuilder
impl Send for SegmentBlocksBuilder
impl Sync for SegmentBlocksBuilder
impl Unpin for SegmentBlocksBuilder
impl UnsafeUnpin for SegmentBlocksBuilder
impl UnwindSafe for SegmentBlocksBuilder
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