ReadLine

Trait ReadLine 

Source
pub trait ReadLine {
    // Required methods
    fn read_line(&mut self) -> Result<String>;
    fn clear_history(&mut self);
}
Expand description

Generic input stream adapter trait, used for adding a proper line editor.

Comes with a generic implementation for all BufRead types.

Required Methods§

Source

fn read_line(&mut self) -> Result<String>

This is called once by every execution of the ? command within ADC.

ErrorKind::Interrupted causes ? to error, ErrorKind::UnexpectedEof makes an empty string, other ErrorKinds are returned early from the interpreter.

Source

fn clear_history(&mut self)

If Self has a history, clear it.

Implementors§

Source§

impl<T: BufRead> ReadLine for T