assert_email_address

Macro assert_email_address 

Source
macro_rules! assert_email_address {
    ($a:expr $(,)?) => { ... };
    ($a:expr, $($message:tt)+) => { ... };
}
Expand description

Assert expression is possibly an email address.

  • If true, return ().

  • Otherwise, call panic! with a message and the values of the expressions with their debug representations.

§Examples

use assertables::*;

let a = "hello@example.com";
assert_email_address!(a);

// This will panic
let a = "hello*example.com";
assert_email_address!(a);
// assertion failed: `assert_email_address!(a)`
// https://docs.rs/assertables/…/assertables/macro.assert_email_address.html
//  Email address must contain an '@' at sign.
//  a label: `a`,
//  a debug: `\"hello*example.com\"`,
//  a: `hello*example.com`

§Module macros