Skip to main content

ValidationReport

Struct ValidationReport 

Source
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: bool

Whether the package is playable despite issues

§is_compliant: bool

Whether the package is compliant with base SMPTE standards

§profile: ValidationProfile

Validation profile used

§timestamp: String

Timestamp of validation

Implementations§

Source§

impl ValidationReport

Source

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

Source

pub fn new(profile: ValidationProfile) -> Self

Source

pub fn add(&mut self, issue: ValidationIssue)

Source

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.

Source

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.

Source

pub fn total_issues(&self) -> usize

Source

pub fn has_critical(&self) -> bool

Source

pub fn has_errors(&self) -> bool

Source

pub fn summary(&self) -> String

Trait Implementations§

Source§

impl Clone for ValidationReport

Source§

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)

Performs copy-assignment from source. Read more
Source§

impl Debug for ValidationReport

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ValidationReport

Source§

fn default() -> ValidationReport

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ValidationReport

Source§

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 Display for ValidationReport

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Serialize for ValidationReport

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.