Skip to main content

KernelError

Enum KernelError 

Source
#[repr(u16)]
pub enum KernelError {
Show 28 variants InvalidCapability = 1, InsufficientRights = 2, CapabilityRevoked = 3, ProofRejected = 4, OutOfMemory = 5, QueueFull = 6, QueueEmpty = 7, Timeout = 8, InvalidSignature = 9, InvalidManifest = 10, InvalidObjectType = 11, LimitExceeded = 12, AlreadyExists = 13, NotFound = 14, NotPermitted = 15, CoherenceViolation = 16, DelegationDepthExceeded = 17, CannotGrant = 18, StaleHandle = 19, InvalidSlot = 20, SlabFull = 21, RegionFull = 22, RegionPolicyViolation = 23, BufferTooSmall = 24, InvalidArgument = 25, MessageTooLarge = 26, InvalidDescriptorRegion = 27, InternalError = 255,
}
Expand description

Kernel error codes.

Every syscall can return these errors. Error codes are stable across kernel versions (part of the ABI contract).

Variants§

§

InvalidCapability = 1

The specified capability handle is invalid or does not exist.

§

InsufficientRights = 2

The capability does not have the required rights for this operation.

§

CapabilityRevoked = 3

The capability has been revoked (epoch mismatch).

§

ProofRejected = 4

The proof token is invalid (wrong hash, expired, or nonce reused).

§

OutOfMemory = 5

Out of memory when trying to allocate a region.

§

QueueFull = 6

The queue is full and cannot accept more messages.

§

QueueEmpty = 7

The queue is empty (timeout expired during receive).

§

Timeout = 8

The operation timed out.

§

InvalidSignature = 9

The RVF package signature verification failed.

§

InvalidManifest = 10

The RVF manifest is malformed or references invalid components.

§

InvalidObjectType = 11

The object type does not support this operation.

§

LimitExceeded = 12

The operation would exceed system limits (e.g., max tasks, max regions).

§

AlreadyExists = 13

The resource already exists (e.g., duplicate mount point).

§

NotFound = 14

The resource was not found.

§

NotPermitted = 15

The operation is not permitted in the current state.

§

CoherenceViolation = 16

The operation would violate coherence constraints.

§

DelegationDepthExceeded = 17

Maximum delegation depth exceeded.

§

CannotGrant = 18

The capability cannot be granted (no GRANT or GRANT_ONCE right).

§

StaleHandle = 19

The handle generation does not match (stale handle detection).

§

InvalidSlot = 20

The slot handle is invalid or stale (slab regions).

§

SlabFull = 21

The slab region has no free slots available.

§

RegionFull = 22

The append-only region has reached its maximum size.

§

RegionPolicyViolation = 23

Operation violates the region’s policy (e.g., write to immutable).

§

BufferTooSmall = 24

The provided buffer is too small for the requested operation.

§

InvalidArgument = 25

An invalid argument was provided.

§

MessageTooLarge = 26

The message exceeds the queue’s maximum message size.

§

InvalidDescriptorRegion = 27

The descriptor references a region with an invalid policy for zero-copy. Only Immutable and AppendOnly regions allow descriptors (TOCTOU protection).

§

InternalError = 255

Internal kernel error (should not happen in normal operation).

Implementations§

Source§

impl KernelError

Source

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

Returns a human-readable description of the error.

Source

pub const fn from_u16(code: u16) -> Option<Self>

Converts from a raw u16 error code.

Trait Implementations§

Source§

impl Clone for KernelError

Source§

fn clone(&self) -> KernelError

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 KernelError

Source§

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

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

impl Hash for KernelError

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 KernelError

Source§

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

Source§

impl Eq for KernelError

Source§

impl StructuralPartialEq for KernelError

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