pub struct FileSum { /* private fields */ }
Expand description
Reduction of counts, dates and sizes on a file or directory
Implementations
sourceimpl 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
sourceimpl AddAssign<FileSum> for FileSum
impl AddAssign<FileSum> for FileSum
sourcefn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
Performs the +=
operation. Read more
impl Copy for FileSum
Auto Trait Implementations
impl RefUnwindSafe for FileSum
impl Send for FileSum
impl Sync for FileSum
impl Unpin for FileSum
impl UnwindSafe for FileSum
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more