pub struct Address { /* private fields */ }Expand description
A mailbox: bare address plus optional display name.
Implementations§
Source§impl Address
impl Address
Sourcepub fn new(email: impl Into<String>) -> Result<Address, MailerError>
pub fn new(email: impl Into<String>) -> Result<Address, MailerError>
Creates an address with no display name.
§Errors
Returns MailerError::InvalidAddress when email is empty or lacks @.
Sourcepub fn with_name(
email: impl Into<String>,
name: Option<impl Into<String>>,
) -> Result<Address, MailerError>
pub fn with_name( email: impl Into<String>, name: Option<impl Into<String>>, ) -> Result<Address, MailerError>
Creates an address with an optional display name.
§Errors
Returns MailerError::InvalidAddress when email is empty or lacks @.
Sourcepub fn parse(raw: &str) -> Result<Address, MailerError>
pub fn parse(raw: &str) -> Result<Address, MailerError>
Parses email@host or Display Name <email@host>.
§Errors
Returns MailerError::InvalidAddress when the mailbox is invalid.
Sourcepub fn parse_list(raw: &str) -> Result<Vec<Address>, MailerError>
pub fn parse_list(raw: &str) -> Result<Vec<Address>, MailerError>
Parses a comma-separated list of mailboxes.
§Errors
Returns the first MailerError::InvalidAddress encountered.
Trait Implementations§
impl Eq for Address
impl StructuralPartialEq for Address
Auto Trait Implementations§
impl Forget for Address
impl Freeze for Address
impl Move 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> SerializableKey for T
impl<T> SerializableKey for T
Source§impl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Source§fn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Borrows the value.
Source§fn into_taken(self) -> T
fn into_taken(self) -> T
Takes the value.
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more