Skip to main content

Validator

Trait Validator 

Source
pub trait Validator: Clone {
    type Error;

    // Required method
    fn validate(s: impl AsRef<str>) -> Result<(), Self::Error>;
}
Expand description

Validation trait

Usually it’s implemented by marker type.

Required Associated Types§

Required Methods§

Source

fn validate(s: impl AsRef<str>) -> Result<(), Self::Error>

Validate the string.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl Validator for ()

Implementors§