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 valid Reflection.
  • Any Reflection can be safely transmuted to a potentially invalid DataTree.
  • To safely convert a DataTree into a Reflection without the unsafe keyword, use DataTree::into_reflection (it would be slower than using transmute).
  • To safely convert a Reflection into a valid DataTree, use par_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.

Attempt to convert all names from OsString to String.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Deserialize this value from the given Serde deserializer. Read more
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
Serialize this value into the given Serde serializer. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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<Target = Param>. Read more
Apply f to &mut self where f takes a single parameter of type Param and Self implements trait [DerefMut<Target = Param>]. Read more
Apply f to &self where f takes a single parameter of type Param and Self implements trait Borrow<Param>. Read more
Apply f to &mut self where f takes a single parameter of type Param and Self implements trait BorrowMut<Param>. Read more
The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.