Struct datafusion_rustyline::Editor[][src]

pub struct Editor<H: Helper> { /* fields omitted */ }

Line editor

Methods

impl<H: Helper> Editor<H>
[src]

Create an editor with the default configuration

Create an editor with a specific configuration.

This method will read a line from STDIN and will display a prompt.

It uses terminal-style interaction if stdin is connected to a terminal. Otherwise (e.g., if stdin is a pipe or the terminal is not supported), it uses file-style interaction.

This function behaves in the exact same manner as readline, except that it pre-populates the input area.

The text that resides in the input area is given as a 2-tuple. The string on the left of the tuple is what will appear to the left of the cursor and the string on the right is what will appear to the right of the cursor.

Load the history from the specified file.

Save the history in the specified file.

Add a new entry in the history.

Clear history.

Return a mutable reference to the history object.

Return an immutable reference to the history object.

Register a callback function to be called for tab-completion or to show hints to the user at the right of the prompt.

Deprecating in 2.0.0

: Use set_helper instead

Bind a sequence to a command.

Remove a binding for the given sequence.

Important traits for Iter<'a, H>

let mut rl = rustyline::Editor::<()>::new();
for readline in rl.iter("> ") {
    match readline {
        Ok(line) => {
            println!("Line: {}", line);
        }
        Err(err) => {
            println!("Error: {:?}", err);
            break;
        }
    }
}

Trait Implementations

impl<H: Helper> Debug for Editor<H>
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl<H> Send for Editor<H> where
    H: Send

impl<H> Sync for Editor<H> where
    H: Sync