pub struct LocatedError<E> { /* private fields */ }
Expand description
Wrapper that records the call-site for any core::error::Error
and exposes it as a StackError
.
This is useful when you already have an error type that implements core::error::Error
but cannot be modified to derive StackError
.
§Examples
use pseudo_backtrace::{LocatedError, StackError};
fn assert_stack_error<T:StackError>(){}
assert_stack_error::<LocatedError<std::io::Error>>();
Implementations§
Source§impl<E> LocatedError<E>
impl<E> LocatedError<E>
Sourcepub fn into_inner(self) -> E
pub fn into_inner(self) -> E
Returns the inner value
Trait Implementations§
Source§impl<E: Debug> Debug for LocatedError<E>
impl<E: Debug> Debug for LocatedError<E>
Source§impl<E> Display for LocatedError<E>where
E: Display,
impl<E> Display for LocatedError<E>where
E: Display,
Source§impl<E> Error for LocatedError<E>where
E: Error,
impl<E> Error for LocatedError<E>where
E: Error,
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()
Source§impl<E> From<E> for LocatedError<E>
impl<E> From<E> for LocatedError<E>
Source§impl<E> StackError for LocatedError<E>where
E: Error,
impl<E> StackError for LocatedError<E>where
E: Error,
Source§fn next<'a>(&'a self) -> Option<ErrorDetail<'a>>
fn next<'a>(&'a self) -> Option<ErrorDetail<'a>>
Returns the next detail in the stack.
Auto Trait Implementations§
impl<E> Freeze for LocatedError<E>where
E: Freeze,
impl<E> RefUnwindSafe for LocatedError<E>where
E: RefUnwindSafe,
impl<E> Send for LocatedError<E>where
E: Send,
impl<E> Sync for LocatedError<E>where
E: Sync,
impl<E> Unpin for LocatedError<E>where
E: Unpin,
impl<E> UnwindSafe for LocatedError<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
Source§impl<E> StackErrorExt for Ewhere
E: StackError,
impl<E> StackErrorExt for Ewhere
E: StackError,
Source§fn to_chain<'a>(&'a self) -> StackChain<'a> ⓘwhere
Self: Sized,
fn to_chain<'a>(&'a self) -> StackChain<'a> ⓘwhere
Self: Sized,
Returns a
StackChain
that walks this error stack from the top.Source§fn last<'a>(&'a self) -> ErrorDetail<'a>where
Self: Sized,
fn last<'a>(&'a self) -> ErrorDetail<'a>where
Self: Sized,
Returns the deepest
ErrorDetail
in the chain.