pub struct EmailAddress { /* private fields */ }Expand description
A parsed, validated, and normalized email address.
Immutable after construction. All accessors return borrowed data.
Implementations§
Source§impl EmailAddress
impl EmailAddress
Sourcepub fn parse_with(input: &str, config: &Config) -> Result<Self, Error>
pub fn parse_with(input: &str, config: &Config) -> Result<Self, Error>
Parse and validate with the given configuration.
Sourcepub fn local_part(&self) -> &str
pub fn local_part(&self) -> &str
The canonical local part (after normalization).
If subaddress stripping is enabled, this excludes the +tag.
If dot stripping is enabled, dots are removed.
Sourcepub fn tag(&self) -> Option<&str>
pub fn tag(&self) -> Option<&str>
The extracted subaddress tag, if present.
For user+promo@example.com, returns Some("promo").
Always extracted regardless of SubaddressPolicy — the policy only
affects whether it appears in canonical().
Sourcepub fn display_name(&self) -> Option<&str>
pub fn display_name(&self) -> Option<&str>
The display name, if parsed from "Name" <addr> or Name <addr> format.
Sourcepub fn skeleton(&self) -> Option<&str>
pub fn skeleton(&self) -> Option<&str>
The confusable skeleton of the local part (if config enabled it).
Two addresses with the same skeleton + domain are visually confusable.
Sourcepub fn is_freemail(&self) -> bool
pub fn is_freemail(&self) -> bool
Check if the domain is a well-known freemail provider.
Trait Implementations§
Source§impl Clone for EmailAddress
impl Clone for EmailAddress
Source§fn clone(&self) -> EmailAddress
fn clone(&self) -> EmailAddress
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EmailAddress
impl Debug for EmailAddress
Source§impl<'de> Deserialize<'de> for EmailAddress
Available on crate feature serde only.
impl<'de> Deserialize<'de> for EmailAddress
serde only.Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Source§impl Display for EmailAddress
impl Display for EmailAddress
Source§impl FromStr for EmailAddress
impl FromStr for EmailAddress
Source§impl Hash for EmailAddress
impl Hash for EmailAddress
Source§impl PartialEq for EmailAddress
impl PartialEq for EmailAddress
Source§impl Serialize for EmailAddress
Available on crate feature serde only.
impl Serialize for EmailAddress
serde only.