BacktraceFilter

Struct BacktraceFilter 

Source
pub struct BacktraceFilter {
    pub skipped_initial_crates: &'static [&'static str],
    pub skipped_middle_crates: &'static [&'static str],
    pub skipped_final_crates: &'static [&'static str],
    pub max_entry_count: usize,
    pub show_full_path: bool,
}
Expand description

Configuration for filtering frames from certain crates in a backtrace.

§Examples

Use default filtering:

use rootcause_backtrace::BacktraceFilter;

let filter = BacktraceFilter::DEFAULT;

Custom filtering to focus on application code:

use rootcause_backtrace::BacktraceFilter;

let filter = BacktraceFilter {
    // Hide rootcause crate frames at the start
    skipped_initial_crates: &["rootcause", "rootcause-backtrace"],
    // Hide framework frames in the middle
    skipped_middle_crates: &["tokio", "hyper", "tower"],
    // Hide runtime frames at the end
    skipped_final_crates: &["std", "tokio"],
    // Show only the most relevant 10 frames
    max_entry_count: 10,
    // Show shortened paths
    show_full_path: false,
};

Fields§

§skipped_initial_crates: &'static [&'static str]

Set of crate names whose frames should be hidden when they appear at the beginning of a backtrace.

§skipped_middle_crates: &'static [&'static str]

Set of crate names whose frames should be hidden when they appear in the middle of a backtrace.

§skipped_final_crates: &'static [&'static str]

Set of crate names whose frames should be hidden when they appear at the end of a backtrace.

§max_entry_count: usize

Maximum number of entries to include in the backtrace.

§show_full_path: bool

Whether to show full file paths in the backtrace frames.

Implementations§

Source§

impl BacktraceFilter

Source

pub const DEFAULT: Self

Default backtrace filter settings.

Trait Implementations§

Source§

impl Clone for BacktraceFilter

Source§

fn clone(&self) -> BacktraceFilter

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for BacktraceFilter

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for BacktraceFilter

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Copy for BacktraceFilter

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.