pub fn next<G>(&mut self, graph: G) -> Option<(N, N, E)>
    where
        G: IntoEdges<NodeId = N, EdgeId = E>,
    {
        let (source, target, edge) = self.stack.pop()?;
        if self.discovered.visit(target) {
            self.stack.extend(graph.edges(target).map(edge_triple));
        }
        Some((source, target, edge))
    }
Returns the next edge in the dfs, or `None` if no more edges remain.
guppy/src/petgraph_support/walk.rs