pub trait MapCollection {
type Key;
type Value;
type Iter<'a>: Iterator<Item = (&'a Self::Key, &'a Self::Value)> + 'a
where Self: 'a;
// Required methods
fn iter(&self) -> Self::Iter<'_>;
fn len(&self) -> usize;
// Provided method
fn is_empty(&self) -> bool { ... }
}Expand description
MapCollection
Explicit iteration contract for map wrapper types. Keeps generic map code on one stable boundary even when concrete wrapper types opt into direct container ergonomics.
Required Associated Types§
Required Methods§
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.