pub struct CauseRef<'problem, ErrorT> {
pub problem: &'problem Problem,
pub depth: usize,
pub error: &'problem ErrorT,
pub attachments: &'problem ThinVec<CapturedAttachment>,
}Expand description
Reference to a Cause.
Fields§
§problem: &'problem ProblemContaining problem.
depth: usizeDepth in causation chain.
error: &'problem ErrorTError.
This error could be either on the causation chain or nested in source.
attachments: &'problem ThinVec<CapturedAttachment>Attachments.
Implementations§
Source§impl<'problem, ErrorT> CauseRef<'problem, ErrorT>
impl<'problem, ErrorT> CauseRef<'problem, ErrorT>
Sourcepub fn new(
problem: &'problem Problem,
depth: usize,
error: &'problem ErrorT,
attachments: &'problem ThinVec<CapturedAttachment>,
) -> Self
pub fn new( problem: &'problem Problem, depth: usize, error: &'problem ErrorT, attachments: &'problem ThinVec<CapturedAttachment>, ) -> Self
Constructor.
Sourcepub fn iter_under(&self) -> CauseRefIterator<'problem> ⓘ
pub fn iter_under(&self) -> CauseRefIterator<'problem> ⓘ
Iterate the causation chain starting from under this cause ending at the root.
Note that this will skip over source.
Sourcepub fn under(&self) -> Option<CauseRef<'problem, CapturedError>>
pub fn under(&self) -> Option<CauseRef<'problem, CapturedError>>
Trait Implementations§
Source§impl<'problem, ErrorT> Attachments for CauseRef<'problem, ErrorT>
impl<'problem, ErrorT> Attachments for CauseRef<'problem, ErrorT>
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.
Auto Trait Implementations§
impl<'problem, ErrorT> Freeze for CauseRef<'problem, ErrorT>
impl<'problem, ErrorT> !RefUnwindSafe for CauseRef<'problem, ErrorT>
impl<'problem, ErrorT> Send for CauseRef<'problem, ErrorT>where
ErrorT: Sync,
impl<'problem, ErrorT> Sync for CauseRef<'problem, ErrorT>where
ErrorT: Sync,
impl<'problem, ErrorT> Unpin for CauseRef<'problem, ErrorT>
impl<'problem, ErrorT> UnsafeUnpin for CauseRef<'problem, ErrorT>
impl<'problem, ErrorT> !UnwindSafe for CauseRef<'problem, ErrorT>
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