[][src]Struct exonum_rocksdb::WriteOptions

pub struct WriteOptions { /* fields omitted */ }

Optionally disable WAL or sync for this write.

Examples

Making an unsafe write of a batch:

extern crate tempdir;
extern crate exonum_rocksdb;

use exonum_rocksdb::{DB, WriteBatch, WriteOptions};
use tempdir::TempDir;

let temp_dir = TempDir::new("storageY").unwrap();
let db = DB::open_default(temp_dir.path()).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");

let mut write_options = WriteOptions::default();
write_options.set_sync(false);
write_options.disable_wal(true);

db.write_opt(batch, &write_options);

Methods

impl WriteOptions[src]

pub fn new() -> WriteOptions[src]

pub fn set_sync(&mut self, sync: bool)[src]

pub fn disable_wal(&mut self, disable: bool)[src]

Trait Implementations

impl Default for WriteOptions[src]

impl Drop for WriteOptions[src]

Auto Trait Implementations

impl !Send for WriteOptions

impl !Sync for WriteOptions

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]