|
|
@ -334,11 +334,22 @@ impl WriteOptions { |
|
|
|
pub fn new() -> WriteOptions { |
|
|
|
pub fn new() -> WriteOptions { |
|
|
|
WriteOptions::default() |
|
|
|
WriteOptions::default() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
pub fn set_sync(&mut self, sync: bool) { |
|
|
|
pub fn set_sync(&mut self, sync: bool) { |
|
|
|
unsafe { |
|
|
|
unsafe { |
|
|
|
rocksdb_ffi::rocksdb_writeoptions_set_sync(self.inner, sync); |
|
|
|
rocksdb_ffi::rocksdb_writeoptions_set_sync(self.inner, sync); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pub fn disable_wal(&mut self, disable: bool) { |
|
|
|
|
|
|
|
unsafe { |
|
|
|
|
|
|
|
if disable { |
|
|
|
|
|
|
|
rocksdb_ffi::rocksdb_writeoptions_disable_WAL(self.inner, 1); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
rocksdb_ffi::rocksdb_writeoptions_disable_WAL(self.inner, 0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
impl Default for WriteOptions { |
|
|
|
impl Default for WriteOptions { |
|
|
|