pub trait Tui {
Show 13 methods
// Required methods
fn get_color_mode(&self) -> ColorMode;
fn reset(&mut self) -> Result<(), DisplayError>;
fn flush(&mut self) -> Result<(), DisplayError>;
fn print(&mut self, s: &str) -> Result<(), DisplayError>;
fn set_color(&mut self, colors: Colors) -> Result<(), DisplayError>;
fn set_dim(&mut self, dim: bool) -> Result<(), DisplayError>;
fn set_underline(&mut self, underline: bool) -> Result<(), DisplayError>;
fn set_reverse(&mut self, reverse: bool) -> Result<(), DisplayError>;
fn get_size(&self) -> Size;
fn move_to_column(&mut self, x: u16) -> Result<(), DisplayError>;
fn move_next_line(&mut self) -> Result<(), DisplayError>;
fn start(&mut self) -> Result<(), DisplayError>;
fn end(&mut self) -> Result<(), DisplayError>;
}
Expand description
An interface that describes interactions with a terminal interface.
Required Methods§
sourcefn get_color_mode(&self) -> ColorMode
fn get_color_mode(&self) -> ColorMode
Get the supported color mode.
sourcefn reset(&mut self) -> Result<(), DisplayError>
fn reset(&mut self) -> Result<(), DisplayError>
Reset the terminal interface to a default state.
Errors
Errors if the Tui cannot be reset for any reason. In general this should not error, and if this does generate an error, the Tui should be considered to be in a non-recoverable state.
sourcefn flush(&mut self) -> Result<(), DisplayError>
fn flush(&mut self) -> Result<(), DisplayError>
Flush the contents printed to the terminal interface.
Errors
Errors if the Tui cannot be flushed for any reason. In general this should not error, and if this does generate an error, the Tui should be considered to be in a non-recoverable state.
sourcefn print(&mut self, s: &str) -> Result<(), DisplayError>
fn print(&mut self, s: &str) -> Result<(), DisplayError>
Print text to the terminal interface.
Errors
Errors if the Tui cannot be printed to for any reason. In general this should not error, and if this does generate an error, the Tui should be considered to be in a non-recoverable state.
sourcefn set_color(&mut self, colors: Colors) -> Result<(), DisplayError>
fn set_color(&mut self, colors: Colors) -> Result<(), DisplayError>
Set the color attribute of text printed to the terminal interface.
Errors
Errors if the Tui cannot set the color for any reason. In general this should not error, and if this does generate an error, the Tui should be considered to be in a non-recoverable state.
sourcefn set_dim(&mut self, dim: bool) -> Result<(), DisplayError>
fn set_dim(&mut self, dim: bool) -> Result<(), DisplayError>
Set the dimmed style attribute of text printed to the terminal interface.
Errors
Errors if the Tui cannot set the dimmed state for any reason. In general this should not error, and if this does generate an error, the Tui should be considered to be in a non-recoverable state.
sourcefn set_underline(&mut self, underline: bool) -> Result<(), DisplayError>
fn set_underline(&mut self, underline: bool) -> Result<(), DisplayError>
Set the underlined style attribute of text printed to the terminal interface.
Errors
Errors if the Tui cannot set the underline state for any reason. In general this should not error, and if this does generate an error, the Tui should be considered to be in a non-recoverable state.
sourcefn set_reverse(&mut self, reverse: bool) -> Result<(), DisplayError>
fn set_reverse(&mut self, reverse: bool) -> Result<(), DisplayError>
Set the reversed style attribute of text printed to the terminal interface.
Errors
Errors if the Tui cannot set the reversed state for any reason. In general this should not error, and if this does generate an error, the Tui should be considered to be in a non-recoverable state.
sourcefn move_to_column(&mut self, x: u16) -> Result<(), DisplayError>
fn move_to_column(&mut self, x: u16) -> Result<(), DisplayError>
Move the cursor position x
characters from the start of the line.
Errors
Errors if the Tui cannot move to a column for any reason. In general this should not error, and if this does generate an error, the Tui should be considered to be in a non-recoverable state.
sourcefn move_next_line(&mut self) -> Result<(), DisplayError>
fn move_next_line(&mut self) -> Result<(), DisplayError>
Move the cursor to the next line.
Errors
Errors if the Tui cannot move to the next line for any reason. In general this should not error, and if this does generate an error, the Tui should be considered to be in a non-recoverable state.