pub enum Address<'x> {
Address(EmailAddress<'x>),
Group(GroupedAddresses<'x>),
List(Vec<Address<'x>>),
}Expand description
RFC5322 address
Variants
Address(EmailAddress<'x>)
Group(GroupedAddresses<'x>)
List(Vec<Address<'x>>)
Implementations
sourceimpl<'x> Address<'x>
impl<'x> Address<'x>
sourcepub fn new_address(
name: Option<impl Into<Cow<'x, str>>>,
email: impl Into<Cow<'x, str>>
) -> Self
pub fn new_address(
name: Option<impl Into<Cow<'x, str>>>,
email: impl Into<Cow<'x, str>>
) -> Self
Create an RFC5322 e-mail address
sourcepub fn new_group(
name: Option<impl Into<Cow<'x, str>>>,
addresses: Vec<Address<'x>>
) -> Self
pub fn new_group(
name: Option<impl Into<Cow<'x, str>>>,
addresses: Vec<Address<'x>>
) -> Self
Create an RFC5322 grouped e-mail address
pub fn unwrap_address(&self) -> &EmailAddress<'x>
Trait Implementations
sourceimpl<'x, T, U> From<(U, Vec<T, Global>)> for Address<'x>where
T: Into<Address<'x>>,
U: Into<Cow<'x, str>>,
impl<'x, T, U> From<(U, Vec<T, Global>)> for Address<'x>where
T: Into<Address<'x>>,
U: Into<Cow<'x, str>>,
sourceimpl<'x> From<Address<'x>> for HeaderType<'x>
impl<'x> From<Address<'x>> for HeaderType<'x>
sourceimpl<'x> Ord for Address<'x>
impl<'x> Ord for Address<'x>
1.21.0 · sourceconst fn max(self, other: Self) -> Self
const fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourceconst fn min(self, other: Self) -> Self
const fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourceconst fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
const fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<'x> PartialEq<Address<'x>> for Address<'x>
impl<'x> PartialEq<Address<'x>> for Address<'x>
sourceimpl<'x> PartialOrd<Address<'x>> for Address<'x>
impl<'x> PartialOrd<Address<'x>> for Address<'x>
sourcefn partial_cmp(&self, other: &Address<'x>) -> Option<Ordering>
fn partial_cmp(&self, other: &Address<'x>) -> Option<Ordering>
1.0.0 · sourceconst fn le(&self, other: &Rhs) -> bool
const fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moreimpl<'x> Eq for Address<'x>
impl<'x> StructuralEq for Address<'x>
impl<'x> StructuralPartialEq for Address<'x>
Auto Trait Implementations
impl<'x> RefUnwindSafe for Address<'x>
impl<'x> Send for Address<'x>
impl<'x> Sync for Address<'x>
impl<'x> Unpin for Address<'x>
impl<'x> UnwindSafe for Address<'x>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more