pub struct ErrCtx<E: Error> {
pub source: E,
/* private fields */
}Expand description
Custom error struct ErrCtx.
Stores two fields, a msg: Vec<u8> field which stores the context messages as raw bytes for
less memory usage, and source: E where E: std::error::Error for the lower-level source of
the error.
The Vec<u8> for messages will be optimized even further in nexy versions to use smallvec or
a similar crate for zero-alloc small contexts while longer ones stay alloc.
Fields§
§source: EImplementations§
Trait Implementations§
Source§impl<E: Display + Error + 'static> Error for ErrCtx<E>
impl<E: Display + Error + 'static> Error for ErrCtx<E>
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
Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
impl<E: Error> Send for ErrCtx<E>
impl<E: Error> Sync for ErrCtx<E>
Auto Trait Implementations§
impl<E> Freeze for ErrCtx<E>where
E: Freeze,
impl<E> RefUnwindSafe for ErrCtx<E>where
E: RefUnwindSafe,
impl<E> Unpin for ErrCtx<E>where
E: Unpin,
impl<E> UnwindSafe for ErrCtx<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