Macro tracerr::from_and_wrap [−][src]
macro_rules! from_and_wrap { () => { ... }; ($from:ty) => { ... }; (=> $to:ty) => { ... }; ($from:ty => $to:ty) => { ... }; }
Expand description
Provides a closure, which captures new Frame
in the invocation place,
applies required From
implementation for the given error and wraps it
into Traced
wrapper containing this Frame
.
If the error is a Traced
already then just growth its Trace
with the captured Frame
.
Examples
use tracerr::Traced; let res: Result<(), u8> = Err(7); let err: Traced<u64> = res.map_err(tracerr::from_and_wrap!()).unwrap_err();