KernelError

Enum KernelError 

Source
pub enum KernelError {
Show 21 variants OperationNotPermitted, NoSuchEntry, IOError, NoExec, BadFileDescriptor, NoMemory, InvalidAccess, BadAddress, Busy, FileExist, NotDirectory, IsDirectory, InvalidArgument, TooManyOpenFile, NoSpace, BrokenPipe, NameTooLong, NoSuchSyscall, DirectoryNotEmpty, FilesystemCorrupted(&'static str), NotSupportedOperation,
}
Expand description

Enum representing errors that can occur during a kernel operation.

This enum is used to categorize errors encountered by the kernel operation. Each variant corresponds to a specific type of error that might occur during the handling of a kernel operation. These errors can be returned to the user program to indicate the nature of the failure.

Variants§

§

OperationNotPermitted

Operation is not permitted. (EPERM)

§

NoSuchEntry

No such file or directory. (ENOENT)

§

IOError

IO Error. (EIO)

§

NoExec

Exec format error. (ENOEXEC)

§

BadFileDescriptor

BAD file descriptor. (EBADF)

§

NoMemory

Out of memory. (ENOMEM)

§

InvalidAccess

Permission denied. (EACCES)

§

BadAddress

Bad address. (EFAULT)

§

Busy

Device or resource busy. (EBUSY)

§

FileExist

File exists. (EEXIST)

§

NotDirectory

Not a directory. (ENOTDIR)

§

IsDirectory

Is a directory. (EISDIR)

§

InvalidArgument

Invalid arguement. (EINVAL)

§

TooManyOpenFile

Too many open files. (EMFILE)

§

NoSpace

No space left on device. (ENOSPC)

§

BrokenPipe

Broken pipe. (EPIPE)

§

NameTooLong

File name too long. (ENAMETOOLONG)

§

NoSuchSyscall

Invalid system call number. (ENOSYS)

§

DirectoryNotEmpty

Directory not empty (ENOTEMPTY)

§

FilesystemCorrupted(&'static str)

File system is corrupted. (EFSCORRUPTED)

§

NotSupportedOperation

Operation is not supported. (ENOTSUPP)

Implementations§

Source§

impl KernelError

Source

pub fn into_usize(self) -> usize

Converts the KernelError enum into a corresponding usize error code. The result is cast to usize for use as a return value in system calls.

Trait Implementations§

Source§

impl Debug for KernelError

Source§

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

Formats the value using the given formatter. 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§

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 TryFrom<isize> for KernelError

Source§

type Error = TryFromError

The type returned in the event of a conversion error.
Source§

fn try_from(value: isize) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl Eq for KernelError

Source§

impl StructuralPartialEq for KernelError

Auto Trait Implementations§

§

impl Freeze for KernelError

§

impl RefUnwindSafe for KernelError

§

impl Send for KernelError

§

impl Sync for KernelError

§

impl Unpin for KernelError

§

impl UnwindSafe for KernelError

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.