Get neighbors of a node (nodes connected by outgoing edges)
(&self, node_id: &str)
| 250 | |
| 251 | /// Get neighbors of a node (nodes connected by outgoing edges) |
| 252 | pub fn get_neighbors(&self, node_id: &str) -> Vec<&Node> { |
| 253 | self.get_outgoing_edges(node_id) |
| 254 | .into_iter() |
| 255 | .filter_map(|edge| self.nodes.get(&edge.to_node)) |
| 256 | .collect() |
| 257 | } |
| 258 | |
| 259 | /// Get all neighbors (both incoming and outgoing connections) |
| 260 | pub fn get_all_neighbors(&self, node_id: &str) -> Vec<&Node> { |
nothing calls this directly
no test coverage detected