Struct parallel_disk_usage::data_tree::reflection::Reflection [−][src]
pub struct Reflection<Name, Data: Size> { pub name: Name, pub data: Data, pub children: Vec<Self>, }
Expand description
Intermediate format used for construction and inspection of
DataTree
’s internal content.
Unlike Tree
where the fields are all private, the fields of TreeReflection
are all public to allow construction in tests.
Conversion between DataTree
and Reflection
:
- Any
DataTree
can be safely transmuted to a validReflection
. - Any
Reflection
can be safely transmuted to a potentially invalidDataTree
. - To safely convert a
DataTree
into aReflection
without theunsafe
keyword, useDataTree::into_reflection
(it would be slower than usingtransmute
). - To safely convert a
Reflection
into a validDataTree
, usepar_try_into_tree
.
Serialization and deserialization: (feature: json
) Reflection
implements
Serialize
and Deserialize
traits, this allows functions in serde_json
to convert
a Reflection
into/from JSON.
Fields
name: Name
Name of the tree.
data: Data
Disk usage of a file or total disk usage of a folder.
children: Vec<Self>
Data of children filesystem subtrees.
Implementations
Attempting to convert a Reflection
into a valid DataTree
.
Attempt to transform names and data.
pub fn par_convert_names_to_utf8(self) -> Result<Reflection<String, Data>, Name> where
Name: AsRef<OsStr>,
Data: Sync,
pub fn par_convert_names_to_utf8(self) -> Result<Reflection<String, Data>, Name> where
Name: AsRef<OsStr>,
Data: Sync,
Attempt to convert all names from OsString
to String
.
Trait Implementations
impl<'de, Name, Data: Size> Deserialize<'de> for Reflection<Name, Data> where
Name: Deserialize<'de>,
Data: Deserialize<'de>,
impl<'de, Name, Data: Size> Deserialize<'de> for Reflection<Name, Data> where
Name: Deserialize<'de>,
Data: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Performs the conversion.
Performs the conversion.
impl<Name: PartialEq, Data: PartialEq + Size> PartialEq<Reflection<Name, Data>> for Reflection<Name, Data>
impl<Name: PartialEq, Data: PartialEq + Size> PartialEq<Reflection<Name, Data>> for Reflection<Name, Data>
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl<Name, Data> RefUnwindSafe for Reflection<Name, Data> where
Data: RefUnwindSafe,
Name: RefUnwindSafe,
impl<Name, Data> Send for Reflection<Name, Data> where
Data: Send,
Name: Send,
impl<Name, Data> Sync for Reflection<Name, Data> where
Data: Sync,
Name: Sync,
impl<Name, Data> Unpin for Reflection<Name, Data> where
Data: Unpin,
Name: Unpin,
impl<Name, Data> UnwindSafe for Reflection<Name, Data> where
Data: UnwindSafe,
Name: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Apply f
to self
. Read more
Apply f
to &self
. Read more
Apply f
to &mut self
. Read more
Apply f
to &self
where f
takes a single parameter of type Param
and Self
implements trait AsRef<Param>
. Read more
Apply f
to &mut self
where f
takes a single parameter of type Param
and Self
implements trait AsMut<Param>
. Read more
Apply f
to &self
where f
takes a single parameter of type Param
and Self
implements trait Deref<Param>
. Read more
Apply f
to &mut self
where f
takes a single parameter of type Param
and Self
implements trait DerefMut<Param>
. Read more
Apply f
to &self
where f
takes a single parameter of type Param
and Self
implements trait Deref<Param>
. Read more
Apply f
to &mut self
where f
takes a single parameter of type Param
and Self
implements trait DerefMut<Param>
. Read more