Trait aliri_braid::Validator
source · pub trait Validator {
type Error;
// Required method
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§
sourcetype Error
type Error
The error produced when the string is invalid
TryFrom<String>::Error
for the wrapped type must be convertable into this
error type. In most cases, this conversion is infallible, and so the error
type needs to implement From<Infallible>
. See the from_infallible!()
helper macro to quickly implement this for your error type.