#[repr(u8)]pub enum ImageFormat {
Png = 0,
Jpg = 1,
Webp = 2,
Avif = 3,
Unknown = 4,
}
Expand description
The type of an image. You can read more about the tradeoffs between image formats here
Variants§
Png = 0
A png image. Png images cannot contain transparency and tend to compress worse than other formats
Jpg = 1
A jpg image. Jpg images can contain transparency and tend to compress better than png images
Webp = 2
A webp image. Webp images can contain transparency and tend to compress better than jpg images
Avif = 3
An avif image. Avif images can compress slightly better than webp images but are not supported by all browsers
Unknown = 4
An unknown image type
Trait Implementations§
Source§impl Clone for ImageFormat
impl Clone for ImageFormat
Source§fn clone(&self) -> ImageFormat
fn clone(&self) -> ImageFormat
Returns a copy 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<'de> Deserialize<'de> for ImageFormat
impl<'de> Deserialize<'de> for ImageFormat
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Hash for ImageFormat
impl Hash for ImageFormat
Source§impl PartialEq for ImageFormat
impl PartialEq for ImageFormat
Source§impl PartialOrd for ImageFormat
impl PartialOrd for ImageFormat
Source§impl Serialize for ImageFormat
impl Serialize for ImageFormat
Source§impl SerializeConst for ImageFormat
impl SerializeConst for ImageFormat
impl Copy 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