pub struct WriteOptions { /* private fields */ }Expand description
Optionally disable WAL or sync for this write.
§Examples
Making an unsafe write of a batch:
use emerald_rocksdb::{DB, WriteBatch, WriteOptions};
let db = DB::open_default("path/for/rocksdb/storageY").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);Implementations§
Source§impl WriteOptions
impl WriteOptions
pub fn new() -> WriteOptions
pub fn set_sync(&mut self, sync: bool)
pub fn disable_wal(&mut self, disable: bool)
Trait Implementations§
Source§impl Default for WriteOptions
impl Default for WriteOptions
Source§fn default() -> WriteOptions
fn default() -> WriteOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for WriteOptions
impl RefUnwindSafe for WriteOptions
impl !Send for WriteOptions
impl !Sync for WriteOptions
impl Unpin for WriteOptions
impl UnwindSafe for WriteOptions
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