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
sourceimpl<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.
sourceimpl<Name, Data: Size> DataTree<Name, Data>
impl<Name, Data: Size> DataTree<Name, Data>
sourceimpl<Name, Data> DataTree<Name, Data> where
Self: Send,
Data: Size,
impl<Name, Data> DataTree<Name, Data> where
Self: Send,
Data: 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) where
Data: Into<u64>,
pub fn par_cull_insignificant_data(&mut self, min_ratio: f32) where
Data: Into<u64>,
Recursively cull all descendants whose data are too small relative to root.
Trait Implementations
sourceimpl<Name, Data: Size> From<DataTree<Name, Data>> for Reflection<Name, Data>
impl<Name, Data: Size> From<DataTree<Name, Data>> for Reflection<Name, Data>
sourceimpl<Data, GetData, Report> From<FsTreeBuilder<Data, GetData, Report>> for DataTree<OsStringDisplay, Data> where
Data: Size + Send + Sync,
GetData: Fn(&Metadata) -> Data + Sync,
Report: Reporter<Data> + Sync,
impl<Data, GetData, Report> From<FsTreeBuilder<Data, GetData, Report>> for DataTree<OsStringDisplay, Data> where
Data: Size + Send + Sync,
GetData: Fn(&Metadata) -> Data + Sync,
Report: Reporter<Data> + Sync,
sourcefn from(builder: FsTreeBuilder<Data, GetData, Report>) -> Self
fn from(builder: FsTreeBuilder<Data, GetData, Report>) -> Self
Create a DataTree
from an FsTreeBuilder
.
sourceimpl<Path, Name, Data, GetInfo, JoinPath> From<TreeBuilder<Path, Name, Data, GetInfo, JoinPath>> for DataTree<Name, Data> where
Path: Send + Sync,
Name: Send + Sync,
Data: Size + Send,
GetInfo: Fn(&Path) -> Info<Name, Data> + Copy + Send + Sync,
JoinPath: Fn(&Path, &Name) -> Path + Copy + Send + Sync,
impl<Path, Name, Data, GetInfo, JoinPath> From<TreeBuilder<Path, Name, Data, GetInfo, JoinPath>> for DataTree<Name, Data> where
Path: Send + Sync,
Name: Send + Sync,
Data: Size + Send,
GetInfo: Fn(&Path) -> Info<Name, Data> + Copy + Send + Sync,
JoinPath: Fn(&Path, &Name) -> Path + Copy + Send + Sync,
sourcefn 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
.
sourceimpl<Name: PartialEq, Data: PartialEq + Size> PartialEq<DataTree<Name, Data>> for DataTree<Name, Data>
impl<Name: PartialEq, Data: PartialEq + Size> PartialEq<DataTree<Name, Data>> for DataTree<Name, Data>
impl<Name: Eq, Data: Eq + Size> Eq for DataTree<Name, Data>
impl<Name, Data: Size> StructuralEq 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> where
Data: Send,
Name: Send,
impl<Name, Data> Sync for DataTree<Name, Data> where
Data: Sync,
Name: Sync,
impl<Name, Data> Unpin for DataTree<Name, Data> where
Data: Unpin,
Name: Unpin,
impl<Name, Data> UnwindSafe for DataTree<Name, Data> where
Data: UnwindSafe,
Name: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<X> Pipe for X
impl<X> Pipe for X
sourcefn pipe<Return, Function>(self, f: Function) -> Return where
Function: FnOnce(Self) -> Return,
fn pipe<Return, Function>(self, f: Function) -> Return where
Function: FnOnce(Self) -> Return,
Apply f
to self
. Read more
sourcefn pipe_ref<'a, Return, Function>(&'a self, f: Function) -> Return where
Function: FnOnce(&'a Self) -> Return,
fn pipe_ref<'a, Return, Function>(&'a self, f: Function) -> Return where
Function: FnOnce(&'a Self) -> Return,
Apply f
to &self
. Read more
sourcefn pipe_mut<'a, Return, Function>(&'a mut self, f: Function) -> Return where
Function: FnOnce(&'a mut Self) -> Return,
fn pipe_mut<'a, Return, Function>(&'a mut self, f: Function) -> Return where
Function: FnOnce(&'a mut Self) -> Return,
Apply f
to &mut self
. Read more
sourcefn pipe_as_ref<'a, Param, Return, Function>(&'a self, f: Function) -> Return where
Self: AsRef<Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a Param) -> Return,
fn pipe_as_ref<'a, Param, Return, Function>(&'a self, f: Function) -> Return where
Self: AsRef<Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a Param) -> Return,
Apply f
to &self
where f
takes a single parameter of type Param
and Self
implements trait AsRef<Param>
. Read more
sourcefn pipe_as_mut<'a, Param, Return, Function>(&'a mut self, f: Function) -> Return where
Self: AsMut<Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a mut Param) -> Return,
fn pipe_as_mut<'a, Param, Return, Function>(&'a mut self, f: Function) -> Return where
Self: AsMut<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 AsMut<Param>
. Read more
sourcefn pipe_deref<'a, Param, Return, Function>(&'a self, f: Function) -> Return where
Self: Deref<Target = Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a Param) -> Return,
fn pipe_deref<'a, Param, Return, Function>(&'a self, f: Function) -> Return where
Self: Deref<Target = Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a Param) -> Return,
Apply f
to &self
where f
takes a single parameter of type Param
and Self
implements trait Deref<Target = Param>
. Read more
sourcefn pipe_deref_mut<'a, Param, Return, Function>(
&'a mut self,
f: Function
) -> Return where
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
) -> Return where
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 more
sourcefn pipe_borrow<'a, Param, Return, Function>(&'a self, f: Function) -> Return where
Self: Borrow<Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a Param) -> Return,
fn pipe_borrow<'a, Param, Return, Function>(&'a self, f: Function) -> Return where
Self: Borrow<Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a Param) -> Return,
Apply f
to &self
where f
takes a single parameter of type Param
and Self
implements trait Borrow<Param>
. Read more
sourcefn pipe_borrow_mut<'a, Param, Return, Function>(
&'a mut self,
f: Function
) -> Return where
Self: BorrowMut<Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a mut Param) -> Return,
fn pipe_borrow_mut<'a, Param, Return, Function>(
&'a mut self,
f: Function
) -> Return where
Self: BorrowMut<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 BorrowMut<Param>
. Read more
sourceimpl<X> Pipe for X
impl<X> Pipe for X
sourcefn pipe<Return, Function>(self, f: Function) -> Return where
Function: FnOnce(Self) -> Return,
fn pipe<Return, Function>(self, f: Function) -> Return where
Function: FnOnce(Self) -> Return,
Apply f
to self
. Read more
sourcefn pipe_ref<'a, Return, Function>(&'a self, f: Function) -> Return where
Function: FnOnce(&'a Self) -> Return,
fn pipe_ref<'a, Return, Function>(&'a self, f: Function) -> Return where
Function: FnOnce(&'a Self) -> Return,
Apply f
to &self
. Read more
sourcefn pipe_mut<'a, Return, Function>(&'a mut self, f: Function) -> Return where
Function: FnOnce(&'a mut Self) -> Return,
fn pipe_mut<'a, Return, Function>(&'a mut self, f: Function) -> Return where
Function: FnOnce(&'a mut Self) -> Return,
Apply f
to &mut self
. Read more
sourcefn pipe_as_ref<'a, Param, Return, Function>(&'a self, f: Function) -> Return where
Self: AsRef<Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a Param) -> Return,
fn pipe_as_ref<'a, Param, Return, Function>(&'a self, f: Function) -> Return where
Self: AsRef<Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a Param) -> Return,
Apply f
to &self
where f
takes a single parameter of type Param
and Self
implements trait AsRef<Param>
. Read more
sourcefn pipe_as_mut<'a, Param, Return, Function>(&'a mut self, f: Function) -> Return where
Self: AsMut<Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a mut Param) -> Return,
fn pipe_as_mut<'a, Param, Return, Function>(&'a mut self, f: Function) -> Return where
Self: AsMut<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 AsMut<Param>
. Read more
sourcefn pipe_deref<'a, Param, Return, Function>(&'a self, f: Function) -> Return where
Self: Deref<Target = Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a Param) -> Return,
fn pipe_deref<'a, Param, Return, Function>(&'a self, f: Function) -> Return where
Self: Deref<Target = Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a Param) -> Return,
Apply f
to &self
where f
takes a single parameter of type Param
and Self
implements trait Deref<Param>
. Read more
sourcefn pipe_deref_mut<'a, Param, Return, Function>(
&'a mut self,
f: Function
) -> Return where
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
) -> Return where
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<Param>
. Read more
sourcefn pipe_borrow<'a, Param, Return, Function>(&'a self, f: Function) -> Return where
Self: Borrow<Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a Param) -> Return,
fn pipe_borrow<'a, Param, Return, Function>(&'a self, f: Function) -> Return where
Self: Borrow<Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a Param) -> Return,
Apply f
to &self
where f
takes a single parameter of type Param
and Self
implements trait Deref<Param>
. Read more
sourcefn pipe_borrow_mut<'a, Param, Return, Function>(
&'a mut self,
f: Function
) -> Return where
Self: BorrowMut<Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a mut Param) -> Return,
fn pipe_borrow_mut<'a, Param, Return, Function>(
&'a mut self,
f: Function
) -> Return where
Self: BorrowMut<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<Param>
. Read more