(&self)
| 453 | /// Iteration order is undefined. |
| 454 | #[inline] |
| 455 | pub fn iter(&self) -> impl Iterator<Item = (Id, &T)> + '_ { |
| 456 | assert!(self.entries.len() <= Self::MAX_CAPACITY); |
| 457 | self.entries |
| 458 | .iter() |
| 459 | .enumerate() |
| 460 | .filter_map(|(i, e)| match e { |
| 461 | Entry::Occupied(x) => Some((Id(EntryIndex::new(i)), x)), |
| 462 | Entry::Free { .. } => None, |
| 463 | }) |
| 464 | } |
| 465 | |
| 466 | /// Mutably iterate over all values currently allocated within this `Slab`. |
| 467 | /// |