Struct wallswitch::FileInfo
source · pub struct FileInfo {
pub dimension: Dimension,
pub size: u64,
pub path: PathBuf,
}Expand description
Image information
Fields§
§dimension: Dimensiondimension: width x length of an image
size: u64The size of the file, in bytes
path: PathBufThe image file path
Implementations§
source§impl FileInfo
impl FileInfo
sourcepub fn path_contains(&self, string: &str) -> bool
pub fn path_contains(&self, string: &str) -> bool
Returns true if the given pattern matches a sub-slice of this path.
Returns false if it does not.
sourcepub fn update_info(&mut self, config: &Config) -> MyResult<()>
pub fn update_info(&mut self, config: &Config) -> MyResult<()>
Update dimension field and valid_dimension field
sourcepub fn dimension_is_valid(&self, config: &Config) -> bool
pub fn dimension_is_valid(&self, config: &Config) -> bool
Check if the dimension is valid
Calculate the minimum/maximum between width and height
Calcular o mínimo/máximo entre largura e altura
sourcepub fn size_is_valid(&self, config: &Config) -> bool
pub fn size_is_valid(&self, config: &Config) -> bool
Check if the size is valid
Trait Implementations§
source§impl Ord for FileInfo
impl Ord for FileInfo
source§impl PartialOrd for FileInfo
impl PartialOrd for FileInfo
impl Eq for FileInfo
impl StructuralPartialEq for FileInfo
Auto Trait Implementations§
impl Freeze for FileInfo
impl RefUnwindSafe for FileInfo
impl Send for FileInfo
impl Sync for FileInfo
impl Unpin for FileInfo
impl UnwindSafe for FileInfo
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)