Struct rocksdb::SstFileWriter [−][src]
pub struct SstFileWriter<'a> { /* fields omitted */ }
SstFileWriter is used to create sst files that can be added to database later All keys in files generated by SstFileWriter will have sequence number = 0.
Implementations
impl<'a> SstFileWriter<'a>
[src]
impl<'a> SstFileWriter<'a>
[src]pub fn create(opts: &'a Options) -> SstFileWriter<'_>
[src]
Initializes SstFileWriter with given DB options.
pub fn open<P: AsRef<Path>>(&'a self, path: P) -> Result<(), Error>
[src]
Prepare SstFileWriter to write into file located at “file_path”.
pub fn finish(&mut self) -> Result<(), Error>
[src]
Finalize writing to sst file and close file.
pub fn file_size(&self) -> u64
[src]
returns the current file size
pub fn put<K, V>(&mut self, key: K, value: V) -> Result<(), Error> where
K: AsRef<[u8]>,
V: AsRef<[u8]>,
[src]
K: AsRef<[u8]>,
V: AsRef<[u8]>,
Adds a Put key with value to currently opened file REQUIRES: key is after any previously added key according to comparator.
pub fn merge<K, V>(&mut self, key: K, value: V) -> Result<(), Error> where
K: AsRef<[u8]>,
V: AsRef<[u8]>,
[src]
K: AsRef<[u8]>,
V: AsRef<[u8]>,
Adds a Merge key with value to currently opened file REQUIRES: key is after any previously added key according to comparator.
pub fn delete<K: AsRef<[u8]>>(&mut self, key: K) -> Result<(), Error>
[src]
Adds a deletion key to currently opened file REQUIRES: key is after any previously added key according to comparator.
Trait Implementations
impl<'a> Drop for SstFileWriter<'a>
[src]
impl<'a> Drop for SstFileWriter<'a>
[src]