pub struct ErrorWithSource<This, Source> {
pub this: This,
pub source: Source,
}Expand description
Fields§
§this: ThisThe current error
Note that calling Error::source on an ErrorWithSource will not
call Error::source on this; source will always be returned
instead.
source: SourceThe error that caused the current error
This value will be returned by ErrorWithSource’s Error::source
and Error::cause implementations. Note that the latter is
deprecated.
Trait Implementations§
Source§impl<This, Source> Display for ErrorWithSource<This, Source>where
This: Display,
impl<This, Source> Display for ErrorWithSource<This, Source>where
This: Display,
Source§impl<This, Source> Error for ErrorWithSource<This, Source>
impl<This, Source> Error for ErrorWithSource<This, Source>
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
Source§fn cause(&self) -> Option<&dyn Error>
fn cause(&self) -> Option<&dyn Error>
👎Deprecated since 1.33.0:
replaced by Error::source, which can support downcasting
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl<This, Source> Freeze for ErrorWithSource<This, Source>
impl<This, Source> RefUnwindSafe for ErrorWithSource<This, Source>where
This: RefUnwindSafe,
Source: RefUnwindSafe,
impl<This, Source> Send for ErrorWithSource<This, Source>
impl<This, Source> Sync for ErrorWithSource<This, Source>
impl<This, Source> Unpin for ErrorWithSource<This, Source>
impl<This, Source> UnsafeUnpin for ErrorWithSource<This, Source>where
This: UnsafeUnpin,
Source: UnsafeUnpin,
impl<This, Source> UnwindSafe for ErrorWithSource<This, Source>where
This: UnwindSafe,
Source: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<This> ErrorExt for Thiswhere
This: Error,
impl<This> ErrorExt for Thiswhere
This: Error,
Source§fn with_source<Source>(self, source: Source) -> ErrorWithSource<This, Source>where
This: Sized,
fn with_source<Source>(self, source: Source) -> ErrorWithSource<This, Source>where
This: Sized,
Attach a source to the current error Read more
Source§fn caused<Error>(self, error: Error) -> ErrorWithSource<Error, This>where
This: Sized,
fn caused<Error>(self, error: Error) -> ErrorWithSource<Error, This>where
This: Sized,
Set
self as the source of the given error Read more