Severity

Enum Severity 

Source
#[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

SeverityCharPriorityMeaning
ErrorE8Operation failed
BlockedB7Execution blocked/waiting
CriticalC6Severe issue requiring attention
WarningW5Potential issue
HelpH4Helpful suggestion
SuccessS3Operation succeeded
CompletedK2Task/phase completed
InfoI1Informational events
TraceT0Execution 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

Source

pub const fn as_char(self) -> char

Get the single-character code (E, W, C, B, S, K, I, T)

Source

pub const fn as_str(self) -> &'static str

Get the full name as a string slice (e.g., “Error”, “Warning”)

Source

pub const fn description(self) -> &'static str

Get a human-readable description of this severity level

Source

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)
Source

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.

Source

pub const fn is_positive(self) -> bool

Check if this is a positive outcome (Success/Completed)

Source

pub const fn is_negative(self) -> bool

Check if this is a negative outcome (Error/Warning/Critical/Blocked)

Source

pub const fn is_neutral(self) -> bool

Check if this is neutral (Info/Trace)

Source

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)
Source

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)
Source

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.

Source

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.

Trait Implementations§

Source§

impl Clone for Severity

Source§

fn clone(&self) -> Severity

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Severity

Source§

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

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

impl Display for Severity

Source§

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

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

impl Hash for Severity

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for Severity

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for Severity

Source§

fn eq(&self, other: &Severity) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for Severity

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Copy for Severity

Source§

impl Eq for Severity

Source§

impl StructuralPartialEq for Severity

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> 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> 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.