Trait fixed_map::Storage

source ·
pub trait Storage<K: 'static, V: 'static>: Default {
    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<'a, F>(&'a self, f: F)
    where
        F: FnMut((&'a K, &'a V))
; fn iter_mut<'a, F>(&'a mut self, f: F)
    where
        F: FnMut((&'a K, &'a mut V))
; }
Expand description

The trait defining how storage works.

Type Arguments

  • K is the key being stored.
  • V is the value being stored.

Required Methods

This is the storage abstraction for Map::insert.

This is the storage abstraction for Map::get.

This is the storage abstraction for Map::get_mut.

This is the storage abstraction for Map::remove.

This is the storage abstraction for Map::clear.

This is the storage abstraction for Map::iter.

This is the storage abstraction for Map::iter_mut.

Implementors