Enum axerrno::AxError

source ·
#[repr(i32)]
#[non_exhaustive]
pub enum AxError {
Show 22 variants AddrInUse, AlreadyExists, BadAddress, BadState, ConnectionRefused, ConnectionReset, DirectoryNotEmpty, InvalidData, InvalidInput, Io, IsADirectory, NoMemory, NotADirectory, NotConnected, NotFound, PermissionDenied, ResourceBusy, StorageFull, UnexpectedEof, Unsupported, WouldBlock, WriteZero,
}
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

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

§

AlreadyExists

An entity already exists, often a file.

§

BadAddress

Bad address.

§

BadState

Bad internal state.

§

ConnectionRefused

The connection was refused by the remote server,

§

ConnectionReset

The connection was reset by the remote server.

§

DirectoryNotEmpty

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

§

InvalidData

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

Invalid parameter/argument.

§

Io

Input/output error.

§

IsADirectory

The filesystem object is, unexpectedly, a directory.

§

NoMemory

Not enough space/cannot allocate memory.

§

NotADirectory

A filesystem object is, unexpectedly, not a directory.

§

NotConnected

The network operation failed because it was not connected yet.

§

NotFound

The requested entity is not found.

§

PermissionDenied

The operation lacked the necessary privileges to complete.

§

ResourceBusy

Device or resource is busy.

§

StorageFull

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

§

UnexpectedEof

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

§

Unsupported

This operation is unsupported or unimplemented.

§

WouldBlock

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

§

WriteZero

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

Implementations§

source§

impl AxError

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 AxError

source§

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
source§

impl Debug for AxError

source§

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

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

impl Display for AxError

source§

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

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

impl From<AxError> for LinuxError

source§

fn from(e: AxError) -> Self

Converts to this type from the input type.
source§

impl PartialEq<AxError> for AxError

source§

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.
source§

impl TryFrom<i32> for AxError

§

type Error = i32

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

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

Performs the conversion.
source§

impl Copy for AxError

source§

impl Eq for AxError

source§

impl StructuralEq for AxError

source§

impl StructuralPartialEq for AxError

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere 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 Twhere 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.