pub struct TreeNode {
pub name: String,
pub path: PathBuf,
pub is_file: bool,
pub children: BTreeMap<String, TreeNode>,
}Expand description
Represents a node in the directory tree
Fields§
§name: String§path: PathBuf§is_file: bool§children: BTreeMap<String, TreeNode>Implementations§
Source§impl TreeNode
impl TreeNode
pub fn new(name: String, path: PathBuf, is_file: bool) -> Self
Sourcepub fn count_nodes(&self) -> usize
pub fn count_nodes(&self) -> usize
Get the total number of nodes in this tree (including self)
Sourcepub fn count_files(&self) -> usize
pub fn count_files(&self) -> usize
Get the number of file nodes in this tree
Sourcepub fn estimate_render_lines(&self, show_files: bool) -> usize
pub fn estimate_render_lines(&self, show_files: bool) -> usize
Estimate the number of lines this tree would take to render
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TreeNode
impl RefUnwindSafe for TreeNode
impl Send for TreeNode
impl Sync for TreeNode
impl Unpin for TreeNode
impl UnsafeUnpin for TreeNode
impl UnwindSafe for TreeNode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more