pub struct ErrorWithData<E: Error> { /* private fields */ }
Expand description
Type that allows to return data with the error
This is useful since commands like new()
will take ownership of the data.
Using this as error type allows to continue using the data afterward.
Implementations§
Trait Implementations§
Source§impl<E: Error> Debug for ErrorWithData<E>
impl<E: Error> Debug for ErrorWithData<E>
Source§impl<E: Error> Display for ErrorWithData<E>
impl<E: Error> Display for ErrorWithData<E>
Source§impl<E: Error> Error for ErrorWithData<E>
impl<E: Error> Error for ErrorWithData<E>
1.30.0 · 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
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<E> Freeze for ErrorWithData<E>where
E: Freeze,
impl<E> RefUnwindSafe for ErrorWithData<E>where
E: RefUnwindSafe,
impl<E> Send for ErrorWithData<E>where
E: Send,
impl<E> Sync for ErrorWithData<E>where
E: Sync,
impl<E> Unpin for ErrorWithData<E>where
E: Unpin,
impl<E> UnwindSafe for ErrorWithData<E>where
E: 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