Enum broot::verb::Internal

source ·
pub enum Internal {
Show 92 variants back, close_panel_ok, close_panel_cancel, copy_line, copy_path, filesystems, focus, help, input_clear, input_del_char_left, input_del_char_below, input_del_word_left, input_del_word_right, input_go_to_end, input_go_left, input_go_right, input_go_to_start, input_go_word_left, input_go_word_right, input_selection_copy, input_selection_cut, input_paste, line_down, line_up, line_down_no_cycle, line_up_no_cycle, open_stay, open_stay_filter, open_leave, mode_input, mode_command, previous_dir, next_dir, previous_match, next_match, next_same_depth, no_sort, page_down, page_up, parent, panel_left, panel_right, panel_left_no_open, panel_right_no_open, previous_same_depth, open_preview, close_preview, toggle_preview, preview_image, preview_text, preview_binary, print_path, print_relative_path, print_tree, start_end_panel, quit, refresh, root_up, root_down, select_first, select_last, select, set_syntax_theme, sort_by_count, sort_by_date, sort_by_size, sort_by_type, sort_by_type_dirs_first, sort_by_type_dirs_last, clear_stage, stage, unstage, open_staging_area, close_staging_area, toggle_staging_area, stage_all_files, toggle_stage, toggle_counts, toggle_dates, toggle_device_id, toggle_files, toggle_git_ignore, toggle_git_file_info, toggle_git_status, toggle_root_fs, toggle_hidden, toggle_perm, toggle_sizes, toggle_trim_root, toggle_second_tree, total_search, up_tree,
}

Variants§

§

back

§

close_panel_ok

§

close_panel_cancel

§

copy_line

§

copy_path

§

filesystems

§

focus

§

help

§

input_clear

§

input_del_char_left

§

input_del_char_below

§

input_del_word_left

§

input_del_word_right

§

input_go_to_end

§

input_go_left

§

input_go_right

§

input_go_to_start

§

input_go_word_left

§

input_go_word_right

§

input_selection_copy

§

input_selection_cut

§

input_paste

§

line_down

§

line_up

§

line_down_no_cycle

§

line_up_no_cycle

§

open_stay

§

open_stay_filter

§

open_leave

§

mode_input

§

mode_command

§

previous_dir

§

next_dir

§

previous_match

§

next_match

§

next_same_depth

§

no_sort

§

page_down

§

page_up

§

parent

§

panel_left

§

panel_right

§

panel_left_no_open

§

panel_right_no_open

§

previous_same_depth

§

open_preview

§

close_preview

§

toggle_preview

§

preview_image

§

preview_text

§

preview_binary

§

print_path

§

print_relative_path

§

print_tree

§

start_end_panel

§

quit

§

refresh

§

root_up

§

root_down

§

select_first

§

select_last

§

select

§

set_syntax_theme

§

sort_by_count

§

sort_by_date

§

sort_by_size

§

sort_by_type

§

sort_by_type_dirs_first

§

sort_by_type_dirs_last

§

clear_stage

§

stage

§

unstage

§

open_staging_area

§

close_staging_area

§

toggle_staging_area

§

stage_all_files

§

toggle_stage

§

toggle_counts

§

toggle_dates

§

toggle_device_id

§

toggle_files

§

toggle_git_ignore

§

toggle_git_file_info

§

toggle_git_status

§

toggle_root_fs

§

toggle_hidden

§

toggle_perm

§

toggle_sizes

§

toggle_trim_root

§

toggle_second_tree

§

up_tree

Implementations§

Examples found in repository?
src/verb/internal_execution.rs (line 40)
38
39
40
41
42
43
44
45
46
    pub fn try_from(invocation_str: &str) -> Result<Self, ConfError> {
        let invocation = VerbInvocation::from(invocation_str);
        let internal = Internal::try_from(&invocation.name)?;
        Ok(Self {
            internal,
            bang: invocation.bang,
            arg: invocation.args,
        })
    }
Examples found in repository?
src/verb/internal_execution.rs (line 53)
52
53
54
55
56
57
58
59
60
61
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(f, ":{}", self.internal.name())?;
        if self.bang {
            write!(f, "!")?;
        }
        if let Some(arg) = &self.arg {
            write!(f, " {}", arg)?;
        }
        Ok(())
    }
More examples
Hide additional examples
src/verb/internal.rs (line 161)
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
    pub fn invocation_pattern(self) -> &'static str {
        match self {
            Internal::focus => r"focus (?P<path>.*)?",
            Internal::select => r"select (?P<path>.*)?",
            Internal::line_down => r"line_down (?P<count>\d*)?",
            Internal::line_up => r"line_up (?P<count>\d*)?",
            Internal::line_down_no_cycle => r"line_down_no_cycle (?P<count>\d*)?",
            Internal::line_up_no_cycle => r"line_up_no_cycle (?P<count>\d*)?",
            Internal::set_syntax_theme => r"set_syntax_theme {theme:theme}",
            _ => self.name(),
        }
    }
    pub fn exec_pattern(self) -> &'static str {
        match self {
            Internal::focus => r"focus {path}",
            Internal::line_down => r"line_down {count}",
            Internal::line_up => r"line_up {count}",
            Internal::line_down_no_cycle => r"line_down_no_cycle {count}",
            Internal::line_up_no_cycle => r"line_up_no_cycle {count}",
            _ => self.name(),
        }
    }
Examples found in repository?
src/verb/builtin.rs (line 17)
9
10
11
12
13
14
15
16
17
18
19
fn build_internal(
    internal: Internal,
    bang: bool,
) -> Verb {
    let invocation = internal.invocation_pattern();
    let execution = VerbExecution::Internal(
        InternalExecution::from_internal_bang(internal, bang)
    );
    let description = VerbDescription::from_text(internal.description().to_string());
    Verb::new(Some(invocation), execution, description).unwrap()
}
Examples found in repository?
src/verb/internal.rs (line 177)
174
175
176
177
178
179
    pub fn needs_selection(self, arg: &Option<String>) -> bool {
        match self {
            Internal::focus => arg.is_none(),
            _ => self.need_path(),
        }
    }
Examples found in repository?
src/verb/builtin.rs (line 13)
9
10
11
12
13
14
15
16
17
18
19
fn build_internal(
    internal: Internal,
    bang: bool,
) -> Verb {
    let invocation = internal.invocation_pattern();
    let execution = VerbExecution::Internal(
        InternalExecution::from_internal_bang(internal, bang)
    );
    let description = VerbDescription::from_text(internal.description().to_string());
    Verb::new(Some(invocation), execution, description).unwrap()
}
Examples found in repository?
src/verb/internal_execution.rs (line 48)
47
48
49
    pub fn needs_selection(&self) -> bool {
        self.internal.needs_selection(&self.arg)
    }

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.