[−][src]Macro af_macros::fail_when
macro_rules! fail_when { (let Err($err:ident) = $value:ident, $($args:tt)+) => { ... }; (let $pattern:pat = $expr:expr) => { ... }; (let $pattern:pat = $expr:expr, $($args:tt)+) => { ... }; ($left:tt == $right:tt) => { ... }; ($actual:tt != $expected:expr) => { ... }; ($actual:tt . $method:ident () != $expected:expr) => { ... }; ($left:tt > $right:tt) => { ... }; ($left:tt < $right:tt) => { ... }; ($left:tt >= $right:tt) => { ... }; ($left:tt <= $right:tt) => { ... }; ($value:tt.is_some()) => { ... }; ($value:ident.is_none()) => { ... }; ($value:tt.is_none()) => { ... }; ($value:ident.is_ok()) => { ... }; ($value:ident.is_ok(), $($args:tt)+) => { ... }; ($value:tt.is_ok()) => { ... }; ($value:tt.is_empty()) => { ... }; (!$value:tt.is_empty()) => { ... }; (!$value:tt) => { ... }; ($value:tt) => { ... }; ($condition:expr, $($args:tt)+) => { ... }; ($($condition:tt)*) => { ... }; }
Returns a fail::Error
if a condition is true
.
Some simple patterns have default error messages.