#[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 (light mode)
Returns Radix Colors for light backgrounds per WDP Part 10. Uses step 11 (text) or step 9 (emphasis) for WCAG AA contrast.
§WDP Part 10 Color Scheme (Radix Colors)
- Error: #ce2c31 (red-11)
- Blocked: #dc3e42 (red-10)
- Critical: #cc4e00 (orange-11)
- Warning: #ab6400 (amber-11)
- Help: #218358 (green-11)
- Success: #30a46c (green-9)
- Completed: #008573 (teal-11)
- Info: #0d74ce (blue-11)
- Trace: #60646c (slate-11)
Sourcepub const fn hex_color_dark(self) -> &'static str
pub const fn hex_color_dark(self) -> &'static str
Get hex color for HTML/CSS display (dark mode)
Returns Radix Colors dark scale for dark backgrounds per WDP Part 10. Perceptually matched with light mode colors for consistency.
§WDP Part 10 Dark Mode Colors (Radix Colors Dark Scale)
- Error: #ff9592 (red-11 dark)
- Blocked: #ec5d5e (red-10 dark)
- Critical: #ffa057 (orange-11 dark)
- Warning: #ffca16 (amber-11 dark)
- Help: #3dd68c (green-11 dark)
- Success: #33b074 (green-10 dark)
- Completed: #0bd8b6 (teal-11 dark)
- Info: #70b8ff (blue-11 dark)
- Trace: #b0b4ba (slate-11 dark)
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 (light mode)
Returns Radix Colors step 3 for light, subtle backgrounds per WDP Part 10. Perfect for badges, chips, and callout boxes.
Sourcepub const fn hex_bg_color_dark(self) -> &'static str
pub const fn hex_bg_color_dark(self) -> &'static str
Get background color for HTML/CSS badges (dark mode)
Returns Radix Colors dark scale step 3 for dark, muted backgrounds per WDP Part 10. Perfect for badges, chips, and callout boxes in dark themes.