pub trait Completer {
// Required method
fn completions(&mut self, input: &str) -> Vec<CompletionResult>;
// Provided methods
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 { ... }
}Expand description
The trait completer is an interface to be satisfied by input completers.
Required Methods§
Sourcefn completions(&mut self, input: &str) -> Vec<CompletionResult>
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.
Provided Methods§
Sourcefn column_count(&self) -> usize
fn column_count(&self) -> usize
The number of column.
Sourcefn complete_result(&self, value: &str) -> String
fn complete_result(&self, value: &str) -> String
From the selected text entry, return the text that should be written in the text input.
Sourcefn have_command(&self) -> bool
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.
Sourcefn text_column(&self) -> i32
fn text_column(&self) -> i32
Set the column to use as the result of a selected text entry.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".