Struct mail_parser::MessagePart
source · pub struct MessagePart<'x> {
pub headers: Vec<Header<'x>>,
pub is_encoding_problem: bool,
pub body: PartType<'x>,
pub encoding: Encoding,
pub offset_header: usize,
pub offset_body: usize,
pub offset_end: usize,
}
Expand description
MIME Message Part
Fields§
§headers: Vec<Header<'x>>
§is_encoding_problem: bool
§body: PartType<'x>
§encoding: Encoding
§offset_header: usize
§offset_body: usize
§offset_end: usize
Implementations§
source§impl<'x> MessagePart<'x>
impl<'x> MessagePart<'x>
sourcepub fn text_contents(&'x self) -> Option<&'x str>
pub fn text_contents(&'x self) -> Option<&'x str>
Returns the body part’s contents as a str
sourcepub fn sub_parts(&'x self) -> Option<&[MessagePartId]>
pub fn sub_parts(&'x self) -> Option<&[MessagePartId]>
Returns the sub parts ids of a MIME part
sourcepub fn is_text_html(&self) -> bool
pub fn is_text_html(&self) -> bool
Returns true
when the body part MIME type is text/tml
sourcepub fn is_multipart(&self) -> bool
pub fn is_multipart(&self) -> bool
Returns true
when the part is multipart
sourcepub fn is_message(&self) -> bool
pub fn is_message(&self) -> bool
Returns true
when the part is a nested message
sourcepub fn raw_header_offset(&self) -> usize
pub fn raw_header_offset(&self) -> usize
Get the raw header offset of this part
sourcepub fn raw_body_offset(&self) -> usize
pub fn raw_body_offset(&self) -> usize
Get the raw body offset of this part
sourcepub fn raw_end_offset(&self) -> usize
pub fn raw_end_offset(&self) -> usize
Get the raw body end offset of this part
sourcepub fn into_owned<'y>(self) -> MessagePart<'y>
pub fn into_owned<'y>(self) -> MessagePart<'y>
Returns an owned version of the this part
Trait Implementations§
source§impl<'x> Clone for MessagePart<'x>
impl<'x> Clone for MessagePart<'x>
source§fn clone(&self) -> MessagePart<'x>
fn clone(&self) -> MessagePart<'x>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<'x> Debug for MessagePart<'x>
impl<'x> Debug for MessagePart<'x>
source§impl<'x> Default for MessagePart<'x>
impl<'x> Default for MessagePart<'x>
source§fn default() -> MessagePart<'x>
fn default() -> MessagePart<'x>
Returns the “default value” for a type. Read more
source§impl<'x> Display for MessagePart<'x>
impl<'x> Display for MessagePart<'x>
source§impl<'x> MimeHeaders<'x> for MessagePart<'x>
impl<'x> MimeHeaders<'x> for MessagePart<'x>
source§fn content_description(&self) -> Option<&str>
fn content_description(&self) -> Option<&str>
Returns the Content-Description field
source§fn content_disposition(&self) -> Option<&ContentType<'_>>
fn content_disposition(&self) -> Option<&ContentType<'_>>
Returns the Content-Disposition field
source§fn content_id(&self) -> Option<&str>
fn content_id(&self) -> Option<&str>
Returns the Content-ID field
source§fn content_transfer_encoding(&self) -> Option<&str>
fn content_transfer_encoding(&self) -> Option<&str>
Returns the Content-Encoding field
source§fn content_type(&self) -> Option<&ContentType<'_>>
fn content_type(&self) -> Option<&ContentType<'_>>
Returns the Content-Type field
source§fn content_language(&self) -> &HeaderValue<'_>
fn content_language(&self) -> &HeaderValue<'_>
Returns the Content-Language field
source§fn content_location(&self) -> Option<&str>
fn content_location(&self) -> Option<&str>
Returns the Content-Location field
source§fn attachment_name(&self) -> Option<&str>
fn attachment_name(&self) -> Option<&str>
Returns the attachment name, if any.