ErrorStatus

Enum ErrorStatus 

Source
#[repr(u16)]
pub enum ErrorStatus {
Show 42 variants Generic = 1, OperationNotSupported = 2, NotSupported = 3, Corrupted = 4, InvalidSyscall = 5, UnknownResource = 6, InvalidPid = 7, InvalidOffset = 8, InvalidPtr = 9, InvalidStr = 10, StrTooLong = 11, InvalidPath = 12, NoSuchAFileOrDirectory = 13, NotAFile = 14, NotADirectory = 15, AlreadyExists = 16, NotExecutable = 17, DirectoryNotEmpty = 18, MissingPermissions = 19, MMapError = 20, Busy = 21, NotEnoughArguments = 22, OutOfMemory = 23, InvalidTid = 24, Timeout = 25, InvalidCommand = 26, InvalidArgument = 27, Unknown = 28, Panic = 29, NotADevice = 30, WouldBlock = 31, ConnectionClosed = 32, ConnectionRefused = 33, UnsupportedResource = 34, ResourceCloneFailed = 35, TypeMismatch = 36, TooShort = 37, AddressNotFound = 38, InvalidSize = 39, ForceTerminated = 40, AddressAlreadyInUse = 41, NotBound = 42,
}

Variants§

§

Generic = 1

Use when no ErrorStatus is available for xyz and you cannot add a new one

§

OperationNotSupported = 2

§

NotSupported = 3

For example an elf class is not supported, there is a difference between NotSupported and OperationNotSupported

§

Corrupted = 4

For example a magic value is invalid

§

InvalidSyscall = 5

§

UnknownResource = 6

There is no Resource associated with a given ID

§

InvalidPid = 7

§

InvalidOffset = 8

§

InvalidPtr = 9

instead of panicking syscalls will return this on null and unaligned pointers some operations may accept null pointers

§

InvalidStr = 10

for operations that requires a valid utf8 str…

§

StrTooLong = 11

for operations that requires a str that doesn’t exceed a max length such as file names (128 bytes)

§

InvalidPath = 12

§

NoSuchAFileOrDirectory = 13

§

NotAFile = 14

§

NotADirectory = 15

§

AlreadyExists = 16

§

NotExecutable = 17

§

DirectoryNotEmpty = 18

§

MissingPermissions = 19

Generic permissions(protection) related error

§

MMapError = 20

Memory Mapping error for now this means that the region has been already mapped before

§

Busy = 21

§

NotEnoughArguments = 22

§

OutOfMemory = 23

§

InvalidTid = 24

Invalid Thread ID

§

Timeout = 25

Operation Timeouted

§

InvalidCommand = 26

A given Command is unknown or invalid

§

InvalidArgument = 27

A given Argument is invalid

§

Unknown = 28

For example happens when a new error is added here, returned by a syscall and the Userspace App isn’t aware of what that error means because it’s ABI is out of date

§

Panic = 29

A panick or a fatal exception occurred, used for example when the rust runtime panics and it wants to exit the process with a value

§

NotADevice = 30

A given resource wasn’t a Device while one was expected

§

WouldBlock = 31

An Operation on a resource would block while it was configured as not blockable, for example through sockets

§

ConnectionClosed = 32

A bi-directional Connection closed from a side and not the other

§

ConnectionRefused = 33

Attempt to form a Connection failed

§

UnsupportedResource = 34

There is a resource associated with the given ID but it isn’t supported by that operation

§

ResourceCloneFailed = 35

The given Resource is not duplictable

§

TypeMismatch = 36

A given X is incompatible with a Y in an operation that requires them to be compatible

Used for example with Sockets when you try to connect with a bad Descriptor

§

TooShort = 37

A given buffer is too short to hold full information, this for example is used with the keyboard input event device to indicate that we couldn’t fit an event in a buffer

§

AddressNotFound = 38

Failed to connect to an address because it wasn’t found

§

InvalidSize = 39

A given input buffer size is not acceptable by the attempted operation

§

ForceTerminated = 40

The syscall was interrupted by something, such as a kill command.

§

AddressAlreadyInUse = 41

Attempt to use an address thats already used.

§

NotBound = 42

Attempt to use an interface thats not bound to an address.

Implementations§

Source§

impl ErrorStatus

Source

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

Gives a string description of the error

Source

pub const fn try_from_u16(value: u16) -> Result<Self, ()>

Try to convert a given value into an error code

Source

pub const fn from_u16(value: u16) -> Self

Converts a given value into an error code on failure, returns Self::Unknown

Trait Implementations§

Source§

impl Clone for ErrorStatus

Source§

fn clone(&self) -> ErrorStatus

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 ErrorStatus

Source§

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

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

impl From<ErrorStatus> for SysResult

Source§

fn from(value: ErrorStatus) -> Self

Converts to this type from the input type.
Source§

impl<T: IntoErr> From<T> for ErrorStatus

Source§

fn from(value: T) -> Self

Converts to this type from the input type.
Source§

impl From<Utf8Error> for ErrorStatus

Source§

fn from(value: Utf8Error) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for ErrorStatus

Source§

fn eq(&self, other: &ErrorStatus) -> 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 TryFrom<u16> for ErrorStatus

Source§

type Error = ()

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

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

Performs the conversion.
Source§

impl Copy for ErrorStatus

Source§

impl Eq for ErrorStatus

Source§

impl StructuralPartialEq for ErrorStatus

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.