Struct tcalc_rustyline::Editor [] [src]

pub struct Editor<C: Completer> { /* fields omitted */ }

Line editor

Methods

impl<C: Completer> Editor<C>
[src]

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

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 reference to the history object.

Register a callback function to be called for tab-completion.

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<C: Completer> Debug for Editor<C>
[src]

Formats the value using the given formatter.