pub enum ImageFormat {
Png,
Jpeg,
Gif,
Bmp,
Ico,
Tiff,
Svg,
Emf,
Emz,
Wmf,
Wmz,
}Expand description
Supported image formats.
Variants§
Png
PNG image.
Jpeg
JPEG image.
Gif
GIF image.
Bmp
BMP image.
Ico
ICO image.
Tiff
TIFF image.
Svg
SVG image.
Emf
EMF (Enhanced Metafile) image.
Emz
EMZ (compressed EMF) image.
Wmf
WMF (Windows Metafile) image.
Wmz
WMZ (compressed WMF) image.
Implementations§
Source§impl ImageFormat
impl ImageFormat
Sourcepub fn from_extension(ext: &str) -> Result<Self>
pub fn from_extension(ext: &str) -> Result<Self>
Parse an extension string into an ImageFormat.
Accepts common aliases such as "jpg" for JPEG and "tif" for TIFF.
Returns Error::UnsupportedImageFormat for unrecognised strings.
Sourcepub fn content_type(&self) -> &str
pub fn content_type(&self) -> &str
Return the MIME content type string for this image format.
Trait Implementations§
Source§impl Clone for ImageFormat
impl Clone for ImageFormat
Source§fn clone(&self) -> ImageFormat
fn clone(&self) -> ImageFormat
Returns a duplicate 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 ImageFormat
impl Debug for ImageFormat
Source§impl PartialEq for ImageFormat
impl PartialEq for ImageFormat
impl StructuralPartialEq for ImageFormat
Auto Trait Implementations§
impl Freeze for ImageFormat
impl RefUnwindSafe for ImageFormat
impl Send for ImageFormat
impl Sync for ImageFormat
impl Unpin for ImageFormat
impl UnwindSafe for ImageFormat
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