[][src]Trait mg::completion::Completer

pub trait Completer {
    fn completions(&mut self, input: &str) -> Vec<CompletionResult>;

    fn columns(&self) -> Vec<Column> { ... }
fn column_count(&self) -> usize { ... }
fn complete_result(&self, value: &str) -> String { ... }
fn have_command(&self) -> bool { ... }
fn text_column(&self) -> i32 { ... } }

The trait completer is an interface to be satisfied by input completers.

Required methods

fn completions(&mut self, input: &str) -> Vec<CompletionResult>

From the user input, return the completion results. The results are on two columns, hence the 2-tuple.

Loading content...

Provided methods

fn columns(&self) -> Vec<Column>

The number of columns of the completer.

fn column_count(&self) -> usize

The number of column.

fn complete_result(&self, value: &str) -> String

From the selected text entry, return the text that should be written in the text input.

fn have_command(&self) -> bool

Return true if the completer is for an input containing a command. Return false otherwise. This will have the effect of removing the command when there's one it set to true.

fn text_column(&self) -> i32

Set the column to use as the result of a selected text entry.

Loading content...

Implementors

impl Completer for NoCompleter[src]

impl<T> Completer for SettingCompleter<T>[src]

impl<T: Clone> Completer for CommandCompleter<T>[src]

Loading content...