Enum arceos_api::AxError

#[non_exhaustive]
#[repr(i32)]
pub enum AxError {
Show 22 variants AddrInUse = 1, AlreadyExists = 2, BadAddress = 3, BadState = 4, ConnectionRefused = 5, ConnectionReset = 6, DirectoryNotEmpty = 7, InvalidData = 8, InvalidInput = 9, Io = 10, IsADirectory = 11, NoMemory = 12, NotADirectory = 13, NotConnected = 14, NotFound = 15, PermissionDenied = 16, ResourceBusy = 17, StorageFull = 18, UnexpectedEof = 19, Unsupported = 20, WouldBlock = 21, WriteZero = 22,
}
Expand description

The error 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.

§

AlreadyExists = 2

An entity already exists, often a file.

§

BadAddress = 3

Bad address.

§

BadState = 4

Bad internal state.

§

ConnectionRefused = 5

The connection was refused by the remote server,

§

ConnectionReset = 6

The connection was reset by the remote server.

§

DirectoryNotEmpty = 7

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

§

InvalidData = 8

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.

§

InvalidInput = 9

Invalid parameter/argument.

§

Io = 10

Input/output error.

§

IsADirectory = 11

The filesystem object is, unexpectedly, a directory.

§

NoMemory = 12

Not enough space/cannot allocate memory.

§

NotADirectory = 13

A filesystem object is, unexpectedly, not a directory.

§

NotConnected = 14

The network operation failed because it was not connected yet.

§

NotFound = 15

The requested entity is not found.

§

PermissionDenied = 16

The operation lacked the necessary privileges to complete.

§

ResourceBusy = 17

Device or resource is busy.

§

StorageFull = 18

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

§

UnexpectedEof = 19

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

§

Unsupported = 20

This operation is unsupported or unimplemented.

§

WouldBlock = 21

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

§

WriteZero = 22

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

Implementations§

§

impl AxError

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

Returns the error description.

pub const fn code(self) -> i32

Returns the error code value in i32.

Trait Implementations§

§

impl Clone for AxError

§

fn clone(&self) -> AxError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for AxError

§

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

Formats the value using the given formatter. Read more
§

impl Display for AxError

§

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

Formats the value using the given formatter. Read more
§

impl PartialEq for AxError

§

fn eq(&self, other: &AxError) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl TryFrom<i32> for AxError

§

type Error = i32

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

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

Performs the conversion.
§

impl Copy for AxError

§

impl Eq for AxError

§

impl StructuralPartialEq for AxError

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

§

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§

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

§

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

§

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.