pub enum ImageSource<'a> {
Memory(&'a [u8]),
Path(&'a Path),
Image(DynamicImage),
}
Expand description
Helper type used to define the source of ImageSource
’s data
Variants§
Memory(&'a [u8])
A raw buffer of image data, see image::load_from_memory
for details
on what is supported
Path(&'a Path)
The path to an image to load from disk. The image format is inferred
from the file extension, see image::open
for details
Image(DynamicImage)
An already loaded image that is passed directly to the generator
Implementations§
Trait Implementations§
Source§impl<'a> Clone for ImageSource<'a>
impl<'a> Clone for ImageSource<'a>
Source§fn clone(&self) -> ImageSource<'a>
fn clone(&self) -> ImageSource<'a>
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<'a, S> From<&'a S> for ImageSource<'a>
impl<'a, S> From<&'a S> for ImageSource<'a>
Source§impl<'a> From<DynamicImage> for ImageSource<'a>
impl<'a> From<DynamicImage> for ImageSource<'a>
Source§fn from(img: DynamicImage) -> Self
fn from(img: DynamicImage) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'a> Freeze for ImageSource<'a>
impl<'a> RefUnwindSafe for ImageSource<'a>
impl<'a> Send for ImageSource<'a>
impl<'a> Sync for ImageSource<'a>
impl<'a> Unpin for ImageSource<'a>
impl<'a> UnwindSafe for ImageSource<'a>
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