pub struct TreeStats {
pub total_size: u64,
pub total_files: u64,
pub total_dirs: u64,
pub total_symlinks: u64,
pub max_depth: u32,
pub largest_file: Option<(PathBuf, u64)>,
pub oldest_file: Option<(PathBuf, SystemTime)>,
pub newest_file: Option<(PathBuf, SystemTime)>,
}Expand description
Summary statistics for a scanned tree.
Fields§
§total_size: u64Total size in bytes.
total_files: u64Total number of files.
total_dirs: u64Total number of directories.
total_symlinks: u64Total number of symbolic links.
max_depth: u32Maximum depth reached.
largest_file: Option<(PathBuf, u64)>Largest file (path, size).
oldest_file: Option<(PathBuf, SystemTime)>Oldest file (path, time).
newest_file: Option<(PathBuf, SystemTime)>Newest file (path, time).
Implementations§
Source§impl TreeStats
impl TreeStats
Sourcepub fn record_file(
&mut self,
path: &Path,
size: u64,
modified: SystemTime,
depth: u32,
)
pub fn record_file( &mut self, path: &Path, size: u64, modified: SystemTime, depth: u32, )
Update stats with a file entry. Only clones the path when updating a tracked field.
Sourcepub fn record_dir(&mut self, depth: u32)
pub fn record_dir(&mut self, depth: u32)
Record a directory.
Sourcepub fn record_symlink(&mut self)
pub fn record_symlink(&mut self)
Record a symlink.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TreeStats
impl<'de> Deserialize<'de> for TreeStats
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TreeStats, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TreeStats, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for TreeStats
impl Serialize for TreeStats
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for TreeStats
impl RefUnwindSafe for TreeStats
impl Send for TreeStats
impl Sync for TreeStats
impl Unpin for TreeStats
impl UnsafeUnpin for TreeStats
impl UnwindSafe for TreeStats
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§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more