pub trait IterableMap<K, V>: BackingMap<K, V> {
type Iter<'a>: Iterator<Item = (&'a K, &'a V)>
where Self: 'a,
K: 'a,
V: 'a;
type IterMut<'a>: Iterator<Item = (&'a K, &'a mut V)>
where Self: 'a,
K: 'a,
V: 'a;
// Required methods
fn iter(&self) -> Self::Iter<'_>;
fn iter_mut(&mut self) -> Self::IterMut<'_>;
}Expand description
Extension trait for backing maps that support iteration.
This trait is required when using unknown/extension fields with
#[structible(key = ...)]. It provides iter() and iter_mut() methods
for iterating over entries in the map.
It is automatically implemented for HashMap and BTreeMap.
Required Associated Types§
Required 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.