pub struct FileSystemTree<'a> {
pub root_path: PathBuf,
pub nodes: Vec<FileSystemTreeNode>,
pub config: FileSystemTreeConfig,
pub block: Option<Block<'a>>,
}Available on crate feature
file-system-tree only.Fields§
§root_path: PathBuf§nodes: Vec<FileSystemTreeNode>§config: FileSystemTreeConfig§block: Option<Block<'a>>Implementations§
Source§impl<'a> FileSystemTree<'a>
impl<'a> FileSystemTree<'a>
pub fn new(root_path: PathBuf) -> Result<FileSystemTree<'a>, Error>
pub fn with_config( root_path: PathBuf, config: FileSystemTreeConfig, ) -> Result<FileSystemTree<'a>, Error>
pub fn expand_directory(&mut self, path: &[usize]) -> Result<(), Error>
pub fn get_entry_at_path(&self, path: &[usize]) -> Option<&FileSystemEntry>
pub fn get_selected_entry( &self, state: &FileSystemTreeState, ) -> Option<&FileSystemEntry>
pub fn get_visible_paths(&self, state: &FileSystemTreeState) -> Vec<Vec<usize>>
pub fn select_next(&mut self, state: &mut FileSystemTreeState)
pub fn select_previous(&mut self, state: &mut FileSystemTreeState)
pub fn toggle_selected( &mut self, state: &mut FileSystemTreeState, ) -> Result<(), Error>
pub fn enter_filter_mode(&self, state: &mut FileSystemTreeState)
pub fn is_filter_mode(&self, state: &FileSystemTreeState) -> bool
pub fn filter_text<'s>(&self, state: &'s FileSystemTreeState) -> Option<&'s str>
pub fn clear_filter(&self, state: &mut FileSystemTreeState)
pub fn handle_filter_key( &self, key: KeyCode, state: &mut FileSystemTreeState, ) -> bool
pub fn block(self, block: Block<'a>) -> FileSystemTree<'a>
Trait Implementations§
Source§impl<'a> Clone for FileSystemTree<'a>
impl<'a> Clone for FileSystemTree<'a>
Source§fn clone(&self) -> FileSystemTree<'a>
fn clone(&self) -> FileSystemTree<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> StatefulWidget for FileSystemTree<'a>
impl<'a> StatefulWidget for FileSystemTree<'a>
Source§type State = FileSystemTreeState
type State = FileSystemTreeState
State associated with the stateful widget. Read more
Source§fn render(
self,
area: Rect,
buf: &mut Buffer,
state: &mut <FileSystemTree<'a> as StatefulWidget>::State,
)
fn render( self, area: Rect, buf: &mut Buffer, state: &mut <FileSystemTree<'a> as StatefulWidget>::State, )
Draws the current state of the widget in the given buffer. That is the only method required
to implement a custom stateful widget.
Auto Trait Implementations§
impl<'a> Freeze for FileSystemTree<'a>
impl<'a> RefUnwindSafe for FileSystemTree<'a>
impl<'a> Send for FileSystemTree<'a>
impl<'a> Sync for FileSystemTree<'a>
impl<'a> Unpin for FileSystemTree<'a>
impl<'a> UnsafeUnpin for FileSystemTree<'a>
impl<'a> UnwindSafe for FileSystemTree<'a>
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> 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