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 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 async fn add_history_entry(&mut self, entry: String) -> Option<()>
pub async fn add_history_entry(&mut self, entry: String) -> Option<()>
Add history entry asyncronously, should resolve immediately unless sending too many history entries
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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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