Trait snafu::GenerateBacktrace
source · pub trait GenerateBacktrace {
// Required methods
fn generate() -> Self;
fn as_backtrace(&self) -> Option<&Backtrace>;
}
Expand description
Construct a backtrace, allowing it to be optional.
Required Methods§
sourcefn as_backtrace(&self) -> Option<&Backtrace>
fn as_backtrace(&self) -> Option<&Backtrace>
Retrieve the optional backtrace
Object Safety§
This trait is not object safe.
Implementations on Foreign Types§
source§impl GenerateBacktrace for Option<Backtrace>
impl GenerateBacktrace for Option<Backtrace>
Only create a backtrace when an environment variable is set.
This looks first for the value of RUST_LIB_BACKTRACE
then
RUST_BACKTRACE
. If the value is set to 1
, backtraces will be
enabled.
This value will be tested only once per program execution; changing the environment variable after it has been checked will have no effect.