Trait Validator

Source
pub trait Validator<T: ?Sized> {
    // Required methods
    fn validate(&self, input: &T) -> Result<()>;
    fn validation_rules(&self) -> Vec<&'static str>;
}
Expand description

Trait for validating inputs

Required Methods§

Source

fn validate(&self, input: &T) -> Result<()>

Validate the input

Source

fn validation_rules(&self) -> Vec<&'static str>

Get validation rules for display to users

Implementors§