Skip to main content

ass_core/analysis/styles/validation/
severity.rs

1//! Severity levels for style validation issues.
2//!
3//! Defines the ordered [`ValidationSeverity`] scale used to classify style
4//! validation issues from informational notes through warnings to errors.
5
6use core::fmt;
7
8/// Severity level for style validation issues
9#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
10pub enum ValidationSeverity {
11    /// Informational message about style properties
12    Info,
13    /// Warning about potential rendering or performance issues
14    Warning,
15    /// Error that violates ASS specification or causes problems
16    Error,
17}
18
19impl fmt::Display for ValidationSeverity {
20    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
21        match self {
22            Self::Info => write!(f, "info"),
23            Self::Warning => write!(f, "warning"),
24            Self::Error => write!(f, "error"),
25        }
26    }
27}