Struct parallel_disk_usage::data_tree::DataTree
source · pub struct DataTree<Name, Data: 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, Data: Size> DataTree<Name, Data>
impl<Name, Data: Size> DataTree<Name, Data>
sourcepub fn into_reflection(self) -> Reflection<Name, Data>
pub fn into_reflection(self) -> Reflection<Name, Data>
Create reflection.
source§impl<Name, Data: Size> DataTree<Name, Data>
impl<Name, Data: Size> DataTree<Name, Data>
source§impl<Name, Data> DataTree<Name, Data>
impl<Name, Data> DataTree<Name, Data>
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 data are too small relative to root.
Trait Implementations§
source§impl<Data, GetData, Report> From<FsTreeBuilder<Data, GetData, Report>> for DataTree<OsStringDisplay, Data>
impl<Data, GetData, Report> From<FsTreeBuilder<Data, GetData, Report>> for DataTree<OsStringDisplay, Data>
source§fn from(builder: FsTreeBuilder<Data, GetData, Report>) -> Self
fn from(builder: FsTreeBuilder<Data, GetData, Report>) -> Self
Create a DataTree
from an FsTreeBuilder
.
source§impl<Path, Name, Data, GetInfo, JoinPath> From<TreeBuilder<Path, Name, Data, GetInfo, JoinPath>> for DataTree<Name, Data>
impl<Path, Name, Data, GetInfo, JoinPath> From<TreeBuilder<Path, Name, Data, GetInfo, JoinPath>> for DataTree<Name, Data>
source§fn from(builder: TreeBuilder<Path, Name, Data, GetInfo, JoinPath>) -> Self
fn from(builder: TreeBuilder<Path, Name, Data, GetInfo, JoinPath>) -> Self
Create a DataTree
from a TreeBuilder
.
source§impl<Name: PartialEq, Data: PartialEq + Size> PartialEq for DataTree<Name, Data>
impl<Name: PartialEq, Data: PartialEq + Size> PartialEq for DataTree<Name, Data>
impl<Name: Eq, Data: Eq + Size> Eq for DataTree<Name, Data>
impl<Name, Data: Size> StructuralPartialEq for DataTree<Name, Data>
Auto Trait Implementations§
impl<Name, Data> RefUnwindSafe for DataTree<Name, Data>where
Data: RefUnwindSafe,
Name: RefUnwindSafe,
impl<Name, Data> Send for DataTree<Name, Data>
impl<Name, Data> Sync for DataTree<Name, Data>
impl<Name, Data> Unpin for DataTree<Name, Data>
impl<Name, Data> UnwindSafe for DataTree<Name, Data>where
Data: UnwindSafe,
Name: 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
Mutably borrows from an owned value. Read more
source§impl<X> Pipe for X
impl<X> Pipe for X
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