dependency-graph
Dependency-graph is a minimal library, exposing DependencyGraph structure and a single Node trait.
To use the library, simply implement the Node trait's two functions for the object you wish to.
Example
In this example, we'll be using dependency-graph to resolve dependencies between our Package structs. We'll be using a custom Dependency type, because we want to include Semantic Versioning constraints in our dependencies. That way we'll be able to say that our package mypackage depends on version 2.0 of some package some-library for instance.
Our Package and Dependency structs use the semver::Version and semver::VersionReq types to define the versions of the Packages (such as 1.2.3-beta.4) and the dependency requirements such as >=2.0. See the semver crate for more information.
First we define the Package struct:
Where Dependency is:
Implementing the Node trait for our Package is pretty simple: