#[repr(u8)]pub enum Severity {
Error = 69,
Warning = 87,
Critical = 67,
Blocked = 66,
Help = 72,
Success = 83,
Completed = 75,
Info = 73,
Trace = 84,
}Expand description
Diagnostic severity level (single-character prefix for 4-part codes)
Each severity gets a single-character prefix: SEVERITY.COMPONENT.PRIMARY.SEQUENCE
§Available Severities
| Severity | Char | Priority | Meaning |
|---|---|---|---|
| Error | E | 8 | Operation failed |
| Blocked | B | 7 | Execution blocked/waiting |
| Critical | C | 6 | Severe issue requiring attention |
| Warning | W | 5 | Potential issue |
| Help | H | 4 | Helpful suggestion |
| Success | S | 3 | Operation succeeded |
| Completed | K | 2 | Task/phase completed |
| Info | I | 1 | Informational events |
| Trace | T | 0 | Execution traces |
Variants§
Error = 69
Error (E) - Operation failed
Warning = 87
Warning (W) - Potential issue or caveat
Critical = 67
Critical (C) - Severe issue requiring attention
Blocked = 66
Blocked (B) - Execution blocked/waiting
Help = 72
Help (H) - Helpful suggestion or recommendation
Success = 83
Success (S) - Operation succeeded
Completed = 75
Completed (K) - Task or phase completed
Info = 73
Info (I) - General informational events
Trace = 84
Trace (T) - Execution traces and instrumentation
Implementations§
Source§impl Severity
impl Severity
Sourcepub const fn as_str(self) -> &'static str
pub const fn as_str(self) -> &'static str
Get the full name as a string slice (e.g., “Error”, “Warning”)
Sourcepub const fn description(self) -> &'static str
pub const fn description(self) -> &'static str
Get a human-readable description of this severity level
Sourcepub const fn priority(self) -> u8
pub const fn priority(self) -> u8
Get the priority level (0-8, higher = more severe)
Priority Scale:
- 0-1: Diagnostic (Trace, Info)
- 2-3: Positive (Completed, Success)
- 4: Suggestions (Help)
- 5-6: Issues (Warning, Critical)
- 7-8: Blocking (Blocked, Error)
Sourcepub const fn is_blocking(self) -> bool
pub const fn is_blocking(self) -> bool
Check if this severity blocks execution
Returns true only for Error and Blocked.
Critical is a severe warning but does NOT block.
Sourcepub const fn is_positive(self) -> bool
pub const fn is_positive(self) -> bool
Check if this is a positive outcome (Success/Completed)
Sourcepub const fn is_negative(self) -> bool
pub const fn is_negative(self) -> bool
Check if this is a negative outcome (Error/Warning/Critical/Blocked)
Sourcepub const fn is_neutral(self) -> bool
pub const fn is_neutral(self) -> bool
Check if this is neutral (Info/Trace)
Sourcepub const fn hex_color(self) -> &'static str
pub const fn hex_color(self) -> &'static str
Get hex color for HTML/CSS display
Returns a CSS-compatible hex color code for web UIs.
§Color Scheme
- Error: #c0392b (dark red)
- Blocked: #e74c3c (red)
- Critical: #e67e22 (orange)
- Warning: #f39c12 (yellow/orange)
- Help: #27ae60 (green)
- Success: #2ecc71 (bright green)
- Completed: #16a085 (teal)
- Info: #3498db (blue)
- Trace: #95a5a6 (gray)
Sourcepub const fn hex_bg_color(self) -> &'static str
pub const fn hex_bg_color(self) -> &'static str
Get background color for HTML/CSS badges
Returns a light background color suitable for badges/chips.