Trait linefeed::terminal::TerminalWriter [−][src]
pub trait TerminalWriter<Term: Terminal> { fn size(&self) -> Result<Size>; fn clear_screen(&mut self) -> Result<()>; fn clear_to_screen_end(&mut self) -> Result<()>; fn move_up(&mut self, n: usize) -> Result<()>; fn move_down(&mut self, n: usize) -> Result<()>; fn move_left(&mut self, n: usize) -> Result<()>; fn move_right(&mut self, n: usize) -> Result<()>; fn move_to_first_column(&mut self) -> Result<()>; fn set_cursor_mode(&mut self, mode: CursorMode) -> Result<()>; fn write(&mut self, s: &str) -> Result<()>; fn flush(&mut self) -> Result<()>; }
Holds a lock on Terminal
write operations
Required Methods
fn size(&self) -> Result<Size>
Returns the size of the terminal window
fn clear_screen(&mut self) -> Result<()>
Presents a clear terminal screen, with cursor at first row, first column.
If the terminal possesses a scrolling window over a buffer, this shall have the effect of moving the visible window down such that it shows an empty view of the buffer, preserving some or all of existing buffer contents, where possible.
fn clear_to_screen_end(&mut self) -> Result<()>
Clears characters on the line occupied by the cursor, beginning with the cursor and ending at the end of the line. Also clears all characters on all lines after the cursor.
fn move_up(&mut self, n: usize) -> Result<()>
Moves the cursor up n
cells; n
may be zero.
fn move_down(&mut self, n: usize) -> Result<()>
Moves the cursor down n
cells; n
may be zero.
fn move_left(&mut self, n: usize) -> Result<()>
Moves the cursor left n
cells; n
may be zero.
fn move_right(&mut self, n: usize) -> Result<()>
Moves the cursor right n
cells; n
may be zero.
fn move_to_first_column(&mut self) -> Result<()>
Moves the cursor to the first column of the current line
fn set_cursor_mode(&mut self, mode: CursorMode) -> Result<()>
Set the current cursor mode
fn write(&mut self, s: &str) -> Result<()>
Writes output to the terminal.
For each carriage return '\r'
written to the terminal, the cursor
should be moved to the first column of the current line.
For each newline '\n'
written to the terminal, the cursor should
be moved to the first column of the following line.
The terminal interface shall not automatically move the cursor to the next
line when write
causes a character to be written to the final column.
fn flush(&mut self) -> Result<()>
Flushes any currently buffered output data.
TerminalWriter
instances may not buffer data on all systems.
Data must be flushed when the TerminalWriter
instance is dropped.
Implementations on Foreign Types
impl<'a> TerminalWriter<DefaultTerminal> for TerminalWriteGuard<'a>
[src]
impl<'a> TerminalWriter<DefaultTerminal> for TerminalWriteGuard<'a>
fn size(&self) -> Result<Size>
[src]
fn size(&self) -> Result<Size>
fn clear_screen(&mut self) -> Result<()>
[src]
fn clear_screen(&mut self) -> Result<()>
fn clear_to_screen_end(&mut self) -> Result<()>
[src]
fn clear_to_screen_end(&mut self) -> Result<()>
fn move_up(&mut self, n: usize) -> Result<()>
[src]
fn move_up(&mut self, n: usize) -> Result<()>
fn move_down(&mut self, n: usize) -> Result<()>
[src]
fn move_down(&mut self, n: usize) -> Result<()>
fn move_left(&mut self, n: usize) -> Result<()>
[src]
fn move_left(&mut self, n: usize) -> Result<()>
fn move_right(&mut self, n: usize) -> Result<()>
[src]
fn move_right(&mut self, n: usize) -> Result<()>
fn move_to_first_column(&mut self) -> Result<()>
[src]
fn move_to_first_column(&mut self) -> Result<()>
fn set_cursor_mode(&mut self, mode: CursorMode) -> Result<()>
[src]
fn set_cursor_mode(&mut self, mode: CursorMode) -> Result<()>
fn write(&mut self, s: &str) -> Result<()>
[src]
fn write(&mut self, s: &str) -> Result<()>
fn flush(&mut self) -> Result<()>
[src]
fn flush(&mut self) -> Result<()>
Implementors
impl<'a> TerminalWriter<MemoryTerminal> for MemoryWriteGuard<'a>