Struct rustyline_async::Readline
source · pub struct Readline { /* private fields */ }
Expand description
Structure that contains all the data necessary to read and write lines in an asyncronous manner
Implementations§
source§impl Readline
impl Readline
sourcepub fn new(prompt: String) -> Result<(Self, SharedWriter), ReadlineError>
pub fn new(prompt: String) -> Result<(Self, SharedWriter), ReadlineError>
Create new Readline
sourcepub fn set_max_history(&mut self, max_size: usize)
pub fn set_max_history(&mut self, max_size: usize)
Set max history length
sourcepub fn flush(&mut self) -> Result<(), ReadlineError>
pub fn flush(&mut self) -> Result<(), ReadlineError>
Flush all writers to terminal
sourcepub async fn readline(&mut self) -> Result<String, ReadlineError>
pub async fn readline(&mut self) -> Result<String, ReadlineError>
Polling function for readline, manages all input and output.
sourcepub fn add_history_entry(&mut self, entry: String) -> Option<()>
pub fn add_history_entry(&mut self, entry: String) -> Option<()>
Add history entry asyncronously