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
sourceimpl 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
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Readline
impl Send for Readline
impl Sync for Readline
impl Unpin for Readline
impl !UnwindSafe for Readline
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more