pub struct ValidationResult {
pub errors: Vec<ValidationError>,
}Expand description
The aggregated result of validating an ISO 20022 message.
§Examples
use mx20022_validate::error::{ValidationResult, ValidationError, Severity};
let result = ValidationResult::new(vec![]);
assert!(result.is_valid());
assert_eq!(result.error_count(), 0);
assert_eq!(result.warning_count(), 0);Fields§
§errors: Vec<ValidationError>All findings produced during validation.
Implementations§
Source§impl ValidationResult
impl ValidationResult
Sourcepub fn new(errors: Vec<ValidationError>) -> Self
pub fn new(errors: Vec<ValidationError>) -> Self
Create a new ValidationResult from a list of findings.
Sourcepub fn is_valid(&self) -> bool
pub fn is_valid(&self) -> bool
Returns true if there are no findings with Severity::Error.
Sourcepub fn error_count(&self) -> usize
pub fn error_count(&self) -> usize
Count of findings with Severity::Error.
Sourcepub fn warning_count(&self) -> usize
pub fn warning_count(&self) -> usize
Count of findings with Severity::Warning.
Sourcepub fn merge(&mut self, other: ValidationResult)
pub fn merge(&mut self, other: ValidationResult)
Merge another ValidationResult into this one.
Trait Implementations§
Source§impl Clone for ValidationResult
impl Clone for ValidationResult
Source§fn clone(&self) -> ValidationResult
fn clone(&self) -> ValidationResult
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ValidationResult
impl Debug for ValidationResult
Auto Trait Implementations§
impl Freeze for ValidationResult
impl RefUnwindSafe for ValidationResult
impl Send for ValidationResult
impl Sync for ValidationResult
impl Unpin for ValidationResult
impl UnsafeUnpin for ValidationResult
impl UnwindSafe for ValidationResult
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