Iterate over all live (handle, &T) pairs.
(&self)
| 62 | |
| 63 | /// Iterate over all live (handle, &T) pairs. |
| 64 | pub fn iter(&self) -> impl Iterator<Item = (f64, &T)> { |
| 65 | self.items.iter().enumerate().filter_map(|(idx, slot)| { |
| 66 | slot.as_ref().map(|item| ((idx + 1) as f64, item)) |
| 67 | }) |
| 68 | } |
| 69 | |
| 70 | /// Iterate over all live (handle, &mut T) pairs. |
| 71 | pub fn iter_mut(&mut self) -> impl Iterator<Item = (f64, &mut T)> { |
no outgoing calls