Trait linefeed::terminal::TerminalWriter
source · 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<()>;
}
Expand description
Holds a lock on Terminal
write operations
Required Methods
sourcefn clear_screen(&mut self) -> Result<()>
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.
sourcefn clear_to_screen_end(&mut self) -> Result<()>
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.
sourcefn move_right(&mut self, n: usize) -> Result<()>
fn move_right(&mut self, n: usize) -> Result<()>
Moves the cursor right n
cells; n
may be zero.
sourcefn move_to_first_column(&mut self) -> Result<()>
fn move_to_first_column(&mut self) -> Result<()>
Moves the cursor to the first column of the current line
sourcefn set_cursor_mode(&mut self, mode: CursorMode) -> Result<()>
fn set_cursor_mode(&mut self, mode: CursorMode) -> Result<()>
Set the current cursor mode
sourcefn write(&mut self, s: &str) -> Result<()>
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.