#[derive(Debug)]
pub struct ValidationReport {
pub errors: Vec<String>,
pub warnings: Vec<String>,
}
impl ValidationReport {
#[must_use]
pub const fn new() -> Self {
Self {
errors: Vec::new(),
warnings: Vec::new(),
}
}
pub fn add_error(&mut self, error: String) {
self.errors.push(error);
}
pub fn add_warning(&mut self, warning: String) {
self.warnings.push(warning);
}
#[must_use]
pub fn is_valid(&self) -> bool {
self.errors.is_empty()
}
}
impl Default for ValidationReport {
fn default() -> Self {
Self::new()
}
}