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.
The file path is the compiler-provided path, before diagnostic formatting shortens it.
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)>
Follow the unique causal child until reaching a leaf or a branch.
Native Error::source() values, I/O payloads, nested crate::Error graphs, and explicitly raised frames all
participate.
An aggregate is the error at a branch that groups two or more diagnostic causes. This is a role in the error
tree, not a special concrete error type. For example, Exn::raise_all can attach multiple failed operations
to a shared "batch failed" crate::Message. That shared message is the aggregate, so selection stops there
rather than arbitrarily choosing one operation’s error:
outer context
└─ batch failed (aggregate, selected)
├─ first operation failed
└─ second operation failedAll crate::ClassificationMarker values are ignored. Their frames, including nested boundaries,
are transparent: their real descendants count as children of the nearest non-marker parent instead.
Return None if selection stays at this frame, allowing callers to fall back to Self::error(), even for a
classification-only root.
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.