pub struct LineTerminal<R, W> { /* private fields */ }Expand description
A line-driven Terminal over an injected reader and writer.
It uses the operating system’s cooked line discipline: the user types a whole
line and presses Enter. It never enters raw mode, works over pipes, and needs
no extra dependencies, so it is the default terminal. Bind it to real streams
with LineTerminal::stdio, or to in-memory buffers with LineTerminal::new.
Implementations§
Trait Implementations§
Source§impl<R: BufRead, W: Write> Terminal for LineTerminal<R, W>
impl<R: BufRead, W: Write> Terminal for LineTerminal<R, W>
Source§fn capabilities(&self) -> Capabilities
fn capabilities(&self) -> Capabilities
The interaction model this terminal supports.
Source§fn read_line(&mut self) -> AppResult<Option<String>>
fn read_line(&mut self) -> AppResult<Option<String>>
Read one whole line (line-driven terminals). Read more
Source§fn read_key(&mut self) -> AppResult<Key>
fn read_key(&mut self) -> AppResult<Key>
Read one decoded keystroke (key-driven terminals). Read more
Source§fn write(&mut self, text: &str) -> AppResult<()>
fn write(&mut self, text: &str) -> AppResult<()>
Write
text verbatim (no trailing newline). Read moreSource§fn write_line(&mut self, text: &str) -> AppResult<()>
fn write_line(&mut self, text: &str) -> AppResult<()>
Write
text followed by a newline (a carriage return + line feed in raw
mode). Read moreSource§fn clear_last_lines(&mut self, _count: u16) -> AppResult<()>
fn clear_last_lines(&mut self, _count: u16) -> AppResult<()>
Move the cursor up
count lines and clear from there down, so the next
frame overwrites the previous one. A no-op for line-driven terminals. Read moreAuto Trait Implementations§
impl<R, W> Freeze for LineTerminal<R, W>
impl<R, W> RefUnwindSafe for LineTerminal<R, W>where
R: RefUnwindSafe,
W: RefUnwindSafe,
impl<R, W> Send for LineTerminal<R, W>
impl<R, W> Sync for LineTerminal<R, W>
impl<R, W> Unpin for LineTerminal<R, W>
impl<R, W> UnsafeUnpin for LineTerminal<R, W>where
R: UnsafeUnpin,
W: UnsafeUnpin,
impl<R, W> UnwindSafe for LineTerminal<R, W>where
R: UnwindSafe,
W: UnwindSafe,
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