Macro tracerr::wrap[][src]

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

Provides a closure, which captures a new Frame in the invocation place and wraps the given error into a Traced wrapper containing this Frame. If the error represents a Traced already, then just growths 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();