pub struct KV<K, V> { /* private fields */ }
Expand description
The type that represents the key-value store
Implementations
sourceimpl<K, V> KV<K, V>where
K: Clone + Serialize + for<'kde> Deserialize<'kde> + Eq + Hash,
V: Clone + Serialize + for<'vde> Deserialize<'vde>,
impl<K, V> KV<K, V>where
K: Clone + Serialize + for<'kde> Deserialize<'kde> + Eq + Hash,
V: Clone + Serialize + for<'vde> Deserialize<'vde>,
sourcepub fn new(p: &'static str) -> Result<KV<K, V>, PersyError>
pub fn new(p: &'static str) -> Result<KV<K, V>, PersyError>
Creates a new instance of the KV store
sourcepub fn insert(&mut self, key: K, value: V) -> PRes<bool>
pub fn insert(&mut self, key: K, value: V) -> PRes<bool>
Inserta a key, value pair into the key-value store
sourcepub fn remove(&mut self, key: &K) -> PRes<bool>
pub fn remove(&mut self, key: &K) -> PRes<bool>
Removes a key and associated value from the key-value Store
sourcepub fn keys(&mut self) -> Result<Vec<K>, PersyError>
pub fn keys(&mut self) -> Result<Vec<K>, PersyError>
get all the keys contained in the KV Store
Auto Trait Implementations
impl<K, V> RefUnwindSafe for KV<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for KV<K, V>where
K: Send,
V: Send,
impl<K, V> Sync for KV<K, V>where
K: Sync,
V: Sync,
impl<K, V> Unpin for KV<K, V>where
K: Unpin,
V: Unpin,
impl<K, V> UnwindSafe for KV<K, V>where
K: UnwindSafe,
V: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more