pub struct ContentType(String);Expand description
Label for opaque payload bytes. The engine does not interpret it.
The string is not validated as a MIME type. Adapters agree on the constants below; a custom value is just another label a peer may or may not understand.
Tuple Fields§
§0: StringImplementations§
Source§impl ContentType
impl ContentType
pub const OCTET_STREAM: &'static str = "application/octet-stream"
pub const JSON: &'static str = "application/json"
pub const XML: &'static str = "application/xml"
pub fn octet_stream() -> Self
pub fn json() -> Self
pub fn xml() -> Self
pub fn as_str(&self) -> &str
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 Default for ContentType
impl Default for ContentType
Source§impl Hash for ContentType
impl Hash 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