mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-04-28 03:00:18 -04:00
add key_exist_cf() funciton to Rocks struct
This commit is contained in:
@@ -83,6 +83,14 @@ impl Rocks {
|
||||
Ok(val)
|
||||
}
|
||||
|
||||
pub fn key_exist_cf(&self, cf: &ColumnFamily, key: Vec<u8>) -> Result<bool> {
|
||||
let val = self.db.get_cf(cf, key)?;
|
||||
if let None = val {
|
||||
return Ok(false);
|
||||
};
|
||||
Ok(true)
|
||||
}
|
||||
|
||||
pub fn iterator(&self, cf: &ColumnFamily, iterator_mode: IteratorMode) -> rocksdb::DBIterator{
|
||||
let iterator_mode = match iterator_mode {
|
||||
IteratorMode::Start => rocksdb::IteratorMode::Start,
|
||||
|
||||
Reference in New Issue
Block a user