Struct sstable::TableBuilder
source · pub struct TableBuilder<Dst: Write> { /* private fields */ }
Expand description
A TableBuilder is used to create a table from a set of sorted string pairs and write it to a file or a buffer.
Implementations§
source§impl<Dst: Write> TableBuilder<Dst>
impl<Dst: Write> TableBuilder<Dst>
pub fn new_no_filter(opt: Options, dst: Dst) -> TableBuilder<Dst>
source§impl<Dst: Write> TableBuilder<Dst>
impl<Dst: Write> TableBuilder<Dst>
TableBuilder is used for building a new SSTable. It groups entries into blocks, calculating checksums and bloom filters.
sourcepub fn new(opt: Options, dst: Dst) -> TableBuilder<Dst>
pub fn new(opt: Options, dst: Dst) -> TableBuilder<Dst>
Create a new table builder.
sourcepub fn size_estimate(&self) -> usize
pub fn size_estimate(&self) -> usize
Returns the estimated size of the SSTable in bytes. It includes already written and outstanding bytes.
sourcepub fn add(&mut self, key: &[u8], val: &[u8]) -> Result<()>
pub fn add(&mut self, key: &[u8], val: &[u8]) -> Result<()>
Add a key to the table. The key must be lexically greater or equal to the one that was previously added.
pub fn finish(self) -> Result<usize>
Auto Trait Implementations§
impl<Dst> !RefUnwindSafe for TableBuilder<Dst>
impl<Dst> Send for TableBuilder<Dst>where Dst: Send,
impl<Dst> Sync for TableBuilder<Dst>where Dst: Sync,
impl<Dst> Unpin for TableBuilder<Dst>where Dst: Unpin,
impl<Dst> !UnwindSafe for TableBuilder<Dst>
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