Struct emerald_rocksdb::WriteBatch
[−]
[src]
pub struct WriteBatch { /* fields omitted */ }
An atomic batch of write operations.
Making an atomic commit of several writes:
use rocksdb::{DB, WriteBatch}; let db = DB::open_default("path/for/rocksdb/storage1").unwrap(); { let mut batch = WriteBatch::default(); batch.put(b"my key", b"my value"); batch.put(b"key2", b"value2"); batch.put(b"key3", b"value3"); db.write(batch); // Atomically commits the batch }
Methods
impl WriteBatch
[src]
fn len(&self) -> usize
[src]
fn is_empty(&self) -> bool
[src]
fn put(&mut self, key: &[u8], value: &[u8]) -> Result<(), Error>
[src]
Insert a value into the database under the given key.
fn put_cf(
&mut self,
cf: ColumnFamily,
key: &[u8],
value: &[u8]
) -> Result<(), Error>
[src]
&mut self,
cf: ColumnFamily,
key: &[u8],
value: &[u8]
) -> Result<(), Error>
fn merge(&mut self, key: &[u8], value: &[u8]) -> Result<(), Error>
[src]
fn merge_cf(
&mut self,
cf: ColumnFamily,
key: &[u8],
value: &[u8]
) -> Result<(), Error>
[src]
&mut self,
cf: ColumnFamily,
key: &[u8],
value: &[u8]
) -> Result<(), Error>
fn delete(&mut self, key: &[u8]) -> Result<(), Error>
[src]
Remove the database entry for key.
Returns an error if the key was not found.
fn delete_cf(&mut self, cf: ColumnFamily, key: &[u8]) -> Result<(), Error>
[src]
Trait Implementations
impl Default for WriteBatch
[src]
fn default() -> WriteBatch
[src]
Returns the "default value" for a type. Read more