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.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.