Macro tracerr::wrap[][src]

macro_rules! wrap {
    () => { ... };
    ($from:ty) => { ... };
    (=> $to:ty) => { ... };
    ($from:ty => $to:ty) => { ... };
}
Expand description

Provides a closure, which captures new Frame in the invocation place and wraps the given error 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<(), u32> = Err(89);
let err: Traced<u32> = res
    .map_err(tracerr::wrap!())
    .map_err(tracerr::wrap!())
    .unwrap_err();