Validator

Trait Validator 

Source
pub trait Validator: Send + Sync {
    // Required methods
    fn validate(&self, value: &str) -> ValidationResult;
    fn name(&self) -> &str;
}
Expand description

A validator that can validate a string value.

Required Methods§

Source

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

Validate the given value.

Source

fn name(&self) -> &str

Get the name of this validator.

Implementors§