[][src]Struct perkv::KV

pub struct KV<K, V>(_, _);

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]

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]

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]

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]

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]

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]

Auto Trait Implementations

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

impl<K, V> RefUnwindSafe for KV<K, V> where
    K: RefUnwindSafe,
    V: RefUnwindSafe

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,