impl_err_fn

Macro impl_err_fn 

Source
macro_rules! impl_err_fn {
    ($ErrorName:ident, $ty:expr, $name:ident, $name_err:ident) => { ... };
}
Expand description

Macro to template out standard builder functions for types build with impl_error

impl ErrorName {
    pub fn name(msg: String) -> Self {
        Self {
            error_type: ty,
            msg,
        }
    }
    pub fn name_err<T>(msg: String) -> Result<T, Self> {
        Err(Self::name(msg))
    }
}