[−][src]Trait fixed_map::storage::Storage
The trait defining how storage works.
Type Arguments
Kis the key being stored.Vis the value being stored.
Associated Types
type Iter: Clone + Iterator<Item = (K, *const V)>
Immutable iterator over storage. Uses raw pointers (unsafe) since we don't have GATs.
type IterMut: Iterator<Item = (K, *mut V)>
Mutable iterator over storage. Uses raw pointers (unsafe) since we don't have GATs.
Required methods
fn insert(&mut self, key: K, value: V) -> Option<V>
This is the storage abstraction for Map::insert.
fn get(&self, key: K) -> Option<&V>
This is the storage abstraction for Map::get.
fn get_mut(&mut self, key: K) -> Option<&mut V>
This is the storage abstraction for Map::get_mut.
fn remove(&mut self, key: K) -> Option<V>
This is the storage abstraction for Map::remove.
fn clear(&mut self)
This is the storage abstraction for Map::clear.
fn iter(&self) -> Self::Iter
This is the storage abstraction for Map::iter.
fn iter_mut(&mut self) -> Self::IterMut
This is the storage abstraction for Map::iter_mut.
Implementors
impl<K, V> Storage<Option<K>, V> for OptionStorage<K, V> where
K: Key<K, V>, [src]
K: Key<K, V>,
type Iter = Iter<K, V>
type IterMut = IterMut<K, V>
fn insert(&mut self, key: Option<K>, value: V) -> Option<V>[src]
fn get(&self, key: Option<K>) -> Option<&V>[src]
fn get_mut(&mut self, key: Option<K>) -> Option<&mut V>[src]
fn remove(&mut self, key: Option<K>) -> Option<V>[src]
fn clear(&mut self)[src]
fn iter(&self) -> Self::Iter[src]
fn iter_mut(&mut self) -> Self::IterMut[src]
impl<K, V> Storage<K, V> for MapStorage<K, V> where
K: Copy + Eq + Hash, [src]
K: Copy + Eq + Hash,
type Iter = Iter<K, V>
type IterMut = IterMut<K, V>
fn insert(&mut self, key: K, value: V) -> Option<V>[src]
fn get(&self, key: K) -> Option<&V>[src]
fn get_mut(&mut self, key: K) -> Option<&mut V>[src]
fn remove(&mut self, key: K) -> Option<V>[src]
fn clear(&mut self)[src]
fn iter(&self) -> Self::Iter[src]
fn iter_mut(&mut self) -> Self::IterMut[src]
impl<K, V> Storage<K, V> for SingletonStorage<K, V> where
K: Copy + Default, [src]
K: Copy + Default,