[−][src]Trait cmdtree::completion::Completer
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>>
&self,
word: &str,
prompter: &Prompter<Term>,
start: usize,
end: usize
) -> Option<Vec<Completion>>
Returns the set of possible completions for the prefix word
.
Provided methods
fn word_start(&self, line: &str, end: usize, prompter: &Prompter<Term>) -> usize
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(&self, word: &'a str) -> Cow<'a, str>
Quotes a possible completion for insertion into input.
The default implementation returns the word, as is.
fn unquote(&self, word: &'a str) -> Cow<'a, str>
Unquotes a piece of user input before searching for completions.
The default implementation returns the word, as is.
Implementations on Foreign Types
impl<Term> Completer<Term> for DummyCompleter where
Term: Terminal,
[src]
Term: Terminal,
fn complete(
&self,
_word: &str,
_reader: &Prompter<Term>,
_start: usize,
_end: usize
) -> Option<Vec<Completion>>
[src]
&self,
_word: &str,
_reader: &Prompter<Term>,
_start: usize,
_end: usize
) -> Option<Vec<Completion>>
fn word_start(&self, line: &str, end: usize, prompter: &Prompter<Term>) -> usize
[src]
fn quote(&self, word: &'a str) -> Cow<'a, str>
[src]
fn unquote(&self, word: &'a str) -> Cow<'a, str>
[src]
impl<Term> Completer<Term> for PathCompleter where
Term: Terminal,
[src]
Term: Terminal,
fn complete(
&self,
word: &str,
_reader: &Prompter<Term>,
_start: usize,
_end: usize
) -> Option<Vec<Completion>>
[src]
&self,
word: &str,
_reader: &Prompter<Term>,
_start: usize,
_end: usize
) -> Option<Vec<Completion>>