Skip to main content

Module graph

Module graph 

Source
Expand description

The project graph engine.

killer graph builds a structural map of a project: which source files import which external modules, and which dependencies the project declares in its manifests. From those two views it derives a supply-chain signal — declared dependencies that no source file appears to import (“possibly unused”).

This is deliberately a structural graph, not a semantic/data-flow one. Import extraction is line-level and per-language; dependency-usage matching is a best-effort name normalization (so pretty-env-logger in Cargo.toml matches use pretty_env_logger). A true multi-language IR and data-flow graph remain on the roadmap.

Structs§

DependencyNode
A declared dependency (from a manifest) plus whether the project uses it.
Edge
A file → module import edge.
FileNode
A source file node.
ProjectGraph
The complete project graph.

Functions§

extract_imports
Extract the external modules a file imports (deduped, sorted).
parse_manifest
Parse a manifest file into (dependency_name, is_dev) pairs. Non-manifest files yield nothing.
rust_crate_referenced
Whether any Rust file references a crate via a fully-qualified path (crate_ident::…) — the idiomatic way to use a crate without a use. Cargo crate names use hyphens; the Rust identifier uses underscores.