pub trait LoadImage {
    type Image;
    type Error;

    // Required method
    fn load_from_path(
        &self,
        path: impl AsRef<str>
    ) -> Result<Self::Image, Self::Error>;
}
Expand description

Ability to load an image from path

Required Associated Types§

source

type Image

Type of image being loaded

source

type Error

Error type representing failure to load an image

Required Methods§

source

fn load_from_path( &self, path: impl AsRef<str> ) -> Result<Self::Image, Self::Error>

Load an image from its path

Errors

Returns Self::Error if the image cannot be loaded (i.e image not found)

Object Safety§

This trait is not object safe.

Implementors§