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<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. 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