pub fn package_ids<'a>(
        &'a self,
        direction: DependencyDirection,
    ) -> impl Iterator<Item = &'g PackageId> + ExactSizeIterator + 'a {
        let graph = self.graph;
        self.core
            .topo(self.graph.sccs(), direction)
            .map(move |package_ix| &graph.dep_graph[package_ix])
    }
Iterates over package IDs, in topological order in the direction specified.

## Cycles

The packages within a dependency cycle will be returned in non-dev order. When the direction
is forward, if package Foo has a dependency on Bar, and Bar has a cyclic dev-dependency on
Foo, then Foo is returned before Bar.
guppy/src/graph/resolve.rs