pub fn packages_with_features<'a>(
        &'a self,
        direction: DependencyDirection,
    ) -> impl Iterator<Item = FeatureList<'g>> + 'a {
        let package_graph = self.graph.package_graph;

        // Use the package graph's SCCs for the topo order guarantee.
        package_graph
            .sccs()
            .node_iter(direction.into())
            .filter_map(move |package_ix| {
                let package_id = &package_graph.dep_graph()[package_ix];
                let package = package_graph
                    .metadata(package_id)
                    .expect("valid package ID");
                self.features_for_package_impl(package)
            })
    }
Iterates over package metadatas and their corresponding features, 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/feature/resolve.rs