Struct Errno

Source
pub struct Errno(/* private fields */);
Expand description

Error number representation.

Implementations§

Source§

impl Errno

Source

pub const EDATALESS: Self

kernel internal error

Source

pub const EKEEPLOOKING: Self

kernel internal error

Source

pub const EREDRIVEOPEN: Self

kernel internal error

Source

pub const ERECYCLE: Self

restart lookup under heavy vnode pressure/recycling

Source

pub const EJUSTRETURN: Self

don’t modify regs, just return

Source

pub const ERESTART: Self

restart syscall

Source

pub const EPERM: Self

Operation not permitted

Source

pub const ENOENT: Self

No such file or directory

Source

pub const ESRCH: Self

No such process

Source

pub const EINTR: Self

Interrupted system call

Source

pub const EIO: Self

Input/output error

Source

pub const ENXIO: Self

Device not configured

Source

pub const E2BIG: Self

Argument list too long

Source

pub const ENOEXEC: Self

Exec format error

Source

pub const EBADF: Self

Bad file descriptor

Source

pub const ECHILD: Self

No child processes

Source

pub const EDEADLK: Self

Resource deadlock avoided

Source

pub const ENOMEM: Self

Cannot allocate memory

Source

pub const EACCES: Self

Permission denied

Source

pub const EFAULT: Self

Bad address

Source

pub const ENOTBLK: Self

Block device required

Source

pub const EBUSY: Self

Device / Resource busy

Source

pub const EEXIST: Self

File exists

Source

pub const EXDEV: Self

Cross-device link

Source

pub const ENODEV: Self

Operation not supported by device

Source

pub const ENOTDIR: Self

Not a directory

Source

pub const EISDIR: Self

Is a directory

Source

pub const EINVAL: Self

Invalid argument

Source

pub const ENFILE: Self

Too many open files in system

Source

pub const EMFILE: Self

Too many open files

Source

pub const ENOTTY: Self

Inappropriate ioctl for device

Source

pub const ETXTBSY: Self

Text file busy

Source

pub const EFBIG: Self

File too large

Source

pub const ENOSPC: Self

No space left on device

Source

pub const ESPIPE: Self

Illegal seek

Source

pub const EROFS: Self

Read-only file system

Too many links

Source

pub const EPIPE: Self

Broken pipe

Source

pub const EDOM: Self

Numerical argument out of domain

Source

pub const ERANGE: Self

Result too large

Source

pub const EAGAIN: Self

Resource temporarily unavailable

Source

pub const EINPROGRESS: Self

Operation now in progress

Source

pub const EALREADY: Self

Operation already in progress

Source

pub const ENOTSOCK: Self

Socket operation on non-socket

Source

pub const EDESTADDRREQ: Self

Destination address required

Source

pub const EMSGSIZE: Self

Message too long

Source

pub const EPROTOTYPE: Self

Protocol wrong type for socket

Source

pub const ENOPROTOOPT: Self

Protocol not available

Source

pub const EPROTONOSUPPORT: Self

Protocol not supported

Source

pub const ESOCKTNOSUPPORT: Self

Socket type not supported

Source

pub const ENOTSUP: Self

Operation not supported

Source

pub const EPFNOSUPPORT: Self

Protocol family not supported

Source

pub const EAFNOSUPPORT: Self

Address family not supported by protocol family

Source

pub const EADDRINUSE: Self

Address already in use

Source

pub const EADDRNOTAVAIL: Self

Can’t assign requested address

Source

pub const ENETDOWN: Self

Network is down

Source

pub const ENETUNREACH: Self

Network is unreachable

Source

pub const ENETRESET: Self

Network dropped connection on reset

Source

pub const ECONNABORTED: Self

Software caused connection abort

Source

pub const ECONNRESET: Self

Connection reset by peer

Source

pub const ENOBUFS: Self

No buffer space available

Source

pub const EISCONN: Self

Socket is already connected

Source

pub const ENOTCONN: Self

Socket is not connected

Source

pub const ESHUTDOWN: Self

Can’t send after socket shutdown

Source

pub const ETOOMANYREFS: Self

Too many references: can’t splice

Source

pub const ETIMEDOUT: Self

Operation timed out

Source

pub const ECONNREFUSED: Self

Connection refused

Source

pub const ELOOP: Self

Too many levels of symbolic links

Source

pub const ENAMETOOLONG: Self

File name too long

Source

pub const EHOSTDOWN: Self

Host is down

Source

pub const EHOSTUNREACH: Self

No route to host

Source

pub const ENOTEMPTY: Self

Directory not empty

Source

pub const EPROCLIM: Self

Too many processes

Source

pub const EUSERS: Self

Too many users

Source

pub const EDQUOT: Self

Disc quota exceeded

Source

pub const ESTALE: Self

Stale NFS file handle

Source

pub const EREMOTE: Self

Too many levels of remote in path

Source

pub const EBADRPC: Self

RPC struct is bad

Source

pub const ERPCMISMATCH: Self

RPC version wrong

Source

pub const EPROGUNAVAIL: Self

RPC prog. not avail

Source

pub const EPROGMISMATCH: Self

Program version wrong

Source

pub const EPROCUNAVAIL: Self

Bad procedure for program

Source

pub const ENOLCK: Self

No locks available

Source

pub const ENOSYS: Self

Function not implemented

Source

pub const EFTYPE: Self

Inappropriate file type or format

Source

pub const EAUTH: Self

Authentication error

Source

pub const ENEEDAUTH: Self

Need authenticator

Source

pub const EPWROFF: Self

Device power is off

Source

pub const EDEVERR: Self

Device error, e.g. paper out

Source

pub const EOVERFLOW: Self

Value too large to be stored in data type

Source

pub const EBADEXEC: Self

Bad executable

Source

pub const EBADARCH: Self

Bad CPU type in executable

Source

pub const ESHLIBVERS: Self

Shared library version mismatch

Source

pub const EBADMACHO: Self

Malformed Macho file

Source

pub const ECANCELED: Self

Operation canceled

Source

pub const EIDRM: Self

Identifier removed

Source

pub const ENOMSG: Self

No message of desired type

Source

pub const EILSEQ: Self

Illegal byte sequence

Source

pub const ENOATTR: Self

Attribute not found

Source

pub const EBADMSG: Self

Bad message

Source

pub const EMULTIHOP: Self

Reserved

Source

pub const ENODATA: Self

No message available on STREAM

Reserved

Source

pub const ENOSR: Self

No STREAM resources

Source

pub const ENOSTR: Self

Not a STREAM

Source

pub const EPROTO: Self

Protocol error

Source

pub const ETIME: Self

STREAM ioctl timeout

Source

pub const EOPNOTSUPP: Self

Operation not supported on socket

Source

pub const ENOPOLICY: Self

No such policy registered

Source

pub const ENOTRECOVERABLE: Self

State not recoverable

Source

pub const EOWNERDEAD: Self

Previous owner died

Source

pub const EQFULL: Self

Interface output queue is full

Source

pub const ECVCERORR: Self

kernel internal error

Source

pub const ECVPERORR: Self

kernel internal error

Source

pub const EWOULDBLOCK: Self = Self::EAGAIN

Alias for Self::EAGAIN

Source

pub const MIN: i32 = -8i32

Source

pub const MAX: i32 = 512i32

Source§

impl Errno

Source

pub const fn new(num: i32) -> Self

Returns a new Errno from the given integer.

Source

pub const fn into_raw(self) -> i32

Converts Errno into the under underlining integer.

Source

pub const fn is_valid(&self) -> bool

Returns true if the error code is in valid range (lower than 4096)

Source

pub fn from_ret(value: usize) -> Result<usize, Errno>

Returns a new Errno from a syscall’s result.

Source

pub fn name(&self) -> Option<&'static str>

Returns the name of the error if it’s known. Generally the name of the constant.

Examples found in repository?
examples/list.rs (line 9)
5pub fn main() {
6    for errno in Errno::iter() {
7        println!(
8            "{}: {}",
9            errno.name().unwrap(),
10            errno.description().unwrap()
11        );
12    }
13}
Source

pub fn description(&self) -> Option<&'static str>

Returns a description of the error if it’s known.

Examples found in repository?
examples/list.rs (line 10)
5pub fn main() {
6    for errno in Errno::iter() {
7        println!(
8            "{}: {}",
9            errno.name().unwrap(),
10            errno.description().unwrap()
11        );
12    }
13}
Source

pub fn from_io_error(err: Error) -> Option<Self>

Returns a new Errno if the given error is generated from a system error. None otherwise.

Source

pub fn last_os_error() -> Self

Returns a new Errno from last OS error.

Source

pub fn iter() -> ErrnoIter

Returns an iterator ErrnoIter over all the known error numbers.

Examples found in repository?
examples/list.rs (line 6)
5pub fn main() {
6    for errno in Errno::iter() {
7        println!(
8            "{}: {}",
9            errno.name().unwrap(),
10            errno.description().unwrap()
11        );
12    }
13}

Trait Implementations§

Source§

impl Clone for Errno

Source§

fn clone(&self) -> Errno

Returns a duplicate of the value. Read more
1.0.0§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Errno

Source§

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

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

impl Display for Errno

Source§

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

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

impl Error for Errno

1.30.0§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Errno> for Error

Source§

fn from(value: Errno) -> Self

Converts to this type from the input type.
Source§

impl Hash for Errno

Source§

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

Feeds this value into the given [Hasher]. Read more
1.3.0§

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 Errno

Source§

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

This method returns an [Ordering] between self and other. Read more
1.21.0§

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

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

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

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

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

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

impl PartialEq for Errno

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0§

const 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 Errno

Source§

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

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

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

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

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§

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

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

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 Copy for Errno

Source§

impl Eq for Errno

Source§

impl StructuralPartialEq for Errno

Auto Trait Implementations§

§

impl Freeze for Errno

§

impl RefUnwindSafe for Errno

§

impl Send for Errno

§

impl Sync for Errno

§

impl Unpin for Errno

§

impl UnwindSafe for Errno

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CloneToUninit for T
where T: Clone,

§

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
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

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

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

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

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

§

fn to_string(&self) -> String

Converts the given value to a String. Read more
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

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

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.