Struct email::MimeMessage [] [src]

pub struct MimeMessage {
    pub headers: HeaderMap,
    pub body: String,
    pub message_type: Option<MimeMultipartType>,
    pub children: Vec<MimeMessage>,
    pub boundary: String,
}

Represents a MIME message [unstable]

Fields

headers

The headers for this message

body

The content of this message

Keep in mind that this is the undecoded form, so may be quoted-printable or base64 encoded.

message_type

The MIME multipart message type of this message, or None if the message is not a multipart message.

children

The sub-messages of this message

boundary

The boundary used for MIME multipart messages

This will always be set, even if the message only has a single part

Methods

impl MimeMessage

fn new(body: String) -> MimeMessage

[unstable]

fn new_with_children(body: String, message_type: MimeMultipartType, children: Vec<MimeMessage>) -> MimeMessage

fn new_with_boundary(body: String, message_type: MimeMultipartType, children: Vec<MimeMessage>, boundary: String) -> MimeMessage

fn new_blank_message() -> MimeMessage

fn update_headers(&mut self)

Update the headers on this message based on the internal state.

When certain properties of the message are modified, the headers used to represent them are not automatically updated. Call this if these are changed.

fn parse(s: &str) -> ParsingResult<MimeMessage>

Parse s into a MimeMessage.

Recurses down into each message, supporting an unlimited depth of messages.

Be warned that each sub-message that fails to be parsed will be thrown away. [unstable]

fn as_string(&self) -> String

fn as_string_without_headers(&self) -> String

fn decoded_body_bytes(&self) -> Option<Vec<u8>>

Decode the body of this message, as a series of bytes

fn decoded_body_string(&self) -> ParsingResult<String>

Decode the body of this message, as a string.

This takes into account any charset as set on the Content-Type header, decoding the bytes with this character set.

Trait Implementations

Derived Implementations

impl Clone for MimeMessage

fn clone(&self) -> MimeMessage

fn clone_from(&mut self, source: &Self)

impl Debug for MimeMessage

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl PartialEq for MimeMessage

fn eq(&self, __arg_0: &MimeMessage) -> bool

fn ne(&self, __arg_0: &MimeMessage) -> bool

impl Eq for MimeMessage