pub struct ContentType(/* private fields */);
Expand description
Content-Type
of the body
This struct can represent any valid mime type, which can be parsed via
ContentType::parse
. Constants are provided for the most-used mime-types.
Defined in RFC2045
Implementations§
Source§impl ContentType
impl ContentType
Sourcepub const TEXT_PLAIN: ContentType
pub const TEXT_PLAIN: ContentType
A ContentType
of type text/plain; charset=utf-8
Indicates that the body is in utf-8 encoded plain text.
Sourcepub const TEXT_HTML: ContentType
pub const TEXT_HTML: ContentType
A ContentType
of type text/html; charset=utf-8
Indicates that the body is in utf-8 encoded html.
Sourcepub fn parse(s: &str) -> Result<ContentType, ContentTypeErr>
pub fn parse(s: &str) -> Result<ContentType, ContentTypeErr>
Parse s
into ContentType
Trait Implementations§
Source§impl Clone for ContentType
impl Clone for ContentType
Source§fn clone(&self) -> ContentType
fn clone(&self) -> ContentType
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 Debug for ContentType
impl Debug for ContentType
Source§impl FromStr for ContentType
impl FromStr for ContentType
Source§impl Header for ContentType
impl Header for ContentType
Source§impl PartialEq for ContentType
impl PartialEq for ContentType
impl Eq for ContentType
impl StructuralPartialEq for ContentType
Auto Trait Implementations§
impl Freeze for ContentType
impl RefUnwindSafe for ContentType
impl Send for ContentType
impl Sync for ContentType
impl Unpin for ContentType
impl UnwindSafe for ContentType
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