struct App<'a> {
roots: Vec<&'a DirStat>,
path_stack: Vec<&'a DirStat>,
current: Option<&'a DirStat>,
entries: Vec<DirEntry>,
list_state: ListState,
should_quit: bool,
}Expand description
State for the TUI application
Fields§
§roots: Vec<&'a DirStat>Stored roots for lookup when at root level
path_stack: Vec<&'a DirStat>Stack of directory stats for navigation (parent directories)
current: Option<&'a DirStat>Current directory being viewed (None means we’re at the roots list)
entries: Vec<DirEntry>List of entries in the current directory
list_state: ListStateCurrently selected index
should_quit: boolShould quit
Implementations§
Source§impl<'a> App<'a>
impl<'a> App<'a>
Sourcefn make_entry(stat: &DirStat) -> DirEntry
fn make_entry(stat: &DirStat) -> DirEntry
Convert a DirStat to a DirEntry
Sourcefn finalize_entries(&mut self)
fn finalize_entries(&mut self)
Sort entries by size (descending) and select first item
fn new(roots: Vec<&'a DirStat>) -> Self
fn from_stat(stat: &'a DirStat) -> Self
fn populate_entries_from_current(&mut self)
fn populate_entries_from_roots(&mut self)
fn get_current_path(&self) -> String
fn get_current_total_size(&self) -> u64
fn move_up(&mut self)
fn move_down(&mut self)
fn enter_selected(&mut self)
fn go_back(&mut self)
fn handle_key(&mut self, code: KeyCode)
Auto Trait Implementations§
impl<'a> Freeze for App<'a>
impl<'a> RefUnwindSafe for App<'a>
impl<'a> Send for App<'a>
impl<'a> Sync for App<'a>
impl<'a> Unpin for App<'a>
impl<'a> UnwindSafe for App<'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> 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