pub struct ValidationReport {
pub critical: Vec<ValidationIssue>,
pub errors: Vec<ValidationIssue>,
pub warnings: Vec<ValidationIssue>,
pub info: Vec<ValidationIssue>,
pub suppressed: Vec<ValidationIssue>,
pub is_playable: bool,
pub is_compliant: bool,
pub profile: ValidationProfile,
pub timestamp: String,
}Expand description
Comprehensive validation report
Fields§
§critical: Vec<ValidationIssue>Critical issues that prevent usage
errors: Vec<ValidationIssue>Errors that must be fixed for compliance
warnings: Vec<ValidationIssue>Warnings that should be addressed
info: Vec<ValidationIssue>Informational issues
suppressed: Vec<ValidationIssue>Issues that were suppressed by a RuleSeverity::Off override.
These are not counted toward is_playable/is_compliant or
surfaced by has_errors/summary — they exist so operators can
debug their RulesConfig (--show-suppressed) without re-running
validation. Each carries a context["suppressed_by"] annotation
naming the rule key that matched.
Skipped during serialisation when empty so reports without suppressed rules keep the previous on-wire shape.
is_playable: boolWhether the package is playable despite issues
is_compliant: boolWhether the package is compliant with base SMPTE standards
profile: ValidationProfileValidation profile used
timestamp: StringTimestamp of validation
Implementations§
Source§impl ValidationReport
impl ValidationReport
Sourcepub fn apply_rules(self, rules: &RulesConfig) -> Self
pub fn apply_rules(self, rules: &RulesConfig) -> Self
Apply ESLint-style per-rule severity overrides.
Issues whose rule matches a RuleSeverity::Off entry are removed.
All other matching issues have their severity remapped and re-bucketed.
is_playable and is_compliant are recomputed from the updated buckets.
When multiple keys match the same issue, the most-specific match wins (see module docs). Selection is deterministic across runs.
An empty RulesConfig is a no-op (fast path, no allocation).
Source§impl ValidationReport
impl ValidationReport
pub fn new(profile: ValidationProfile) -> Self
pub fn add(&mut self, issue: ValidationIssue)
Sourcepub fn aggregate(self) -> Self
pub fn aggregate(self) -> Self
Collapse repeat-offender diagnostics within each severity bucket.
When the same code fires N times, the first-encountered issue
is kept as the canonical instance and the rest contribute only
their Location to its ValidationIssue::additional_instances.
All other fields (message, suggestion, context, severity,
category) are taken from the first occurrence; later instances’
additional_instances (if any — handles repeated aggregation
idempotently) are merged in.
Aggregation stays within severity buckets, since rules emit at a fixed severity per code. Order across the report is preserved (first-seen wins) so output remains reproducible.
Idempotent and order-independent with Self::apply_rules —
safe to call either before or after.
Sourcepub fn merge(&mut self, other: ValidationReport)
pub fn merge(&mut self, other: ValidationReport)
Merge another report’s issues into this one.
The source report’s profile and timestamp are discarded;
only self’s values are retained. The is_playable and
is_compliant flags are combined via logical AND.
pub fn total_issues(&self) -> usize
pub fn has_critical(&self) -> bool
pub fn has_errors(&self) -> bool
pub fn summary(&self) -> String
Trait Implementations§
Source§impl Clone for ValidationReport
impl Clone for ValidationReport
Source§fn clone(&self) -> ValidationReport
fn clone(&self) -> ValidationReport
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more