Skip to main content

StoreMut

Trait StoreMut 

Source
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);
}

Required Methods§

Source

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.

Source

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.

Source

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.

Source

fn lm_push(&mut self, key: K, value: V)

Pushes one additional item onto the store.

Source

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.

Source

fn lm_remove(&mut self, index: usize) -> (K, V)

Removes an item at a specific index in the store.

§Panics

Panics if index is greater than the length.

Source

fn lm_clear(&mut self)

Removes all items from the store.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§