Struct mail_parser::ContentType
source · pub struct ContentType<'x> {
pub c_type: Cow<'x, str>,
pub c_subtype: Option<Cow<'x, str>>,
pub attributes: Option<Vec<(Cow<'x, str>, Cow<'x, str>)>>,
}
Expand description
An RFC2047 Content-Type or RFC2183 Content-Disposition MIME header field.
Fields§
§c_type: Cow<'x, str>
§c_subtype: Option<Cow<'x, str>>
§attributes: Option<Vec<(Cow<'x, str>, Cow<'x, str>)>>
Implementations§
source§impl<'x> ContentType<'x>
impl<'x> ContentType<'x>
An RFC2047 Content-Type or RFC2183 Content-Disposition MIME header field.
sourcepub fn remove_attribute(&mut self, name: &str) -> Option<Cow<'_, str>>
pub fn remove_attribute(&mut self, name: &str) -> Option<Cow<'_, str>>
Removes an attribute by name
sourcepub fn has_attribute(&self, name: &str) -> bool
pub fn has_attribute(&self, name: &str) -> bool
Returns true
when the provided attribute name is present
sourcepub fn is_attachment(&self) -> bool
pub fn is_attachment(&self) -> bool
Returns true
if the Content-Disposition type is “attachment”
Trait Implementations§
source§impl<'x> Clone for ContentType<'x>
impl<'x> Clone for ContentType<'x>
source§fn clone(&self) -> ContentType<'x>
fn clone(&self) -> ContentType<'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 ContentType<'x>
impl<'x> Debug for ContentType<'x>
source§impl<'x> PartialEq for ContentType<'x>
impl<'x> PartialEq for ContentType<'x>
source§fn eq(&self, other: &ContentType<'x>) -> bool
fn eq(&self, other: &ContentType<'x>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<'x> Eq for ContentType<'x>
impl<'x> StructuralPartialEq for ContentType<'x>
Auto Trait Implementations§
impl<'x> Freeze for ContentType<'x>
impl<'x> RefUnwindSafe for ContentType<'x>
impl<'x> Send for ContentType<'x>
impl<'x> Sync for ContentType<'x>
impl<'x> Unpin for ContentType<'x>
impl<'x> UnwindSafe for ContentType<'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