[−][src]Trait fixed_map::storage::Storage
The trait defining how storage works.
Type Arguments
K
is the key being stored.V
is 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]
impl<K, V> Storage<Option<K>, V> for OptionStorage<K, V> where
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]
impl<K, V> Storage<K, V> for MapStorage<K, V> where
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]
impl<K, V> Storage<K, V> for SingletonStorage<K, V> where
K: Copy + Default,
type Iter = Iter<K, V>
type IterMut = IterMut<K, V>
fn insert(&mut self, _: K, value: V) -> Option<V> | [src] |
fn get(&self, _: K) -> Option<&V> | [src] |
fn get_mut(&mut self, _: K) -> Option<&mut V> | [src] |
fn remove(&mut self, _: K) -> Option<V> | [src] |
fn clear(&mut self) | [src] |
fn iter(&self) -> Self::Iter | [src] |
fn iter_mut(&mut self) -> Self::IterMut | [src] |
impl<V> Storage<bool, V> for BooleanStorage<V>
[src]
impl<V> Storage<bool, V> for BooleanStorage<V>
type Iter = Iter<V>
type IterMut = IterMut<V>
fn insert(&mut self, key: bool, value: V) -> Option<V> | [src] |
fn get(&self, key: bool) -> Option<&V> | [src] |
fn get_mut(&mut self, key: bool) -> Option<&mut V> | [src] |
fn remove(&mut self, key: bool) -> Option<V> | [src] |
fn clear(&mut self) | [src] |
fn iter(&self) -> Self::Iter | [src] |
fn iter_mut(&mut self) -> Self::IterMut | [src] |