| Crates.io | backtrait_error |
| lib.rs | backtrait_error |
| version | 2.1.0 |
| created_at | 2024-07-02 04:10:11.866059+00 |
| updated_at | 2024-07-03 07:22:16.084034+00 |
| description | Errors with backtraces. |
| homepage | |
| repository | https://github.com/JoshuaXOng/backtrace_error |
| max_upload_size | |
| id | 1289224 |
| size | 32,652 |
Procedural macros to aid the propagation of Backtraces between structs/enums (typically errors).
Dunno if it'd be useful yet.
Provides function-like procedural macros to: generate a simple trait for facilitating propagating backtraces (the trait is defined where the macro is called); and, generate an enum that contains the backtrace and optional source of the error. See below.
define_backtrace_error!(ErrorWithBacktrace); // Expands into `pub trait ErrorWithBacktrace: std::error::Error {`...
define_backtrace_source!(BacktraceSource, ErrorWithBacktrace);
Provides an attribute procedural macro to derive a simple std::error::Error implementation for structs/enums. See below.
#[backtrace_derive(ErrorWithBacktrace)]
#[derive(Debug, BacktraceError)]
struct UnitError(#[display] String, #[backtrace] BacktraceSource);