pub struct ValidationResult {
pub valid: bool,
pub issues: Vec<ValidationIssue>,
}Expand description
Result of context validation.
Fields§
§valid: boolWhether validation passed (no errors or critical issues)
issues: Vec<ValidationIssue>List of issues found
Implementations§
Source§impl ValidationResult
impl ValidationResult
Sourcepub fn invalid(issues: Vec<ValidationIssue>) -> Self
pub fn invalid(issues: Vec<ValidationIssue>) -> Self
Create an invalid result with issues.
Sourcepub fn add_issue(&mut self, issue: ValidationIssue)
pub fn add_issue(&mut self, issue: ValidationIssue)
Add an issue to the result.
Sourcepub fn has_critical(&self) -> bool
pub fn has_critical(&self) -> bool
Check if there are any critical issues.
Sourcepub fn has_errors(&self) -> bool
pub fn has_errors(&self) -> bool
Check if there are any errors.
Sourcepub fn issues_of_type(&self, issue_type: IssueType) -> Vec<&ValidationIssue>
pub fn issues_of_type(&self, issue_type: IssueType) -> Vec<&ValidationIssue>
Get all issues of a specific type.
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<'de> Deserialize<'de> for ValidationResult
impl<'de> Deserialize<'de> for ValidationResult
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ValidationResult
impl PartialEq for ValidationResult
Source§impl Serialize for ValidationResult
impl Serialize 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