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
sourceimpl<'x> MessagePart<'x>
impl<'x> MessagePart<'x>
sourcepub fn get_contents(&'x self) -> &'x [u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
pub fn get_contents(&'x self) -> &'x [u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
Returns the body part’s contents as a u8
slice
sourcepub fn get_text_contents(&'x self) -> Option<&'x str>
pub fn get_text_contents(&'x self) -> Option<&'x str>
Returns the body part’s contents as a str
sourcepub fn get_message(&'x self) -> Option<Cow<'x, Message<'x>>>
pub fn get_message(&'x self) -> Option<Cow<'x, Message<'x>>>
Returns the nested message
sourcepub fn get_sub_parts(&'x self) -> Option<&'_ [MessagePartId]>
pub fn get_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 offset_end_offset(&self) -> usize
pub fn offset_end_offset(&self) -> usize
Get the raw body end offset of this part
Trait Implementations
sourceimpl<'x> Clone for MessagePart<'x>
impl<'x> Clone for MessagePart<'x>
sourcefn clone(&self) -> MessagePart<'x>
fn clone(&self) -> MessagePart<'x>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<'x> Debug for MessagePart<'x>
impl<'x> Debug for MessagePart<'x>
sourceimpl<'x> Default for MessagePart<'x>
impl<'x> Default for MessagePart<'x>
sourcefn default() -> MessagePart<'x>
fn default() -> MessagePart<'x>
Returns the “default value” for a type. Read more
sourceimpl<'de: 'x, 'x> Deserialize<'de> for MessagePart<'x>
impl<'de: 'x, 'x> Deserialize<'de> for MessagePart<'x>
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<'x> Display for MessagePart<'x>
impl<'x> Display for MessagePart<'x>
sourceimpl<'x> MimeHeaders<'x> for MessagePart<'x>
impl<'x> MimeHeaders<'x> for MessagePart<'x>
sourcefn get_content_description(&self) -> Option<&str>
fn get_content_description(&self) -> Option<&str>
Returns the Content-Description field
sourcefn get_content_disposition(&self) -> Option<&ContentType<'_>>
fn get_content_disposition(&self) -> Option<&ContentType<'_>>
Returns the Content-Disposition field
sourcefn get_content_id(&self) -> Option<&str>
fn get_content_id(&self) -> Option<&str>
Returns the Content-ID field
sourcefn get_content_transfer_encoding(&self) -> Option<&str>
fn get_content_transfer_encoding(&self) -> Option<&str>
Returns the Content-Encoding field
sourcefn get_content_type(&self) -> Option<&ContentType<'_>>
fn get_content_type(&self) -> Option<&ContentType<'_>>
Returns the Content-Type field
sourcefn get_content_language(&self) -> &HeaderValue<'_>
fn get_content_language(&self) -> &HeaderValue<'_>
Returns the Content-Language field
sourcefn get_content_location(&self) -> Option<&str>
fn get_content_location(&self) -> Option<&str>
Returns the Content-Location field
sourcefn get_attachment_name(&self) -> Option<&str>
fn get_attachment_name(&self) -> Option<&str>
Returns the attachment name, if any.
sourceimpl<'x> PartialEq<MessagePart<'x>> for MessagePart<'x>
impl<'x> PartialEq<MessagePart<'x>> for MessagePart<'x>
sourcefn eq(&self, other: &MessagePart<'x>) -> bool
fn eq(&self, other: &MessagePart<'x>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourceimpl<'x> Serialize for MessagePart<'x>
impl<'x> Serialize for MessagePart<'x>
impl<'x> StructuralPartialEq for MessagePart<'x>
Auto Trait Implementations
impl<'x> RefUnwindSafe for MessagePart<'x>
impl<'x> Send for MessagePart<'x>
impl<'x> Sync for MessagePart<'x>
impl<'x> Unpin for MessagePart<'x>
impl<'x> UnwindSafe for MessagePart<'x>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more