pub struct Frame { /* private fields */ }Expand description
A frame in the exception tree.
Implementations§
Source§impl Frame
impl Frame
Sourcepub fn location(self) -> &'static Location<'static>
pub fn location(self) -> &'static Location<'static>
Return the source code location where this exception frame was created. Return the frame location used when formatting this node.
A frame returns its own captured location. A native source inherits the location of the frame whose error owns its
source chain, providing formatting context even though no location was captured for the source itself. In contrast,
captured_location() reports only locations belonging to the node itself.
Sourcepub fn children(&self) -> &[Frame]
pub fn children(&self) -> &[Frame]
Return explicitly raised child frames.
Native Error::source() values are borrowed from Self::error() and traversed lazily, so they aren’t owned
Frame children.
Source§impl Frame
Navigation
impl Frame
Navigation
Sourcepub fn probable_cause(&self) -> Option<&(dyn Error + 'static)>
pub fn probable_cause(&self) -> Option<&(dyn Error + 'static)>
Find the best possible cause:
- in a linear chain of a single error each, it’s the last-most error
- in trees, find the deepest-possible error that has the most leafs as children
Native Error::source() values participate as borrowed children. Return None if there are no children.
Sourcepub fn iter_frames(&self) -> impl Iterator<Item = &Frame> + '_
pub fn iter_frames(&self) -> impl Iterator<Item = &Frame> + '_
Iterate over all explicitly created frames in breadth-first order. The first frame is this instance, followed by
all explicitly raised children. Native Error::source() values are not frames.