Adds a starting node to the traversal. If the node has already been visited, this has no effect. This allows traversing disconnected components by adding multiple starting nodes. # Examples ```rust # use hashql_core::graph::{LinkedGraph, algorithms::DepthFirstTraversal}; # let mut graph = LinkedGraph::new(); let n1 = graph.add_node("A"); let n2 = graph.add_node("B"); let n3 = graph.add_node("C"
(&mut self, start_node: N)
| 152 | /// # assert_eq!(visited, [n3, n1, n2]); |
| 153 | /// ``` |
| 154 | pub fn push_start_node(&mut self, start_node: N) |
| 155 | where |
| 156 | G: DirectedGraph<NodeId = N>, |
| 157 | { |
| 158 | if self.visited.insert(start_node) { |
| 159 | self.stack.push(start_node); |
| 160 | } |
| 161 | } |
| 162 | |
| 163 | /// Returns whether the given node has been visited. |
| 164 | /// |
no test coverage detected