Get all outgoing edges from a node
(&self, node_id: &str)
| 217 | |
| 218 | /// Get all outgoing edges from a node |
| 219 | pub fn get_outgoing_edges(&self, node_id: &str) -> Vec<&Edge> { |
| 220 | self.adjacency_out |
| 221 | .get(node_id) |
| 222 | .map(|edge_ids| { |
| 223 | edge_ids |
| 224 | .iter() |
| 225 | .filter_map(|id| self.edges.get(id)) |
| 226 | .collect() |
| 227 | }) |
| 228 | .unwrap_or_default() |
| 229 | } |
| 230 | |
| 231 | /// Get all incoming edges to a node |
| 232 | pub fn get_incoming_edges(&self, node_id: &str) -> Vec<&Edge> { |
no test coverage detected