pub struct MimeType { /* private fields */ }
Expand description
Represents a mime type as defined by RFC 6838
Implementations§
Source§impl MimeType
impl MimeType
Sourcepub fn new(mime_type: &str) -> Option<Self>
pub fn new(mime_type: &str) -> Option<Self>
Create a MimeType based on a string
The entered data is validated. A MimeType
is only created when the
data is valid, otherwise you will receive None
.
Sourcepub fn is_supertype_only(&self) -> bool
pub fn is_supertype_only(&self) -> bool
Check if the mime type only defines the super type
Sourcepub fn get_supertype(&self) -> MimeType
pub fn get_supertype(&self) -> MimeType
Get the super type of this mimetype
For example, text/plain
will return text
.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MimeType
impl RefUnwindSafe for MimeType
impl Send for MimeType
impl Sync for MimeType
impl Unpin 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