source-mesh-core
Analyze Rust file and folder dependencies, export DOT, Mermaid, or GraphML diagrams,
and produce file and folder cycle reports. The source-mesh package provides the CLI;
this package exposes the same pipeline without command-line parsing.
use PathBuf;
use Input;
use Request;
use Format;
#
To analyze project sources, use Input::Project(Project::new(project_path, configuration)).
This runs rust-analyzer and requires the Rust toolchain, rust-analyzer, and rust-src;
replaying a saved index does not. configuration is an optional path to rust-analyzer JSON configuration.
All boolean options default to false. Configure reports and cycle gating through
CycleOptions::builder() and pass the result to the request's .cycles(...)
setter. Reports default to at most DEFAULT_CYCLE_LIMIT simple cycles each.
Pass analyzer_options::Options::new(true) to .analyzer(...) for verbose diagnostics.
Validation and analysis errors preserve existing outputs. Cycle gating with
CycleOptions::builder().fail_on_cycles(true).build() reports failure after writing requested outputs. Output I/O
errors can leave earlier files written; output writes are not a transaction.
The low-level analyzer, graph, cycle, and exporter APIs remain available.
Development
The package includes the saved SCIP fixture for offline tests and the API example. Cargo excludes nested fixture packages from published archives, so the ignored tests that run rust-analyzer and the index regeneration tool require a repository checkout. Fixture projects retain standalone workspaces. Run the regeneration tool from the checkout: