Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
Completer in datafusion_rustyline::completion - Rust
[go: Go Back, main page]

Trait Completer

Source
pub trait Completer {
    // Required method
    fn complete(&self, line: &str, pos: usize) -> Result<(usize, Vec<String>)>;

    // Provided method
    fn update(&self, line: &mut LineBuffer, start: usize, elected: &str) { ... }
}
Expand description

To be called for tab-completion.

Required Methods§

Source

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

Takes the currently edited line with the cursor position and returns the start position and the completion candidates for the partial word to be completed.

(“ls /usr/loc”, 11) => Ok((3, vec![“/usr/local/”]))

Provided Methods§

Source

fn update(&self, line: &mut LineBuffer, start: usize, elected: &str)

Updates the edited line with the elected candidate.

Implementations on Foreign Types§

Source§

impl Completer for ()

Source§

fn complete(&self, _line: &str, _pos: usize) -> Result<(usize, Vec<String>)>

Source§

fn update(&self, _line: &mut LineBuffer, _start: usize, _elected: &str)

Source§

impl<'c, C: ?Sized + Completer> Completer for &'c C

Source§

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

Source§

fn update(&self, line: &mut LineBuffer, start: usize, elected: &str)

Source§

impl<C: ?Sized + Completer> Completer for Box<C>

Source§

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

Source§

fn update(&self, line: &mut LineBuffer, start: usize, elected: &str)

Source§

impl<C: ?Sized + Completer> Completer for Rc<C>

Source§

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

Source§

fn update(&self, line: &mut LineBuffer, start: usize, elected: &str)

Source§

impl<C: ?Sized + Completer> Completer for Arc<C>

Source§

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

Source§

fn update(&self, line: &mut LineBuffer, start: usize, elected: &str)

Implementors§