Skip to main content

Validator

Trait Validator 

Source
pub trait Validator: Send + Sync {
    // Required methods
    fn schema_version(&self) -> GenomeSchemaVersion;
    fn validate(&self, genome: &Value) -> ValidationReport;
}
Expand description

Validates a genome at a specific schema version.

Validators are stateless; the trait is Send + Sync so registries can be shared across threads. Implementations must not mutate the input or perform I/O.

Required Methods§

Source

fn schema_version(&self) -> GenomeSchemaVersion

The schema version this validator targets.

Source

fn validate(&self, genome: &Value) -> ValidationReport

Inspect a genome and return findings. Never mutates.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§