Struct linux_errnos::linux::generic::Errno
source · #[repr(transparent)]pub struct Errno(_);
target_arch="hexagon"
or s390x or M68k or RISC-V RV32 or RISC-V RV64 or LoongArch LA64) and Linux, or crate feature aarch64
, or crate feature arc
, or crate feature arm
, or crate feature arm64
, or crate feature csky
, or crate feature generic
, or crate feature hexagon
, or crate feature ia64
, or crate feature loongarch
, or crate feature loongarch64
, or crate feature m68k
, or crate feature microblaze
, or crate feature nios2
, or crate feature openrisc
, or crate feature riscv
, or crate feature riscv32
, or crate feature riscv64
, or crate feature s390
, or crate feature s390x
, or crate feature sh
, or crate feature um
, or crate feature x86
, or crate feature x86_64
, or crate feature xtensa
only.Expand description
Error number representation.
Implementations§
source§impl Errno
impl Errno
sourcepub fn is_valid(&self) -> bool
pub fn is_valid(&self) -> bool
Returns true
if the error code is in valid range (lower than 4096)
sourcepub fn from_ret(value: usize) -> Result<usize, Errno>
pub fn from_ret(value: usize) -> Result<usize, Errno>
Returns a new Errno
from a syscall’s result.
sourcepub fn name(&self) -> Option<&'static str>
pub fn name(&self) -> Option<&'static str>
Returns the name of the error if it’s known. Generally the name of the constant.
sourcepub fn description(&self) -> Option<&'static str>
pub fn description(&self) -> Option<&'static str>
Returns a description of the error if it’s known.
sourcepub fn from_io_error(err: Error) -> Option<Self>
Available on crate feature std
only.
pub fn from_io_error(err: Error) -> Option<Self>
std
only.Returns a new Errno
if the given error is generated from a system error.
None otherwise.
source§impl Errno
impl Errno
sourcepub const ENAMETOOLONG: Self = _
pub const ENAMETOOLONG: Self = _
File name too long
sourcepub const EDESTADDRREQ: Self = _
pub const EDESTADDRREQ: Self = _
Destination address required
sourcepub const EPROTOTYPE: Self = _
pub const EPROTOTYPE: Self = _
Protocol wrong type for socket
sourcepub const ENOPROTOOPT: Self = _
pub const ENOPROTOOPT: Self = _
Protocol not available
sourcepub const EPROTONOSUPPORT: Self = _
pub const EPROTONOSUPPORT: Self = _
Protocol not supported
sourcepub const ESOCKTNOSUPPORT: Self = _
pub const ESOCKTNOSUPPORT: Self = _
Socket type not supported
sourcepub const EOPNOTSUPP: Self = _
pub const EOPNOTSUPP: Self = _
Operation not supported on transport endpoint
sourcepub const EPFNOSUPPORT: Self = _
pub const EPFNOSUPPORT: Self = _
Protocol family not supported
sourcepub const EAFNOSUPPORT: Self = _
pub const EAFNOSUPPORT: Self = _
Address family not supported by protocol
sourcepub const EADDRINUSE: Self = _
pub const EADDRINUSE: Self = _
Address already in use
sourcepub const EADDRNOTAVAIL: Self = _
pub const EADDRNOTAVAIL: Self = _
Cannot assign requested address
sourcepub const ENETUNREACH: Self = _
pub const ENETUNREACH: Self = _
Network is unreachable
sourcepub const ECONNABORTED: Self = _
pub const ECONNABORTED: Self = _
Software caused connection abort
sourcepub const ECONNRESET: Self = _
pub const ECONNRESET: Self = _
Connection reset by peer
sourcepub const ETOOMANYREFS: Self = _
pub const ETOOMANYREFS: Self = _
Too many references: cannot splice
sourcepub const ECONNREFUSED: Self = _
pub const ECONNREFUSED: Self = _
Connection refused
sourcepub const EHOSTUNREACH: Self = _
pub const EHOSTUNREACH: Self = _
No route to host
sourcepub const EINPROGRESS: Self = _
pub const EINPROGRESS: Self = _
Operation now in progress
sourcepub const EMEDIUMTYPE: Self = _
pub const EMEDIUMTYPE: Self = _
Wrong medium type
sourcepub const EKEYEXPIRED: Self = _
pub const EKEYEXPIRED: Self = _
Key has expired
sourcepub const EKEYREVOKED: Self = _
pub const EKEYREVOKED: Self = _
Key has been revoked
sourcepub const EKEYREJECTED: Self = _
pub const EKEYREJECTED: Self = _
Key was rejected by service
sourcepub const EOWNERDEAD: Self = _
pub const EOWNERDEAD: Self = _
Owner died
sourcepub const ENOTRECOVERABLE: Self = _
pub const ENOTRECOVERABLE: Self = _
State not recoverable
sourcepub const ERESTARTSYS: Self = _
pub const ERESTARTSYS: Self = _
Restart syscall
sourcepub const ERESTARTNOINTR: Self = _
pub const ERESTARTNOINTR: Self = _
Restart if no interrupt
sourcepub const ERESTARTNOHAND: Self = _
pub const ERESTARTNOHAND: Self = _
restart if no handler..
sourcepub const ENOIOCTLCMD: Self = _
pub const ENOIOCTLCMD: Self = _
No ioctl command
sourcepub const ERESTART_RESTARTBLOCK: Self = _
pub const ERESTART_RESTARTBLOCK: Self = _
restart by calling sys_restart_syscall
sourcepub const EPROBE_DEFER: Self = _
pub const EPROBE_DEFER: Self = _
Driver requests probe retry
sourcepub const EOPENSTALE: Self = _
pub const EOPENSTALE: Self = _
open found a stale dentry
sourcepub const EBADHANDLE: Self = _
pub const EBADHANDLE: Self = _
Illegal NFS file handle
sourcepub const EBADCOOKIE: Self = _
pub const EBADCOOKIE: Self = _
Cookie is stale
sourcepub const ESERVERFAULT: Self = _
pub const ESERVERFAULT: Self = _
An untranslatable error occurred
sourcepub const EIOCBQUEUED: Self = _
pub const EIOCBQUEUED: Self = _
iocb queued, will get completion event
sourcepub const ERECALLCONFLICT: Self = _
pub const ERECALLCONFLICT: Self = _
conflict with recalled state
sourcepub const EDEADLOCK: Self = Self::EDEADLK
pub const EDEADLOCK: Self = Self::EDEADLK
Alias for Self::EDEADLK
sourcepub const EWOULDBLOCK: Self = Self::EAGAIN
pub const EWOULDBLOCK: Self = Self::EAGAIN
Alias for Self::EAGAIN
pub const MIN: i32 = 1i32
pub const MAX: i32 = 531i32
source§impl Errno
impl Errno
sourcepub fn last_os_error() -> Self
Available on (Linux or Android) and (x86 or x86-64 or ARM or AArch64), or (target_arch="hexagon"
or s390x or PowerPC or PowerPC-64 or MIPS or MIPS-64 or M68k or RISC-V RV32 or RISC-V RV64 or target_arch="sparc"
or SPARC64 or LoongArch LA64) and Linux only.
pub fn last_os_error() -> Self
target_arch="hexagon"
or s390x or PowerPC or PowerPC-64 or MIPS or MIPS-64 or M68k or RISC-V RV32 or RISC-V RV64 or target_arch="sparc"
or SPARC64 or LoongArch LA64) and Linux only.Returns a new Errno
from last OS error.
Trait Implementations§
source§impl Error for Errno
Available on crate feature std
only.
impl Error for Errno
std
only.