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 get_contents(&'x self) -> &'x [u8] ⓘ
pub fn get_contents(&'x self) -> &'x [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§
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<'de: 'x, 'x> Deserialize<'de> for MessagePart<'x>
impl<'de: 'x, 'x> Deserialize<'de> for MessagePart<'x>
Source§fn 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
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 get_content_description(&self) -> Option<&str>
fn get_content_description(&self) -> Option<&str>
Returns the Content-Description field
Source§fn get_content_disposition(&self) -> Option<&ContentType<'_>>
fn get_content_disposition(&self) -> Option<&ContentType<'_>>
Returns the Content-Disposition field
Source§fn get_content_id(&self) -> Option<&str>
fn get_content_id(&self) -> Option<&str>
Returns the Content-ID field
Source§fn get_content_transfer_encoding(&self) -> Option<&str>
fn get_content_transfer_encoding(&self) -> Option<&str>
Returns the Content-Encoding field
Source§fn get_content_type(&self) -> Option<&ContentType<'_>>
fn get_content_type(&self) -> Option<&ContentType<'_>>
Returns the Content-Type field
Source§fn get_content_language(&self) -> &HeaderValue<'_>
fn get_content_language(&self) -> &HeaderValue<'_>
Returns the Content-Language field
Source§fn get_content_location(&self) -> Option<&str>
fn get_content_location(&self) -> Option<&str>
Returns the Content-Location field
Source§fn get_attachment_name(&self) -> Option<&str>
fn get_attachment_name(&self) -> Option<&str>
Returns the attachment name, if any.
Source§impl<'x> PartialEq for MessagePart<'x>
impl<'x> PartialEq for MessagePart<'x>
Source§impl<'x> Serialize for MessagePart<'x>
impl<'x> Serialize for MessagePart<'x>
impl<'x> StructuralPartialEq for MessagePart<'x>
Auto Trait Implementations§
impl<'x> Freeze for MessagePart<'x>
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§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more