Macro hotdrink_rs::fail[][src]

macro_rules! fail {
    ($($arg:tt)*) => { ... };
}

Turns a list of inputs into a failed MethodResult. This can be used defining methods in components with component!.

Examples

let result: MethodResult<()> = fail!("Expected {} to be equal to {}", 2, 3);
assert_eq!(result, Err(MethodFailure::Custom(String::from("Expected 2 to be equal to 3"))));