pub struct Readline { /* private fields */ }
Expand description
A struct representing a context for reading a line using libreadline.
Implementations§
source§impl Readline
impl Readline
sourcepub fn feed<C>(&mut self, c: C) -> Option<CString>where
C: Into<c_int>,
pub fn feed<C>(&mut self, c: C) -> Option<CString>where
C: Into<c_int>,
Feed a character to libreadline.
sourcepub fn reset<'s, S>(&'s mut self, line: S, cursor: usize, clear_undo: bool)where
S: AsRef<CStr>,
pub fn reset<'s, S>(&'s mut self, line: S, cursor: usize, clear_undo: bool)where
S: AsRef<CStr>,
Reset libreadline’s line state to the given line with the given
cursor position. If clear_undo
is set, the undo list associated
with the current line is cleared
Panics
Panics if the cursor is not less than or equal to the number of characters in the given line.