Returns an iterator over all the key-value pairs in the map.
(&self)
| 142 | |
| 143 | /// Returns an iterator over all the key-value pairs in the map. |
| 144 | pub fn iter(&self) -> impl ExactSizeIterator<Item = (&K, &V)> { |
| 145 | match self { |
| 146 | Self::Small(list) => Either::Left(list.iter().map(|(k, v)| (k, v))), |
| 147 | Self::Large(map) => Either::Right(map.iter()), |
| 148 | } |
| 149 | } |
| 150 | |
| 151 | /// Returns an iterator over all the keys in the map. |
| 152 | pub fn keys(&self) -> impl ExactSizeIterator<Item = &K> { |