ErrorImpl

Struct ErrorImpl 

Source
pub struct ErrorImpl<E> { /* private fields */ }
Expand description

A struct that wraps an error together with a backtrace and an optional description

Implementations§

Source§

impl<E> ErrorImpl<E>

Source

pub fn new(err: E, desc: String) -> Self

Captures a backtrace and creates a new error

Source

pub fn new_static(err: E, desc: &'static str) -> Self

Captures a backtrace and creates a new error with a static description

Source

pub const fn with_backtrace( err: E, desc: Cow<'static, str>, backtrace: Option<Backtrace>, ) -> Self

Creates a new error with the given backtrace

Source

pub const fn err(&self) -> &E

The wrapped error

Source

pub const fn desc(&self) -> &Cow<'static, str>

The error description

Source

pub fn backtrace(&self) -> Option<&Backtrace>

The underlying backtrace

Trait Implementations§

Source§

impl<E> Clone for ErrorImpl<E>
where E: Clone,

Source§

fn clone(&self) -> Self

Returns a duplicate 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<E> Debug for ErrorImpl<E>
where E: Debug,

Source§

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

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

impl<E> Default for ErrorImpl<E>
where E: Default + Display,

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<E> Deref for ErrorImpl<E>

Source§

type Target = E

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<E> Display for ErrorImpl<E>
where E: Display,

Source§

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

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

impl<E> Error for ErrorImpl<E>
where E: Error,

Source§

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

Returns 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<E> From<E> for ErrorImpl<E>
where E: Display,

Source§

fn from(error: E) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for ErrorImpl<ErrorKind>

Source§

fn from(underlying: Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<E> Freeze for ErrorImpl<E>
where E: Freeze,

§

impl<E> RefUnwindSafe for ErrorImpl<E>
where E: RefUnwindSafe,

§

impl<E> Send for ErrorImpl<E>
where E: Send,

§

impl<E> Sync for ErrorImpl<E>
where E: Sync,

§

impl<E> Unpin for ErrorImpl<E>
where E: Unpin,

§

impl<E> UnwindSafe for ErrorImpl<E>
where E: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

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

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<!> for T

Source§

fn from(t: !) -> T

Converts to this type from the input type.
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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

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

Source§

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§

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>,

Source§

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>,

Source§

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.