Iterate over all vertices.
(&self)
| 361 | |
| 362 | /// Iterate over all vertices. |
| 363 | pub fn iter_vertices(&self) -> impl Iterator<Item = (VertexId, &AliveVertex)> { |
| 364 | self.vertices |
| 365 | .iter() |
| 366 | .enumerate() |
| 367 | .map(|(i, v)| (VertexId::new(i), v)) |
| 368 | } |
| 369 | |
| 370 | /// Iterate over all vertices mutably. |
| 371 | pub fn iter_vertices_mut(&mut self) -> impl Iterator<Item = (VertexId, &mut AliveVertex)> { |