pub trait Validate {
// Provided methods
fn validate_basic(&self) -> Result<(), ValidationError> { ... }
fn validate(&self, level: ValidationLevel) -> Result<(), ValidationError> { ... }
}Expand description
Trait for types that can be validated
Provided Methods§
Sourcefn validate_basic(&self) -> Result<(), ValidationError>
fn validate_basic(&self) -> Result<(), ValidationError>
Perform basic validation
This should include type checks and range validation to fail fast on obviously invalid input.
Sourcefn validate(&self, level: ValidationLevel) -> Result<(), ValidationError>
fn validate(&self, level: ValidationLevel) -> Result<(), ValidationError>
Validate with the specified level