pub fn packages<'a>(
        &'a self,
        direction: DependencyDirection,
    ) -> impl Iterator<Item = PackageMetadata<'g>> + ExactSizeIterator + 'a {
        let graph = self.graph;
        self.package_ids(direction)
            .map(move |package_id| graph.metadata(package_id).expect("known package IDs"))
    }
Iterates over package metadatas, 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