#[non_exhaustive]pub struct Backtrace {
pub error: Box<Error>,
pub frames: Vec<BacktraceFrame>,
}Expand description
A backtrace containing a set of frames representing (in order from innermost to outmost code)
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
Implementations
sourceimpl Backtrace
impl Backtrace
sourcepub fn new(error: Error, frames: Vec<BacktraceFrame>) -> Self
pub fn new(error: Error, frames: Vec<BacktraceFrame>) -> Self
Create a new backtrace from a source error and a set of frames
If the error itself is a Backtrace, the set of frames is appended to the existing
set of frames. This ensures Backtrace::error is not itself a Backtrace.
Trait Implementations
sourceimpl ContextExt for Backtrace
impl ContextExt for Backtrace
sourcefn with_context<Frame: Into<BacktraceFrame>>(self, frame: Frame) -> Self
fn with_context<Frame: Into<BacktraceFrame>>(self, frame: Frame) -> Self
Adds an additional frame of context to the backtrace
sourcefn with_message(self, message: impl Into<Cow<'static, str>>) -> Self
fn with_message(self, message: impl Into<Cow<'static, str>>) -> Self
Adds an additional frame of context to the backtrace including a message, file name, and line number.
Auto Trait Implementations
impl !RefUnwindSafe for Backtrace
impl Send for Backtrace
impl Sync for Backtrace
impl Unpin for Backtrace
impl !UnwindSafe for Backtrace
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> CustomError for T where
T: 'static + Display + Debug + Send + Sync,
impl<T> CustomError for T where
T: 'static + Display + Debug + Send + Sync,
fn as_any(&self) -> &(dyn Any + Sync + Send + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + Sync + Send + 'static)
fn as_box_any(
self: Box<T, Global>
) -> Box<dyn Any + Sync + Send + 'static, Global>ⓘNotable traits for Box<R, Global>impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized,
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized,