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>

source

pub fn new_no_filter(opt: Options, dst: Dst) -> TableBuilder<Dst>

source§

impl<Dst: Write> TableBuilder<Dst>

TableBuilder is used for building a new SSTable. It groups entries into blocks, calculating checksums and bloom filters.

source

pub fn new(opt: Options, dst: Dst) -> TableBuilder<Dst>

Create a new table builder.

source

pub fn entries(&self) -> usize

Returns the current number of entries.

source

pub fn size_estimate(&self) -> usize

Returns the estimated size of the SSTable in bytes. It includes already written and outstanding bytes.

source

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.

source

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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.