Trait reedline::Completer

source ·
pub trait Completer: Send {
    fn complete(&mut self, line: &str, pos: usize) -> Vec<Suggestion>;

    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§

source

fn complete(&mut self, line: &str, pos: usize) -> Vec<Suggestion>

the action that will take the line and position and convert it to a vector of completions, which include the span to replace and the contents of that replacement

Provided Methods§

source

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

source

fn total_completions(&mut self, line: &str, pos: usize) -> usize

number of available completions

Implementors§