Skip to main content

ValidateEmail

Trait ValidateEmail 

Source
pub trait ValidateEmail {
    // Required method
    fn as_email_string(&self) -> Option<Cow<'_, str>>;

    // Provided method
    fn validate_email(&self) -> bool { ... }
}
Expand description

Validates whether the given string is an email based on the HTML5 spec. RFC 5322 is not practical in most circumstances and allows email addresses that are unfamiliar to most users.

Required Methods§

Source

fn as_email_string(&self) -> Option<Cow<'_, str>>

Provided Methods§

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl ValidateEmail for &str

Source§

impl ValidateEmail for Cow<'_, str>

Source§

impl ValidateEmail for String

Source§

impl<T> ValidateEmail for &T
where T: ValidateEmail,

Source§

impl<T> ValidateEmail for Option<T>
where T: ValidateEmail,

Implementors§