pub struct Mailbox { /* private fields */ }Expand description
Represents an email address, aka “mailbox” in the SMTP spec.
It is composed of a local part and a foreign part. If the address is sent to the Postmaster
address for a domain, then the local part will always be converted postmaster, all lowercase.
Since the Postmaster address must be handled without regard for case, this makes things simpler.
Implementations§
Source§impl Mailbox
impl Mailbox
Sourcepub fn parse(s: &str) -> Result<Mailbox, MailboxParseError>
pub fn parse(s: &str) -> Result<Mailbox, MailboxParseError>
Creates a Mailbox from a string if the string contains a valid email
address. Otherwise, returns a MailboxParseError.
The argument should be of the form:
hello@world.com
This function does not expect anything to wrap the passed email
address. For example, this will result in an error:
<hello@world.com>
Trait Implementations§
impl Eq for Mailbox
impl StructuralPartialEq for Mailbox
Auto Trait Implementations§
impl Freeze for Mailbox
impl RefUnwindSafe for Mailbox
impl Send for Mailbox
impl Sync for Mailbox
impl Unpin for Mailbox
impl UnsafeUnpin for Mailbox
impl UnwindSafe for Mailbox
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