pub struct FileSum { /* private fields */ }
Expand description
Reduction of counts, dates and sizes on a file or directory
Implementations§
source§impl FileSum
impl FileSum
pub fn new(real_size: u64, sparse: bool, count: usize, modified: u32) -> Self
pub fn zero() -> Self
pub fn incr(&mut self)
sourcepub fn from_file(path: &Path) -> Self
pub fn from_file(path: &Path) -> Self
return the sum of the given file, which is assumed to be a normal file (ie not a directory)
sourcepub fn from_dir(path: &Path, dam: &Dam, con: &AppContext) -> Option<Self>
pub fn from_dir(path: &Path, dam: &Dam, con: &AppContext) -> Option<Self>
Return the sum of the directory, either by computing it of by fetching it from cache. If the lifetime expires before complete computation, None is returned.
pub fn part_of_size(self, total: Self) -> f32
sourcepub fn to_seconds(self) -> u32
pub fn to_seconds(self) -> u32
return the number of seconds from Epoch to last modification, or 0 if the computation failed
pub fn to_valid_seconds(self) -> Option<i64>
Trait Implementations§
source§impl AddAssign<FileSum> for FileSum
impl AddAssign<FileSum> for FileSum
source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
Performs the
+=
operation. Read more