pub struct Errno(/* private fields */);
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 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) and crate feature libc-compat
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) and crate feature libc-compat
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.1.30.0§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl Ord for Errno
impl Ord for Errno
Source§impl PartialOrd for Errno
impl PartialOrd for Errno
impl Copy for Errno
impl Eq for Errno
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 Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit
)