guppy
Track and query Cargo dependency graphs.
guppy
provides a Rust interface to run queries over Cargo dependency graphs. guppy
parses
the output of cargo metadata
,
then presents a graph interface over it.
Optional features
proptest010
: Support for property-based testing using theproptest
framework.rayon1
: Support for parallel iterators through Rayon (preliminary work so far, more parallel iterators to be added in the future).summaries
: Support for writing out build summaries.
Examples
Print out all direct dependencies of a package:
use ;
// `guppy` accepts `cargo metadata` JSON output. Use a pre-existing fixture for these examples.
let metadata = parse_json.unwrap;
let package_graph = metadata.build_graph.unwrap;
// `guppy` provides several ways to get hold of package IDs. Use a pre-defined one for this
// example.
let package_id = new;
// The `metadata` method returns information about the package, or `None` if the package ID
// wasn't recognized.
let package = package_graph.metadata.unwrap;
// `direct_links` returns all direct dependencies of a package.
for link in package.direct_links
For more examples, see
the examples
directory.
Contributing
See the CONTRIBUTING file for how to help out.
License
This project is available under the terms of either the Apache 2.0 license or the MIT license.