pub struct BoxError(/* private fields */);Expand description
A type-erased error value. Carries an error from any source in a public API without exposing the concrete type.
Construction:
BoxError::new: wraps anyE: Error + Send + Sync + 'staticFrom<Box<dyn Error + Send + Sync>>: migrates from an already-boxed form
No From<E> for arbitrary E: Error: under Rust’s coherence rules, this would
overlap with the blanket From<T> for T impl (since BoxError itself implements
Error). Callers should use BoxError::new to wrap explicitly.
Implementations§
Trait Implementations§
Source§impl Error for BoxError
impl Error for BoxError
Source§fn source(&self) -> Option<&(dyn StdError + 'static)>
fn source(&self) -> Option<&(dyn StdError + '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 !RefUnwindSafe for BoxError
impl !UnwindSafe for BoxError
impl Freeze for BoxError
impl Send for BoxError
impl Sync for BoxError
impl Unpin for BoxError
impl UnsafeUnpin for BoxError
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