Struct kernel::error::Error

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

Generic integer kernel error.

The kernel defines a set of integer generic error codes based on C and POSIX ones. These codes may have a more specific meaning in some contexts.

Invariants

The value is a valid errno (i.e. >= -MAX_ERRNO && < 0).

Implementations§

source§

impl Error

source

pub fn to_errno(self) -> c_int

Returns the kernel error code.

source

pub fn name(&self) -> Option<&'static CStr>

Returns a string representing the error, if one exists.

Trait Implementations§

source§

impl Clone for Error

source§

fn clone(&self) -> Error

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 Error

source§

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

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

impl From<AllocError> for Error

source§

fn from(_: AllocError) -> Error

Converts to this type from the input type.
source§

impl From<CStrConvertError> for Error

source§

fn from(_: CStrConvertError) -> Error

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(_: Error) -> Error

Converts to this type from the input type.
source§

impl From<Infallible> for Error

source§

fn from(e: Infallible) -> Error

Converts to this type from the input type.
source§

impl From<LayoutError> for Error

source§

fn from(_: LayoutError) -> Error

Converts to this type from the input type.
source§

impl From<TryFromIntError> for Error

source§

fn from(_: TryFromIntError) -> Error

Converts to this type from the input type.
source§

impl From<TryReserveError> for Error

source§

fn from(_: TryReserveError) -> Error

Converts to this type from the input type.
source§

impl From<Utf8Error> for Error

source§

fn from(_: Utf8Error) -> Error

Converts to this type from the input type.
source§

impl PartialEq<Error> for Error

source§

fn eq(&self, other: &Error) -> 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 Error

source§

impl Eq for Error

source§

impl StructuralEq for Error

source§

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§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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, E> Init<T, E> for T

source§

unsafe fn __init(self, slot: *mut T) -> Result<(), E>

Initializes slot. Read more
source§

fn chain<F>(self, f: F) -> ChainInit<Self, F, T, E>where F: FnOnce(&mut T) -> Result<(), E>,

First initializes the value using self then calls the function f with the initialized value. Read more
source§

impl<T, U> Into<U> for Twhere 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, E> PinInit<T, E> for T

source§

unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), E>

Initializes slot. Read more
source§

fn pin_chain<F>(self, f: F) -> ChainPinInit<Self, F, T, E>where F: FnOnce(Pin<&mut T>) -> Result<(), E>,

First initializes the value using self then calls the function f with the initialized value. Read more
source§

impl<T, U> TryFrom<U> for Twhere 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 Twhere 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.