pub struct FilesView {
pub current_dir: PathBuf,
pub entries: Vec<FileEntry>,
pub selected: usize,
pub list_state: ListState,
pub show_hidden: bool,
pub filter: Option<String>,
pub preview: Option<String>,
}Expand description
File browser view state
Fields§
§current_dir: PathBufCurrent directory path
entries: Vec<FileEntry>List of file entries
selected: usizeSelected entry index
list_state: ListStateList state for navigation
Show hidden files
filter: Option<String>Filter pattern
preview: Option<String>Currently previewed file info
Implementations§
Source§impl FilesView
impl FilesView
Sourcepub fn load_demo_entries(&mut self)
pub fn load_demo_entries(&mut self)
Load demo file entries for visualization
Sourcepub fn select_prev(&mut self)
pub fn select_prev(&mut self)
Move selection up
Sourcepub fn select_next(&mut self)
pub fn select_next(&mut self)
Move selection down
Sourcepub fn toggle_or_open(&mut self)
pub fn toggle_or_open(&mut self)
Toggle directory expansion or open file
Sourcepub fn open_selected(&mut self) -> Option<PathBuf>
pub fn open_selected(&mut self) -> Option<PathBuf>
Open selected file and return its path if it’s a file (not directory)
Toggle hidden files
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FilesView
impl RefUnwindSafe for FilesView
impl Send for FilesView
impl Sync for FilesView
impl Unpin for FilesView
impl UnwindSafe for FilesView
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