pub trait StoreMut<K, V>: Store<K, V> {
// Required methods
fn lm_with_capacity(capacity: usize) -> Self;
fn lm_reserve(&mut self, additional: usize);
fn lm_get_mut(&mut self, index: usize) -> Option<(&K, &mut V)>;
fn lm_push(&mut self, key: K, value: V);
fn lm_insert(&mut self, index: usize, key: K, value: V);
fn lm_remove(&mut self, index: usize) -> (K, V);
fn lm_clear(&mut self);
// Provided method
fn lm_retain<F>(&mut self, predicate: F)
where F: FnMut(&K, &V) -> bool { ... }
}
Required Methods§
sourcefn lm_with_capacity(capacity: usize) -> Self
fn lm_with_capacity(capacity: usize) -> Self
Creates a new store with the specified capacity hint.
Implementations may ignore the argument if they do not support pre-allocating capacity.
sourcefn lm_reserve(&mut self, additional: usize)
fn lm_reserve(&mut self, additional: usize)
Reserves additional capacity in the store.
Implementations may ignore the argument if they do not support pre-allocating capacity.
sourcefn lm_get_mut(&mut self, index: usize) -> Option<(&K, &mut V)>
fn lm_get_mut(&mut self, index: usize) -> Option<(&K, &mut V)>
Gets a key/value pair at the specified index, with a mutable value.
sourcefn lm_insert(&mut self, index: usize, key: K, value: V)
fn lm_insert(&mut self, index: usize, key: K, value: V)
Inserts an item at a specific index in the store.
§Panics
Panics if index
is greater than the length.
Provided Methods§
Object Safety§
This trait is not object safe.