Struct leveldb_rs::DBWriteBatch
[−]
[src]
pub struct DBWriteBatch { /* fields omitted */ }
A write batch holds a collection of updates to apply atomically to a database. Updates are applied in the order in which they are added to the write batch.
Methods
impl DBWriteBatch
[src]
fn new() -> Option<DBWriteBatch>
Create a new, empty write batch. Returns None if the underlying library call returns a null pointer.
fn put(&mut self, key: &[u8], val: &[u8])
Set the database entry for "key" to "value". See put()
on DB
for
more information.
fn clear(&mut self)
Clear all updates buffered in this write batch.
fn delete(&mut self, key: &[u8])
If the database contains the given key, erase it. Otherwise, do nothing.
fn iterate<'a, F: 'a, G: 'a>(&'a self, put: F, delete: G) where
F: FnMut(&'a [u8], &'a [u8]) + 'a,
G: FnMut(&'a [u8]) + 'a,
F: FnMut(&'a [u8], &'a [u8]) + 'a,
G: FnMut(&'a [u8]) + 'a,
Iterate over the contents of the write batch by calling callbacks for each operation in the batch.