Skip to main content

GraphValidator

Trait GraphValidator 

Source
pub trait GraphValidator {
    // Required methods
    fn name(&self) -> &'static str;
    fn check(&self, graph: &PackGraph) -> Vec<PackValidationError>;
}
Expand description

Plan-phase validator that operates on an assembled PackGraph.

Separate trait from Validator on purpose: graph-level checks need the full graph, not a single manifest, and mixing the two into one trait would force every per-manifest validator to accept a graph it doesn’t need. Two traits keep each call site’s surface minimal and type-safe.

Required Methods§

Source

fn name(&self) -> &'static str

Stable human-readable identifier.

Source

fn check(&self, graph: &PackGraph) -> Vec<PackValidationError>

Inspect graph and emit zero or more errors.

Implementors§