Trait Validator

Source
pub trait Validator {
    // Required methods
    fn validate(&self, context: &ValidationContext<'_>) -> ValidationResult;
    fn get_validation_rules(&self) -> Vec<ValidationRule>;
    fn get_severity(&self) -> ValidationSeverity;

    // Provided method
    fn supports_incremental(&self) -> bool { ... }
}
Expand description

Core trait for validators

Required Methods§

Source

fn validate(&self, context: &ValidationContext<'_>) -> ValidationResult

Validate content against rules

Source

fn get_validation_rules(&self) -> Vec<ValidationRule>

Get validation rules supported by this validator

Source

fn get_severity(&self) -> ValidationSeverity

Get the severity level for this validator

Provided Methods§

Source

fn supports_incremental(&self) -> bool

Whether this validator supports incremental validation

Implementors§