pub struct KvStore {
db_path: PathBuf,
}
Fields§
§db_path: PathBuf
Implementations§
Trait Implementations§
source§impl Storage for KvStore
impl Storage for KvStore
fn db_path(&self) -> PathBuf
fn open_db(&self) -> Result<Db, Error>
fn get<T>(&self, key: &str) -> Result<Option<T>, Error>where
T: for<'a> Deserialize<'a>,
fn set<T>(&self, key: &str, value: &T) -> Result<(), Error>where
T: Serialize,
fn delete(&self, key: &str) -> Result<(), Error>
fn clear(&self) -> Result<(), Error>
fn load_from_json<T>(&self, key: &str, path: PathBuf) -> Result<(), Error>where
T: for<'a> Deserialize<'a> + Serialize,
fn iter_keys(&self) -> Result<Vec<String>, Error>
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