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§
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.