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<HashMap<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<HashMap<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(&'x self) -> Option<&'x str>
pub fn get_subtype(&'x self) -> Option<&'x str>
Returns the sub-type
sourcepub fn get_attribute(&'x self, name: &str) -> Option<&'x str>
pub fn get_attribute(&'x self, name: &str) -> Option<&'x str>
Returns an attribute by name
sourcepub fn has_attribute(&'x self, name: &str) -> bool
pub fn has_attribute(&'x self, name: &str) -> bool
Returns true
when the provided attribute name is present
sourcepub fn is_attachment(&'x self) -> bool
pub fn is_attachment(&'x self) -> bool
Returns true
if the Content-Disposition type is “attachment”
Trait Implementations
sourceimpl<'x> Debug for ContentType<'x>
impl<'x> Debug for ContentType<'x>
sourceimpl<'de, 'x> Deserialize<'de> for ContentType<'x>
impl<'de, 'x> Deserialize<'de> for ContentType<'x>
sourcefn 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
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
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &ContentType<'x>) -> bool
fn ne(&self, other: &ContentType<'x>) -> bool
This method tests for !=
.
sourceimpl<'x> Serialize for ContentType<'x>
impl<'x> Serialize 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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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