pub struct KvStore { /* private fields */ }
Expand description
Usage
use std::path::Path;
use kvs::KvStore;
use crate::kvs::KvsEngine;
let db_path = "/tmp/";
let mut path = Path::new(db_path);
let mut store = KvStore::open(path).unwrap();
store.set("key1".to_owned(), "value1".to_owned());
assert_eq!(store.get("key1".to_owned())?, Some("value1".to_owned()));
store.remove("key1".to_owned());
In memory key value storage String:String
Implementations
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for KvStore
impl Send for KvStore
impl Sync for KvStore
impl Unpin for KvStore
impl UnwindSafe for KvStore
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more