#[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
impl ErrorStatus
Sourcepub const fn try_from_u16(value: u16) -> Result<Self, ()>
pub const fn try_from_u16(value: u16) -> Result<Self, ()>
Try to convert a given value into an error code
Sourcepub const fn from_u16(value: u16) -> Self
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
impl Clone for ErrorStatus
Source§fn clone(&self) -> ErrorStatus
fn clone(&self) -> ErrorStatus
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more