pub trait BaseConsole {
    type Error;

Show 13 methods fn get_width(&self) -> Col; fn get_height(&self) -> Row; fn set_col(&mut self, col: Col) -> Result<(), Self::Error>; fn set_row(&mut self, row: Row) -> Result<(), Self::Error>; fn set_pos(&mut self, pos: Position) -> Result<(), Self::Error>; fn get_pos(&self) -> Position; fn set_control_char_mode(&mut self, mode: ControlCharMode); fn get_control_char_mode(&self) -> ControlCharMode; fn set_escape_char_mode(&mut self, mode: EscapeCharMode); fn get_escape_char_mode(&self) -> EscapeCharMode; fn scroll_screen(&mut self) -> Result<(), Self::Error>; fn set_pos_unbounded(&mut self, pos: Position) { ... } fn move_cursor_right(&mut self) -> Result<(), Self::Error> { ... }
}
Expand description

Abstraction for our console. We can move the cursor around and write text to it. You should use either UnicodeConsole or AsciiConsole depending on whether you want full Unicode support (&str, char, etc), or just 8-bit characters (&[u8] and u8).

Required Associated Types§

Required Methods§

Gets the last col on the screen.

Gets the last row on the screen.

Set the horizontal position for the next text output.

Set the vertical position for the next text output.

Set the horizontal and vertical position for the next text output.

Get the current screen position.

Set the control char mode

Get the current control char mode

Set the escape char mode

Get the current escape char mode

Called when the screen needs to scroll up one row.

Provided Methods§

Set the horizontal and vertical position for the next text output. Don’t bounds check the value, we’ve already done it.

Move the current cursor right one position. Wraps at the end of the line. Returns Ok(true) if the screen needs to scroll, or Ok(false) if it does not.

Implementors§