Trait fixed_map::storage::Storage [−][src]
pub trait Storage<K, V>: Default { type Iter: Clone + Iterator<Item = (K, *const V)>; type IterMut: Iterator<Item = (K, *mut V)>; fn insert(&mut self, key: K, value: V) -> Option<V>; fn get(&self, key: K) -> Option<&V>; fn get_mut(&mut self, key: K) -> Option<&mut V>; fn remove(&mut self, key: K) -> Option<V>; fn clear(&mut self); fn iter(&self) -> Self::Iter; fn iter_mut(&mut self) -> Self::IterMut; }
Expand description
The trait defining how storage works.
Type Arguments
Kis the key being stored.Vis the value being stored.
Associated Types
Required methods
fn insert(&mut self, key: K, value: V) -> Option<V>[src]
fn insert(&mut self, key: K, value: V) -> Option<V>[src]This is the storage abstraction for Map::insert.
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>, [src]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, [src]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, [src]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>[src]