pub struct MimeType { /* private fields */ }Expand description
A parsed MIME type: its essence (type/subtype, lowercase) and its parameters.
Parameter names are lowercase, and only the first occurrence of each is kept, the way browsers do it. Parameters that aren’t valid are dropped rather than making the whole MIME type invalid.
Implementations§
Source§impl MimeType
impl MimeType
Sourcepub fn parse(input: &str) -> Result<MimeType, Error>
pub fn parse(input: &str) -> Result<MimeType, Error>
Parses a MIME type, failing if its type/subtype part isn’t valid.
Sourcepub fn parameters(&self) -> impl Iterator<Item = (&str, &str)>
pub fn parameters(&self) -> impl Iterator<Item = (&str, &str)>
Iterates over parameters as (name, value) pairs, in order.
Trait Implementations§
impl Eq for MimeType
impl StructuralPartialEq for MimeType
Auto Trait Implementations§
impl Freeze for MimeType
impl RefUnwindSafe for MimeType
impl Send for MimeType
impl Sync for MimeType
impl Unpin for MimeType
impl UnsafeUnpin for MimeType
impl UnwindSafe for MimeType
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