#[non_exhaustive]pub struct Backtrace {
pub error: Box<Error>,
pub frames: Vec<BacktraceFrame>,
}
Expand description
An error backtrace.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.error: Box<Error>
The source error which caused this backtrace.
This is guaranteed to not itself be a backtrace.
frames: Vec<BacktraceFrame>
The frames which lead to the given error.
The first frame is the innermost frame.
Implementations§
source§impl Backtrace
impl Backtrace
sourcepub fn new(error: Error, frames: Vec<BacktraceFrame>) -> Self
pub fn new(error: Error, frames: Vec<BacktraceFrame>) -> Self
Creates a new backtrace from a source error and a set of frames.
If the source error is an Error::Backtrace
, the given frames are
appended to that object and it is unwrapped and used instead of creating
a new backtrace. This ensures that Backtrace::error
is never a
Backtrace
and avoids recursion.
Trait Implementations§
source§impl ContextExt for Backtrace
impl ContextExt for Backtrace
source§fn with_context<Frame: Into<BacktraceFrame>>(self, frame: Frame) -> Self
fn with_context<Frame: Into<BacktraceFrame>>(self, frame: Frame) -> Self
Adds a new context frame to the error, consuming the original error.
Auto Trait Implementations§
impl Freeze for Backtrace
impl !RefUnwindSafe for Backtrace
impl Send for Backtrace
impl Sync for Backtrace
impl Unpin for Backtrace
impl !UnwindSafe for Backtrace
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