pub struct MediaType {
pub type_: String,
pub subtype: String,
pub suffix: Option<String>,
}Expand description
A parsed media type: type/subtype with an optional structured-syntax suffix.
The suffix is None when the subtype has no +, and Some(_) otherwise — note it
can be Some("") for a degenerate subtype like x++ (matching the reference), which
is why round-tripping such a value back through format fails.
Fields§
§type_: StringThe top-level type, e.g. application (lower-cased by parse).
subtype: StringThe subtype, e.g. vnd.api (lower-cased by parse, suffix removed).
suffix: Option<String>The structured-syntax suffix after the last +, e.g. json.
Implementations§
Trait Implementations§
impl Eq for MediaType
impl StructuralPartialEq for MediaType
Auto Trait Implementations§
impl Freeze for MediaType
impl RefUnwindSafe for MediaType
impl Send for MediaType
impl Sync for MediaType
impl Unpin for MediaType
impl UnsafeUnpin for MediaType
impl UnwindSafe for MediaType
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