pub struct StdError(pub Box<dyn Error + Send + Sync>);
Expand description
An escape hatch to preserve stack traces when we don’t know the error.
This crate exports some traits such as Conn
and Listener
. The trait functions
produce the local error util::Error
. However when used in crates higher up the stack,
we are forced to handle errors that are local to that crate. For example we use
Listener
the dtls
crate and it needs to handle dtls::Error
.
By using util::Error::from_std
we can preserve the underlying error (and stack trace!).
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 !UnwindSafe for StdError
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