Skip to main content

ValidationRule

Trait ValidationRule 

Source
pub trait ValidationRule: Send + Sync {
    // Required methods
    fn id(&self) -> &str;
    fn severity(&self) -> Severity;
    fn check(&self, model: &Model, ctx: &ValidationContext) -> Vec<Violation>;
}
Expand description

A rule that checks one aspect of a model (ONNX_RS §8.1).

Required Methods§

Source

fn id(&self) -> &str

Unique identifier for enable/disable (e.g. "ir.opset_import_present").

Source

fn severity(&self) -> Severity

Severity of the violations this rule produces.

Source

fn check(&self, model: &Model, ctx: &ValidationContext) -> Vec<Violation>

Run the check and return any violations found.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§