Skip to main content

Module deps

Module deps 

Source
Expand description

ct-deps’s crate-graph queries.

The resolved dependency graph comes from cargo metadata --format-version 1 --locked --offline (hermetic by construction); this module parses that JSON into a Graph and answers the crate-level invariant questions: is crate X anywhere in the tree (deny_paths), does workspace member A reach crate B (forbid_path), and do any crates resolve at more than one version ([duplicates]). Every violation carries its evidence — a dependency path or the duplicated version list — so a red answer is never just a name.

Structs§

Graph
The resolved crate graph.
Package
One resolved package.
Violation
Evidence for one violated assertion.

Enums§

EdgeKind
A dependency edge kind, as cargo models it.

Functions§

deny_paths
Evaluate --deny NAME: a violation when name resolves anywhere reachable from the workspace members over allowed edges.
forbid_path
Evaluate --forbid 'A=>B': a violation when any package named from reaches a package named to over allowed edges. Err when from is not in the graph at all (a defective assertion, not a clean pass).
parse_metadata
Parse cargo metadata --format-version 1 JSON into a Graph.