EventAction

Struct EventAction 

Source
pub struct EventAction {}
Expand description

Links events from ratatui to custom actions. It mutates Status or its children Tab.

Implementations§

Source§

impl EventAction

Source

pub fn quit(status: &mut Status) -> Result<()>

Once a quit event is received, we change a flag and break the main loop. It’s useful to be able to reset the cursor before leaving the application. If a menu is opened, closes it.

Source

pub fn refresh_view(status: &mut Status) -> Result<()>

Refresh the current view, reloading the files. Move the selection to top.

Source

pub fn refresh_if_needed(status: &mut Status) -> Result<()>

Refresh the views if files were modified in current directory.

Source

pub fn resize(status: &mut Status, width: u16, height: u16) -> Result<()>

Source

pub fn reset_mode(status: &mut Status) -> Result<()>

Leave current mode to normal mode. Reset the inputs and completion, reset the window, exit the preview.

Source

pub fn toggle_display_full(status: &mut Status) -> Result<()>

Toggle between a full display (aka ls -lah) or a simple mode (only the filenames).

Source

pub fn toggle_dualpane(status: &mut Status) -> Result<()>

Toggle between dualpane and single pane. Does nothing if the width is too low to display both panes.

Source

pub fn toggle_preview_second(status: &mut Status) -> Result<()>

Toggle the second pane between preview & normal mode (files).

Source

pub fn tree(status: &mut Status) -> Result<()>

Creates a tree in every mode but “Tree”. In display_mode tree it will exit this view.

Source

pub fn tree_fold(status: &mut Status) -> Result<()>

Fold the current node of the tree. Has no effect on “file” nodes.

Source

pub fn tree_unfold_all(status: &mut Status) -> Result<()>

Unfold every child node in the tree. Recursively explore the tree and unfold every node. Reset the display.

Source

pub fn tree_fold_all(status: &mut Status) -> Result<()>

Fold every child node in the tree. Recursively explore the tree and fold every node. Reset the display.

Source

pub fn display_flagged(status: &mut Status) -> Result<()>

Toggle the display of flagged files. Does nothing if a menu is opened.

Source

pub fn preview(status: &mut Status) -> Result<()>

Preview the selected file. Every file can be previewed. See the crate::enum::Preview for more details on previewinga file. Does nothing if the directory is empty.

Source

pub fn toggle_hidden(status: &mut Status) -> Result<()>

Toggle the display of hidden files.

Source

pub fn clear_flags(status: &mut Status) -> Result<()>

Remove every flag on files in this directory and others.

Source

pub fn flag_all(status: &mut Status) -> Result<()>

Flag all files in the current directory.

Source

pub fn flagged_to_clipboard(status: &mut Status) -> Result<()>

Push every flagged path to the clipboard.

Source

pub fn flagged_from_clipboard(status: &mut Status) -> Result<()>

Replace the currently flagged files by those in clipboard. Does nothing if the clipboard is empty or can’t be read.

Source

pub fn reverse_flags(status: &mut Status) -> Result<()>

Reverse every flag in current directory. Flagged files in other directory aren’t affected.

Source

pub fn toggle_flag(status: &mut Status) -> Result<()>

Toggle a single flag and move down one row.

Source

pub fn rename(status: &mut Status) -> Result<()>

Enter the rename mode. Keep a track of the current mode to ensure we rename the correct file. When we enter rename from a “tree” mode, we’ll need to rename the selected file in the tree, not the selected file in the pathcontent.

Source

pub fn copy_paste(status: &mut Status) -> Result<()>

Enter a copy paste mode. A confirmation is asked before copying all flagged files to the current directory. Does nothing if no file is flagged.

Source

pub fn cut_paste(status: &mut Status) -> Result<()>

Enter the ‘move’ mode. A confirmation is asked before moving all flagged files to the current directory. Does nothing if no file is flagged.

Creates a symlink of every flagged file to the current directory.

Source

pub fn delete_file(status: &mut Status) -> Result<()>

Enter the delete mode. A confirmation is then asked before deleting all the flagged files. If no file is flagged, flag the selected one before entering the mode.

Source

pub fn chmod(status: &mut Status) -> Result<()>

Change to CHMOD mode allowing to edit permissions of a file.

Source

pub fn new_dir(status: &mut Status) -> Result<()>

Enter the new dir mode.

Source

pub fn new_file(status: &mut Status) -> Result<()>

Enter the new file mode.

Source

pub fn open_file(status: &mut Status) -> Result<()>

Open files with custom opener. If there’s no flagged file, the selected is chosen. Otherwise, it will open the flagged files (not the flagged directories) with their respective opener. Directories aren’t opened since it will lead nowhere, it would only replace the current tab multiple times. It may change in the future. Only files which use an external opener are supported.

Source

pub fn open_all(status: &mut Status) -> Result<()>

Source

pub fn exec(status: &mut Status) -> Result<()>

Enter the execute mode. Most commands must be executed to allow for a confirmation.

Source

pub fn sort(status: &mut Status) -> Result<()>

Enter the sort mode, allowing the user to select a sort method.

Source

pub fn filter(status: &mut Status) -> Result<()>

Enter the filter mode, where you can filter. See crate::modes::Filter for more details.

Source

pub fn bulk(status: &mut Status) -> Result<()>

Enter bulkrename mode, opening a random temp file where the user can edit the selected filenames. Once the temp file is saved, those file names are changed.

Source

pub fn search(status: &mut Status) -> Result<()>

Enter the search mode. Matching items are displayed as you type them.

Source

pub fn regex_match(status: &mut Status) -> Result<()>

Enter the regex mode. Every file matching the typed regex will be flagged.

Source

pub fn help(status: &mut Status, binds: &Bindings) -> Result<()>

Display the help which can be navigated and displays the configrable binds.

Source

pub fn log(status: &mut Status) -> Result<()>

Display the last actions impacting the file tree

Source

pub fn cd(status: &mut Status) -> Result<()>

Enter the cd mode where an user can type a path to jump to.

Source

pub fn shell(status: &mut Status) -> Result<()>

Open a new terminal in current directory and current window. The shell is a fork of current process and will exit if the application is terminated first.

Source

pub fn shell_command(status: &mut Status) -> Result<()>

Enter the shell input command mode. The user can type a command which will be parsed and run.

Source

pub fn tui_menu(status: &mut Status) -> Result<()>

Enter the shell menu mode. You can pick a TUI application to be run

Source

pub fn cli_menu(status: &mut Status) -> Result<()>

Enter the cli info mode. You can pick a Text application to be displayed/

Source

pub fn history(status: &mut Status) -> Result<()>

Enter the history mode, allowing to navigate to previously visited directory.

Source

pub fn marks_new(status: &mut Status) -> Result<()>

Enter Marks new mode, allowing to bind a char to a path.

Source

pub fn marks_jump(status: &mut Status) -> Result<()>

Enter Marks jump mode, allowing to jump to a marked file.

Source

pub fn temp_marks_jump(status: &mut Status) -> Result<()>

Enter TempMarks jump mode, allowing to jump to a marked file.

Source

pub fn temp_marks_new(status: &mut Status) -> Result<()>

Enter TempMarks new mode, allowing to bind a char to a path.

Source

pub fn shortcut(status: &mut Status) -> Result<()>

Enter the shortcut mode, allowing to visit predefined shortcuts. Basic folders (/, /dev… $HOME) and mount points (even impossible to visit ones) are proposed.

Source

pub fn nvim_filepicker(status: &mut Status) -> Result<()>

Send a signal to parent NVIM process, picking files. If there’s no flagged file, it picks the selected one. otherwise, flagged files are picked. If no RPC server were provided at launch time - which may happen for reasons unknow to me - it does nothing. It requires the “nvim-send” application to be in $PATH.

Source

pub fn set_nvim_server(status: &mut Status) -> Result<()>

Enter the set neovim RPC address mode where the user can type the RPC address himself

Source

pub fn back(status: &mut Status) -> Result<()>

Move back in history to the last visited directory.

Source

pub fn home(status: &mut Status) -> Result<()>

Move to $HOME aka ~.

Source

pub fn go_root(status: &mut Status) -> Result<()>

Source

pub fn go_start(status: &mut Status) -> Result<()>

Source

pub fn search_next(status: &mut Status) -> Result<()>

Source

pub fn move_up(status: &mut Status) -> Result<()>

Move up one row in modes allowing movement. Does nothing if the selected item is already the first in list.

Source

pub fn next_thing(status: &mut Status) -> Result<()>

Special move to the next “thing”. if we’re in tree mode, focusing a file, it’s the next sibling (= node of the same level sharing parent) if we’re inputing something, it’s the next history result

Source

pub fn previous_thing(status: &mut Status) -> Result<()>

Special move to the previous “thing”. if we’re in tree mode, focusing a file, it’s the previous sibling (= node of the same level sharing parent) if we’re inputing something, it’s the previous history result

Source

pub fn move_down(status: &mut Status) -> Result<()>

Move down one row in modes allowing movements. Does nothing if the user is already at the bottom.

Source

pub fn move_left(status: &mut Status) -> Result<()>

Move to parent in normal mode, move left one char in mode requiring text input.

Source

pub fn move_right(status: &mut Status) -> Result<()>

Move to child if any or open a regular file in normal mode. Move the cursor one char to right in mode requiring text input.

Source

pub fn focus_follow_mouse(status: &mut Status, row: u16, col: u16) -> Result<()>

Source

pub fn left_click( status: &mut Status, binds: &Bindings, row: u16, col: u16, ) -> Result<()>

Left Click a file at row, col. Gives the focus to the window container.

Source

pub fn right_click( status: &mut Status, binds: &Bindings, row: u16, col: u16, ) -> Result<()>

Right click gives focus to the window and open the context menu

Source

pub fn wheel_up(status: &mut Status, row: u16, col: u16) -> Result<()>

Wheel up moves the display up

Source

pub fn wheel_down(status: &mut Status, row: u16, col: u16) -> Result<()>

Wheel down moves the display down

Source

pub fn middle_click( status: &mut Status, binds: &Bindings, row: u16, col: u16, ) -> Result<()>

A middle_click click opens a file or execute a menu item

Source

pub fn backspace(status: &mut Status) -> Result<()>

Delete a char to the left in modes allowing edition.

Source

pub fn delete(status: &mut Status) -> Result<()>

When files are focused, try to delete the flagged files (or selected if no file is flagged) When edit window is focused, delete all chars to the right in mode allowing edition.

Source

pub fn delete_line(status: &mut Status) -> Result<()>

Source

pub fn delete_left(status: &mut Status) -> Result<()>

Delete one word to the left in menus with input

Source

pub fn key_home(status: &mut Status) -> Result<()>

Move to leftmost char in mode allowing edition.

Source

pub fn end(status: &mut Status) -> Result<()>

Move to the bottom in any mode.

Source

pub fn page_up(status: &mut Status) -> Result<()>

Move up 10 lines in normal mode and preview.

Source

pub fn page_down(status: &mut Status) -> Result<()>

Move down 10 lines in normal & preview mode.

Source

pub fn enter(status: &mut Status, binds: &Bindings) -> Result<()>

Execute the mode. In modes requiring confirmation or text input, it will execute the related action. In normal mode, it will open the file. Reset to normal mode afterwards.

Source

pub fn tab(status: &mut Status) -> Result<()>

Change tab in normal mode with dual pane displayed, insert a completion in modes allowing completion.

Source

pub fn fuzzyfind(status: &mut Status) -> Result<()>

Start a fuzzy find with skim.

Source

pub fn fuzzyfind_line(status: &mut Status) -> Result<()>

Start a fuzzy find for a specific line with skim.

Source

pub fn fuzzyfind_help(status: &mut Status, binds: &Bindings) -> Result<()>

Start a fuzzy find for a keybinding with skim.

Source

pub fn copy_content(status: &Status) -> Result<()>

Copy the content of the selected text file in normal mode.

Source

pub fn copy_filename(status: &Status) -> Result<()>

Copy the filename of the selected file in normal mode.

Source

pub fn copy_filepath(status: &Status) -> Result<()>

Copy the filepath of the selected file in normal mode.

Source

pub fn trash_move_file(status: &mut Status) -> Result<()>

Move flagged files to the trash directory. If no file is flagged, flag the selected file. More information in the trash crate itself. If the file is mounted on the $topdir of the trash (aka the $HOME mount point), it is moved there. Else, nothing is done.

Source

pub fn trash_empty(status: &mut Status) -> Result<()>

Ask the user if he wants to empty the trash. It requires a confimation before doing anything

Source

pub fn trash_open(status: &mut Status) -> Result<()>

Open the trash. Displays a navigable content of the trash. Each item can be restored or deleted. Each opening refresh the trash content.

Source

pub fn trash_restore(status: &mut Status) -> Result<()>

Source

pub fn open_config(status: &mut Status) -> Result<()>

Open the config file.

Source

pub fn compress(status: &mut Status) -> Result<()>

Enter compression mode

Source

pub fn context(status: &mut Status) -> Result<()>

Enter the context menu mode where the user can choose a basic file action.

Source

pub fn action(status: &mut Status) -> Result<()>

Enter action mode in which you can type any valid action. Some action does nothing as they require to be executed from a specific context.

Source

pub fn custom(status: &mut Status, input_string: &str) -> Result<()>

Execute a custom event on the selected file

Source

pub fn remote_mount(status: &mut Status) -> Result<()>

Enter the remote mount mode where the user can provide an username, an adress and a mount point to mount a remote device through SSHFS.

Source

pub fn cloud_drive(status: &mut Status) -> Result<()>

Source

pub fn select_pane(status: &mut Status, col: u16) -> Result<()>

Select the left or right tab depending on col

Source

pub fn focus_go_left(status: &mut Status) -> Result<()>

Source

pub fn focus_go_right(status: &mut Status) -> Result<()>

Source

pub fn focus_go_down(status: &mut Status) -> Result<()>

Source

pub fn focus_go_up(status: &mut Status) -> Result<()>

Source

pub fn sync_ltr(status: &mut Status) -> Result<()>

Source

pub fn bulk_confirm(status: &mut Status) -> Result<()>

Source

pub fn file_copied(status: &mut Status) -> Result<()>

Source

pub fn display_copy_progress( status: &mut Status, content: InMemoryTerm, ) -> Result<()>

Source

pub fn check_preview_fuzzy_tick(status: &mut Status) -> Result<()>

Source

pub fn visual(status: &mut Status) -> Result<()>

Source

pub fn mount(status: &mut Status) -> Result<()>

Open the mount menu

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &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
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSend for T
where T: Send,