pub struct ImageDir {
pub path: PathBuf,
pub file_extension: String,
}Expand description
Local directory on-disk where images are stored.
Fields§
§path: PathBufThe filepath of the image directory.
file_extension: StringThe file extension of image files, for filtering directory contents.
Implementations§
Source§impl ImageDir
impl ImageDir
Sourcepub fn find_images(&self) -> Vec<PathBuf>
pub fn find_images(&self) -> Vec<PathBuf>
Walk filesystem directory and return a list of all files matching file extension.
Sourcepub fn get_random_image(&self) -> PathBuf
pub fn get_random_image(&self) -> PathBuf
Return a single image filepath, as string, at random from the direcotry.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ImageDir
impl RefUnwindSafe for ImageDir
impl Send for ImageDir
impl Sync for ImageDir
impl Unpin for ImageDir
impl UnwindSafe for ImageDir
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