Struct rustyline::Editor [] [src]

pub struct Editor<'completer> {
    // some fields omitted
}

Line editor

Methods

impl<'completer> Editor<'completer>
[src]

fn new() -> Editor<'completer>

fn readline(&mut self, prompt: &str) -> Result<String>

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

fn load_history<P: AsRef<Path> + ?Sized>(&mut self, path: &P) -> Result<()>

Load the history from the specified file.

fn save_history<P: AsRef<Path> + ?Sized>(&self, path: &P) -> Result<()>

Save the history in the specified file.

fn add_history_entry(&mut self, line: &str) -> bool

Add a new entry in the history.

fn set_history_max_len(&mut self, max_len: usize)

Set the maximum length for the history.

fn clear_history(&mut self)

Clear history.

fn get_history(&mut self) -> &mut History

Return a reference to the history object.

fn set_completer(&mut self, completer: Option<&'completer Completer>)

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

Trait Implementations

impl<'completer> Default for Editor<'completer>
[src]

fn default() -> Editor<'completer>

Returns the "default value" for a type. Read more

impl<'completer> Debug for Editor<'completer>
[src]

fn fmt(&self, f: &mut Formatter) -> Result

Formats the value using the given formatter.