pub struct KvStore { /* private fields */ }
Expand description
The KvStore
stores string key/value pairs.
Key/value pairs are persisted to disk in log files. Log files are named after
monotonically increasing generation numbers with a log
extension name.
A BTreeMap
in memory stores the keys and the value locations for fast query.
use std::env::current_dir;
let mut store = KvStore::open(current_dir()?)?;
store.set("key".to_owned(), "value".to_owned())?;
let val = store.get("key".to_owne())?;
assert_eq!(val, Some("value".to_owned()));
Implementations§
Auto Trait Implementations§
impl Freeze for KvStore
impl RefUnwindSafe for KvStore
impl Send for KvStore
impl Sync for KvStore
impl Unpin for KvStore
impl UnwindSafe for KvStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more