pub trait Rule: Send + Sync {
// Required methods
fn validate(
&self,
field: &str,
value: &Value,
data: &Value,
) -> Result<(), String>;
fn name(&self) -> &'static str;
}Expand description
A validation rule that can be applied to a field.