Struct rustix::io::Errno

source ·
pub struct Errno(/* private fields */);
Expand description

errno—An error code.

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.

References

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§

source§

impl Errno

source

pub const ACCESS: Self = _

EACCES

source

pub const ADDRINUSE: Self = _

EADDRINUSE

source

pub const ADDRNOTAVAIL: Self = _

EADDRNOTAVAIL

source

pub const AFNOSUPPORT: Self = _

EAFNOSUPPORT

source

pub const AGAIN: Self = _

EAGAIN

source

pub const ALREADY: Self = _

EALREADY

source

pub const BADF: Self = _

EBADF

source

pub const CANCELED: Self = _

ECANCELED

source

pub const CONNABORTED: Self = _

ECONNABORTED

source

pub const CONNREFUSED: Self = _

ECONNREFUSED

source

pub const CONNRESET: Self = _

ECONNRESET

source

pub const DESTADDRREQ: Self = _

EDESTADDRREQ

source

pub const DISCON: Self = _

EDISCON

source

pub const DQUOT: Self = _

EDQUOT

source

pub const FAULT: Self = _

EFAULT

source

pub const HOSTDOWN: Self = _

EHOSTDOWN

source

pub const HOSTUNREACH: Self = _

EHOSTUNREACH

source

pub const INPROGRESS: Self = _

EINPROGRESS

source

pub const INTR: Self = _

EINTR

For a convenient way to retry system calls that exit with INTR, use retry_on_intr.

source

pub const INVAL: Self = _

EINVAL

source

pub const INVALIDPROCTABLE: Self = _

EINVALIDPROCTABLE

source

pub const INVALIDPROVIDER: Self = _

EINVALIDPROVIDER

source

pub const ISCONN: Self = _

EISCONN

source

pub const LOOP: Self = _

ELOOP

source

pub const MFILE: Self = _

EMFILE

source

pub const MSGSIZE: Self = _

EMSGSIZE

source

pub const NAMETOOLONG: Self = _

ENAMETOOLONG

source

pub const NETDOWN: Self = _

ENETDOWN

source

pub const NETRESET: Self = _

ENETRESET

source

pub const NETUNREACH: Self = _

ENETUNREACH

source

pub const NOBUFS: Self = _

ENOBUFS

source

pub const NOMORE: Self = _

ENOMORE

source

pub const NOPROTOOPT: Self = _

ENOPROTOOPT

source

pub const NOTCONN: Self = _

ENOTCONN

source

pub const NOTEMPTY: Self = _

ENOTEMPTY

source

pub const NOTSOCK: Self = _

ENOTSOCK

source

pub const OPNOTSUPP: Self = _

EOPNOTSUPP

source

pub const PFNOSUPPORT: Self = _

EPFNOSUPPORT

source

pub const PROTONOSUPPORT: Self = _

EPROTONOSUPPORT

source

pub const PROTOTYPE: Self = _

EPROTOTYPE

source

pub const PROVIDERFAILEDINIT: Self = _

EPROVIDERFAILEDINIT

source

pub const REFUSED: Self = _

EREFUSED

source

pub const REMOTE: Self = _

EREMOTE

source

pub const SHUTDOWN: Self = _

ESHUTDOWN

source

pub const SOCKTNOSUPPORT: Self = _

ESOCKTNOSUPPORT

source

pub const STALE: Self = _

ESTALE

source

pub const TIMEDOUT: Self = _

ETIMEDOUT

source

pub const TOOMANYREFS: Self = _

ETOOMANYREFS

source

pub const USERS: Self = _

EUSERS

source

pub const WOULDBLOCK: Self = _

EWOULDBLOCK

source§

impl Errno

source

pub fn from_io_error(io_err: &Error) -> Option<Self>

Extract an Errno value from a std::io::Error.

This isn’t a From conversion because it’s expected to be relatively uncommon.

source

pub const fn raw_os_error(self) -> i32

Extract the raw OS error number from this error.

source

pub const fn from_raw_os_error(raw: i32) -> Self

Construct an Errno from a raw OS error number.

source§

impl Errno

source

pub fn kind(self) -> ErrorKind

Shorthand for std::io::Error::from(self).kind().

Trait Implementations§

source§

impl Clone for Errno

source§

fn clone(&self) -> Errno

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Errno

source§

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

Formats the value using the given formatter. Read more
source§

impl Display for Errno

source§

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

Formats the value using the given formatter. Read more
source§

impl Error for Errno

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<Errno> for Error

source§

fn from(err: Errno) -> Self

Converts to this type from the input type.
source§

impl Hash for Errno

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for Errno

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for Errno

source§

impl Eq for Errno

source§

impl StructuralEq for Errno

source§

impl StructuralPartialEq for Errno

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§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

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

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

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

Performs the conversion.