Skip to main content

TreeNode

Struct TreeNode 

Source
pub struct TreeNode {
Show 13 fields pub path: PathBuf, pub name: String, pub kind: EntryKind, pub entry_ignored: Option<bool>, pub bytes: u64, pub allocated: u64, pub files: u64, pub dirs: u64, pub ignored: Option<IgnoredTally>, pub newest_mtime_ns: Option<i64>, pub children: Vec<TreeNode>, pub omissions: Vec<TreeOmission>, pub truncated: bool,
}
Expand description

One directory’s row in a tree view.

Fields§

§path: PathBuf

Path relative to the index root; empty for the root itself.

§name: String

Final path component, or . for the root.

§kind: EntryKind

What the entry is.

§entry_ignored: Option<bool>

Whether this entry itself is gitignored, or None when its classification is unknown. This is independent of the selected subtree’s ignored tally.

§bytes: u64

Apparent bytes in this subtree.

§allocated: u64

Allocated bytes in this subtree.

§files: u64

Files in this subtree.

§dirs: u64

Directories in this subtree.

§ignored: Option<IgnoredTally>

The part of this subtree’s tallies that .gitignore rules ignore, or None when governing controls were unobserved or could not be verified.

Counted over the selected entries, like every other tally on the row, so it is zero when the selection excludes ignored entries and the whole row when it admits only them.

§newest_mtime_ns: Option<i64>

Newest modification time in this subtree, when it holds any files.

§children: Vec<TreeNode>

Children reported beneath this node.

§omissions: Vec<TreeOmission>

Disjoint child subtrees first excluded at this node’s display boundary.

§truncated: bool

Whether children were withheld by the depth or limit bound.

Trait Implementations§

Source§

impl Clone for TreeNode

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TreeNode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for TreeNode

Source§

fn drop(&mut self)

Release children iteratively.

The derived drop glue recurses once per level, so a deeply nested tree would exhaust the stack on release even after every renderer was made iterative — the same hazard the index avoids when freeing a subtree. Taking the children out first turns that recursion into a loop.

Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.