pub struct Message<'x> {
    pub html_body: Vec<MessagePartId>,
    pub text_body: Vec<MessagePartId>,
    pub attachments: Vec<MessagePartId>,
    pub parts: Vec<MessagePart<'x>>,
    pub raw_message: Cow<'x, [u8]>,
}
Expand description

An RFC5322/RFC822 message.

Fields

html_body: Vec<MessagePartId>text_body: Vec<MessagePartId>attachments: Vec<MessagePartId>parts: Vec<MessagePart<'x>>raw_message: Cow<'x, [u8]>

Implementations

Returns false if at least one header field was successfully parsed.

Parses a byte slice containing the RFC5322 raw message and returns a Message struct.

This function never panics, a best-effort is made to parse the message and if no headers are found None is returned.

Returns the root message part

Returns a parsed header.

Removed a parsed header and returns its value.

Removed a parsed RFC heade and returns its value.

Returns the raw header.

Returns an iterator over the RFC headers of this message.

Returns an iterator over the matching RFC headers of this message.

Returns all headers in raw format

Returns the BCC header field

Returns the CC header field

Returns all Comments header fields

Returns the Date header field

Returns the From header field

Returns all In-Reply-To header fields

Returns all Keywords header fields

Returns the List-Archive header field

Returns the List-Help header field

Returns the List-ID header field

Returns the List-Owner header field

source

pub fn get_list_post(&self) -> &HeaderValue<'_>

Returns the List-Post header field

Returns the List-Subscribe header field

Returns the List-Unsubscribe header field

Returns the Message-ID header field

Returns the MIME-Version header field

Returns all Received header fields

Returns all References header fields

Returns the Reply-To header field

Returns the Resent-BCC header field

Returns the Resent-CC header field

Returns all Resent-Date header fields

Returns the Resent-From header field

Returns all Resent-Message-ID header fields

Returns the Sender header field

Returns the Resent-To header field

Returns all Return-Path header fields

Returns the return address from either the Return-Path or From header fields

Returns the Sender header field

Returns the Subject header field

Returns the message thread name or ‘base subject’ as defined in RFC 5957 - Internet Message Access Protocol - SORT and THREAD Extensions (Section 2.1)

Returns the To header field

Returns a preview of the message body

Returns the transformed contents an inline HTML body part by position

Returns the transformed contents an inline text body part by position

Returns a message part by position

Returns an inline HTML body part by position

Returns an inline text body part by position

Returns an attacment by position

Returns the number of plain text body parts

Returns the number of HTML body parts

Returns the number of attachments

Returns an Interator over the text body parts

Returns an Interator over the HTML body parts

Returns an Interator over the attachments

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

Returns the Content-Description field

Returns the Content-Disposition field

Returns the Content-ID field

Returns the Content-Encoding field

Returns the Content-Type field

Returns the Content-Language field

Returns the Content-Location field

Returns the attachment name, if any.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Serialize this value into the given Serde serializer. Read more

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.