ZXFoundation™ 26h2
Loading...
Searching...
No Matches
lib::kernel_error Struct Referenceexport
module lib.error

Unified kernel error type. More...

Public Member Functions

constexpr kernel_error () noexcept
 Default constructor: no error.
constexpr kernel_error (error_category cat, u32 c) noexcept
 Construct from category and raw code.
constexpr operator bool () const noexcept
 Check if error is non-zero.
constexpr auto operator!= (const kernel_error &other) const noexcept -> bool
 Check if two errors differ.
constexpr auto operator== (const kernel_error &other) const noexcept -> bool
 Check if two errors are identical.

Static Public Member Functions

static constexpr auto from_arch (arch_error::code c) noexcept -> kernel_error
 Construct architecture error.
static constexpr auto from_crypto (crypto_error::code c) noexcept -> kernel_error
 Construct cryptographic error.
static constexpr auto from_driver (driver_error::code c) noexcept -> kernel_error
 Construct driver error.
static constexpr auto from_generic (generic_error::code c) noexcept -> kernel_error
 Construct generic error.
static constexpr auto from_init (init_error::code c) noexcept -> kernel_error
 Construct initialization error.
static constexpr auto from_locking (locking_error::code c) noexcept -> kernel_error
 Construct locking error.
static constexpr auto from_machine (machine_error::code c) noexcept -> kernel_error
static constexpr auto from_memory (memory_error::code c) noexcept -> kernel_error
 Construct memory error.
static constexpr auto from_time (time_error::code c) noexcept -> kernel_error
 Construct time error.

Data Fields

error_category category
 Error category discriminator.
u32 code
 Subsystem-specific error code.

Detailed Description

Unified kernel error type.

Note
Combines an error category with a subsystem-specific code. Use the from_* factory methods for type-safe construction.

Constructor & Destructor Documentation

◆ kernel_error()

lib::kernel_error::kernel_error ( error_category cat,
u32 c )
inlineconstexprexportnoexcept

Construct from category and raw code.

Parameters
[in]catError category.
[in]cRaw error code.
Warning
Prefer type-safe from_* methods.

Member Function Documentation

◆ from_arch()

constexpr auto lib::kernel_error::from_arch ( arch_error::code c) ->kernel_error
inlinestaticconstexprexportnoexcept

Construct architecture error.

Parameters
[in]carch_error::code value.
Returns
kernel_error with category=arch.

◆ from_crypto()

constexpr auto lib::kernel_error::from_crypto ( crypto_error::code c) ->kernel_error
inlinestaticconstexprexportnoexcept

Construct cryptographic error.

Parameters
[in]ccrypto_error::code value.
Returns
kernel_error with category=crypto.

◆ from_driver()

constexpr auto lib::kernel_error::from_driver ( driver_error::code c) ->kernel_error
inlinestaticconstexprexportnoexcept

Construct driver error.

Parameters
[in]cdriver_error::code value.
Returns
kernel_error with category=driver.

◆ from_generic()

constexpr auto lib::kernel_error::from_generic ( generic_error::code c) ->kernel_error
inlinestaticconstexprexportnoexcept

Construct generic error.

Parameters
[in]cgeneric_error::code value.
Returns
kernel_error with category=generic.

◆ from_init()

constexpr auto lib::kernel_error::from_init ( init_error::code c) ->kernel_error
inlinestaticconstexprexportnoexcept

Construct initialization error.

Parameters
[in]cinit_error::code value.
Returns
kernel_error with category=init.

◆ from_locking()

constexpr auto lib::kernel_error::from_locking ( locking_error::code c) ->kernel_error
inlinestaticconstexprexportnoexcept

Construct locking error.

Parameters
[in]clocking_error::code value.
Returns
kernel_error with category=locking.

◆ from_machine()

constexpr auto lib::kernel_error::from_machine ( machine_error::code c) ->kernel_error
inlinestaticconstexprexportnoexcept
Parameters
[in]cgeneric_error::code value.
Returns
kernel_error with category=generic.

◆ from_memory()

constexpr auto lib::kernel_error::from_memory ( memory_error::code c) ->kernel_error
inlinestaticconstexprexportnoexcept

Construct memory error.

Parameters
[in]cmemory_error::code value.
Returns
kernel_error with category=memory.

◆ from_time()

constexpr auto lib::kernel_error::from_time ( time_error::code c) ->kernel_error
inlinestaticconstexprexportnoexcept

Construct time error.

Parameters
[in]ctime_error::code value.
Returns
kernel_error with category=time.

◆ operator bool()

lib::kernel_error::operator bool ( ) const
inlineexplicitconstexprexportnoexcept

Check if error is non-zero.

Returns
true if category is not none.

The documentation for this struct was generated from the following file: