Struct broot::tree::Tree[][src]

pub struct Tree {
    pub lines: Box<[TreeLine]>,
    pub selection: usize,
    pub options: TreeOptions,
    pub scroll: usize,
    pub nb_gitignored: u32,
    pub total_search: bool,
    pub git_status: ComputationResult<TreeGitStatus>,
}
Expand description

The tree which may be displayed, with onle line per visible line of the panel.

In the tree structure, every “node” is just a line, there’s no link from a child to its parent or from a parent to its children.

Fields

lines: Box<[TreeLine]>selection: usizeoptions: TreeOptionsscroll: usizenb_gitignored: u32total_search: boolgit_status: ComputationResult<TreeGitStatus>

Implementations

rebuild the tree with the same root, height, and options

do what must be done after line additions or removals:

  • sort the lines
  • compute left branchs

select another line

For example the following one if dy is 1.

Scroll the desired amount and return true, or return false if it’s already at end or the tree fits the page

try to select a line by index of visible line (works if y+scroll falls on a selectable line)

select the line with the best matching score

return true when we could select the given path

fetch the file_sums of regular files (thus avoiding the long computation which is needed for directories)

compute the file_sum of one directory

To compute the size of all of them, this should be called until has_dir_missing_sum returns false

compute and return the size of the root

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

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

Performs the conversion.

Performs the conversion.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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.