[−][src]Struct email_parser::email::Email
A struct representing a valid RFC 5322 message.
Example
let email = Email::parse( b"\ From: Mubelotix <mubelotix@mubelotix.dev>\r\n\ Subject:Example Email\r\n\ To: Someone <example@example.com>\r\n\ Message-id: <6546518945@mubelotix.dev>\r\n\ Date: 5 May 2003 18:58:34 +0000\r\n\ \r\n\ Hey!\r\n", ) .unwrap(); assert_eq!(email.subject.unwrap(), "Example Email"); assert_eq!(email.sender.name.unwrap(), vec!["Mubelotix"]); assert_eq!(email.sender.address.local_part, "mubelotix"); assert_eq!(email.sender.address.domain, "mubelotix.dev");
Fields
body: Option<Cow<'a, str>>
The ASCII text of the body.
from: Vec<Mailbox<'a>>
The list of authors of the message.
It's not the identity of the sender. See the sender field.
sender: Mailbox<'a>
The mailbox of the agent responsible for the actual transmission of the message.
Do not mix up with the from field that contains the list of authors.
When there is only one author, this field can be omitted, and its value is inferred. Otherwise, an explicit value is required.
subject: Option<Cow<'a, str>>
A short optional string identifying the topic of the message.
date: DateTime
The date and time at which the sender of the message indicated that the message was complete and ready to enter the mail delivery system. For instance, this might be the time that a user pushes the "send" or "submit" button in an application program.
to: Option<Vec<Address<'a>>>
cc: Option<Vec<Address<'a>>>
bcc: Option<Vec<Address<'a>>>
message_id: Option<(Cow<'a, str>, Cow<'a, str>)>
in_reply_to: Option<Vec<(Cow<'a, str>, Cow<'a, str>)>>
references: Option<Vec<(Cow<'a, str>, Cow<'a, str>)>>
reply_to: Option<Vec<Address<'a>>>
comments: Vec<Cow<'a, str>>
keywords: Vec<Vec<Cow<'a, str>>>
trace: Vec<(Option<Option<EmailAddress<'a>>>, Vec<(Vec<ReceivedToken<'a>>, DateTime)>, Vec<TraceField<'a>>)>
unknown_fields: Vec<(Cow<'a, str>, Cow<'a, str>)>
The list of unrecognized fields.
Each field is stored as a (name, value)
tuple.
Implementations
impl<'a> Email<'a>
[src]
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for Email<'a>
impl<'a> Send for Email<'a>
impl<'a> Sync for Email<'a>
impl<'a> Unpin for Email<'a>
impl<'a> UnwindSafe for Email<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,