[−][src]Struct perkv::KV
The type that represents the key-value store
Methods
impl<K, V> KV<K, V> where
K: Eq + Serialize,
V: for<'vde> Deserialize<'vde> + Serialize,
[src]
K: Eq + Serialize,
V: for<'vde> Deserialize<'vde> + Serialize,
pub fn new(p: &str) -> PRes<KV<K, V>>
[src]
Creates a new instance of the KV store
pub fn insert<Q: ?Sized, U: ?Sized>(&self, key: &Q, value: &U) -> PRes<()> where
K: Borrow<Q>,
Q: Eq + Serialize,
V: Borrow<U>,
U: Serialize,
[src]
K: Borrow<Q>,
Q: Eq + Serialize,
V: Borrow<U>,
U: Serialize,
Inserts a key-value pair into the KV store
The key may be any borrowed form of the store's key type, but
Eq
and Serialize
on the borrowed form must match those
for the key type. This also applies to value type/store's value type.
pub fn get<Q: ?Sized>(&self, key: &Q) -> PRes<Option<V>> where
K: Borrow<Q>,
Q: Eq + Serialize,
[src]
K: Borrow<Q>,
Q: Eq + Serialize,
Gets the associated value from a key
The key may be any borrowed form of the store's key type, but
Eq
and Serialize
on the borrowed form must match those
for the key type.
pub fn remove<Q: ?Sized>(&self, key: &Q) -> PRes<()> where
K: Borrow<Q>,
Q: Eq + Serialize,
[src]
K: Borrow<Q>,
Q: Eq + Serialize,
Removes a key and associated value from the KV store
The key may be any borrowed form of the store's key type, but
Eq
and Serialize
on the borrowed form must match those
for the key type.
pub fn keys<B>(&self) -> PRes<B> where
K: for<'kde> Deserialize<'kde>,
B: FromIterator<K>,
[src]
K: for<'kde> Deserialize<'kde>,
B: FromIterator<K>,
Gets all the keys contained in the KV Store
pub fn clear(&self) -> PRes<()>
[src]
Removes all entries from the KV store
Trait Implementations
impl<K, V> Clone for KV<K, V>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Auto Trait Implementations
impl<K, V> Send for KV<K, V> where
K: Send,
V: Send,
K: Send,
V: Send,
impl<K, V> Sync for KV<K, V> where
K: Sync,
V: Sync,
K: Sync,
V: Sync,
impl<K, V> Unpin for KV<K, V> where
K: Unpin,
V: Unpin,
K: Unpin,
V: Unpin,
impl<K, V> UnwindSafe for KV<K, V> where
K: UnwindSafe,
V: UnwindSafe,
K: UnwindSafe,
V: UnwindSafe,
impl<K, V> RefUnwindSafe for KV<K, V> where
K: RefUnwindSafe,
V: RefUnwindSafe,
K: RefUnwindSafe,
V: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,