pub trait Validator {
// Required method
fn validate(&self, input: &str) -> Validation;
}Expand description
Inspects a candidate answer, accepting it or explaining why it is rejected.
Required Methods§
Sourcefn validate(&self, input: &str) -> Validation
fn validate(&self, input: &str) -> Validation
Validate input, returning Ok(()) to accept or Err(reason) to reject.
§Errors
Returns the human-readable rejection reason to surface to the user.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".