Returns an iterator over all the keys in the map.
(&self)
| 150 | |
| 151 | /// Returns an iterator over all the keys in the map. |
| 152 | pub fn keys(&self) -> impl ExactSizeIterator<Item = &K> { |
| 153 | match self { |
| 154 | Self::Small(list) => Either::Left(list.iter().map(|(k, _)| k)), |
| 155 | Self::Large(map) => Either::Right(map.keys()), |
| 156 | } |
| 157 | } |
| 158 | |
| 159 | /// Returns an iterator over all the values in the map. |
| 160 | pub fn values(&self) -> impl ExactSizeIterator<Item = &V> { |