Crate arcella_inspect

Crate arcella_inspect 

Source
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 with external: true.

Structs§

AnalysisResult
The top-level result of a project analysis.
FunctionDecl
Represents a function or method found in the source code.
StructDecl
Represents a struct definition found in the source code.
YamlCall
YAML representation of a function call.
YamlFunction
YAML representation of a function or method.
YamlOutput
Top-level YAML output document.
YamlStruct
YAML representation of a struct.
YamlSubproject
YAML representation of a crate (subproject).

Functions§

analysis_to_yaml
Serializes an AnalysisResult to a YAML 1.2 string.
analyze_project
Analyzes a Rust project directory and returns structured metadata about its code.