Trait rushell_deps_linefeed::function::Function[][src]

pub trait Function<Term: Terminal>: Send + Sync {
    fn execute(
        &self,
        prompter: &mut Prompter<'_, '_, Term>,
        count: i32,
        ch: char
    ) -> Result<()>; fn category(&self) -> Category { ... } }

Implements custom functionality for a Prompter command

Required methods

fn execute(
    &self,
    prompter: &mut Prompter<'_, '_, Term>,
    count: i32,
    ch: char
) -> Result<()>
[src]

Executes the function.

count is the numerical argument supplied by the user; 1 by default. prompter.explicit_arg() may be called to determine whether this value was explicitly supplied by the user.

ch is the final character of the sequence that triggered the command. prompter.sequence() may be called to determine the full sequence that triggered the command.

Loading content...

Provided methods

fn category(&self) -> Category[src]

Returns the command category.

Loading content...

Implementors

impl<F, Term: Terminal> Function<Term> for F where
    F: Send + Sync,
    F: Fn(&mut Prompter<'_, '_, Term>, i32, char) -> Result<()>, 
[src]

fn execute(
    &self,
    prompter: &mut Prompter<'_, '_, Term>,
    count: i32,
    ch: char
) -> Result<()>
[src]

Loading content...