pub struct Envelope { /* private fields */ }Expand description
Simple email envelope representation
We only accept mailboxes, and do not support source routes (as per RFC).
Implementations§
Source§impl Envelope
impl Envelope
Sourcepub fn to(&self) -> &[Address]
pub fn to(&self) -> &[Address]
Gets the destination addresses of the envelope.
§Examples
let sender = "from@email.com".parse::<Address>()?;
let recipients = vec!["to@email.com".parse::<Address>()?];
let envelope = Envelope::new(Some(sender), recipients.clone())?;
assert_eq!(envelope.to(), recipients.as_slice());Sourcepub fn from(&self) -> Option<&Address>
pub fn from(&self) -> Option<&Address>
Gets the sender of the envelope.
§Examples
let sender = "from@email.com".parse::<Address>()?;
let recipients = vec!["to@email.com".parse::<Address>()?];
let envelope = Envelope::new(Some(sender), recipients.clone())?;
assert!(envelope.from().is_some());
let senderless = Envelope::new(None, recipients.clone())?;
assert!(senderless.from().is_none());Trait Implementations§
impl Eq for Envelope
impl StructuralPartialEq for Envelope
Auto Trait Implementations§
impl Freeze for Envelope
impl RefUnwindSafe for Envelope
impl Send for Envelope
impl Sync for Envelope
impl Unpin for Envelope
impl UnwindSafe for Envelope
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§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 more