[][src]Struct broot::file_sum::FileSum

pub struct FileSum { /* fields omitted */ }

Reduction of counts, dates and sizes on a file or directory

Implementations

impl FileSum[src]

pub fn new(real_size: u64, sparse: bool, count: usize, modified: u32) -> Self[src]

pub fn zero() -> Self[src]

pub fn incr(&mut self)[src]

pub fn from_file(path: &Path) -> Self[src]

return the sum of the given file, which is assumed to be a normal file (ie not a directory)

pub fn from_dir(path: &Path, dam: &Dam) -> Option<Self>[src]

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[src]

pub fn to_count(self) -> usize[src]

return the number of files (normally at least 1)

pub fn to_seconds(self) -> u32[src]

return the number of seconds from Epoch to last modification, or 0 if the computation failed

pub fn to_size(self) -> u64[src]

return the size in bytes

pub fn to_valid_seconds(self) -> Option<i64>[src]

pub fn is_sparse(self) -> bool[src]

tell whether the file has holes (in which case the size displayed by other tools may be greater than the "real" one returned by broot). Not computed (return false) on windows or for directories.

Trait Implementations

impl AddAssign<FileSum> for FileSum[src]

impl Clone for FileSum[src]

impl Copy for FileSum[src]

impl Debug for FileSum[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.