pub trait Constraint: Send + Sync {
// Required methods
fn code(&self) -> &'static str;
fn validate(
&self,
value: &str,
property_path: &str,
violations: &mut ConstraintViolationList,
);
}Expand description
A rule that may append violations for a value.
Required Methods§
Sourcefn validate(
&self,
value: &str,
property_path: &str,
violations: &mut ConstraintViolationList,
)
fn validate( &self, value: &str, property_path: &str, violations: &mut ConstraintViolationList, )
Validates value for property_path, appending to violations on failure.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".