Skip to main content

RawStoreMut

Trait RawStoreMut 

Source
pub trait RawStoreMut<K, V>: RawStore<K, V> {
    // Required methods
    fn get_mut(&mut self, key: &K) -> Option<&mut V>;
    fn insert(&mut self, key: K, value: V) -> Option<V>;
    fn remove(&mut self, key: &K) -> Option<V>;
}
Expand description

RawStoreMut extends the RawStore trait by introducing various mutable operations and accessors for elements within the store.

Required Methods§

Source

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

retrieves a mutable reference to a value by key

Source

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

inserts a key-value pair into the store

Source

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

removes a key-value pair from the store by key

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Implementors§