Struct 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]

[src]

[src]

[src]

Insert a value into the database under the given key.

[src]

[src]

[src]

[src]

Remove the database entry for key.

Returns an error if the key was not found.

[src]

Trait Implementations

impl Default for WriteBatch
[src]

[src]

Returns the "default value" for a type. Read more

impl Drop for WriteBatch
[src]

[src]

Executes the destructor for this type. Read more