pub struct Address { /* private fields */ }Expand description
One mailbox: an address, and optionally the name a human should see.
Implementations§
Source§impl Address
impl Address
Sourcepub fn named(
name: impl Into<String>,
email: impl Into<String>,
) -> Result<Address>
pub fn named( name: impl Into<String>, email: impl Into<String>, ) -> Result<Address>
An address with the name a recipient’s client will show.
Sourcepub fn parse(input: &str) -> Result<Address>
pub fn parse(input: &str) -> Result<Address>
Parse Ada Lovelace <ada@example.com>, <ada@example.com>, or a bare
ada@example.com — the three shapes a configuration file or a header
actually contains.
pub fn email(&self) -> &str
pub fn name(&self) -> Option<&str>
Trait Implementations§
impl Eq for Address
Source§impl IntoAddress for Address
impl IntoAddress for Address
fn into_address(self) -> Result<Address>
Source§impl IntoAddress for &Address
impl IntoAddress for &Address
fn into_address(self) -> Result<Address>
impl StructuralPartialEq for Address
Auto Trait Implementations§
impl Freeze for Address
impl RefUnwindSafe for Address
impl Send for Address
impl Sync for Address
impl Unpin for Address
impl UnsafeUnpin for Address
impl UnwindSafe for Address
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