Enum Errno

#[repr(i32)]
#[non_exhaustive]
pub enum Errno

Variants

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

Implementations

impl Errno

fn last() -> Self

Returns the current value of errno

fn last_raw() -> i32

Returns the current raw i32 value of errno

fn set(self)

Sets the value of errno.

Example

use nix::errno::Errno;

Errno::EIO.set();

assert_eq!(Errno::last(), Errno::EIO);
fn set_raw(errno: i32)

Sets the raw i32 value of errno.

const fn from_i32(err: i32) -> Errno
const fn from_raw(err: i32) -> Errno
fn desc(self) -> &'static str
fn clear()

Sets the platform-specific errno to no-error

use nix::errno::Errno;

Errno::EIO.set();

Errno::clear();

let err = Errno::last();
assert_ne!(err, Errno::EIO);
assert_eq!(err, Errno::from_raw(0));
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.

impl Errno

const EWOULDBLOCK: Errno = Errno::EAGAIN;
const EDEADLOCK: Errno = Errno::EDEADLK;
const ENOTSUP: Errno = Errno::EOPNOTSUPP;

Trait Implementations

impl Clone for Errno

fn clone(&self) -> Self

impl Copy for Errno

impl Debug for Errno

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

impl Display for Errno

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

impl Eq for Errno

impl Error for Errno

impl PartialEq for Errno

fn eq(&self, other: &Self) -> bool

impl StructuralPartialEq for Errno

impl TryFrom<Error> for Errno

type Error = Error;
fn try_from(ioerror: Error) -> Result<Self, Error>

Auto Trait Implementations

impl Freeze for Errno

impl RefUnwindSafe for Errno

impl Send for Errno

impl Sync for Errno

impl Unpin for Errno

impl UnsafeUnpin for Errno

impl UnwindSafe for Errno

Blanket Implementations

impl<T> Any for Errno where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for Errno where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for Errno where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> CloneToUninit for Errno where T: Clone,

unsafe fn clone_to_uninit(&self, dest: *mut u8)

impl<T> From<T> for Errno

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for Errno where T: Clone,

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

impl<T> ToString for Errno where T: Display + ?Sized,

fn to_string(&self) -> String

impl<T, U> Into<U> for Errno 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, U> TryFrom<U> for Errno where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for Errno where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>