Expand description
arcella-inspect: Structured static analysis of Rust source code.
This crate provides tools to extract rich metadata from Rust projects:
- Functions and methods (with full paths, e.g.
my_mod::MyStruct::method) - Structs
- Call graphs (internal vs external calls)
- Function signatures (parameters, return types)
- Documentation comments (
///) - Attributes (
pub,async,#[cfg(...)], etc.)
The primary output format is YAML 1.2, designed for consumption by:
- AI code reasoning agents
- Architecture visualization tools
- Documentation generators
- Dependency and compliance auditors
§Usage
§As a library
use arcella_inspect::{analyze_project, analysis_to_yaml};
use std::path::Path;
let root = Path::new("./my-rust-project");
let analysis = analyze_project(root).unwrap();
let yaml = analysis_to_yaml(&analysis, root).unwrap();
println!("{}", yaml);§As a CLI
Install via cargo install arcella-inspect and run:
arc-inspect ./my-project > metadata.yaml§Output Format
See the full specification in FORMAT.md.
§Design Notes
- Analysis is based on the AST (via
syn), not MIR/HIRpreserving source-level fidelity. - Only meaningful function calls are recorded (noise like
.clone(),.unwrap()is filtered). - Supports Cargo workspaces (each crate = subproject).
- External calls (e.g. from
std,tokio) are marked withexternal: true.
Structs§
- Analysis
Result - The top-level result of a project analysis.
- Function
Decl - Represents a function or method found in the source code.
- Struct
Decl - Represents a struct definition found in the source code.
- Yaml
Call - YAML representation of a function call.
- Yaml
Function - YAML representation of a function or method.
- Yaml
Output - Top-level YAML output document.
- Yaml
Struct - YAML representation of a struct.
- Yaml
Subproject - YAML representation of a crate (subproject).
Functions§
- analysis_
to_ yaml - Serializes an
AnalysisResultto a YAML 1.2 string. - analyze_
project - Analyzes a Rust project directory and returns structured metadata about its code.