Macro utils_results::errcast[][src]

macro_rules! errcast {
    ($result : expr, $kind : ty $(, $format_str : expr $(, $val : expr) *) ?) => { ... };
}
Expand description

any type of inside Err() can be converted
and Ok() will be unwraped, converted err will be escaped

// <Unwraped Ok> = errcast!(<Any Result>, <Master Err>, <Optional,..>);
let num_read = errcast!(file.read(&mut buf), err::ReadErr, "cannot read.");