Struct Errno

Source
pub struct Errno(/* private fields */);
Available on (target_arch="sparc" or SPARC64) and Linux, or crate feature sparc, or crate feature sparc64 only.
Expand description

Error number representation.

Implementations§

Source§

impl Errno

Source

pub fn new(num: i32) -> Self

Returns a new Errno from the given integer.

Source

pub fn into_raw(self) -> i32

Converts Errno into the under underlining integer.

Source

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

Source

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

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

Source

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

Available on crate feature std only.

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

Source

pub fn iter() -> ErrnoIter

Available on crate feature iter only.

Returns an iterator ErrnoIter over all the known error numbers.

Source§

impl Errno

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

I/O error

Source

pub const ENXIO: Self

No such device or address

Source

pub const E2BIG: Self

Argument list too long

Source

pub const ENOEXEC: Self

Exec format error

Source

pub const EBADF: Self

Bad file number

Source

pub const ECHILD: Self

No child processes

Source

pub const EAGAIN: Self

Try again

Source

pub const ENOMEM: Self

Out of 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 or resource busy

Source

pub const EEXIST: Self

File exists

Source

pub const EXDEV: Self

Cross-device link

Source

pub const ENODEV: Self

No such 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

File table overflow

Source

pub const EMFILE: Self

Too many open files

Source

pub const ENOTTY: Self

Not a typewriter

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

Math argument out of domain of func

Source

pub const ERANGE: Self

Math result not representable

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 EOPNOTSUPP: Self

Op not supported on transport endpoint

Source

pub const EPFNOSUPPORT: Self

Protocol family not supported

Source

pub const EAFNOSUPPORT: Self

Address family not supported by protocol

Source

pub const EADDRINUSE: Self

Address already in use

Source

pub const EADDRNOTAVAIL: Self

Cannot assign requested address

Source

pub const ENETDOWN: Self

Network is down

Source

pub const ENETUNREACH: Self

Network is unreachable

Source

pub const ENETRESET: Self

Net dropped connection because of 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

Transport endpoint is already connected

Source

pub const ENOTCONN: Self

Transport endpoint is not connected

Source

pub const ESHUTDOWN: Self

No send after transport endpoint shutdown

Source

pub const ETOOMANYREFS: Self

Too many references: cannot splice

Source

pub const ETIMEDOUT: Self

Connection timed out

Source

pub const ECONNREFUSED: Self

Connection refused

Source

pub const ELOOP: Self

Too many symbolic links encountered

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

SUNOS: Too many processes

Source

pub const EUSERS: Self

Too many users

Source

pub const EDQUOT: Self

Quota exceeded

Source

pub const ESTALE: Self

Stale file handle

Source

pub const EREMOTE: Self

Object is remote

Source

pub const ENOSTR: Self

Device not a stream

Source

pub const ETIME: Self

Timer expired

Source

pub const ENOSR: Self

Out of streams resources

Source

pub const ENOMSG: Self

No message of desired type

Source

pub const EBADMSG: Self

Not a data message

Source

pub const EIDRM: Self

Identifier removed

Source

pub const EDEADLK: Self

Resource deadlock would occur

Source

pub const ENOLCK: Self

No record locks available

Source

pub const ENONET: Self

Machine is not on the network

Source

pub const ERREMOTE: Self

SunOS: Too many lvls of remote in path

Link has been severed

Source

pub const EADV: Self

Advertise error

Source

pub const ESRMNT: Self

Srmount error

Source

pub const ECOMM: Self

Communication error on send

Source

pub const EPROTO: Self

Protocol error

Source

pub const EMULTIHOP: Self

Multihop attempted

Source

pub const EDOTDOT: Self

RFS specific error

Source

pub const EREMCHG: Self

Remote address changed

Source

pub const ENOSYS: Self

Function not implemented

Source

pub const ESTRPIPE: Self

Streams pipe error

Source

pub const EOVERFLOW: Self

Value too large for defined data type

Source

pub const EBADFD: Self

File descriptor in bad state

Source

pub const ECHRNG: Self

Channel number out of range

Source

pub const EL2NSYNC: Self

Level 2 not synchronized

Source

pub const EL3HLT: Self

Level 3 halted

Source

pub const EL3RST: Self

Level 3 reset

Source

pub const ELNRNG: Self

Link number out of range

Source

pub const EUNATCH: Self

Protocol driver not attached

Source

pub const ENOCSI: Self

No CSI structure available

Source

pub const EL2HLT: Self

Level 2 halted

Source

pub const EBADE: Self

Invalid exchange

Source

pub const EBADR: Self

Invalid request descriptor

Source

pub const EXFULL: Self

Exchange full

Source

pub const ENOANO: Self

No anode

Source

pub const EBADRQC: Self

Invalid request code

Source

pub const EBADSLT: Self

Invalid slot

Source

pub const EDEADLOCK: Self

File locking deadlock error

Source

pub const EBFONT: Self

Bad font file format

Source

pub const ELIBEXEC: Self

Cannot exec a shared library directly

Source

pub const ENODATA: Self

No data available

Source

pub const ELIBBAD: Self

Accessing a corrupted shared library

Source

pub const ENOPKG: Self

Package not installed

Source

pub const ELIBACC: Self

Can not access a needed shared library

Source

pub const ENOTUNIQ: Self

Name not unique on network

Source

pub const ERESTART: Self

Interrupted syscall should be restarted

Source

pub const EUCLEAN: Self

Structure needs cleaning

Source

pub const ENOTNAM: Self

Not a XENIX named type file

Source

pub const ENAVAIL: Self

No XENIX semaphores available

Source

pub const EISNAM: Self

Is a named type file

Source

pub const EREMOTEIO: Self

Remote I/O error

Source

pub const EILSEQ: Self

Illegal byte sequence

Source

pub const ELIBMAX: Self

Atmpt to link in too many shared libs

Source

pub const ELIBSCN: Self

.lib section in a.out corrupted

Source

pub const ENOMEDIUM: Self

No medium found

Source

pub const EMEDIUMTYPE: Self

Wrong medium type

Source

pub const ECANCELED: Self

Operation Cancelled

Source

pub const ENOKEY: Self

Required key not available

Source

pub const EKEYEXPIRED: Self

Key has expired

Source

pub const EKEYREVOKED: Self

Key has been revoked

Source

pub const EKEYREJECTED: Self

Key was rejected by service

Source

pub const EOWNERDEAD: Self

Owner died

Source

pub const ENOTRECOVERABLE: Self

State not recoverable

Source

pub const ERFKILL: Self

Operation not possible due to RF-kill

Source

pub const EHWPOISON: Self

Memory page has hardware error

Source

pub const ERESTARTSYS: Self

Restart syscall

Source

pub const ERESTARTNOINTR: Self

Restart if no interrupt

Source

pub const ERESTARTNOHAND: Self

restart if no handler..

Source

pub const ENOIOCTLCMD: Self

No ioctl command

Source

pub const ERESTART_RESTARTBLOCK: Self

restart by calling sys_restart_syscall

Source

pub const EPROBE_DEFER: Self

Driver requests probe retry

Source

pub const EOPENSTALE: Self

open found a stale dentry

Source

pub const ENOPARAM: Self

Parameter not supported

Source

pub const EBADHANDLE: Self

Illegal NFS file handle

Source

pub const ENOTSYNC: Self

Update synchronization mismatch

Source

pub const EBADCOOKIE: Self

Cookie is stale

Source

pub const ENOTSUPP: Self

Operation is not supported

Source

pub const ETOOSMALL: Self

Buffer or request is too small

Source

pub const ESERVERFAULT: Self

An untranslatable error occurred

Source

pub const EBADTYPE: Self

Type not supported by server

Source

pub const EJUKEBOX: Self

Request initiated, but will not complete before timeout

Source

pub const EIOCBQUEUED: Self

iocb queued, will get completion event

Source

pub const ERECALLCONFLICT: Self

conflict with recalled state

Source

pub const ENOGRACE: Self

NFS file lock reclaim refused

Source

pub const EWOULDBLOCK: Self = Self::EAGAIN

Alias for Self::EAGAIN

Source

pub const MIN: i32 = 1i32

Source

pub const MAX: i32 = 531i32

Trait Implementations§

Source§

impl Clone for Errno

Source§

fn clone(&self) -> Errno

Returns a duplicate of the value. Read more
1.0.0§

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

Available on crate feature std only.
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 Error for Errno

Available on crate feature no_std_io-compat only.
Source§

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

The lower-level source of this error, if any. Read more
Source§

impl From<Errno> for Error

Available on crate feature std only.
Source§

fn from(value: Errno) -> Self

Converts to this type from the input type.
Source§

impl From<Errno> for Error

Available on crate feature no_std_io-compat only.
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§

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.