pub struct Validator { /* private fields */ }Expand description
A validator that runs multiple rules against ADRs.
Implementations§
Source§impl Validator
impl Validator
Sourcepub fn new(rules: Vec<Box<dyn ValidationRule>>) -> Self
pub fn new(rules: Vec<Box<dyn ValidationRule>>) -> Self
Creates a new validator with the given rules.
Sourcepub fn add_rule(&mut self, rule: Box<dyn ValidationRule>)
pub fn add_rule(&mut self, rule: Box<dyn ValidationRule>)
Adds a rule to the validator.
Sourcepub fn validate(&self, adr: &Adr) -> ValidationReport
pub fn validate(&self, adr: &Adr) -> ValidationReport
Validates a single ADR using all configured rules.
Sourcepub fn validate_all(&self, adrs: &[Adr]) -> ValidationReport
pub fn validate_all(&self, adrs: &[Adr]) -> ValidationReport
Validates a collection of ADRs using all configured rules.
Sourcepub fn rules(&self) -> &[Box<dyn ValidationRule>]
pub fn rules(&self) -> &[Box<dyn ValidationRule>]
Returns the configured rules.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Validator
impl !RefUnwindSafe for Validator
impl Send for Validator
impl Sync for Validator
impl Unpin for Validator
impl !UnwindSafe for Validator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more