pub struct ValidationReport {
pub message_type: String,
pub pruefidentifikator: Option<String>,
pub format_version: Option<String>,
pub level: ValidationLevel,
pub issues: Vec<ValidationIssue>,
}Expand description
Complete validation report for an EDIFACT message.
Contains all issues found during validation, with convenience methods for filtering by severity and checking overall validity.
Fields§
§message_type: StringThe detected EDIFACT message type (e.g., “UTILMD”, “ORDERS”).
pruefidentifikator: Option<String>The detected Pruefidentifikator (e.g., “11001”, “55001”).
format_version: Option<String>The detected format version (e.g., “FV2510”).
level: ValidationLevelThe validation level that was used.
issues: Vec<ValidationIssue>All validation issues found.
Implementations§
Source§impl ValidationReport
impl ValidationReport
Sourcepub fn new(message_type: impl Into<String>, level: ValidationLevel) -> Self
pub fn new(message_type: impl Into<String>, level: ValidationLevel) -> Self
Create a new empty validation report.
Sourcepub fn with_pruefidentifikator(self, pid: impl Into<String>) -> Self
pub fn with_pruefidentifikator(self, pid: impl Into<String>) -> Self
Builder: set the Pruefidentifikator.
Sourcepub fn with_format_version(self, fv: impl Into<String>) -> Self
pub fn with_format_version(self, fv: impl Into<String>) -> Self
Builder: set the format version.
Sourcepub fn add_issue(&mut self, issue: ValidationIssue)
pub fn add_issue(&mut self, issue: ValidationIssue)
Add a validation issue.
Sourcepub fn add_issues(&mut self, issues: impl IntoIterator<Item = ValidationIssue>)
pub fn add_issues(&mut self, issues: impl IntoIterator<Item = ValidationIssue>)
Add multiple validation issues.
Sourcepub fn error_count(&self) -> usize
pub fn error_count(&self) -> usize
Returns the number of error-level issues.
Sourcepub fn warning_count(&self) -> usize
pub fn warning_count(&self) -> usize
Returns the number of warning-level issues.
Sourcepub fn errors(&self) -> impl Iterator<Item = &ValidationIssue>
pub fn errors(&self) -> impl Iterator<Item = &ValidationIssue>
Returns all error-level issues.
Sourcepub fn warnings(&self) -> impl Iterator<Item = &ValidationIssue>
pub fn warnings(&self) -> impl Iterator<Item = &ValidationIssue>
Returns all warning-level issues.
Sourcepub fn infos(&self) -> impl Iterator<Item = &ValidationIssue>
pub fn infos(&self) -> impl Iterator<Item = &ValidationIssue>
Returns all info-level issues.
Sourcepub fn by_category(
&self,
category: ValidationCategory,
) -> impl Iterator<Item = &ValidationIssue>
pub fn by_category( &self, category: ValidationCategory, ) -> impl Iterator<Item = &ValidationIssue>
Returns issues filtered by category.
Sourcepub fn total_issues(&self) -> usize
pub fn total_issues(&self) -> usize
Returns the total number of issues.
Sourcepub fn enrich_bo4e_paths(&mut self, resolver: impl Fn(&str) -> Option<String>)
pub fn enrich_bo4e_paths(&mut self, resolver: impl Fn(&str) -> Option<String>)
Enrich all issues that have a field_path by resolving BO4E paths.
The resolver closure maps an EDIFACT field path (e.g., “SG4/SG5/LOC/C517/3225”)
to a BO4E field path (e.g., “stammdaten.Marktlokation.marktlokationsId”).
Issues without a field_path or where the resolver returns None are left unchanged.
Trait Implementations§
Source§impl Clone for ValidationReport
impl Clone for ValidationReport
Source§fn clone(&self) -> ValidationReport
fn clone(&self) -> ValidationReport
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more