Trait Store

Source
pub trait Store<K, V>: RawStore<K, V> {
    type Entry<'a>: RawEntry<'a, Key = K, Value = V>
       where Self: 'a;

    // Required methods
    fn entry(&mut self, key: K) -> Self::Entry<'_>;
    fn insert(&mut self, key: K, value: V) -> Option<V>;
}
Expand description

the [KeyValue] trait extends the [RawKeyValue] trait to provide additional methods for manipulating key-value stores.

Required Associated Types§

Source

type Entry<'a>: RawEntry<'a, Key = K, Value = V> where Self: 'a

the entry for the key-value pair

Required Methods§

Source

fn entry(&mut self, key: K) -> Self::Entry<'_>

returns the [Entry] for the given key

Source

fn insert(&mut self, key: K, value: V) -> Option<V>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<K, V> Store<K, V> for BTreeMap<K, V>
where K: Ord,

Source§

type Entry<'a> = Entry<'a, K, V> where Self: 'a

Source§

fn entry(&mut self, key: K) -> Self::Entry<'_>

Source§

fn insert(&mut self, key: K, value: V) -> Option<V>

Source§

impl<K, V, S> Store<K, V> for HashMap<K, V, S>
where K: Eq + Hash, S: BuildHasher,

Source§

type Entry<'a> = Entry<'a, K, V> where Self: 'a

Source§

fn entry(&mut self, key: K) -> Self::Entry<'_>

Source§

fn insert(&mut self, key: K, value: V) -> Option<V>

Implementors§