pub struct ContentType<'x> {
pub c_type: Cow<'x, str>,
pub c_subtype: Option<Cow<'x, str>>,
pub attributes: Option<Vec<Attribute<'x>>>,
}
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<Attribute<'x>>>
Implementations§
Source§impl<'x> ContentType<'x>
An RFC2047 Content-Type or RFC2183 Content-Disposition MIME header field.
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<'x, str>>
pub fn remove_attribute(&mut self, name: &str) -> Option<Cow<'x, str>>
Removes an attribute by name
Sourcepub fn attributes(&self) -> Option<&[Attribute<'x>]>
pub fn attributes(&self) -> Option<&[Attribute<'x>]>
Returns all attributes
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>
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