pub struct FileTree {
pub root: FileNode,
pub root_path: PathBuf,
pub scanned_at: SystemTime,
pub scan_duration: Duration,
pub config: ScanConfig,
pub stats: TreeStats,
pub warnings: Vec<ScanWarning>,
}Expand description
Complete scanned file tree with metadata.
Warning: Clone performs a deep clone of the entire tree — O(n) in the number of nodes.
Fields§
§root: FileNodeRoot node of the tree.
root_path: PathBufRoot path that was scanned.
scanned_at: SystemTimeWhen this scan was performed.
scan_duration: DurationDuration of the scan.
config: ScanConfigScan configuration used.
stats: TreeStatsSummary statistics.
warnings: Vec<ScanWarning>Warnings encountered during scan.
Implementations§
Source§impl FileTree
impl FileTree
Sourcepub fn new(
root: FileNode,
root_path: PathBuf,
config: ScanConfig,
stats: TreeStats,
scan_duration: Duration,
warnings: Vec<ScanWarning>,
) -> Self
pub fn new( root: FileNode, root_path: PathBuf, config: ScanConfig, stats: TreeStats, scan_duration: Duration, warnings: Vec<ScanWarning>, ) -> Self
Create a new file tree. scanned_at should be captured by the caller at scan start time.
Sourcepub fn total_size(&self) -> u64
pub fn total_size(&self) -> u64
Get the total size of the tree.
Sourcepub fn total_files(&self) -> u64
pub fn total_files(&self) -> u64
Get the total number of files.
Sourcepub fn total_dirs(&self) -> u64
pub fn total_dirs(&self) -> u64
Get the total number of directories.
Sourcepub fn has_warnings(&self) -> bool
pub fn has_warnings(&self) -> bool
Check if there were any warnings during scanning.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for FileTree
impl<'de> Deserialize<'de> for FileTree
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 FileTree
impl RefUnwindSafe for FileTree
impl Send for FileTree
impl Sync for FileTree
impl Unpin for FileTree
impl UnsafeUnpin for FileTree
impl UnwindSafe for FileTree
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