pub struct Pane {
pub cwd: PathBuf,
pub entries: Vec<Entry>,
pub cursor: usize,
pub last_error: Option<String>,
pub scroll_offset: usize,
}Fields§
§cwd: PathBuf§entries: Vec<Entry>§cursor: usize§last_error: Option<String>§scroll_offset: usizeImplementations§
Source§impl Pane
impl Pane
pub fn new(cwd: PathBuf) -> Self
pub fn move_cursor_up(&mut self)
pub fn move_cursor_down(&mut self)
Sourcepub fn ensure_cursor_visible(&mut self, visible_items: usize)
pub fn ensure_cursor_visible(&mut self, visible_items: usize)
Keep the cursor in the visible viewport (for when viewport size changes or entries are reloaded)
pub fn selected(&self) -> Option<&Entry>
Sourcepub fn load_entries(&mut self)
pub fn load_entries(&mut self)
Load entries from the current working directory. Sorts directories first (alphabetical), then files (alphabetical). Excludes “.” but includes “..” (parent directory) if not at root.
Sourcepub fn enter_directory(&mut self)
pub fn enter_directory(&mut self)
Enter the selected directory. If selection is not a directory, does nothing.
Sourcepub fn goto_parent(&mut self)
pub fn goto_parent(&mut self)
Navigate to the parent directory. Does nothing if already at root.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Pane
impl RefUnwindSafe for Pane
impl Send for Pane
impl Sync for Pane
impl Unpin for Pane
impl UnsafeUnpin for Pane
impl UnwindSafe for Pane
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