Struct rustix::io::Error
#[repr(transparent)]
pub struct Error(_);
Documentation
The error type for rustix
APIs.
This is similar to std::io::Error
, but only holds an OS error code,
and no extra error value.
Implementations
impl Error
pub fn from_io_error(io_err: &std::io::Error) -> Option<Self>
Extract an Error
value from a std::io::Error
.
This isn’t a From
conversion because it’s expected to be relatively
uncommon.
pub const fn raw_os_error(Self) -> i32
Extract the raw OS error number from this error.
pub const fn from_raw_os_error(raw: i32) -> Self
Construct an Error
from a raw OS error number.
impl Error
const ACCESS: Self = _
EACCES
const ADDRINUSE: Self = _
EADDRINUSE
const ADDRNOTAVAIL: Self = _
EADDRNOTAVAIL
const ADV: Self = _
EADV
const AFNOSUPPORT: Self = _
EAFNOSUPPORT
const AGAIN: Self = _
EAGAIN
const ALREADY: Self = _
EALREADY
const BADE: Self = _
EBADE
const BADF: Self = _
EBADF
const BADFD: Self = _
EBADFD
const BADMSG: Self = _
EBADMSG
const BADR: Self = _
EBADR
const BADRQC: Self = _
EBADRQC
const BADSLT: Self = _
EBADSLT
const BFONT: Self = _
EBFONT
const BUSY: Self = _
EBUSY
const CANCELED: Self = _
ECANCELED
const CHILD: Self = _
ECHILD
const CHRNG: Self = _
ECHRNG
const COMM: Self = _
ECOMM
const CONNABORTED: Self = _
ECONNABORTED
const CONNREFUSED: Self = _
ECONNREFUSED
const CONNRESET: Self = _
ECONNRESET
const DEADLK: Self = _
EDEADLK
const DEADLOCK: Self = _
EDEADLOCK
const DESTADDRREQ: Self = _
EDESTADDRREQ
const DOM: Self = _
EDOM
const DOTDOT: Self = _
EDOTDOT
const DQUOT: Self = _
EDQUOT
const EXIST: Self = _
EEXIST
const FAULT: Self = _
EFAULT
const FBIG: Self = _
EFBIG
const HOSTDOWN: Self = _
EHOSTDOWN
const HOSTUNREACH: Self = _
EHOSTUNREACH
const HWPOISON: Self = _
EHWPOISON
const IDRM: Self = _
EIDRM
const ILSEQ: Self = _
EILSEQ
const INPROGRESS: Self = _
EINPROGRESS
const INTR: Self = _
EINTR
.
For a convenient way to retry system calls that exit with INTR
, use
with_retrying
.
const INVAL: Self = _
EINVAL
const IO: Self = _
EIO
const ISCONN: Self = _
EISCONN
const ISDIR: Self = _
EISDIR
const ISNAM: Self = _
EISNAM
const KEYEXPIRED: Self = _
EKEYEXPIRED
const KEYREJECTED: Self = _
EKEYREJECTED
const KEYREVOKED: Self = _
EKEYREVOKED
const L2HLT: Self = _
EL2HLT
const L2NSYNC: Self = _
EL2NSYNC
const L3HLT: Self = _
EL3HLT
const L3RST: Self = _
EL3RST
const LIBACC: Self = _
ELIBACC
const LIBBAD: Self = _
ELIBBAD
const LIBEXEC: Self = _
ELIBEXEC
const LIBMAX: Self = _
ELIBMAX
const LIBSCN: Self = _
ELIBSCN
const LNRNG: Self = _
ELNRNG
const LOOP: Self = _
ELOOP
const MEDIUMTYPE: Self = _
EMEDIUMTYPE
const MFILE: Self = _
EMFILE
const MLINK: Self = _
EMLINK
const MSGSIZE: Self = _
EMSGSIZE
const MULTIHOP: Self = _
EMULTIHOP
const NAMETOOLONG: Self = _
ENAMETOOLONG
const NAVAIL: Self = _
ENAVAIL
const NETDOWN: Self = _
ENETDOWN
const NETRESET: Self = _
ENETRESET
const NETUNREACH: Self = _
ENETUNREACH
const NFILE: Self = _
ENFILE
const NOANO: Self = _
ENOANO
const NOBUFS: Self = _
ENOBUFS
const NOCSI: Self = _
ENOCSI
const NODATA: Self = _
ENODATA
const NODEV: Self = _
ENODEV
const NOENT: Self = _
ENOENT
const NOEXEC: Self = _
ENOEXEC
const NOKEY: Self = _
ENOKEY
const NOLCK: Self = _
ENOLCK
const NOLINK: Self = _
ENOLINK
const NOMEDIUM: Self = _
ENOMEDIUM
const NOMEM: Self = _
ENOMEM
const NOMSG: Self = _
ENOMSG
const NONET: Self = _
ENONET
const NOPKG: Self = _
ENOPKG
const NOPROTOOPT: Self = _
ENOPROTOOPT
const NOSPC: Self = _
ENOSPC
const NOSR: Self = _
ENOSR
const NOSTR: Self = _
ENOSTR
const NOSYS: Self = _
ENOSYS
const NOTBLK: Self = _
ENOTBLK
const NOTCONN: Self = _
ENOTCONN
const NOTDIR: Self = _
ENOTDIR
const NOTEMPTY: Self = _
ENOTEMPTY
const NOTNAM: Self = _
ENOTNAM
const NOTRECOVERABLE: Self = _
ENOTRECOVERABLE
const NOTSOCK: Self = _
ENOTSOCK
const NOTSUP: Self = _
ENOTSUP
const NOTTY: Self = _
ENOTTY
const NOTUNIQ: Self = _
ENOTUNIQ
const NXIO: Self = _
ENXIO
const OPNOTSUPP: Self = _
EOPNOTSUPP
const OVERFLOW: Self = _
EOVERFLOW
const OWNERDEAD: Self = _
EOWNERDEAD
const PERM: Self = _
EPERM
const PFNOSUPPORT: Self = _
EPFNOSUPPORT
const PIPE: Self = _
EPIPE
const PROTO: Self = _
EPROTO
const PROTONOSUPPORT: Self = _
EPROTONOSUPPORT
const PROTOTYPE: Self = _
EPROTOTYPE
const RANGE: Self = _
ERANGE
const REMCHG: Self = _
EREMCHG
const REMOTE: Self = _
EREMOTE
const REMOTEIO: Self = _
EREMOTEIO
const RESTART: Self = _
ERESTART
const RFKILL: Self = _
ERFKILL
const ROFS: Self = _
EROFS
const SHUTDOWN: Self = _
ESHUTDOWN
const SOCKTNOSUPPORT: Self = _
ESOCKTNOSUPPORT
const SPIPE: Self = _
ESPIPE
const SRCH: Self = _
ESRCH
const SRMNT: Self = _
ESRMNT
const STALE: Self = _
ESTALE
const STRPIPE: Self = _
ESTRPIPE
const TIME: Self = _
ETIME
const TIMEDOUT: Self = _
ETIMEDOUT
const TOOBIG: Self = _
E2BIG
const TOOMANYREFS: Self = _
ETOOMANYREFS
const TXTBSY: Self = _
ETXTBSY
const UCLEAN: Self = _
EUCLEAN
const UNATCH: Self = _
EUNATCH
const USERS: Self = _
EUSERS
const WOULDBLOCK: Self = _
EWOULDBLOCK
const XDEV: Self = _
EXDEV
const XFULL: Self = _
EXFULL
impl Error
pub fn kind(Self) -> std::io::ErrorKind
Shorthand for std::io::Error::from(self).kind()
.
Trait Implementations
impl Debug for Error
fn fmt(&Self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result
impl Display for Error
fn fmt(&Self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result
impl From<Error> for std::io::Error
impl Hash for Error
fn hash<__H: $crate::hash::Hasher>(&Self, state: &mut __H) -> ()
impl StructuralEq for Error
impl StructuralPartialEq for Error
Auto Trait Implementations
impl RefUnwindSafe for Error
impl UnwindSafe for Error
Blanket Implementations
impl<T> BorrowMut<T> for T
where
T: ?Sized,
where
T: ?Sized,
fn borrow_mut(&mut Self) -> &mut T