pub struct Cause {
pub error: CapturedError,
pub attachments: ThinVec<CapturedAttachment>,
}Expand description
A link in a Problem’s causation chain.
Fields§
§error: CapturedErrorError.
attachments: ThinVec<CapturedAttachment>Attachments.
Implementations§
Trait Implementations§
Source§impl Attachments for Cause
impl Attachments for Cause
Source§fn attachments(&self) -> impl Iterator<Item = &CapturedAttachment>
fn attachments(&self) -> impl Iterator<Item = &CapturedAttachment>
Iterate attachments.
Source§fn attachments_of_type<'this, AttachmentT>(
&'this self,
) -> impl Iterator<Item = &'this AttachmentT>where
AttachmentT: 'static,
fn attachments_of_type<'this, AttachmentT>(
&'this self,
) -> impl Iterator<Item = &'this AttachmentT>where
AttachmentT: 'static,
Iterate attachments of a type.
Source§fn attachment_of_type<AttachmentT>(&self) -> Option<&AttachmentT>where
AttachmentT: 'static,
fn attachment_of_type<AttachmentT>(&self) -> Option<&AttachmentT>where
AttachmentT: 'static,
First attachment of a type.
Source§impl AttachmentsMut for Cause
impl AttachmentsMut for Cause
Source§fn attachments_mut(&mut self) -> impl Iterator<Item = &mut CapturedAttachment>
fn attachments_mut(&mut self) -> impl Iterator<Item = &mut CapturedAttachment>
Iterate attachments.
Source§fn attachments_of_type_mut<'this, AttachmentT>(
&'this mut self,
) -> impl Iterator<Item = &'this mut AttachmentT>where
AttachmentT: 'static,
fn attachments_of_type_mut<'this, AttachmentT>(
&'this mut self,
) -> impl Iterator<Item = &'this mut AttachmentT>where
AttachmentT: 'static,
Iterate attachments of a type.
Source§fn attachment_of_type_mut<AttachmentT>(&mut self) -> Option<&mut AttachmentT>where
AttachmentT: 'static,
fn attachment_of_type_mut<AttachmentT>(&mut self) -> Option<&mut AttachmentT>where
AttachmentT: 'static,
First attachment of a type.
Source§fn must_attachment_of_type_mut<AttachmentT, DefaultT>(
&mut self,
default: DefaultT,
) -> &mut AttachmentT
fn must_attachment_of_type_mut<AttachmentT, DefaultT>( &mut self, default: DefaultT, ) -> &mut AttachmentT
First attachment of a type. Read more
Source§fn attach_once<AttachmentT>(&mut self, attachment: AttachmentT)
fn attach_once<AttachmentT>(&mut self, attachment: AttachmentT)
Add an attachment only if we don’t already have one of its type.
Source§fn attach_location_once(&mut self)
fn attach_location_once(&mut self)
Add a Location (via Location::caller) attachment if we don’t already have one.
Source§fn attach_backtrace_once(&mut self)
fn attach_backtrace_once(&mut self)
Available on crate feature
backtrace-external only.Add a backtrace attachment if we don’t already have one.
Source§impl Errors for Cause
impl Errors for Cause
Source§fn iter_errors_of_type<'this, ErrorT>(
&'this self,
) -> impl Iterator<Item = &'this ErrorT>where
ErrorT: 'static + Error,
fn iter_errors_of_type<'this, ErrorT>(
&'this self,
) -> impl Iterator<Item = &'this ErrorT>where
ErrorT: 'static + Error,
Iterate errors of a type.
Source§fn error_of_type<ErrorT>(&self) -> Option<&ErrorT>where
ErrorT: 'static + Error,
fn error_of_type<ErrorT>(&self) -> Option<&ErrorT>where
ErrorT: 'static + Error,
The first error of a type.
Source§fn has_error_of_type<ErrorT>(&self) -> boolwhere
ErrorT: 'static + Error,
fn has_error_of_type<ErrorT>(&self) -> boolwhere
ErrorT: 'static + Error,
Whether we have an error of a type.
Source§impl<'this> IntoIterator for &'this Cause
impl<'this> IntoIterator for &'this Cause
Source§impl IterateErrorSources for Cause
impl IterateErrorSources for Cause
Source§fn iter_sources<'this>(&'this self) -> ErrorSourceIterator<'this> ⓘ
fn iter_sources<'this>(&'this self) -> ErrorSourceIterator<'this> ⓘ
Iterate the Error::source chain.
Source§impl PartialOrd for Cause
impl PartialOrd for Cause
impl Eq for Cause
Auto Trait Implementations§
impl Freeze for Cause
impl !RefUnwindSafe for Cause
impl Send for Cause
impl Sync for Cause
impl Unpin for Cause
impl !UnwindSafe for Cause
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