Struct linux_errno::Error
source · [−]pub struct Error(_);Expand description
Type for error numbers returned from Linux system calls.
The Error type implements PartialEq for many integer types, and
(optionally) with the POSIX error numbers defined in the posix-errno
library.
Implementations
sourceimpl Error
impl Error
sourcepub const fn new(errno: u16) -> Option<Error>
pub const fn new(errno: u16) -> Option<Error>
Create a new error from a raw error number. If outside the permitted
range [1, 4096) for Linux error numbers, returns None.
sourcepub const unsafe fn new_unchecked(errno: u16) -> Error
pub const unsafe fn new_unchecked(errno: u16) -> Error
Unsafely create a new error from a raw error number, without checking whether it’s within the permitted range for Linux error numbers.
Safety
The caller must ensure that 0 < errno <= 0xFFF. In particular, it is
undefined behavior if errno is zero.
sourcepub const fn get_nonzero(&self) -> NonZeroU16
pub const fn get_nonzero(&self) -> NonZeroU16
Returns the error number as a NonZeroU16.
Trait Implementations
sourceimpl From<Error> for NonZeroI32
impl From<Error> for NonZeroI32
sourcefn from(err: Error) -> NonZeroI32
fn from(err: Error) -> NonZeroI32
Converts to this type from the input type.
sourceimpl From<Error> for NonZeroI64
impl From<Error> for NonZeroI64
sourcefn from(err: Error) -> NonZeroI64
fn from(err: Error) -> NonZeroI64
Converts to this type from the input type.
sourceimpl From<Error> for NonZeroU16
impl From<Error> for NonZeroU16
sourcefn from(err: Error) -> NonZeroU16
fn from(err: Error) -> NonZeroU16
Converts to this type from the input type.
sourceimpl From<Error> for NonZeroU32
impl From<Error> for NonZeroU32
sourcefn from(err: Error) -> NonZeroU32
fn from(err: Error) -> NonZeroU32
Converts to this type from the input type.
sourceimpl From<Error> for NonZeroU64
impl From<Error> for NonZeroU64
sourcefn from(err: Error) -> NonZeroU64
fn from(err: Error) -> NonZeroU64
Converts to this type from the input type.
sourceimpl Ord for Error
impl Ord for Error
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialEq<Error> for Error
impl PartialEq<Error> for Error
sourceimpl PartialEq<Error> for Error
impl PartialEq<Error> for Error
sourceimpl PartialEq<Error> for Error
impl PartialEq<Error> for Error
sourceimpl PartialEq<Error> for NonZeroI16
impl PartialEq<Error> for NonZeroI16
sourceimpl PartialEq<Error> for NonZeroI32
impl PartialEq<Error> for NonZeroI32
sourceimpl PartialEq<Error> for NonZeroI64
impl PartialEq<Error> for NonZeroI64
sourceimpl PartialEq<Error> for NonZeroIsize
impl PartialEq<Error> for NonZeroIsize
sourceimpl PartialEq<Error> for NonZeroU16
impl PartialEq<Error> for NonZeroU16
sourceimpl PartialEq<Error> for NonZeroU32
impl PartialEq<Error> for NonZeroU32
sourceimpl PartialEq<Error> for NonZeroU64
impl PartialEq<Error> for NonZeroU64
sourceimpl PartialEq<Error> for NonZeroUsize
impl PartialEq<Error> for NonZeroUsize
sourceimpl PartialEq<Error> for i16
impl PartialEq<Error> for i16
sourceimpl PartialEq<Error> for i32
impl PartialEq<Error> for i32
sourceimpl PartialEq<Error> for i64
impl PartialEq<Error> for i64
sourceimpl PartialEq<Error> for isize
impl PartialEq<Error> for isize
sourceimpl PartialEq<Error> for u16
impl PartialEq<Error> for u16
sourceimpl PartialEq<Error> for u32
impl PartialEq<Error> for u32
sourceimpl PartialEq<Error> for u64
impl PartialEq<Error> for u64
sourceimpl PartialEq<Error> for usize
impl PartialEq<Error> for usize
sourceimpl PartialEq<NonZeroI16> for Error
impl PartialEq<NonZeroI16> for Error
sourcefn eq(&self, other: &NonZeroI16) -> bool
fn eq(&self, other: &NonZeroI16) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourceimpl PartialEq<NonZeroI32> for Error
impl PartialEq<NonZeroI32> for Error
sourcefn eq(&self, other: &NonZeroI32) -> bool
fn eq(&self, other: &NonZeroI32) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourceimpl PartialEq<NonZeroI64> for Error
impl PartialEq<NonZeroI64> for Error
sourcefn eq(&self, other: &NonZeroI64) -> bool
fn eq(&self, other: &NonZeroI64) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourceimpl PartialEq<NonZeroIsize> for Error
impl PartialEq<NonZeroIsize> for Error
sourcefn eq(&self, other: &NonZeroIsize) -> bool
fn eq(&self, other: &NonZeroIsize) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourceimpl PartialEq<NonZeroU16> for Error
impl PartialEq<NonZeroU16> for Error
sourcefn eq(&self, other: &NonZeroU16) -> bool
fn eq(&self, other: &NonZeroU16) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourceimpl PartialEq<NonZeroU32> for Error
impl PartialEq<NonZeroU32> for Error
sourcefn eq(&self, other: &NonZeroU32) -> bool
fn eq(&self, other: &NonZeroU32) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourceimpl PartialEq<NonZeroU64> for Error
impl PartialEq<NonZeroU64> for Error
sourcefn eq(&self, other: &NonZeroU64) -> bool
fn eq(&self, other: &NonZeroU64) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourceimpl PartialEq<NonZeroUsize> for Error
impl PartialEq<NonZeroUsize> for Error
sourcefn eq(&self, other: &NonZeroUsize) -> bool
fn eq(&self, other: &NonZeroUsize) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourceimpl PartialEq<i16> for Error
impl PartialEq<i16> for Error
sourceimpl PartialEq<i32> for Error
impl PartialEq<i32> for Error
sourceimpl PartialEq<i64> for Error
impl PartialEq<i64> for Error
sourceimpl PartialEq<isize> for Error
impl PartialEq<isize> for Error
sourceimpl PartialEq<u16> for Error
impl PartialEq<u16> for Error
sourceimpl PartialEq<u32> for Error
impl PartialEq<u32> for Error
sourceimpl PartialEq<u64> for Error
impl PartialEq<u64> for Error
sourceimpl PartialEq<usize> for Error
impl PartialEq<usize> for Error
sourceimpl PartialOrd<Error> for Error
impl PartialOrd<Error> for Error
sourcefn partial_cmp(&self, other: &Error) -> Option<Ordering>
fn partial_cmp(&self, other: &Error) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
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 Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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