#[non_exhaustive]pub enum MimeType {
Png,
Jpeg,
Tiff,
Bmp,
Gif,
Unknown(String),
None,
}Expand description
Mime types for pictures.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Png
PNG image
Jpeg
JPEG image
Tiff
TIFF image
Bmp
BMP image
Gif
GIF image
Unknown(String)
Some unknown mimetype
None
No mimetype
Implementations§
source§impl MimeType
impl MimeType
sourcepub fn from_str(mime_type: &str) -> Self
pub fn from_str(mime_type: &str) -> Self
Get a MimeType from a string
Empty strings will map to MimeType::None, while any unrecognized MIME types will
map to MimeType::Unknown.
Examples
use lofty::MimeType;
let jpeg_mimetype_str = "image/jpeg";
assert_eq!(MimeType::from_str(jpeg_mimetype_str), MimeType::Jpeg);Trait Implementations§
source§impl PartialEq for MimeType
impl PartialEq for MimeType
impl Eq for MimeType
impl StructuralEq for MimeType
impl StructuralPartialEq for MimeType
Auto Trait Implementations§
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