|
|
@ -818,6 +818,7 @@ impl ReadOptions { |
|
|
|
// TODO add snapshot setting here
|
|
|
|
// TODO add snapshot setting here
|
|
|
|
// TODO add snapshot wrapper structs with proper destructors;
|
|
|
|
// TODO add snapshot wrapper structs with proper destructors;
|
|
|
|
// that struct needs an "iterator" impl too.
|
|
|
|
// that struct needs an "iterator" impl too.
|
|
|
|
|
|
|
|
#[allow(dead_code)] |
|
|
|
fn fill_cache(&mut self, v: bool) { |
|
|
|
fn fill_cache(&mut self, v: bool) { |
|
|
|
unsafe { |
|
|
|
unsafe { |
|
|
|
rocksdb_ffi::rocksdb_readoptions_set_fill_cache(self.inner, v); |
|
|
|
rocksdb_ffi::rocksdb_readoptions_set_fill_cache(self.inner, v); |
|
|
@ -854,13 +855,11 @@ impl Drop for DBVector { |
|
|
|
|
|
|
|
|
|
|
|
impl DBVector { |
|
|
|
impl DBVector { |
|
|
|
pub fn from_c(val: *mut u8, val_len: size_t) -> DBVector { |
|
|
|
pub fn from_c(val: *mut u8, val_len: size_t) -> DBVector { |
|
|
|
unsafe { |
|
|
|
|
|
|
|
DBVector { |
|
|
|
DBVector { |
|
|
|
base: val, |
|
|
|
base: val, |
|
|
|
len: val_len as usize, |
|
|
|
len: val_len as usize, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pub fn to_utf8<'a>(&'a self) -> Option<&'a str> { |
|
|
|
pub fn to_utf8<'a>(&'a self) -> Option<&'a str> { |
|
|
|
from_utf8(self.deref()).ok() |
|
|
|
from_utf8(self.deref()).ok() |
|
|
|