pub struct ErrorContext {
pub context: SharedString,
pub cause: Option<Arc<dyn Error + Send + Sync + 'static>>,
}
Expand description
An annotated error stack
Fields§
§context: SharedString
§cause: Option<Arc<dyn Error + Send + Sync + 'static>>
Implementations§
Source§impl ErrorContext
impl ErrorContext
pub fn new<T>(msg: T) -> ErrorContextwhere
T: Into<SharedString>,
Trait Implementations§
Source§impl Clone for ErrorContext
impl Clone for ErrorContext
Source§fn clone(&self) -> ErrorContext
fn clone(&self) -> ErrorContext
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ErrorContext
impl Debug for ErrorContext
Source§impl Display for ErrorContext
impl Display for ErrorContext
Source§impl Error for ErrorContext
impl Error for ErrorContext
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 From<Error> for ErrorContext
impl From<Error> for ErrorContext
Source§impl PartialEq for ErrorContext
ErrorContext
values are compared using pointer equality.
impl PartialEq for ErrorContext
ErrorContext
values are compared using pointer equality.
In practice this means that two instances of the same error generated by separate function calls will not be equal, but two clones of the same error will be equal.
Errors without a cause, created using &'static str
are an exception to this.
impl Eq for ErrorContext
Auto Trait Implementations§
impl Freeze for ErrorContext
impl !RefUnwindSafe for ErrorContext
impl Send for ErrorContext
impl Sync for ErrorContext
impl Unpin for ErrorContext
impl !UnwindSafe for ErrorContext
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ErrContext for T
impl<T> ErrContext for T
Source§fn context<M>(self, msg: M) -> ErrorContextwhere
M: Into<SharedString>,
fn context<M>(self, msg: M) -> ErrorContextwhere
M: Into<SharedString>,
Wrap this error into a new
ErrorContext
error, annotated with the specified contextSource§impl<T> IntoErrorIterator for Twhere
T: Error + 'static,
impl<T> IntoErrorIterator for Twhere
T: Error + 'static,
Source§fn error_chain(&self) -> ErrorIterator<'_> ⓘ
fn error_chain(&self) -> ErrorIterator<'_> ⓘ
Creates an iterator over
Error::source
sSource§fn serializable_copy(&self) -> SerializableError
fn serializable_copy(&self) -> SerializableError
Copies and flattens the error stack into a
SerializableError