[−][src]Struct broot::verbs::Verb
what makes a verb.
There are two types of verbs executions:
- external programs or commands (cd, mkdir, user defined commands, etc.)
- built in behaviors (focusing a path, going back, showing the help, etc.)
Fields
invocation: VerbInvocation
key: Option<KeyEvent>
key_desc: String
args_parser: Option<Regex>
shortcut: Option<String>
execution: String
description: Option<String>
from_shell: bool
leave_broot: bool
confirm: bool
selection_condition: SelectionType
Implementations
impl Verb
[src]
pub fn create_external(
invocation_str: &str,
key: Option<KeyEvent>,
shortcut: Option<String>,
execution: String,
description: Option<String>,
from_shell: bool,
leave_broot: bool,
confirm: bool
) -> Result<Verb, ConfError>
[src]
invocation_str: &str,
key: Option<KeyEvent>,
shortcut: Option<String>,
execution: String,
description: Option<String>,
from_shell: bool,
leave_broot: bool,
confirm: bool
) -> Result<Verb, ConfError>
build a verb using standard configurable behavior. "external" means not "built-in".
pub fn create_builtin(
name: &str,
key: Option<KeyEvent>,
shortcut: Option<String>,
description: &str
) -> Verb
[src]
name: &str,
key: Option<KeyEvent>,
shortcut: Option<String>,
description: &str
) -> Verb
built-ins are verbs offering a logic other than the execution based on exec_pattern. They mostly modify the appstate
pub fn match_error(&self, invocation: &VerbInvocation) -> Option<String>
[src]
Assuming the verb has been matched, check whether the arguments are OK according to the regex. Return none when there's no problem and return the error to display if arguments don't match
pub fn write_status(
&self,
w: &mut impl Write,
task: Option<&'static str>,
path: PathBuf,
invocation: &VerbInvocation,
screen: &Screen
) -> Result<(), ProgramError>
[src]
&self,
w: &mut impl Write,
task: Option<&'static str>,
path: PathBuf,
invocation: &VerbInvocation,
screen: &Screen
) -> Result<(), ProgramError>
pub fn to_cmd_result(
&self,
file: &Path,
args: &Option<String>,
_screen: &mut Screen,
con: &AppContext
) -> Result<AppStateCmdResult, ProgramError>
[src]
&self,
file: &Path,
args: &Option<String>,
_screen: &mut Screen,
con: &AppContext
) -> Result<AppStateCmdResult, ProgramError>
build the cmd result for a verb defined with an exec pattern. Calling this function on a built-in doesn't make sense
pub fn exec_token(&self, file: &Path, args: &Option<String>) -> Vec<String>
[src]
build the token which can be used to launch en executable. This doesn't make sense for a built-in.
pub fn shell_exec_string(&self, file: &Path, args: &Option<String>) -> String
[src]
build a shell compatible command, with escapings
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Verb
impl Send for Verb
impl Sync for Verb
impl Unpin for Verb
impl UnwindSafe for Verb
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,