Trait engine_traits::SstWriter[][src]

pub trait SstWriter: Send {
    type ExternalSstFileInfo: ExternalSstFileInfo;
    type ExternalSstFileReader: Read;
    fn put(&mut self, key: &[u8], val: &[u8]) -> Result<()>;
fn delete(&mut self, key: &[u8]) -> Result<()>;
fn file_size(&mut self) -> u64;
fn finish(self) -> Result<Self::ExternalSstFileInfo>;
fn finish_read(
        self
    ) -> Result<(Self::ExternalSstFileInfo, Self::ExternalSstFileReader)>; }

SstWriter is used to create sst files that can be added to database later.

Associated Types

type ExternalSstFileInfo: ExternalSstFileInfo[src]

type ExternalSstFileReader: Read[src]

Loading content...

Required methods

fn put(&mut self, key: &[u8], val: &[u8]) -> Result<()>[src]

Add key, value to currently opened file REQUIRES: key is after any previously added key according to comparator.

fn delete(&mut self, key: &[u8]) -> Result<()>[src]

Add a deletion key to currently opened file REQUIRES: key is after any previously added key according to comparator.

fn file_size(&mut self) -> u64[src]

Return the current file size.

fn finish(self) -> Result<Self::ExternalSstFileInfo>[src]

Finalize writing to sst file and close file.

fn finish_read(
    self
) -> Result<(Self::ExternalSstFileInfo, Self::ExternalSstFileReader)>
[src]

Finalize writing to sst file and read the contents into the buffer.

Loading content...

Implementors

Loading content...