pub struct FileExplorerState {
pub current_dir: PathBuf,
pub entries: Vec<FileEntry>,
pub cursor_index: usize,
pub scroll: u16,
pub selected_files: HashSet<PathBuf>,
pub show_hidden: bool,
pub mode: FileExplorerMode,
pub search_query: String,
pub filtered_indices: Option<Vec<usize>>,
}Expand description
State for the file explorer widget
Fields§
§current_dir: PathBufCurrent directory
entries: Vec<FileEntry>List of entries in current directory
cursor_index: usizeCurrent cursor position
scroll: u16Scroll offset
selected_files: HashSet<PathBuf>Selected files (for multi-select)
Whether to show hidden files
mode: FileExplorerModeCurrent mode
search_query: StringSearch/filter query
filtered_indices: Option<Vec<usize>>Filtered entry indices (None = show all)
Implementations§
Source§impl FileExplorerState
impl FileExplorerState
Sourcepub fn enter_directory(&mut self, path: PathBuf)
pub fn enter_directory(&mut self, path: PathBuf)
Navigate into a directory
Sourcepub fn cursor_down(&mut self)
pub fn cursor_down(&mut self)
Move cursor down
Sourcepub fn visible_count(&self) -> usize
pub fn visible_count(&self) -> usize
Get the number of visible entries
Sourcepub fn current_entry(&self) -> Option<&FileEntry>
pub fn current_entry(&self) -> Option<&FileEntry>
Get the currently selected entry
Sourcepub fn toggle_selection(&mut self)
pub fn toggle_selection(&mut self)
Toggle selection of current file
Sourcepub fn select_all(&mut self)
pub fn select_all(&mut self)
Select all files
Sourcepub fn select_none(&mut self)
pub fn select_none(&mut self)
Clear all selections
Toggle hidden files visibility
Sourcepub fn start_search(&mut self)
pub fn start_search(&mut self)
Enter search mode
Sourcepub fn cancel_search(&mut self)
pub fn cancel_search(&mut self)
Exit search mode
Sourcepub fn update_filter(&mut self)
pub fn update_filter(&mut self)
Update search filter
Sourcepub fn ensure_visible(&mut self, viewport_height: usize)
pub fn ensure_visible(&mut self, viewport_height: usize)
Ensure cursor is visible
Trait Implementations§
Source§impl Clone for FileExplorerState
impl Clone for FileExplorerState
Source§fn clone(&self) -> FileExplorerState
fn clone(&self) -> FileExplorerState
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 moreAuto Trait Implementations§
impl Freeze for FileExplorerState
impl RefUnwindSafe for FileExplorerState
impl Send for FileExplorerState
impl Sync for FileExplorerState
impl Unpin for FileExplorerState
impl UnwindSafe for FileExplorerState
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> 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