Struct melib::email::attachments::Attachment
source · pub struct Attachment {
pub content_type: ContentType,
pub content_transfer_encoding: ContentTransferEncoding,
pub content_disposition: ContentDisposition,
pub raw: Vec<u8>,
pub body: StrBuilder,
}
Expand description
Immutable attachment type.
Fields§
§content_type: ContentType
§content_transfer_encoding: ContentTransferEncoding
§content_disposition: ContentDisposition
§raw: Vec<u8>
§body: StrBuilder
Implementations§
source§impl Attachment
impl Attachment
pub fn new( content_type: ContentType, content_transfer_encoding: ContentTransferEncoding, raw: Vec<u8> ) -> Self
pub fn raw(&self) -> &[u8] ⓘ
pub fn body(&self) -> &[u8] ⓘ
pub fn part_boundaries(&self) -> Vec<StrBuilder>
pub fn check_if_has_attachments_quick(bytes: &[u8], boundary: &[u8]) -> bool
pub fn text(&self) -> String
pub fn mime_type(&self) -> String
pub fn attachments(&self) -> Vec<Self>
pub fn count_attachments(&self) -> usize
pub fn content_type(&self) -> &ContentType
pub fn content_transfer_encoding(&self) -> &ContentTransferEncoding
pub fn is_text(&self) -> bool
pub fn is_html(&self) -> bool
pub fn is_encrypted(&self) -> bool
pub fn is_signed(&self) -> bool
pub fn into_raw(&self) -> String
pub fn parameters(&self) -> Vec<(&[u8], &[u8])>
pub fn filename(&self) -> Option<String>
pub fn decode_rec(&self, options: DecodeOptions<'_>) -> Vec<u8>
pub fn decode(&self, options: DecodeOptions<'_>) -> Vec<u8>
Trait Implementations§
source§impl Clone for Attachment
impl Clone for Attachment
source§fn clone(&self) -> Attachment
fn clone(&self) -> Attachment
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 Debug for Attachment
impl Debug for Attachment
source§impl<'de> Deserialize<'de> for Attachment
impl<'de> Deserialize<'de> for Attachment
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 Display for Attachment
impl Display for Attachment
source§impl From<Attachment> for AttachmentBuilder
impl From<Attachment> for AttachmentBuilder
source§fn from(val: Attachment) -> Self
fn from(val: Attachment) -> Self
Converts to this type from the input type.
source§impl From<AttachmentBuilder> for Attachment
impl From<AttachmentBuilder> for Attachment
source§fn from(val: AttachmentBuilder) -> Self
fn from(val: AttachmentBuilder) -> Self
Converts to this type from the input type.
source§impl Hash for Attachment
impl Hash for Attachment
source§impl PartialEq for Attachment
impl PartialEq for Attachment
source§fn eq(&self, other: &Attachment) -> bool
fn eq(&self, other: &Attachment) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for Attachment
impl Serialize for Attachment
impl Eq for Attachment
impl StructuralPartialEq for Attachment
Auto Trait Implementations§
impl Freeze for Attachment
impl RefUnwindSafe for Attachment
impl Send for Attachment
impl Sync for Attachment
impl Unpin for Attachment
impl UnwindSafe for Attachment
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
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.