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> { ... }
}
Expand description
Performs completion for Prompter
when triggered by a user input sequence
Required Methods
Provided Methods
sourcefn word_start(
&self,
line: &str,
end: usize,
prompter: &Prompter<'_, '_, Term>
) -> usize
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.