Skip to main content

Store

Trait Store 

Source
pub trait Store<K, V>: RawStoreMut<K, V> {
    type Entry<'a>: StoreEntry<'a, K, V>
       where Self: 'a;

    // Required method
    fn entry<'a>(&'a mut self, key: K) -> Self::Entry<'a>;
}
Expand description

The Store trait is a more robust interface for key-value stores, building upon both RawStore and RawStoreMut traits by introducing an entry method for in-place manipulation of key-value pairs.

Required Associated Types§

Source

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

Required Methods§

Source

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

returns the entry corresponding to the given key for in-place manipulation

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

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, S> where HashMap<K, V, S>: 'a

Source§

fn entry<'a>( &'a mut self, key: K, ) -> <HashMap<K, V, S> as Store<K, V>>::Entry<'a>

Source§

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

Source§

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

Source§

fn entry<'a>(&'a mut self, key: K) -> <BTreeMap<K, V> as Store<K, V>>::Entry<'a>

Source§

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

Source§

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

Source§

fn entry<'a>(&'a mut self, key: K) -> <HashMap<K, V> as Store<K, V>>::Entry<'a>

Implementors§