fn next(&mut self) -> Option<Vec<Step<'a>>> {
        if let Some(id) = self.front.pop_front() {
            // Look over this node's outgoing edges, and see if they reach any
            // new nodes. If so, record how we reached them, and queue them to
            // be produced later.
            let node = self.dump.get_node(id).unwrap();
            for edge in &node.edges {
                if let Some(referent) = edge.referent {
                    // Have we reached this edge's referent before?
                    match self.visited.entry(referent) {
                        // We have! Ignore this edge and its referent.
                        Entry::Occupied(_) => (),

                        // No, this is the first time we've reached the
                        // referent! Record the edge by which we reached it, and
                        // queue the referent to be produced later.
                        Entry::Vacant(entry) => {
                            entry.insert(Some(Step { origin: id, edge }));
                            self.front.push_back(referent);
                        }
                    }
                }
            }

            Some(self.path_from_start(id).unwrap())
        } else {
            None
        }
    }
/// Return a shortest path by which one can reach the next node visited in
/// breadth-first order, or `None` if there are no more nodes reachable from
/// the start node(s).
///
/// By 'breadth-first' order, we mean:
///
/// - We produce each node at most once.
///
/// - The lengths of the paths only increase (or stay the same) as we
///   produce them; we never produce a shorter path after a longer path.
///
/// - The path from any produced node back to the (or a) start node is among
///   the shortest such paths in the entire `CoreDump`.
Return a shortest path by which one can reach the next node visited in
breadth-first order, or `None` if there are no more nodes reachable from
the start node(s).

By 'breadth-first' order, we mean.

We produce each node at most once.

The lengths of the paths only increase (or stay the same) as we
produce them; we never produce a shorter path after a longer path.

The path from any produced node back to the (or a) start node is among
the shortest such paths in the entire `CoreDump`.
Return a shortest path by which one can reach the next node visited in breadth - first order or ` None ` if there are no more nodes reachable from the start node ( s ) . By ' breadth - first ' order we mean . We produce each node at most once . The lengths of the paths only increase ( or stay the same ) as we produce them ; we never produce a shorter path after a longer path . The path from any produced node back to the ( or a ) start node is among the shortest such paths in the entire ` CoreDump ` .
fn next(&mut self) -> Option<Vec<Step<'a>>> {
        if let Some(id) = self.front.pop_front() {
            // Look over this node's outgoing edges, and see if they reach any
            // new nodes. If so, record how we reached them, and queue them to
            // be produced later.
            let node = self.dump.get_node(id).unwrap();
            for edge in &node.edges {
                if let Some(referent) = edge.referent {
                    // Have we reached this edge's referent before?
                    match self.visited.entry(referent) {
                        // We have! Ignore this edge and its referent.
                        Entry::Occupied(_) => (),
                        // No, this is the first time we've reached the
                        // referent! Record the edge by which we reached it, and
                        // queue the referent to be produced later.
                        Entry::Vacant(entry) => {
                            entry.insert(Some(Step { origin: id, edge }));
                            self.front.push_back(referent);
                        }
                    }
                }
            }
            Some(self.path_from_start(id).unwrap())
        } else {
            None
        }
    }
fn next ( & mut self ) -> Option < Vec < Step < ' a > > > { if let Some ( id ) = self . front . pop_front ( ) { // Look over this node's outgoing edges, and see if they reach any // new nodes. If so, record how we reached them, and queue them to // be produced later. let node = self . dump . get_node ( id ) . unwrap ( ) ; for edge in & node . edges { if let Some ( referent ) = edge . referent { // Have we reached this edge's referent before? match self . visited . entry ( referent ) { // We have! Ignore this edge and its referent. Entry :: Occupied ( _ ) => ( ) , // No, this is the first time we've reached the // referent! Record the edge by which we reached it, and // queue the referent to be produced later. Entry :: Vacant ( entry ) => { entry . insert ( Some ( Step { origin : id , edge } ) ) ; self . front . push_back ( referent ) ; } } } } Some ( self . path_from_start ( id ) . unwrap ( ) ) } else { None } }
Return a shortest path by which one can reach the next node visited in
breadth-first order, or `None` if there are no more nodes reachable from
the start node(s).
Return a shortest path by which one can reach the next node visited in breadth - first order or ` None ` if there are no more nodes reachable from the start node ( s ) .
&mut self
&mut self