pub enum ErrorRef<'a> {
Std(&'a dyn Error, Option<&'a Meta>),
Stack(&'a dyn StackError),
}Expand description
Reference to an error which can either be a std error or a stack error.
This provides a unified interface to either a std or a stack error. If it’s a stack error it allows to access the error metadata captured at the call site.
Variants§
Std(&'a dyn Error, Option<&'a Meta>)
Std error (no location info).
Stack(&'a dyn StackError)
StackError (has location info).
Implementations§
Source§impl<'a> ErrorRef<'a>
impl<'a> ErrorRef<'a>
Sourcepub fn stack(err: &dyn StackError) -> ErrorRef<'_>
pub fn stack(err: &dyn StackError) -> ErrorRef<'_>
Creates a ErrorRef for a StackError.
Sourcepub fn is_transparent(&self) -> bool
pub fn is_transparent(&self) -> bool
Returns true if this error is transparent (i.e. directly forwards to its source).
Trait Implementations§
impl<'a> Copy for ErrorRef<'a>
Auto Trait Implementations§
impl<'a> Freeze for ErrorRef<'a>
impl<'a> !RefUnwindSafe for ErrorRef<'a>
impl<'a> !Send for ErrorRef<'a>
impl<'a> !Sync for ErrorRef<'a>
impl<'a> Unpin for ErrorRef<'a>
impl<'a> !UnwindSafe for ErrorRef<'a>
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