pub struct MailAddress { /* private fields */ }
Expand description

A simple MailAddress type

In difference to ForwardPath and ReversePath this is only a mail address and no other “path” parts. Which is how the paths are mostly used today anyway.

This type also keeps track of wether or not SMTPUTF8 is required.

Temporary Limitations

Currently this type doesn’t has a mail address parser, once I find a good crate for this it will be included. I.e. currently you have to make sure you mail is valid and then use from_unchecked to crate a MailAddress, this will also check if it’s an internationalized mail address as it can do so without needing to check the grammar.

Implementations§

create a new MailAddress from parts

this methods relies on the given values to be correct if the raw_mail is actually an internationalized mail address but needs_smtputf8 is false this can lead to problems up to a disconnection of the server (especially if it’s an old one)

create a mail from a string not checking syntactical validity

(through it does check if it’s an internationalized mail address)

Trait Implementations§

Converts this type into a shared reference of the (usually inferred) input type.
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Converts to this type from the input type.
Converts to this type from the input type.
Converts this type into the (usually inferred) input type.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.