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>,
) -> FileTree
pub fn new( root: FileNode, root_path: PathBuf, config: ScanConfig, stats: TreeStats, scan_duration: Duration, warnings: Vec<ScanWarning>, ) -> FileTree
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<FileTree, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<FileTree, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for FileTree
impl Serialize for FileTree
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 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
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