pub trait Validator<T> {
// Required methods
fn instructions(&self) -> String;
fn validate(&self, value: &T) -> Result<(), String>;
}
Expand description
A Validator
is a type that can validate a value of type T
.
Required Methods§
Sourcefn instructions(&self) -> String
fn instructions(&self) -> String
A human-readable string that describes the validation to be performed.
Example: “Value must be a positive integer”