Enum riddle_image::ImageFormat[][src]

pub enum ImageFormat {
    Png,
    Bmp,
    Jpeg,
}

The set of support image file formats which Image can load

Variants

Png
Bmp
Jpeg

Implementations

impl ImageFormat[src]

pub fn derive_from_path(path: &str) -> Option<Self>[src]

Derive the image format from a path. It uses the file extension to pick from the supported formats, or returns None if the extension doesn’t map to a known format.

Example

assert_eq!(Some(ImageFormat::Png), ImageFormat::derive_from_path("FOO.PNG"));
assert_eq!(Some(ImageFormat::Bmp), ImageFormat::derive_from_path("Bar.Bmp"));
assert_eq!(Some(ImageFormat::Jpeg), ImageFormat::derive_from_path("baz.jpg"));
assert_eq!(None, ImageFormat::derive_from_path("Bad.txt"));

Trait Implementations

impl Clone for ImageFormat[src]

impl Copy for ImageFormat[src]

impl Debug for ImageFormat[src]

impl Eq for ImageFormat[src]

impl PartialEq<ImageFormat> for ImageFormat[src]

impl StructuralEq for ImageFormat[src]

impl StructuralPartialEq for ImageFormat[src]

Auto Trait Implementations

impl RefUnwindSafe for ImageFormat

impl Send for ImageFormat

impl Sync for ImageFormat

impl Unpin for ImageFormat

impl UnwindSafe for ImageFormat

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.