Trait fixed_map::map::MapStorage

source ·
pub trait MapStorage<K, V>: Sized {
    type Iter<'this>: Iterator<Item = (K, &'this V)>
    where
        Self: 'this,
        V: 'this
; type Keys<'this>: Iterator<Item = K>
    where
        Self: 'this
; type Values<'this>: Iterator<Item = &'this V>
    where
        Self: 'this,
        V: 'this
; type IterMut<'this>: Iterator<Item = (K, &'this mut V)>
    where
        Self: 'this,
        V: 'this
; type ValuesMut<'this>: Iterator<Item = &'this mut V>
    where
        Self: 'this,
        V: 'this
; type IntoIter: Iterator<Item = (K, V)>; type Occupied<'this>: OccupiedEntry<'this, K, V>
    where
        Self: 'this
; type Vacant<'this>: VacantEntry<'this, K, V>
    where
        Self: 'this
;
Show 17 methods fn empty() -> Self; fn len(&self) -> usize; fn is_empty(&self) -> bool; fn insert(&mut self, key: K, value: V) -> Option<V>; fn contains_key(&self, key: K) -> bool; 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 retain<F>(&mut self, f: F)
    where
        F: FnMut(K, &mut V) -> bool
; fn clear(&mut self); fn iter(&self) -> Self::Iter<'_>; fn keys(&self) -> Self::Keys<'_>; fn values(&self) -> Self::Values<'_>; fn iter_mut(&mut self) -> Self::IterMut<'_>; fn values_mut(&mut self) -> Self::ValuesMut<'_>; fn into_iter(self) -> Self::IntoIter; fn entry(&mut self, key: K) -> Entry<'_, Self, K, V>;
}
Expand description

The trait defining how storage works.

Type Arguments

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

Required Associated Types

Immutable iterator over storage.

Immutable iterator over keys in storage.

Immutable iterator over values in storage.

Mutable iterator over storage.

Mutable iterator over values in storage.

Consuming iterator.

An occupied entry.

A vacant entry.

Required Methods

Construct empty storage.

Get the length of storage.

Check if storage is empty.

This is the storage abstraction for Map::insert.

This is the storage abstraction for Map::contains_key.

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::retain.

This is the storage abstraction for Map::clear.

This is the storage abstraction for Map::iter.

This is the storage abstraction for Map::keys.

This is the storage abstraction for Map::values.

This is the storage abstraction for Map::iter_mut.

This is the storage abstraction for Map::values_mut.

This is the storage abstraction for Map::into_iter.

This is the storage abstraction for Map::entry.

Implementors