pub trait Validate {
type Context;
// Required method
fn validate_into(
&self,
ctx: &Self::Context,
parent: &mut dyn FnMut() -> Path,
report: &mut Report
);
// Provided method
fn validate(&self, ctx: &Self::Context) -> Result<(), Report> { ... }
}Expand description
The core trait of this crate.
Validation runs the fields through every validation rules,
and aggregates any errors into a Report.
Required Associated Types§
Required Methods§
Provided Methods§
sourcefn validate(&self, ctx: &Self::Context) -> Result<(), Report>
fn validate(&self, ctx: &Self::Context) -> Result<(), Report>
Validates Self, returning an Err with an aggregate of all errors if
the validation failed.
This method should not be implemented manually. Implement Validate::validate_into instead,
because Validate::validate has a default implementation that calls Validate::validate_into.