Struct linux_stat::Errno

#[repr(transparent)]
pub struct Errno(_);
Expand description

Error number representation.

Implementations§

§

impl Errno

pub fn new(num: i32) -> Errno

Returns a new Errno from the given integer.

pub fn into_raw(self) -> i32

Converts Errno into the under underlining integer.

pub fn is_valid(&self) -> bool

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

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

Returns a new Errno from a syscall’s result.

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

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

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

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

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

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

pub fn last_os_error() -> Errno

Returns a new Errno from last OS error.

§

impl Errno

pub const EPERM: Errno = Self(1)

Operation not permitted

pub const ENOENT: Errno = Self(2)

No such file or directory

pub const ESRCH: Errno = Self(3)

No such process

pub const EINTR: Errno = Self(4)

Interrupted system call

pub const EIO: Errno = Self(5)

I/O error

pub const ENXIO: Errno = Self(6)

No such device or address

pub const E2BIG: Errno = Self(7)

Argument list too long

pub const ENOEXEC: Errno = Self(8)

Exec format error

pub const EBADF: Errno = Self(9)

Bad file number

pub const ECHILD: Errno = Self(10)

No child processes

pub const EAGAIN: Errno = Self(11)

Try again

pub const ENOMEM: Errno = Self(12)

Out of memory

pub const EACCES: Errno = Self(13)

Permission denied

pub const EFAULT: Errno = Self(14)

Bad address

pub const ENOTBLK: Errno = Self(15)

Block device required

pub const EBUSY: Errno = Self(16)

Device or resource busy

pub const EEXIST: Errno = Self(17)

File exists

pub const EXDEV: Errno = Self(18)

Cross-device link

pub const ENODEV: Errno = Self(19)

No such device

pub const ENOTDIR: Errno = Self(20)

Not a directory

pub const EISDIR: Errno = Self(21)

Is a directory

pub const EINVAL: Errno = Self(22)

Invalid argument

pub const ENFILE: Errno = Self(23)

File table overflow

pub const EMFILE: Errno = Self(24)

Too many open files

pub const ENOTTY: Errno = Self(25)

Not a typewriter

pub const ETXTBSY: Errno = Self(26)

Text file busy

pub const EFBIG: Errno = Self(27)

File too large

pub const ENOSPC: Errno = Self(28)

No space left on device

pub const ESPIPE: Errno = Self(29)

Illegal seek

pub const EROFS: Errno = Self(30)

Read-only file system

Too many links

pub const EPIPE: Errno = Self(32)

Broken pipe

pub const EDOM: Errno = Self(33)

Math argument out of domain of func

pub const ERANGE: Errno = Self(34)

Math result not representable

pub const EDEADLK: Errno = Self(35)

Resource deadlock would occur

pub const ENAMETOOLONG: Errno = Self(36)

File name too long

pub const ENOLCK: Errno = Self(37)

No record locks available

pub const ENOSYS: Errno = Self(38)

Invalid system call number

pub const ENOTEMPTY: Errno = Self(39)

Directory not empty

pub const ELOOP: Errno = Self(40)

Too many symbolic links encountered

pub const ENOMSG: Errno = Self(42)

No message of desired type

pub const EIDRM: Errno = Self(43)

Identifier removed

pub const ECHRNG: Errno = Self(44)

Channel number out of range

pub const EL2NSYNC: Errno = Self(45)

Level 2 not synchronized

pub const EL3HLT: Errno = Self(46)

Level 3 halted

pub const EL3RST: Errno = Self(47)

Level 3 reset

pub const ELNRNG: Errno = Self(48)

Link number out of range

pub const EUNATCH: Errno = Self(49)

Protocol driver not attached

pub const ENOCSI: Errno = Self(50)

No CSI structure available

pub const EL2HLT: Errno = Self(51)

Level 2 halted

pub const EBADE: Errno = Self(52)

Invalid exchange

pub const EBADR: Errno = Self(53)

Invalid request descriptor

pub const EXFULL: Errno = Self(54)

Exchange full

pub const ENOANO: Errno = Self(55)

No anode

pub const EBADRQC: Errno = Self(56)

Invalid request code

pub const EBADSLT: Errno = Self(57)

Invalid slot

pub const EBFONT: Errno = Self(59)

Bad font file format

pub const ENOSTR: Errno = Self(60)

Device not a stream

pub const ENODATA: Errno = Self(61)

No data available

pub const ETIME: Errno = Self(62)

Timer expired

pub const ENOSR: Errno = Self(63)

Out of streams resources

pub const ENONET: Errno = Self(64)

Machine is not on the network

pub const ENOPKG: Errno = Self(65)

Package not installed

pub const EREMOTE: Errno = Self(66)

Object is remote

Link has been severed

pub const EADV: Errno = Self(68)

Advertise error

pub const ESRMNT: Errno = Self(69)

Srmount error

pub const ECOMM: Errno = Self(70)

Communication error on send

pub const EPROTO: Errno = Self(71)

Protocol error

pub const EMULTIHOP: Errno = Self(72)

Multihop attempted

pub const EDOTDOT: Errno = Self(73)

RFS specific error

pub const EBADMSG: Errno = Self(74)

Not a data message

pub const EOVERFLOW: Errno = Self(75)

Value too large for defined data type

pub const ENOTUNIQ: Errno = Self(76)

Name not unique on network

pub const EBADFD: Errno = Self(77)

File descriptor in bad state

pub const EREMCHG: Errno = Self(78)

Remote address changed

pub const ELIBACC: Errno = Self(79)

Can not access a needed shared library

pub const ELIBBAD: Errno = Self(80)

Accessing a corrupted shared library

pub const ELIBSCN: Errno = Self(81)

.lib section in a.out corrupted

pub const ELIBMAX: Errno = Self(82)

Attempting to link in too many shared libraries

pub const ELIBEXEC: Errno = Self(83)

Cannot exec a shared library directly

pub const EILSEQ: Errno = Self(84)

Illegal byte sequence

pub const ERESTART: Errno = Self(85)

Interrupted system call should be restarted

pub const ESTRPIPE: Errno = Self(86)

Streams pipe error

pub const EUSERS: Errno = Self(87)

Too many users

pub const ENOTSOCK: Errno = Self(88)

Socket operation on non-socket

pub const EDESTADDRREQ: Errno = Self(89)

Destination address required

pub const EMSGSIZE: Errno = Self(90)

Message too long

pub const EPROTOTYPE: Errno = Self(91)

Protocol wrong type for socket

pub const ENOPROTOOPT: Errno = Self(92)

Protocol not available

pub const EPROTONOSUPPORT: Errno = Self(93)

Protocol not supported

pub const ESOCKTNOSUPPORT: Errno = Self(94)

Socket type not supported

pub const EOPNOTSUPP: Errno = Self(95)

Operation not supported on transport endpoint

pub const EPFNOSUPPORT: Errno = Self(96)

Protocol family not supported

pub const EAFNOSUPPORT: Errno = Self(97)

Address family not supported by protocol

pub const EADDRINUSE: Errno = Self(98)

Address already in use

pub const EADDRNOTAVAIL: Errno = Self(99)

Cannot assign requested address

pub const ENETDOWN: Errno = Self(100)

Network is down

pub const ENETUNREACH: Errno = Self(101)

Network is unreachable

pub const ENETRESET: Errno = Self(102)

Network dropped connection because of reset

pub const ECONNABORTED: Errno = Self(103)

Software caused connection abort

pub const ECONNRESET: Errno = Self(104)

Connection reset by peer

pub const ENOBUFS: Errno = Self(105)

No buffer space available

pub const EISCONN: Errno = Self(106)

Transport endpoint is already connected

pub const ENOTCONN: Errno = Self(107)

Transport endpoint is not connected

pub const ESHUTDOWN: Errno = Self(108)

Cannot send after transport endpoint shutdown

pub const ETOOMANYREFS: Errno = Self(109)

Too many references: cannot splice

pub const ETIMEDOUT: Errno = Self(110)

Connection timed out

pub const ECONNREFUSED: Errno = Self(111)

Connection refused

pub const EHOSTDOWN: Errno = Self(112)

Host is down

pub const EHOSTUNREACH: Errno = Self(113)

No route to host

pub const EALREADY: Errno = Self(114)

Operation already in progress

pub const EINPROGRESS: Errno = Self(115)

Operation now in progress

pub const ESTALE: Errno = Self(116)

Stale file handle

pub const EUCLEAN: Errno = Self(117)

Structure needs cleaning

pub const ENOTNAM: Errno = Self(118)

Not a XENIX named type file

pub const ENAVAIL: Errno = Self(119)

No XENIX semaphores available

pub const EISNAM: Errno = Self(120)

Is a named type file

pub const EREMOTEIO: Errno = Self(121)

Remote I/O error

pub const EDQUOT: Errno = Self(122)

Quota exceeded

pub const ENOMEDIUM: Errno = Self(123)

No medium found

pub const EMEDIUMTYPE: Errno = Self(124)

Wrong medium type

pub const ECANCELED: Errno = Self(125)

Operation Canceled

pub const ENOKEY: Errno = Self(126)

Required key not available

pub const EKEYEXPIRED: Errno = Self(127)

Key has expired

pub const EKEYREVOKED: Errno = Self(128)

Key has been revoked

pub const EKEYREJECTED: Errno = Self(129)

Key was rejected by service

pub const EOWNERDEAD: Errno = Self(130)

Owner died

pub const ENOTRECOVERABLE: Errno = Self(131)

State not recoverable

pub const ERFKILL: Errno = Self(132)

Operation not possible due to RF-kill

pub const EHWPOISON: Errno = Self(133)

Memory page has hardware error

pub const ERESTARTSYS: Errno = Self(512)

Restart syscall

pub const ERESTARTNOINTR: Errno = Self(513)

Restart if no interrupt

pub const ERESTARTNOHAND: Errno = Self(514)

restart if no handler..

pub const ENOIOCTLCMD: Errno = Self(515)

No ioctl command

pub const ERESTART_RESTARTBLOCK: Errno = Self(516)

restart by calling sys_restart_syscall

pub const EPROBE_DEFER: Errno = Self(517)

Driver requests probe retry

pub const EOPENSTALE: Errno = Self(518)

open found a stale dentry

pub const ENOPARAM: Errno = Self(519)

Parameter not supported

pub const EBADHANDLE: Errno = Self(521)

Illegal NFS file handle

pub const ENOTSYNC: Errno = Self(522)

Update synchronization mismatch

pub const EBADCOOKIE: Errno = Self(523)

Cookie is stale

pub const ENOTSUPP: Errno = Self(524)

Operation is not supported

pub const ETOOSMALL: Errno = Self(525)

Buffer or request is too small

pub const ESERVERFAULT: Errno = Self(526)

An untranslatable error occurred

pub const EBADTYPE: Errno = Self(527)

Type not supported by server

pub const EJUKEBOX: Errno = Self(528)

Request initiated, but will not complete before timeout

pub const EIOCBQUEUED: Errno = Self(529)

iocb queued, will get completion event

pub const ERECALLCONFLICT: Errno = Self(530)

conflict with recalled state

pub const ENOGRACE: Errno = Self(531)

NFS file lock reclaim refused

pub const EDEADLOCK: Errno = Self::EDEADLK

Alias for Self::EDEADLK

pub const EWOULDBLOCK: Errno = Self::EAGAIN

Alias for Self::EAGAIN

pub const MIN: i32 = 1i32

pub const MAX: i32 = 531i32

Trait Implementations§

§

impl Clone for Errno

§

fn clone(&self) -> Errno

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 Errno

§

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

Formats the value using the given formatter. Read more
§

impl Display for Errno

§

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

Formats the value using the given formatter. Read more
§

impl Error for Errno

1.30.0 · source§

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

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

fn description(&self) -> &str

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

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

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

fn provide<'a>(&'a self, demand: &mut Demand<'a>)

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

impl Hash for Errno

§

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
§

impl Ord for Errno

§

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

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

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

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

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

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

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
§

impl PartialEq<Errno> for Errno

§

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

§

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

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

This method 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

This method 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

This method 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

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

impl Copy for Errno

§

impl Eq for Errno

§

impl StructuralEq for Errno

§

impl StructuralPartialEq for Errno

Auto Trait Implementations§

§

impl RefUnwindSafe for Errno

§

impl Send for Errno

§

impl Sync for Errno

§

impl Unpin for Errno

§

impl UnwindSafe for Errno

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<E> Provider for Ewhere E: Error + ?Sized,

source§

fn provide<'a>(&'a self, demand: &mut Demand<'a>)

🔬This is a nightly-only experimental API. (provide_any)
Data providers should implement this method to provide all values they are able to provide by using demand. Read more
source§

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