pseudo-backtrace 0.2.1

Utilities for constructing stack-like error chains with caller locations
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use pseudo_backtrace::StackError;

#[derive(Debug, StackError)]
struct ErrorOpt<'a> {
    #[stack_error(std)]
    source: Option<&'a (dyn core::error::Error + 'static)>,
    location: &'static core::panic::Location<'static>,
}
impl core::fmt::Display for ErrorOpt<'_> {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        write!(f, "error with option")
    }
}

impl core::error::Error for ErrorOpt<'_> {}

fn main() {}