Skip to main content

ValidationCode

Trait ValidationCode 

Source
pub trait ValidationCode {
    // Required methods
    fn code(&self) -> &'static str;
    fn description(&self) -> &'static str;
    fn default_severity(&self) -> Severity;
    fn category(&self) -> Category;
}
Expand description

Metadata for a typed validation code.

Implement this trait on a per-spec enum to get a typed, iterable catalogue of all codes a spec emits, each with a canonical code string, description, default severity, and category.

Required Methods§

Source

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

The canonical string written into crate::ValidationIssue::code.

Source

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

A concise English description of what the constraint checks.

Source

fn default_severity(&self) -> Severity

The severity level assigned by the validator by default.

Source

fn category(&self) -> Category

The category bucket this code belongs to.

Implementors§