Struct new_tokio_smtp::send_mail::MailAddress
source · 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§
source§impl MailAddress
impl MailAddress
sourcepub fn new_unchecked(raw_email: String, needs_smtputf8: bool) -> Self
pub fn new_unchecked(raw_email: String, needs_smtputf8: bool) -> Self
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)
sourcepub fn from_unchecked<I>(raw: I) -> Selfwhere
I: Into<String> + AsRef<str>,
pub fn from_unchecked<I>(raw: I) -> Selfwhere
I: Into<String> + AsRef<str>,
create a mail from a string not checking syntactical validity
(through it does check if it’s an internationalized mail address)
pub fn needs_smtputf8(&self) -> bool
pub fn as_str(&self) -> &str
Trait Implementations§
source§impl AsRef<str> for MailAddress
impl AsRef<str> for MailAddress
source§impl Clone for MailAddress
impl Clone for MailAddress
source§fn clone(&self) -> MailAddress
fn clone(&self) -> MailAddress
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more