pub struct FsTreeBuilder<'a, Size, SizeGetter, HardlinksRecorder, Report>where
Report: Reporter<Size> + Sync + ?Sized,
Size: Size + Send + Sync,
SizeGetter: GetSize<Size = Size> + Sync,
HardlinksRecorder: RecordHardlinks<Size, Report> + Sync + ?Sized,{
pub root: PathBuf,
pub size_getter: SizeGetter,
pub hardlinks_recorder: &'a HardlinksRecorder,
pub reporter: &'a Report,
pub max_depth: u64,
}Expand description
Build a DataTree from a directory tree using From or Into.
Example:
use parallel_disk_usage::{
data_tree::DataTree,
get_size::GetApparentSize,
os_string_display::OsStringDisplay,
reporter::{ErrorOnlyReporter, ErrorReport},
size::Bytes,
hardlink::HardlinkIgnorant,
};
let builder = FsTreeBuilder {
root: std::env::current_dir().unwrap(),
hardlinks_recorder: &HardlinkIgnorant,
size_getter: GetApparentSize,
reporter: &ErrorOnlyReporter::new(ErrorReport::SILENT),
max_depth: 10,
};
let data_tree: DataTree<OsStringDisplay, Bytes> = builder.into();Fields§
§root: PathBufRoot of the directory tree.
size_getter: SizeGetterReturns size of an item.
hardlinks_recorder: &'a HardlinksRecorderHandle to detect and record hardlinks.
reporter: &'a ReportReports progress to external system.
max_depth: u64Deepest level of descendent display in the graph. The sizes beyond the max depth still count toward total.
Trait Implementations§
Source§impl<'a, Size, SizeGetter, HardlinksRecorder, Report> Debug for FsTreeBuilder<'a, Size, SizeGetter, HardlinksRecorder, Report>
impl<'a, Size, SizeGetter, HardlinksRecorder, Report> Debug for FsTreeBuilder<'a, Size, SizeGetter, HardlinksRecorder, Report>
Source§impl<'a, Size, SizeGetter, HardlinksRecorder, Report> From<FsTreeBuilder<'a, Size, SizeGetter, HardlinksRecorder, Report>> for DataTree<OsStringDisplay, Size>
impl<'a, Size, SizeGetter, HardlinksRecorder, Report> From<FsTreeBuilder<'a, Size, SizeGetter, HardlinksRecorder, Report>> for DataTree<OsStringDisplay, Size>
Source§fn from(
builder: FsTreeBuilder<'_, Size, SizeGetter, HardlinksRecorder, Report>,
) -> Self
fn from( builder: FsTreeBuilder<'_, Size, SizeGetter, HardlinksRecorder, Report>, ) -> Self
Create a DataTree from an FsTreeBuilder.
Auto Trait Implementations§
impl<'a, Size, SizeGetter, HardlinksRecorder, Report> Freeze for FsTreeBuilder<'a, Size, SizeGetter, HardlinksRecorder, Report>
impl<'a, Size, SizeGetter, HardlinksRecorder, Report> RefUnwindSafe for FsTreeBuilder<'a, Size, SizeGetter, HardlinksRecorder, Report>where
SizeGetter: RefUnwindSafe,
HardlinksRecorder: RefUnwindSafe + ?Sized,
Report: RefUnwindSafe + ?Sized,
impl<'a, Size, SizeGetter, HardlinksRecorder, Report> Send for FsTreeBuilder<'a, Size, SizeGetter, HardlinksRecorder, Report>
impl<'a, Size, SizeGetter, HardlinksRecorder, Report> Sync for FsTreeBuilder<'a, Size, SizeGetter, HardlinksRecorder, Report>
impl<'a, Size, SizeGetter, HardlinksRecorder, Report> Unpin for FsTreeBuilder<'a, Size, SizeGetter, HardlinksRecorder, Report>
impl<'a, Size, SizeGetter, HardlinksRecorder, Report> UnwindSafe for FsTreeBuilder<'a, Size, SizeGetter, HardlinksRecorder, Report>where
SizeGetter: UnwindSafe,
HardlinksRecorder: RefUnwindSafe + ?Sized,
Report: RefUnwindSafe + ?Sized,
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> 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 moreSource§impl<X> Pipe for X
impl<X> Pipe for X
Source§fn pipe_ref<'a, Return, Function>(&'a self, f: Function) -> Returnwhere
Function: FnOnce(&'a Self) -> Return,
fn pipe_ref<'a, Return, Function>(&'a self, f: Function) -> Returnwhere
Function: FnOnce(&'a Self) -> Return,
Source§fn pipe_mut<'a, Return, Function>(&'a mut self, f: Function) -> Returnwhere
Function: FnOnce(&'a mut Self) -> Return,
fn pipe_mut<'a, Return, Function>(&'a mut self, f: Function) -> Returnwhere
Function: FnOnce(&'a mut Self) -> Return,
Source§fn pipe_as_ref<'a, Param, Return, Function>(&'a self, f: Function) -> Return
fn pipe_as_ref<'a, Param, Return, Function>(&'a self, f: Function) -> Return
Apply
f to &self where f takes a single parameter of type Param
and Self implements trait AsRef<Param>. Read moreSource§fn pipe_as_mut<'a, Param, Return, Function>(&'a mut self, f: Function) -> Return
fn pipe_as_mut<'a, Param, Return, Function>(&'a mut self, f: Function) -> Return
Apply
f to &mut self where f takes a single parameter of type Param
and Self implements trait AsMut<Param>. Read moreSource§fn pipe_deref<'a, Param, Return, Function>(&'a self, f: Function) -> Return
fn pipe_deref<'a, Param, Return, Function>(&'a self, f: Function) -> Return
Apply
f to &self where f takes a single parameter of type Param
and Self implements trait Deref<Target = Param>. Read moreSource§fn pipe_deref_mut<'a, Param, Return, Function>(
&'a mut self,
f: Function,
) -> Returnwhere
Self: DerefMut<Target = Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a mut Param) -> Return,
fn pipe_deref_mut<'a, Param, Return, Function>(
&'a mut self,
f: Function,
) -> Returnwhere
Self: DerefMut<Target = Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a mut Param) -> Return,
Apply
f to &mut self where f takes a single parameter of type Param
and Self implements trait DerefMut<Target = Param>. Read moreSource§fn pipe_borrow<'a, Param, Return, Function>(&'a self, f: Function) -> Return
fn pipe_borrow<'a, Param, Return, Function>(&'a self, f: Function) -> Return
Apply
f to &self where f takes a single parameter of type Param
and Self implements trait Borrow<Param>. Read moreSource§fn pipe_borrow_mut<'a, Param, Return, Function>(
&'a mut self,
f: Function,
) -> Return
fn pipe_borrow_mut<'a, Param, Return, Function>( &'a mut self, f: Function, ) -> Return
Apply
f to &mut self where f takes a single parameter of type Param
and Self implements trait BorrowMut<Param>. Read more