snafu/backtrace_inert.rs
1use core::fmt;
2
3/// A backtrace starting from the beginning of the thread.
4///
5/// Backtrace functionality is currently **disabled**. Please review
6/// [the feature flags](crate::guide::feature_flags) to enable it.
7#[derive(Debug)]
8pub struct Backtrace(());
9
10impl crate::GenerateImplicitData for Backtrace {
11 fn generate() -> Self {
12 Backtrace(())
13 }
14}
15
16impl crate::AsBacktrace for Backtrace {
17 fn as_backtrace(&self) -> Option<&Backtrace> {
18 Some(self)
19 }
20}
21
22impl fmt::Display for Backtrace {
23 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
24 write!(f, "disabled backtrace")
25 }
26}