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§
Source§impl WriteBatch
impl 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> ⓘ
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WriteBatch
impl RefUnwindSafe for WriteBatch
impl Send for WriteBatch
impl Sync for WriteBatch
impl Unpin for WriteBatch
impl UnwindSafe for WriteBatch
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