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
sourceimpl<'x> ContentType<'x>
impl<'x> ContentType<'x>
An RFC2047 Content-Type or RFC2183 Content-Disposition MIME header field.
sourcepub fn get_subtype(&self) -> Option<&str>
pub fn get_subtype(&self) -> Option<&str>
Returns the sub-type
sourcepub fn get_attribute(&self, name: &str) -> Option<&str>
pub fn get_attribute(&self, name: &str) -> Option<&str>
Returns an attribute by name
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
sourceimpl<'x> Clone for ContentType<'x>
impl<'x> Clone for ContentType<'x>
sourcefn clone(&self) -> ContentType<'x>
fn clone(&self) -> ContentType<'x>
Returns a copy of the value. Read more
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl<'x> Debug for ContentType<'x>
impl<'x> Debug for ContentType<'x>
sourceimpl<'x> PartialEq<ContentType<'x>> for ContentType<'x>
impl<'x> PartialEq<ContentType<'x>> for ContentType<'x>
sourcefn eq(&self, other: &ContentType<'x>) -> bool
fn eq(&self, other: &ContentType<'x>) -> bool
impl<'x> Eq for ContentType<'x>
impl<'x> StructuralEq for ContentType<'x>
impl<'x> StructuralPartialEq for ContentType<'x>
Auto Trait Implementations
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
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