Struct rusty_leveldb::WriteBatch
source · [−]pub struct WriteBatch { /* private fields */ }
Expand description
A WriteBatch contains entries to be written to a MemTable (for example) in a compact form.
The storage format is (with the respective length in bytes)
[tag: 1, keylen: ~var, key: keylen, vallen: ~var, val: vallen]
Implementations
sourceimpl WriteBatch
impl WriteBatch
pub fn new() -> WriteBatch
sourcepub fn set_contents(&mut self, from: &[u8])
pub fn set_contents(&mut self, from: &[u8])
Initializes a WriteBatch with a serialized WriteBatch.
sourcepub fn put(&mut self, k: &[u8], v: &[u8])
pub fn put(&mut self, k: &[u8], v: &[u8])
Adds an entry to a WriteBatch, to be added to the database.
pub fn sequence(&self) -> u64
pub fn iter(&self) -> WriteBatchIter<'_>
pub fn insert_into_memtable(&self, seq: u64, mt: &mut MemTable)
pub fn encode(self, seq: u64) -> Vec<u8>
Auto Trait Implementations
impl RefUnwindSafe for WriteBatch
impl Send for WriteBatch
impl Sync for WriteBatch
impl Unpin for WriteBatch
impl UnwindSafe for WriteBatch
Blanket Implementations
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstablefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more