Backtrace

Struct Backtrace 

Source
pub struct Backtrace {
    pub entries: Vec<BacktraceEntry>,
    pub total_omitted_frames: usize,
}
Expand description

Stack backtrace information.

Contains a collection of stack frames representing the call stack at the point where a report was created.

§Examples

Capture a backtrace manually:

use rootcause_backtrace::{Backtrace, BacktraceFilter};

let backtrace = Backtrace::capture(&BacktraceFilter::DEFAULT);
if let Some(bt) = backtrace {
    println!("Captured {} frames", bt.entries.len());
}

Fields§

§entries: Vec<BacktraceEntry>

The entries in the backtrace, ordered from most recent to oldest.

§total_omitted_frames: usize

Total number of frames that were omitted due to filtering.

Implementations§

Source§

impl Backtrace

Source

pub fn capture(filter: &BacktraceFilter) -> Option<Self>

Captures the current stack backtrace, applying optional filtering.

Trait Implementations§

Source§

impl<const SHOW_FULL_PATH: bool> AttachmentHandler<Backtrace> for BacktraceHandler<SHOW_FULL_PATH>

Source§

fn display(value: &Backtrace, f: &mut Formatter<'_>) -> Result

Formats the attachment using display-style formatting. Read more
Source§

fn debug(value: &Backtrace, formatter: &mut Formatter<'_>) -> Result

Formats the attachment using debug-style formatting. Read more
Source§

fn preferred_formatting_style( backtrace: &Backtrace, _report_formatting_function: FormattingFunction, ) -> AttachmentFormattingStyle

Specifies the preferred formatting style and placement for this attachment. Read more
Source§

impl Debug for Backtrace

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<O> ObjectMarkerFor<Local> for O
where O: 'static,

Source§

impl<O> ObjectMarkerFor<SendSync> for O
where O: 'static + Send + Sync,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.