pub struct ContentType(/* private fields */);Expand description
Lightweight Content-Type header wrapper.
Implementations§
Source§impl ContentType
impl ContentType
Sourcepub fn new(value: impl AsRef<str>) -> Result<ContentType, HeaderParseError>
pub fn new(value: impl AsRef<str>) -> Result<ContentType, HeaderParseError>
Creates a typed header wrapper.
Sourcepub const fn value(&self) -> &HeaderValue
pub const fn value(&self) -> &HeaderValue
Returns the header value.
Sourcepub fn field(&self) -> HeaderField
pub fn field(&self) -> HeaderField
Converts this wrapper into a header field.
Trait Implementations§
Source§impl Clone for ContentType
impl Clone for ContentType
Source§fn clone(&self) -> ContentType
fn clone(&self) -> ContentType
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 Display for ContentType
impl Display for ContentType
Source§impl Hash for ContentType
impl Hash for ContentType
Source§impl Ord for ContentType
impl Ord for ContentType
Source§fn cmp(&self, other: &ContentType) -> Ordering
fn cmp(&self, other: &ContentType) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for ContentType
impl PartialEq for ContentType
Source§fn eq(&self, other: &ContentType) -> bool
fn eq(&self, other: &ContentType) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for ContentType
impl PartialOrd 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 UnsafeUnpin 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