#[non_exhaustive]pub enum EmailError {
Empty,
TooLong(usize),
MissingAtSymbol,
MultipleAtSymbols,
EmptyLocalPart,
EmptyDomain,
LocalPartTooLong(usize),
InvalidLocalPartChar(char),
LocalPartStartsWithDot,
LocalPartEndsWithDot,
LocalPartConsecutiveDots,
InvalidDomain,
}net only.Expand description
Error type for email validation.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Empty
Empty email
The provided string is empty. Email addresses must contain at least one character.
TooLong(usize)
Email exceeds maximum length of 254 characters
According to RFC 5321, email addresses must not exceed 254 characters. This variant contains the actual length of the provided email.
MissingAtSymbol
Missing @ symbol
Email addresses must contain exactly one @ symbol separating the local and domain parts.
MultipleAtSymbols
Multiple @ symbols
Email addresses must contain exactly one @ symbol.
EmptyLocalPart
Empty local part
The local part (before @) is empty.
EmptyDomain
Empty domain part
The domain part (after @) is empty.
LocalPartTooLong(usize)
Local part exceeds maximum length of 64 characters
According to RFC 5321, the local part must not exceed 64 characters. This variant contains the actual length of the local part.
InvalidLocalPartChar(char)
Invalid character in local part The local part contains an invalid character. This variant contains the invalid character.
LocalPartStartsWithDot
Local part starts with a dot
The local part cannot start with a dot.
LocalPartEndsWithDot
Local part ends with a dot
The local part cannot end with a dot.
LocalPartConsecutiveDots
Local part contains consecutive dots
The local part cannot contain consecutive dots.
InvalidDomain
Invalid domain part
The domain part is invalid according to RFC 1035. This variant contains the domain validation error.
Trait Implementations§
Source§impl Clone for EmailError
impl Clone for EmailError
Source§fn clone(&self) -> EmailError
fn clone(&self) -> EmailError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EmailError
impl Debug for EmailError
Source§impl<'de> Deserialize<'de> for EmailError
impl<'de> Deserialize<'de> for EmailError
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for EmailError
impl Display for EmailError
Source§impl Error for EmailError
Available on crate feature std only.
impl Error for EmailError
std only.