Skip to main content

PasswordValidator

Trait PasswordValidator 

Source
pub trait PasswordValidator {
    type Err;

    // Required method
    fn validate(&self, input: &String) -> Result<(), Self::Err>;
}
Expand description

Trait for password validators.

Required Associated Types§

Required Methods§

Source

fn validate(&self, input: &String) -> Result<(), Self::Err>

Invoked with the value to validate.

If this produces Ok(()) then the value is used and parsed, if an error is returned validation fails with that error.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<F, E> PasswordValidator for F
where F: Fn(&String) -> Result<(), E>,

Source§

type Err = E