Trait CompositeValidator

Source
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§

Source

fn validate_composite( &self, objects: &[Box<dyn ValueObject>], ) -> ValidationResult<()>

Validate relationships between multiple value objects

Source

fn dependent_attributes(&self) -> Vec<String>

Get the names of attributes this validator depends on

Source

fn applies_to(&self, attribute_names: &[String]) -> bool

Check if this validator applies to the given set of attributes

Implementors§