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§
Sourcefn schema_version(&self) -> GenomeSchemaVersion
fn schema_version(&self) -> GenomeSchemaVersion
The schema version this validator targets.
Sourcefn validate(&self, genome: &Value) -> ValidationReport
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".