pub struct ValidationReport {
pub errors: Vec<ValidationIssue>,
pub warnings: Vec<ValidationIssue>,
}Expand description
Report containing validation errors and warnings.
Use is_ok() to check if the configuration is
valid (no errors). Warnings alone do not indicate invalidity.
§Examples
use dnf_repofile::{Repo, RepoId, ValidationReport};
// A repo with no URL source is invalid
let repo = Repo::new(RepoId::try_new("test").unwrap());
let report = repo.validate();
assert!(!report.is_ok());
assert_eq!(report.errors.len(), 1);Fields§
§errors: Vec<ValidationIssue>Issues classified as errors (configuration is invalid).
warnings: Vec<ValidationIssue>Issues classified as warnings (advisory, non-fatal).
Implementations§
Source§impl ValidationReport
impl ValidationReport
Sourcepub fn is_ok(&self) -> bool
pub fn is_ok(&self) -> bool
Returns true if there are no errors (warnings are ignored).
A report with only warnings is still considered valid.
§Examples
use dnf_repofile::ValidationReport;
let report = ValidationReport::new();
assert!(report.is_ok());Sourcepub fn has_issues(&self) -> bool
pub fn has_issues(&self) -> bool
Returns true if there are any issues (errors or warnings).
Trait Implementations§
Source§impl Clone for ValidationReport
impl Clone for ValidationReport
Source§fn clone(&self) -> ValidationReport
fn clone(&self) -> ValidationReport
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ValidationReport
impl Debug for ValidationReport
Auto Trait Implementations§
impl Freeze for ValidationReport
impl RefUnwindSafe for ValidationReport
impl Send for ValidationReport
impl Sync for ValidationReport
impl Unpin for ValidationReport
impl UnsafeUnpin for ValidationReport
impl UnwindSafe for ValidationReport
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