pub struct Email;Expand description
Requires a string that looks like an email address.
This checks the structure only: a local part and a domain separated by
a single @, the domain has at least two labels and there is no
whitespace. Whether the address exists can only be found out by
sending an email. The code of the violation is email.
use deser_validate::{Email, Validator};
assert!(Email::validate("jane@example.com").is_ok());
assert!(Email::validate("jane@localhost").is_err());
assert!(Email::validate("jane example.com").is_err());Trait Implementations§
Auto Trait Implementations§
impl Freeze for Email
impl RefUnwindSafe for Email
impl Send for Email
impl Sync for Email
impl Unpin for Email
impl UnsafeUnpin for Email
impl UnwindSafe for Email
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more