#[repr(transparent)]pub struct Error(_);
Expand description
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
sourceimpl Error
impl Error
sourcepub fn from_io_error(io_err: &Error) -> Option<Self>
pub fn from_io_error(io_err: &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.
sourcepub const fn raw_os_error(self) -> i32
pub const fn raw_os_error(self) -> i32
Extract the raw OS error number from this error.
sourcepub const fn from_raw_os_error(raw: i32) -> Self
pub const fn from_raw_os_error(raw: i32) -> Self
Construct an Error
from a raw OS error number.
sourceimpl Error
impl Error
sourcepub const ADDRNOTAVAIL: Self = Self::from_errno(errno::EADDRNOTAVAIL)
pub const ADDRNOTAVAIL: Self = Self::from_errno(errno::EADDRNOTAVAIL)
EADDRNOTAVAIL
sourcepub const AFNOSUPPORT: Self = Self::from_errno(errno::EAFNOSUPPORT)
pub const AFNOSUPPORT: Self = Self::from_errno(errno::EAFNOSUPPORT)
EAFNOSUPPORT
sourcepub const CONNABORTED: Self = Self::from_errno(errno::ECONNABORTED)
pub const CONNABORTED: Self = Self::from_errno(errno::ECONNABORTED)
ECONNABORTED
sourcepub const CONNREFUSED: Self = Self::from_errno(errno::ECONNREFUSED)
pub const CONNREFUSED: Self = Self::from_errno(errno::ECONNREFUSED)
ECONNREFUSED
sourcepub const DESTADDRREQ: Self = Self::from_errno(errno::EDESTADDRREQ)
pub const DESTADDRREQ: Self = Self::from_errno(errno::EDESTADDRREQ)
EDESTADDRREQ
sourcepub const HOSTUNREACH: Self = Self::from_errno(errno::EHOSTUNREACH)
pub const HOSTUNREACH: Self = Self::from_errno(errno::EHOSTUNREACH)
EHOSTUNREACH
sourcepub const INPROGRESS: Self = Self::from_errno(errno::EINPROGRESS)
pub const INPROGRESS: Self = Self::from_errno(errno::EINPROGRESS)
EINPROGRESS
sourcepub const INTR: Self = Self::from_errno(errno::EINTR)
pub const INTR: Self = Self::from_errno(errno::EINTR)
EINTR
.
For a convenient way to retry system calls that exit with INTR
, use
with_retrying
.
sourcepub const KEYEXPIRED: Self = Self::from_errno(errno::EKEYEXPIRED)
pub const KEYEXPIRED: Self = Self::from_errno(errno::EKEYEXPIRED)
EKEYEXPIRED
sourcepub const KEYREJECTED: Self = Self::from_errno(errno::EKEYREJECTED)
pub const KEYREJECTED: Self = Self::from_errno(errno::EKEYREJECTED)
EKEYREJECTED
sourcepub const KEYREVOKED: Self = Self::from_errno(errno::EKEYREVOKED)
pub const KEYREVOKED: Self = Self::from_errno(errno::EKEYREVOKED)
EKEYREVOKED
sourcepub const MEDIUMTYPE: Self = Self::from_errno(errno::EMEDIUMTYPE)
pub const MEDIUMTYPE: Self = Self::from_errno(errno::EMEDIUMTYPE)
EMEDIUMTYPE
sourcepub const NAMETOOLONG: Self = Self::from_errno(errno::ENAMETOOLONG)
pub const NAMETOOLONG: Self = Self::from_errno(errno::ENAMETOOLONG)
ENAMETOOLONG
sourcepub const NETUNREACH: Self = Self::from_errno(errno::ENETUNREACH)
pub const NETUNREACH: Self = Self::from_errno(errno::ENETUNREACH)
ENETUNREACH
sourcepub const NOPROTOOPT: Self = Self::from_errno(errno::ENOPROTOOPT)
pub const NOPROTOOPT: Self = Self::from_errno(errno::ENOPROTOOPT)
ENOPROTOOPT
sourcepub const NOTRECOVERABLE: Self = Self::from_errno(errno::ENOTRECOVERABLE)
pub const NOTRECOVERABLE: Self = Self::from_errno(errno::ENOTRECOVERABLE)
ENOTRECOVERABLE
sourcepub const PFNOSUPPORT: Self = Self::from_errno(errno::EPFNOSUPPORT)
pub const PFNOSUPPORT: Self = Self::from_errno(errno::EPFNOSUPPORT)
EPFNOSUPPORT
sourcepub const PROTONOSUPPORT: Self = Self::from_errno(errno::EPROTONOSUPPORT)
pub const PROTONOSUPPORT: Self = Self::from_errno(errno::EPROTONOSUPPORT)
EPROTONOSUPPORT
sourcepub const SOCKTNOSUPPORT: Self = Self::from_errno(errno::ESOCKTNOSUPPORT)
pub const SOCKTNOSUPPORT: Self = Self::from_errno(errno::ESOCKTNOSUPPORT)
ESOCKTNOSUPPORT
sourcepub const TOOMANYREFS: Self = Self::from_errno(errno::ETOOMANYREFS)
pub const TOOMANYREFS: Self = Self::from_errno(errno::ETOOMANYREFS)
ETOOMANYREFS
sourcepub const WOULDBLOCK: Self = Self::from_errno(errno::EWOULDBLOCK)
pub const WOULDBLOCK: Self = Self::from_errno(errno::EWOULDBLOCK)
EWOULDBLOCK
Trait Implementations
sourceimpl Error for Error
impl Error for Error
1.30.0 · sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
backtrace
)Returns a stack backtrace, if available, of where this error occurred. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
impl Copy for Error
impl Eq for Error
impl StructuralEq for Error
impl StructuralPartialEq for Error
Auto Trait Implementations
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more