Trait rushell_deps_linefeed::complete::Completer[][src]

pub trait Completer<Term: Terminal>: Send + Sync {
    fn complete(
        &self,
        word: &str,
        prompter: &Prompter<'_, '_, Term>,
        start: usize,
        end: usize
    ) -> Option<Vec<Completion>>; fn word_start(
        &self,
        line: &str,
        end: usize,
        prompter: &Prompter<'_, '_, Term>
    ) -> usize { ... }
fn quote<'a>(&self, word: &'a str) -> Cow<'a, str> { ... }
fn unquote<'a>(&self, word: &'a str) -> Cow<'a, str> { ... } }

Performs completion for Prompter when triggered by a user input sequence

Required methods

fn complete(
    &self,
    word: &str,
    prompter: &Prompter<'_, '_, Term>,
    start: usize,
    end: usize
) -> Option<Vec<Completion>>
[src]

Returns the set of possible completions for the prefix word.

Loading content...

Provided methods

fn word_start(
    &self,
    line: &str,
    end: usize,
    prompter: &Prompter<'_, '_, Term>
) -> usize
[src]

Returns the starting position of the word under the cursor.

The default implementation uses Prompter::word_break_chars() to detect the start of a word.

fn quote<'a>(&self, word: &'a str) -> Cow<'a, str>[src]

Quotes a possible completion for insertion into input.

The default implementation returns the word, as is.

fn unquote<'a>(&self, word: &'a str) -> Cow<'a, str>[src]

Unquotes a piece of user input before searching for completions.

The default implementation returns the word, as is.

Loading content...

Implementors

impl<Term: Terminal> Completer<Term> for DummyCompleter[src]

fn complete(
    &self,
    _word: &str,
    _reader: &Prompter<'_, '_, Term>,
    _start: usize,
    _end: usize
) -> Option<Vec<Completion>>
[src]

impl<Term: Terminal> Completer<Term> for PathCompleter[src]

fn complete(
    &self,
    word: &str,
    _reader: &Prompter<'_, '_, Term>,
    _start: usize,
    _end: usize
) -> Option<Vec<Completion>>
[src]

fn word_start(
    &self,
    line: &str,
    end: usize,
    _reader: &Prompter<'_, '_, Term>
) -> usize
[src]

fn quote<'a>(&self, word: &'a str) -> Cow<'a, str>[src]

fn unquote<'a>(&self, word: &'a str) -> Cow<'a, str>[src]

Loading content...