pub struct Editor<B: Buffer, H: History, IO: Read + Write> { /* private fields */ }Expand description
Line editor for synchronous IO
It is recommended to use crate::builder::EditorBuilder to build an Editor.
Implementations§
source§impl<B, H, IO, RE, WE> Editor<B, H, IO>
impl<B, H, IO, RE, WE> Editor<B, H, IO>
sourcepub fn readline<'b>(
&'b mut self,
prompt: &'b str,
io: &mut IO,
) -> Result<&'b str, Error<RE, WE>>
pub fn readline<'b>( &'b mut self, prompt: &'b str, io: &mut IO, ) -> Result<&'b str, Error<RE, WE>>
Read line from stdin
sourcepub fn load_history<'a>(
&mut self,
entries: impl Iterator<Item = &'a str>,
) -> usize
pub fn load_history<'a>( &mut self, entries: impl Iterator<Item = &'a str>, ) -> usize
Load history from iterator
sourcepub fn get_history<'a>(&'a self) -> impl Iterator<Item = CircularSlice<'a>>
pub fn get_history<'a>(&'a self) -> impl Iterator<Item = CircularSlice<'a>>
Get history as iterator over circular slices
Auto Trait Implementations§
impl<B, H, IO> Freeze for Editor<B, H, IO>
impl<B, H, IO> RefUnwindSafe for Editor<B, H, IO>
impl<B, H, IO> Send for Editor<B, H, IO>
impl<B, H, IO> Sync for Editor<B, H, IO>
impl<B, H, IO> Unpin for Editor<B, H, IO>
impl<B, H, IO> UnwindSafe for Editor<B, H, IO>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more