pub trait Constraint<T> {
// Required method
fn validate(&self, data: &T) -> ConstraintResult;
}
Expand description
Constraint trait
Required Methods§
Sourcefn validate(&self, data: &T) -> ConstraintResult
fn validate(&self, data: &T) -> ConstraintResult
Validates data to make sure it follows constraints
Implementors§
impl<T> Constraint<T> for NumberConstraint
Implementing method to apply constraints on numbers
impl<T> Constraint<T> for StringConstraint
Implementing method to apply constraints on strings