Enum nix::errno::Errno

#[repr(i32)]
#[non_exhaustive]
pub enum Errno {    
    UnknownErrno,
    EPERM,
    ENOENT,
    ESRCH,
    EINTR,
    EIO,
    ENXIO,
    E2BIG,
    ENOEXEC,
    EBADF,
    ECHILD,
    EAGAIN,
    ENOMEM,
    EACCES,
    EFAULT,
    ENOTBLK,
    EBUSY,
    EEXIST,
    EXDEV,
    ENODEV,
    ENOTDIR,
    EISDIR,
    EINVAL,
    ENFILE,
    EMFILE,
    ENOTTY,
    ETXTBSY,
    EFBIG,
    ENOSPC,
    ESPIPE,
    EROFS,
    EMLINK,
    EPIPE,
    EDOM,
    ERANGE,
    EDEADLK,
    ENAMETOOLONG,
    ENOLCK,
    ENOSYS,
    ENOTEMPTY,
    ELOOP,
    ENOMSG,
    EIDRM,
    ECHRNG,
    EL2NSYNC,
    EL3HLT,
    EL3RST,
    ELNRNG,
    EUNATCH,
    ENOCSI,
    EL2HLT,
    EBADE,
    EBADR,
    EXFULL,
    ENOANO,
    EBADRQC,
    EBADSLT,
    EBFONT,
    ENOSTR,
    ENODATA,
    ETIME,
    ENOSR,
    ENONET,
    ENOPKG,
    EREMOTE,
    ENOLINK,
    EADV,
    ESRMNT,
    ECOMM,
    EPROTO,
    EMULTIHOP,
    EDOTDOT,
    EBADMSG,
    EOVERFLOW,
    ENOTUNIQ,
    EBADFD,
    EREMCHG,
    ELIBACC,
    ELIBBAD,
    ELIBSCN,
    ELIBMAX,
    ELIBEXEC,
    EILSEQ,
    ERESTART,
    ESTRPIPE,
    EUSERS,
    ENOTSOCK,
    EDESTADDRREQ,
    EMSGSIZE,
    EPROTOTYPE,
    ENOPROTOOPT,
    EPROTONOSUPPORT,
    ESOCKTNOSUPPORT,
    EOPNOTSUPP,
    EPFNOSUPPORT,
    EAFNOSUPPORT,
    EADDRINUSE,
    EADDRNOTAVAIL,
    ENETDOWN,
    ENETUNREACH,
    ENETRESET,
    ECONNABORTED,
    ECONNRESET,
    ENOBUFS,
    EISCONN,
    ENOTCONN,
    ESHUTDOWN,
    ETOOMANYREFS,
    ETIMEDOUT,
    ECONNREFUSED,
    EHOSTDOWN,
    EHOSTUNREACH,
    EALREADY,
    EINPROGRESS,
    ESTALE,
    EUCLEAN,
    ENOTNAM,
    ENAVAIL,
    EISNAM,
    EREMOTEIO,
    EDQUOT,
    ENOMEDIUM,
    EMEDIUMTYPE,
    ECANCELED,
    ENOKEY,
    EKEYEXPIRED,
    EKEYREVOKED,
    EKEYREJECTED,
    EOWNERDEAD,
    ENOTRECOVERABLE,
    ERFKILL,
    EHWPOISON,
}

Variants

UnknownErrno
EPERM
ENOENT
ESRCH
EINTR
EIO
ENXIO
E2BIG
ENOEXEC
EBADF
ECHILD
EAGAIN
ENOMEM
EACCES
EFAULT
ENOTBLK
EBUSY
EEXIST
EXDEV
ENODEV
ENOTDIR
EISDIR
EINVAL
ENFILE
EMFILE
ENOTTY
ETXTBSY
EFBIG
ENOSPC
ESPIPE
EROFS
EPIPE
EDOM
ERANGE
EDEADLK
ENAMETOOLONG
ENOLCK
ENOSYS
ENOTEMPTY
ELOOP
ENOMSG
EIDRM
ECHRNG
EL2NSYNC
EL3HLT
EL3RST
ELNRNG
EUNATCH
ENOCSI
EL2HLT
EBADE
EBADR
EXFULL
ENOANO
EBADRQC
EBADSLT
EBFONT
ENOSTR
ENODATA
ETIME
ENOSR
ENONET
ENOPKG
EREMOTE
EADV
ESRMNT
ECOMM
EPROTO
EMULTIHOP
EDOTDOT
EBADMSG
EOVERFLOW
ENOTUNIQ
EBADFD
EREMCHG
ELIBACC
ELIBBAD
ELIBSCN
ELIBMAX
ELIBEXEC
EILSEQ
ERESTART
ESTRPIPE
EUSERS
ENOTSOCK
EDESTADDRREQ
EMSGSIZE
EPROTOTYPE
ENOPROTOOPT
EPROTONOSUPPORT
ESOCKTNOSUPPORT
EOPNOTSUPP
EPFNOSUPPORT
EAFNOSUPPORT
EADDRINUSE
EADDRNOTAVAIL
ENETDOWN
ENETUNREACH
ENETRESET
ECONNABORTED
ECONNRESET
ENOBUFS
EISCONN
ENOTCONN
ESHUTDOWN
ETOOMANYREFS
ETIMEDOUT
ECONNREFUSED
EHOSTDOWN
EHOSTUNREACH
EALREADY
EINPROGRESS
ESTALE
EUCLEAN
ENOTNAM
ENAVAIL
EISNAM
EREMOTEIO
EDQUOT
ENOMEDIUM
EMEDIUMTYPE
ECANCELED
ENOKEY
EKEYEXPIRED
EKEYREVOKED
EKEYREJECTED
EOWNERDEAD
ENOTRECOVERABLE
ERFKILL
EHWPOISON

Implementations

impl Errno
const EWOULDBLOCK: Errno = Errno::EAGAIN
const EDEADLOCK: Errno = Errno::EDEADLK
const ENOTSUP: Errno = Errno::EOPNOTSUPP
impl Errno
pub const fn as_errno(Self) -> Option<Self>

Convert this Error to an Errno.

Example

let e = Error::from(Errno::EPERM);
assert_eq!(Some(Errno::EPERM), e.as_errno());
pub fn from_errno(errno: Errno) -> Error

Create a nix Error from a given errno

pub const fn invalid_argument() -> Error

Create a new invalid argument error (EINVAL)

pub fn last() -> Self
pub fn desc(Self) -> &'static str
pub const fn from_i32(err: i32) -> Errno
pub fn clear()
pub fn result<S: ErrnoSentinel + PartialEq<S>>(value: S) -> Result<S>

Returns Ok(value) if it does not contain the sentinel value. This should not be used when -1 is not the errno sentinel value.

pub const fn Sys(errno: Errno) -> Error

Backwards compatibility hack for Nix <= 0.21.0 users

In older versions of Nix, Error::Sys was an enum variant. Now it’s a function, which is compatible with most of the former use cases of the enum variant. But you should use Error(Errno::...) instead.

Trait Implementations

impl Clone for Errno
fn clone(&Self) -> Errno
impl Copy for Errno
impl Debug for Errno
fn fmt(&Self, f: &mut $crate::fmt::Formatter<'_>) -> $crate::fmt::Result
impl Display for Errno
fn fmt(&Self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Eq for Errno
impl Error for Errno
impl From<Errno> for io::Error
fn from(err: Errno) -> Self
impl PartialEq<Errno> for Errno
fn eq(&Self, other: &Errno) -> bool
impl StructuralEq for Errno
impl TryFrom<Error> for Errno
type Error = Error
fn try_from(ioerror: io::Error) -> std::result::Result<Self, io::Error>

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

impl<T> Any for T
where
    T: 'static + ?Sized,
fn type_id(&Self) -> TypeId
impl<T> Borrow<T> for T
where
    T: ?Sized,
fn borrow(&Self) -> &T
impl<T> BorrowMut<T> for T
where
    T: ?Sized,
fn borrow_mut(&mut Self) -> &mut T
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
fn to_owned(&Self) -> T
fn clone_into(&Self, target: &mut T)
impl<T> ToString for T
where
    T: Display + ?Sized,
fn to_string(&Self) -> String
impl<T, U> TryFrom<U> for T
where
    U: Into<T>,
type Error = Infallible
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto<U> for T
where
    U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
fn try_into(Self) -> Result<U, <U as TryFrom<T>>::Error>