pub struct MenuHolder {Show 21 fields
pub window: ContentWindow,
pub bulk: Bulk,
pub cli_applications: CliApplications,
pub cloud: OpendalContainer,
pub completion: Completion,
pub compression: Compresser,
pub context: ContextMenu,
pub flagged: Flagged,
pub input: Input,
pub input_history: InputHistory,
pub iso_device: Option<IsoDevice>,
pub marks: Marks,
pub temp_marks: TempMarks,
pub password_holder: PasswordHolder,
pub picker: Picker,
pub shortcut: Shortcut,
pub tui_applications: TuiApplications,
pub trash: Trash,
pub sudo_command: Option<String>,
pub history: History,
pub mount: Mount,
}Expand description
Holds almost every menu except for the history, which is tab specific. Only one instance is created and hold by status. It acts as an interface for basic methods (navigation, length, completion) etc. it also keeps track of the content window and user input (in menus only, not for the fuzzy finder).
The poor choices of architecture forced the creation of such a monster. For instance, even if you never use marks or cloud, their instance is saved here, waisting ressources.
Building them lazylly is on the todo list.
Fields§
§window: ContentWindowWindow for scrollable menus
bulk: BulkBulk rename
cli_applications: CliApplicationsCLI applications
cloud: OpendalContainercloud
completion: CompletionCompletion list and index in it.
compression: CompresserCompression methods
context: ContextMenuCotext menu
flagged: FlaggedThe flagged files
input: InputThe typed input by the user
input_history: InputHistoryThe user input history.
iso_device: Option<IsoDevice>Iso mounter. Set to None by default, dropped ASAP
marks: MarksMarks allows you to jump to a save mark
temp_marks: TempMarksTemporary marks allows you to jump to a save mark
password_holder: PasswordHolderHold password between their typing and usage
picker: Pickerbasic picker
shortcut: ShortcutPredefined shortcuts
tui_applications: TuiApplicationsTUI application
trash: TrashThe trash
sudo_command: Option<String>Last sudo command ran
history: HistoryHistory - here for compatibility reasons only
mount: Mountmounts
Implementations§
Source§impl MenuHolder
impl MenuHolder
pub fn new(start_dir: &Path, binds: &Bindings) -> Result<Self>
pub fn reset(&mut self)
pub fn resize(&mut self, menu_mode: Menu, height: usize)
Sourcepub fn replace_input_by_permissions(&mut self)
pub fn replace_input_by_permissions(&mut self)
Replace the current input by the permission of the first flagged file as an octal value. If the flagged has permission “rwxrw.r..” or 764 in octal, “764” will be the current input. Only the last 3 octal digits are kept. Nothing is done if :
- there’s no flagged file,
- can’t read the metadata of the first flagged file.
It should never happen.
Sourcepub fn input_complete(&mut self, tab: &mut Tab) -> Result<()>
pub fn input_complete(&mut self, tab: &mut Tab) -> Result<()>
Fill the input string with the currently selected completion.
Sourcepub fn mount_remote(&mut self, current_path: &str)
pub fn mount_remote(&mut self, current_path: &str)
Run sshfs with typed parameters to mount a remote directory in current directory.
sshfs should be reachable in path.
The user must type 3 arguments like this : username hostname remote_path.
If the user doesn’t provide 3 arguments,
Sourcepub fn remove_selected_flagged(&mut self) -> Result<()>
pub fn remove_selected_flagged(&mut self) -> Result<()>
Remove a flag file from Jump mode
pub fn trash_delete_permanently(&mut self) -> Result<()>
Sourcepub fn delete_flagged_files(&mut self) -> Result<()>
pub fn delete_flagged_files(&mut self) -> Result<()>
Delete all the flagged files & directory recursively. If an output socket was provided at launch, it will inform the IPC server about those deletions. Clear the flagged files.
§Errors
May fail if any deletion is impossible (permissions, file already deleted etc.)
Sourcepub fn clear_sudo_attributes(&mut self) -> Result<()>
pub fn clear_sudo_attributes(&mut self) -> Result<()>
Reset the password holder, drop the sudo privileges (sudo -k) and clear the sudo command.
Sourcepub fn input_insert(&mut self, char: char) -> Result<()>
pub fn input_insert(&mut self, char: char) -> Result<()>
Insert a char in the input string.
Sourcepub fn refresh_shortcuts(
&mut self,
mount_points: &[&Path],
left_path: &Path,
right_path: &Path,
)
pub fn refresh_shortcuts( &mut self, mount_points: &[&Path], left_path: &Path, right_path: &Path, )
Refresh the shortcuts. It drops non “hardcoded” shortcuts and extend the vector with the mount points.
pub fn completion_reset(&mut self)
pub fn completion_tab(&mut self)
pub fn len(&self, menu_mode: Menu) -> usize
pub fn index(&self, menu_mode: Menu) -> usize
pub fn page_down(&mut self, navigate: Navigate)
pub fn page_up(&mut self, navigate: Navigate)
pub fn completion_prev(&mut self, input_completed: InputCompleted)
pub fn completion_next(&mut self, input_completed: InputCompleted)
pub fn next(&mut self, navigate: Navigate)
pub fn prev(&mut self, navigate: Navigate)
pub fn set_index(&mut self, index: usize, navigate: Navigate)
pub fn select_last(&mut self, navigate: Navigate)
Draw a navigation menu with its simple draw_menu method.
§Errors
Some mode can’t be displayed directly and this method will raise an error. It’s the responsability of the caller to check beforehand.
Sourcepub fn input_history_next(&mut self, tab: &mut Tab) -> Result<()>
pub fn input_history_next(&mut self, tab: &mut Tab) -> Result<()>
Replace the current input by the next proposition from history for this edit mode.
Sourcepub fn input_history_prev(&mut self, tab: &mut Tab) -> Result<()>
pub fn input_history_prev(&mut self, tab: &mut Tab) -> Result<()>
Replace the current input by the previous proposition from history for this edit mode.
Sourcepub fn shortcut_from_char(&mut self, c: char) -> bool
pub fn shortcut_from_char(&mut self, c: char) -> bool
Navigates to the index in the shortcut field based on the given character.
Sourcepub fn context_from_char(&mut self, c: char) -> bool
pub fn context_from_char(&mut self, c: char) -> bool
Navigates to the index in the context field based on the given character.
Sourcepub fn tui_applications_from_char(&mut self, c: char) -> bool
pub fn tui_applications_from_char(&mut self, c: char) -> bool
Navigates to the index in the tui_applications field based on the given character.
Sourcepub fn cli_applications_from_char(&mut self, c: char) -> bool
pub fn cli_applications_from_char(&mut self, c: char) -> bool
Navigates to the index in the cli_applications field based on the given character.
Sourcepub fn compression_method_from_char(&mut self, c: char) -> bool
pub fn compression_method_from_char(&mut self, c: char) -> bool
Navigates to the index in the compression field based on the given character.
Auto Trait Implementations§
impl Freeze for MenuHolder
impl !RefUnwindSafe for MenuHolder
impl Send for MenuHolder
impl Sync for MenuHolder
impl Unpin for MenuHolder
impl !UnwindSafe for MenuHolder
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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>
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>
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