pub trait MapCollection {
type Key;
type Value;
// Required methods
fn iter<'a>(
&'a self,
) -> Box<dyn Iterator<Item = (&'a Self::Key, &'a Self::Value)> + 'a>;
fn len(&self) -> usize;
// Provided method
fn is_empty(&self) -> bool { ... }
}Expand description
Explicit iteration contract for map wrapper types. Avoids implicit deref-based access to inner collections.