pub struct DataTree<Name, Size: Size> { /* private fields */ }
Expand description
Disk usage data of a filesystem tree.
Construction: There are 3 main ways to create a DataTree
:
- Use
FsTreeBuilder
to create it from the real filesystem. - Use
TreeBuilder
to create it from a representation of a filesystem. - Use
Reflection
.
Visualization: Use the Visualizer
struct to create an
ASCII chart that visualizes DataTree
.
Serialization and deserialization: (feature: json
) DataTree
does not implement
Serialize
and Deserialize
traits directly, instead, it can be converted into/from a
Reflection
which implements these traits.
Implementations§
Source§impl<Name, Size: Size> DataTree<Name, Size>
impl<Name, Size: Size> DataTree<Name, Size>
Sourcepub fn into_reflection(self) -> Reflection<Name, Size>
pub fn into_reflection(self) -> Reflection<Name, Size>
Create reflection.
Source§impl<Name, Size: Size> DataTree<Name, Size>
impl<Name, Size: Size> DataTree<Name, Size>
Source§impl<Name, Size> DataTree<Name, Size>
impl<Name, Size> DataTree<Name, Size>
Sourcepub fn par_retain(&mut self, predicate: impl Fn(&Self) -> bool + Copy + Sync)
pub fn par_retain(&mut self, predicate: impl Fn(&Self) -> bool + Copy + Sync)
Recursively cull all descendants that do not satisfy given predicate
, in parallel.
Sourcepub fn into_par_retained(
self,
predicate: impl Fn(&Self) -> bool + Copy + Sync,
) -> Self
pub fn into_par_retained( self, predicate: impl Fn(&Self) -> bool + Copy + Sync, ) -> Self
Process the tree via par_retain
method.
Sourcepub fn par_cull_insignificant_data(&mut self, min_ratio: f32)
pub fn par_cull_insignificant_data(&mut self, min_ratio: f32)
Recursively cull all descendants whose sizes are too small relative to root.
Source§impl<Name, Size> DataTree<Name, Size>
impl<Name, Size> DataTree<Name, Size>
Sourcepub fn par_sort_by(
&mut self,
compare: impl Fn(&Self, &Self) -> Ordering + Copy + Sync,
)
pub fn par_sort_by( &mut self, compare: impl Fn(&Self, &Self) -> Ordering + Copy + Sync, )
Sort all descendants recursively, in parallel.
Sourcepub fn into_par_sorted(
self,
compare: impl Fn(&Self, &Self) -> Ordering + Copy + Sync,
) -> Self
pub fn into_par_sorted( self, compare: impl Fn(&Self, &Self) -> Ordering + Copy + Sync, ) -> Self
Process the tree via par_sort_by
method.
Trait Implementations§
Source§impl<Size, SizeGetter, Report> From<FsTreeBuilder<Size, SizeGetter, Report>> for DataTree<OsStringDisplay, Size>
impl<Size, SizeGetter, Report> From<FsTreeBuilder<Size, SizeGetter, Report>> for DataTree<OsStringDisplay, Size>
Source§fn from(builder: FsTreeBuilder<Size, SizeGetter, Report>) -> Self
fn from(builder: FsTreeBuilder<Size, SizeGetter, Report>) -> Self
Create a DataTree
from an FsTreeBuilder
.
Source§impl<Path, Name, Size, GetInfo, JoinPath> From<TreeBuilder<Path, Name, Size, GetInfo, JoinPath>> for DataTree<Name, Size>
impl<Path, Name, Size, GetInfo, JoinPath> From<TreeBuilder<Path, Name, Size, GetInfo, JoinPath>> for DataTree<Name, Size>
Source§fn from(builder: TreeBuilder<Path, Name, Size, GetInfo, JoinPath>) -> Self
fn from(builder: TreeBuilder<Path, Name, Size, GetInfo, JoinPath>) -> Self
Create a DataTree
from a TreeBuilder
.
impl<Name: Eq, Size: Eq + Size> Eq for DataTree<Name, Size>
impl<Name, Size: Size> StructuralPartialEq for DataTree<Name, Size>
Auto Trait Implementations§
impl<Name, Size> Freeze for DataTree<Name, Size>
impl<Name, Size> RefUnwindSafe for DataTree<Name, Size>where
Name: RefUnwindSafe,
Size: RefUnwindSafe,
impl<Name, Size> Send for DataTree<Name, Size>
impl<Name, Size> Sync for DataTree<Name, Size>
impl<Name, Size> Unpin for DataTree<Name, Size>
impl<Name, Size> UnwindSafe for DataTree<Name, Size>where
Name: UnwindSafe,
Size: UnwindSafe,
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
Source§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
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
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
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,
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
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
f
to &mut self
where f
takes a single parameter of type Param
and Self
implements trait BorrowMut<Param>
. Read more