pub trait Completer: Send {
// Required method
fn complete(&mut self, line: &str, pos: usize) -> Vec<Suggestion>;
// Provided methods
fn partial_complete(
&mut self,
line: &str,
pos: usize,
start: usize,
offset: usize
) -> Vec<Suggestion> { ... }
fn total_completions(&mut self, line: &str, pos: usize) -> usize { ... }
}
Expand description
A trait that defines how to convert a line and position to a list of potential completions in that position.
Required Methods§
Provided Methods§
sourcefn partial_complete(
&mut self,
line: &str,
pos: usize,
start: usize,
offset: usize
) -> Vec<Suggestion>
fn partial_complete( &mut self, line: &str, pos: usize, start: usize, offset: usize ) -> Vec<Suggestion>
action that will return a partial section of available completions this command comes handy when trying to avoid to pull all the data at once from the completer
sourcefn total_completions(&mut self, line: &str, pos: usize) -> usize
fn total_completions(&mut self, line: &str, pos: usize) -> usize
number of available completions