[][src]Struct better_panic::Settings

pub struct Settings { /* fields omitted */ }

Configuration for panic printing.

Methods

impl Settings[src]

pub fn new() -> Self[src]

Alias for Settings::default.

pub fn debug() -> Self[src]

Common settings for debugging.

pub fn auto() -> Self[src]

In release builds this is new, in debug builds this is debug.

pub fn message(self, message: impl Into<String>) -> Self[src]

Controls the "greeting" message of the panic.

Defaults to "The application panicked (crashed)".

pub fn verbosity(self, v: Verbosity) -> Self[src]

Controls the verbosity level.

Defaults to Verbosity::get_env().

pub fn backtrace_first(self, value: bool) -> Self[src]

Controls the backtrace position.

Defaults to true which causes the backtrace to be printed above the panic.

pub fn most_recent_first(self, value: bool) -> Self[src]

Controls the most-recent-first behavior.

Defaults to true which causes the backtrace to be printed above the panic.

pub fn lineno_suffix(self, value: bool) -> Self[src]

Append the line number as suffix to the filename.

Defaults to false which causes line numbers to be rendered separately. Specifically this renders File "foo.rs:42" instead of File "foo.rs", line 42 which lets some terminals open the editor at the right location on click.

pub fn create_panic_handler(
    self
) -> Box<dyn Fn(&PanicInfo) + Sync + Send + 'static>
[src]

Consumes the settings and creates a panic handler.

pub fn install(self)[src]

Installs the panic handler.

Trait Implementations

impl Clone for Settings[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Default for Settings[src]

impl Debug for Settings[src]

Auto Trait Implementations

impl Unpin for Settings

impl Sync for Settings

impl Send for Settings

impl !RefUnwindSafe for Settings

impl !UnwindSafe for Settings

Blanket Implementations

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]