Skip to main content

Validator

Trait Validator 

Source
pub trait Validator: Send + Sync {
    // Required method
    fn validate_value(
        &self,
        value: &str,
        property_path: &str,
        constraints: &[&dyn Constraint],
    ) -> ConstraintViolationList;
}
Expand description

Runs constraints and returns a violation list.

Required Methods§

Source

fn validate_value( &self, value: &str, property_path: &str, constraints: &[&dyn Constraint], ) -> ConstraintViolationList

Validates value at property_path against constraints.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§