pub trait CompositeValidator {
// Required methods
fn validate_composite(
&self,
objects: &[Box<dyn ValueObject>],
) -> ValidationResult<()>;
fn dependent_attributes(&self) -> Vec<String>;
fn applies_to(&self, attribute_names: &[String]) -> bool;
}Expand description
Trait for composite validation across multiple value objects.
This enables validation rules that span multiple attributes or require context from other value objects to validate properly.
Required Methods§
Sourcefn validate_composite(
&self,
objects: &[Box<dyn ValueObject>],
) -> ValidationResult<()>
fn validate_composite( &self, objects: &[Box<dyn ValueObject>], ) -> ValidationResult<()>
Validate relationships between multiple value objects
Sourcefn dependent_attributes(&self) -> Vec<String>
fn dependent_attributes(&self) -> Vec<String>
Get the names of attributes this validator depends on
Sourcefn applies_to(&self, attribute_names: &[String]) -> bool
fn applies_to(&self, attribute_names: &[String]) -> bool
Check if this validator applies to the given set of attributes