Skip to main content

Crate archaven

Crate archaven 

Source
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.
DependencyGraph
Dependency graph discovered from Rust source files.
Location
Source location for a discovered dependency.
ModulePath
Rust module path split into ::-separated segments.
PathPattern
Segment-based pattern for matching Rust module paths.
PrefixMatch
Result of matching a pattern against the prefix of a module path.
Rule
Neutral dependency rule.
SourceDirectory
A Rust source directory discovered while scanning.
Violation
One dependency rule violation.
Violations
Collection of dependency rule violations.

Enums§

ArchavenError
Error returned when Archaven cannot complete analysis.

Traits§

RuleSet
A custom dependency rule set.