pub struct Tree { /* private fields */ }Expand description
A FileSystem tree of nodes.
Internally it’s a wrapper around an std::collections::HashMap<PathBuf, Node>
It also holds informations about the required height of the tree.
Implementations§
Source§impl Tree
impl Tree
Sourcepub fn selected_path(&self) -> &Path
pub fn selected_path(&self) -> &Path
Selected path
pub fn selected_node_or_parent(&self) -> Result<&Node>
Sourcepub fn selected_node(&self) -> Option<&Node>
pub fn selected_node(&self) -> Option<&Node>
Selected node
Sourcepub fn directory_of_selected(&self) -> Option<&Path>
pub fn directory_of_selected(&self) -> Option<&Path>
The folder containing the selected node. Itself if selected is a directory.
Sourcepub fn selected_path_relative_to_root(&self) -> Result<&Path>
pub fn selected_path_relative_to_root(&self) -> Result<&Path>
Relative path of selected from rootpath.
pub fn display_len(&self) -> usize
Sourcepub fn is_on_root(&self) -> bool
pub fn is_on_root(&self) -> bool
True if selected is root.
pub fn page_up(&mut self)
pub fn page_down(&mut self)
Sourcepub fn toggle_fold(&mut self)
pub fn toggle_fold(&mut self)
Fold selected node
Sourcepub fn unfold_all(&mut self)
pub fn unfold_all(&mut self)
Unfold all node from root to end
pub fn displayable(&self) -> &TreeLines
pub fn flag_all(&self, flagged: &mut Flagged)
Sourcepub fn has_modified_dirs(&self) -> bool
pub fn has_modified_dirs(&self) -> bool
True if any directory (not symlink to a directory) has been modified less than 10 seconds ago.
pub fn selected_is_last(&self) -> bool
pub fn path_from_index(&self, index: usize) -> Result<PathBuf>
pub fn lines_enum_skip_take( &self, window: &ContentWindow, ) -> Take<Skip<Enumerate<Iter<'_, TLine>>>>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Tree
impl RefUnwindSafe for Tree
impl Send for Tree
impl Sync for Tree
impl Unpin for Tree
impl UnwindSafe for Tree
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more