Error

Enum Error 

Source
#[non_exhaustive]
#[repr(i32)]
pub enum Error {
Show 43 variants AddrInUse = 1, AlreadyConnected = 2, AlreadyExists = 3, ArgumentListTooLong = 4, BadAddress = 5, BadFileDescriptor = 6, BadState = 7, BrokenPipe = 8, ConnectionRefused = 9, ConnectionReset = 10, CrossesDevices = 11, DirectoryNotEmpty = 12, FilesystemLoop = 13, IllegalBytes = 14, InProgress = 15, Interrupted = 16, InvalidData = 17, InvalidExecutable = 18, InvalidInput = 19, Io = 20, IsADirectory = 21, NameTooLong = 22, NoMemory = 23, NoSuchDevice = 24, NoSuchProcess = 25, NotADirectory = 26, NotASocket = 27, NotATty = 28, NotConnected = 29, NotFound = 30, OperationNotPermitted = 31, OperationNotSupported = 32, OutOfRange = 33, PermissionDenied = 34, ReadOnlyFilesystem = 35, ResourceBusy = 36, StorageFull = 37, TimedOut = 38, TooManyOpenFiles = 39, UnexpectedEof = 40, Unsupported = 41, WouldBlock = 42, WriteZero = 43,
}
Expand description

The error kind type used by ArceOS.

Similar to std::io::ErrorKind.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

AddrInUse = 1

A socket address could not be bound because the address is already in use elsewhere.

§

AlreadyConnected = 2

The socket is already connected.

§

AlreadyExists = 3

An entity already exists, often a file.

§

ArgumentListTooLong = 4

Program argument list too long.

§

BadAddress = 5

Bad address.

§

BadFileDescriptor = 6

Bad file descriptor.

§

BadState = 7

Bad internal state.

§

BrokenPipe = 8

Broken pipe

§

ConnectionRefused = 9

The connection was refused by the remote server.

§

ConnectionReset = 10

The connection was reset by the remote server.

§

CrossesDevices = 11

Cross-device or cross-filesystem (hard) link or rename.

§

DirectoryNotEmpty = 12

A non-empty directory was specified where an empty directory was expected.

§

FilesystemLoop = 13

Loop in the filesystem or IO subsystem; often, too many levels of symbolic links.

§

IllegalBytes = 14

Illegal byte sequence.

§

InProgress = 15

The operation was partially successful and needs to be checked later on due to not blocking.

§

Interrupted = 16

This operation was interrupted.

§

InvalidData = 17

Data not valid for the operation were encountered.

Unlike InvalidInput, this typically means that the operation parameters were valid, however the error was caused by malformed input data.

For example, a function that reads a file into a string will error with InvalidData if the file’s contents are not valid UTF-8.

§

InvalidExecutable = 18

Invalid executable format.

§

InvalidInput = 19

Invalid parameter/argument.

§

Io = 20

Input/output error.

§

IsADirectory = 21

The filesystem object is, unexpectedly, a directory.

§

NameTooLong = 22

Filename is too long.

§

NoMemory = 23

Not enough space/cannot allocate memory.

§

NoSuchDevice = 24

No such device.

§

NoSuchProcess = 25

No such process.

§

NotADirectory = 26

A filesystem object is, unexpectedly, not a directory.

§

NotASocket = 27

The specified entity is not a socket.

§

NotATty = 28

Not a typewriter.

§

NotConnected = 29

The network operation failed because it was not connected yet.

§

NotFound = 30

The requested entity is not found.

§

OperationNotPermitted = 31

Operation not permitted.

§

OperationNotSupported = 32

Operation not supported.

§

OutOfRange = 33

Result out of range.

§

PermissionDenied = 34

The operation lacked the necessary privileges to complete.

§

ReadOnlyFilesystem = 35

The filesystem or storage medium is read-only, but a write operation was attempted.

§

ResourceBusy = 36

Device or resource is busy.

§

StorageFull = 37

The underlying storage (typically, a filesystem) is full.

§

TimedOut = 38

The I/O operation’s timeout expired, causing it to be canceled.

§

TooManyOpenFiles = 39

The process has too many files open.

§

UnexpectedEof = 40

An error returned when an operation could not be completed because an “end of file” was reached prematurely.

§

Unsupported = 41

This operation is unsupported or unimplemented.

§

WouldBlock = 42

The operation needs to block to complete, but the blocking operation was requested to not occur.

§

WriteZero = 43

An error returned when an operation could not be completed because a call to write() returned Ok(0).

Implementations§

Source§

impl AxErrorKind

Source

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

Returns the error description.

Source

pub const fn code(self) -> i32

Returns the error code value in i32.

Trait Implementations§

Source§

impl Clone for AxErrorKind

Source§

fn clone(&self) -> AxErrorKind

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 AxErrorKind

Source§

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

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

impl Display for AxErrorKind

Source§

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

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

impl EnumCount for AxErrorKind

Source§

const COUNT: usize = 43usize

Source§

impl Hash for AxErrorKind

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

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 Ord for AxErrorKind

Source§

fn cmp(&self, other: &AxErrorKind) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for AxErrorKind

Source§

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

Source§

fn partial_cmp(&self, other: &AxErrorKind) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl TryFrom<AxError> for AxErrorKind

Source§

type Error = LinuxError

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

fn try_from( e: AxError, ) -> Result<AxErrorKind, <AxErrorKind as TryFrom<AxError>>::Error>

Performs the conversion.
Source§

impl TryFrom<LinuxError> for AxErrorKind

Source§

type Error = LinuxError

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

fn try_from( e: LinuxError, ) -> Result<AxErrorKind, <AxErrorKind as TryFrom<LinuxError>>::Error>

Performs the conversion.
Source§

impl TryFrom<i32> for AxErrorKind

Source§

type Error = i32

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

fn try_from( value: i32, ) -> Result<AxErrorKind, <AxErrorKind as TryFrom<i32>>::Error>

Performs the conversion.
Source§

impl Copy for AxErrorKind

Source§

impl Eq for AxErrorKind

Source§

impl StructuralPartialEq for AxErrorKind

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.