pub trait Validator {
    type Error;

    fn validate(raw: &str) -> Result<(), Self::Error>;
}
Expand description

A validator that can verify a given input is valid given certain preconditions

If the type can be normalized, this implementation should also validate that the value is already in normalized form.

Required Associated Types

The error produced when the string is invalid

Required Methods

Validates a string according to a predetermined set of rules

Errors

Returns an error if the string is invalid or not in normalized form.

Implementors