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 more