pub struct StdError(pub Box<dyn Error + Send + Sync>);Expand description
An escape hatch to preserve stack traces for errors whose concrete type is unknown.
Some traits exported by this crate (e.g. Conn, Listener) return Error.
When those traits are used in higher-level crates that have their own error
types, callers are forced to handle foreign errors. StdError boxes any
std::error::Error implementation and wraps it in Error::Std, preserving
the original error’s message and — where supported — its stack trace.
Use Error::from_std to construct this variant.
Tuple Fields§
§0: Box<dyn Error + Send + Sync>Trait Implementations§
Source§impl Error for StdError
impl Error for StdError
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 Freeze for StdError
impl !RefUnwindSafe for StdError
impl Send for StdError
impl Sync for StdError
impl Unpin for StdError
impl UnsafeUnpin for StdError
impl !UnwindSafe for StdError
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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