Skip to main content

ErrorNamespace

Struct ErrorNamespace 

Source
pub struct ErrorNamespace { /* private fields */ }
Expand description

Error namespace type - enforces frozen taxonomy.

Namespaces are locked at compile-time with no runtime construction:

  • Private field prevents user construction
  • Only const instances are exported (see namespaces module)
  • Cannot be moved or duplicated at runtime

Each namespace has authority flags determining permitted operations:

  • Which categories are semantically valid
  • Whether Breach-level impacts are allowed (strict_severity mode)

§No-Copy, No-Move Semantics

This type does not implement Copy or Clone, and cannot be constructed at runtime. Namespaces exist only as const statics, making governance a compile-time property, not a runtime discipline.

This is the identity layer - completely frozen.

§Authority Flags

Each namespace carries const authority flags:

  • CAN_BREACH: Whether Breach-level impacts (951-1000) are permitted

This allows authority to evolve independently of namespace identity.

Implementations§

Source§

impl ErrorNamespace

Source

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

Get the string representation for external display. Zero-allocation - returns static string.

Source

pub const fn can_breach(&self) -> bool

Check if this namespace permits Breach-level impacts (951-1000).

§Strict Severity Mode

When strict_severity feature is enabled, this authority is enforced at error code construction. Without the feature, it’s advisory only.

Authority is granted via const flag, allowing architectural evolution without hardcoded namespace checks.

Trait Implementations§

Source§

impl Debug for ErrorNamespace

Source§

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

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

impl Hash for ErrorNamespace

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 PartialEq for ErrorNamespace

Source§

fn eq(&self, other: &ErrorNamespace) -> 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 Eq for ErrorNamespace

Source§

impl StructuralPartialEq for ErrorNamespace

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