Expand description
Archaven checks dependency rules over Rust module paths.
The crate exposes a small policy language:
use archaven::{Access, Archaven, Rule};
let violations = Archaven::new()
.rule(
Rule::between("app::*")
.named("bounded contexts")
.deny_all()
.allow(
Access::from("*::infrastructure::adapter::**")
.to("*::application::command::**"),
),
)
.check("./src")?;
assert!(violations.is_empty(), "{violations}");Structs§
- Access
- Describes dependency access from one path pattern to one or more target patterns.
- Archaven
- Entry point for scanning Rust source files and checking dependency rules.
- Dependency
- A dependency from one Rust module path to another.
- Dependency
Graph - Dependency graph discovered from Rust source files.
- Location
- Source location for a discovered dependency.
- Module
Path - Rust module path split into
::-separated segments. - Path
Pattern - Segment-based pattern for matching Rust module paths.
- Prefix
Match - Result of matching a pattern against the prefix of a module path.
- Rule
- Neutral dependency rule.
- Source
Directory - A Rust source directory discovered while scanning.
- Violation
- One dependency rule violation.
- Violations
- Collection of dependency rule violations.
Enums§
- Archaven
Error - Error returned when Archaven cannot complete analysis.
Traits§
- RuleSet
- A custom dependency rule set.