pub struct ValidationResult { /* private fields */ }Expand description
Result of validation containing errors and warnings.
Use is_valid() to check if validation passed.
Use errors() and warnings() to iterate over issues.
Implementations§
Source§impl ValidationResult
impl ValidationResult
Sourcepub fn add_error(&mut self, error: ValidationError)
pub fn add_error(&mut self, error: ValidationError)
Adds an error to the result.
Sourcepub fn add_errors(&mut self, errors: impl IntoIterator<Item = ValidationError>)
pub fn add_errors(&mut self, errors: impl IntoIterator<Item = ValidationError>)
Adds multiple errors to the result.
Sourcepub fn all_errors(&self) -> &[ValidationError]
pub fn all_errors(&self) -> &[ValidationError]
Returns all errors and warnings.
Sourcepub fn errors(&self) -> impl Iterator<Item = &ValidationError>
pub fn errors(&self) -> impl Iterator<Item = &ValidationError>
Returns only errors (not warnings).
Sourcepub fn warnings(&self) -> impl Iterator<Item = &ValidationError>
pub fn warnings(&self) -> impl Iterator<Item = &ValidationError>
Returns only warnings (not errors).
Sourcepub fn error_count(&self) -> usize
pub fn error_count(&self) -> usize
Returns the count of errors (not warnings).
Sourcepub fn warning_count(&self) -> usize
pub fn warning_count(&self) -> usize
Returns the count of warnings (not errors).
Sourcepub fn merge(&mut self, other: ValidationResult)
pub fn merge(&mut self, other: ValidationResult)
Merges another result into this one.
Sourcepub fn has_errors(&self) -> bool
pub fn has_errors(&self) -> bool
Returns true if there are any errors (not warnings).
Sourcepub fn has_warnings(&self) -> bool
pub fn has_warnings(&self) -> bool
Returns true if there are any warnings.
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
Source§impl Default for ValidationResult
impl Default for ValidationResult
Source§fn default() -> ValidationResult
fn default() -> ValidationResult
Returns the “default value” for a type. Read more
Source§impl PartialEq for ValidationResult
impl PartialEq for ValidationResult
impl Eq for ValidationResult
impl StructuralPartialEq 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 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