Trait KvStore
Source pub trait KvStore:
Debug
+ Send
+ Sync {
// Required methods
fn get(&self, key: &[u8]) -> Option<Bytes>;
fn set(&mut self, key: &[u8], value: Bytes);
fn compare_and_swap(
&mut self,
key: &[u8],
old: Option<Bytes>,
new: Bytes,
) -> bool;
fn remove(&mut self, key: &[u8]) -> Option<Bytes>;
fn contains_key(&self, key: &[u8]) -> bool;
fn scan(
&self,
start: Bound<&[u8]>,
end: Bound<&[u8]>,
) -> Box<dyn DoubleEndedIterator<Item = (Bytes, Bytes)> + '_>;
fn len(&self) -> usize;
fn is_empty(&self) -> bool;
fn size(&self) -> usize;
fn export_all(&mut self) -> Bytes;
fn import_all(&mut self, bytes: Bytes) -> Result<(), String>;
fn clone_store(&self) -> Arc<Mutex<dyn KvStore>>;
}