pub trait BackingContainer<K, V>: Default {
type Iter<'a>: Iterator<Item = (K, &'a V)>
where V: 'a,
Self: 'a;
// Required methods
fn insert(&mut self, k: K, v: V);
fn get(&self, k: &K) -> Option<&V>;
fn get_mut(&mut self, k: &K) -> Option<&mut V>;
fn remove(&mut self, k: &K);
fn iter(&self) -> Self::Iter<'_>;
fn len(&self) -> usize;
// Provided method
fn is_empty(&self) -> bool { ... }
}
Expand description
Trait for containers that can be wrapped using GroupingContainer.
Required Associated Types§
sourcetype Iter<'a>: Iterator<Item = (K, &'a V)>
where
V: 'a,
Self: 'a
type Iter<'a>: Iterator<Item = (K, &'a V)> where V: 'a, Self: 'a
Type of iterator returned by the BackingContainer::iter method.
Required Methods§
sourcefn get(&self, k: &K) -> Option<&V>
fn get(&self, k: &K) -> Option<&V>
Get a reference to the value at the provided key, or None
if the value doesn’t exist.