Skip to main content

Validator

Trait Validator 

Source
pub trait Validator: Send + Sync {
    // Required method
    fn validate(&self, value: &str, field: &str) -> ValidationResult;

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

Validator trait

Required Methods§

Source

fn validate(&self, value: &str, field: &str) -> ValidationResult

Provided Methods§

Source

fn is_required(&self) -> bool

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§