pub trait Tui {
Show 14 methods
fn get_color_mode(&self) -> ColorMode;
fn reset(&mut self) -> Result<()>;
fn flush(&mut self) -> Result<()>;
fn print(&mut self, s: &str) -> Result<()>;
fn set_color(&mut self, colors: Colors) -> Result<()>;
fn set_dim(&mut self, dim: bool) -> Result<()>;
fn set_underline(&mut self, underline: bool) -> Result<()>;
fn set_reverse(&mut self, reverse: bool) -> Result<()>;
fn read_event() -> Result<Option<Event>>
where
Self: Sized;
fn get_size(&self) -> Size;
fn move_to_column(&mut self, x: u16) -> Result<()>;
fn move_next_line(&mut self) -> Result<()>;
fn start(&mut self) -> Result<()>;
fn end(&mut self) -> Result<()>;
}Expand description
An interface that describes interactions with a terminal interface.
Required Methods
fn get_color_mode(&self) -> ColorMode
fn get_color_mode(&self) -> ColorMode
Get the supported color mode.
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.
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.
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.
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.
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.
fn set_underline(&mut self, underline: bool) -> Result<()>
fn set_underline(&mut self, underline: bool) -> Result<()>
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.
fn set_reverse(&mut self, reverse: bool) -> Result<()>
fn set_reverse(&mut self, reverse: bool) -> Result<()>
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.
Read the next input event from the terminal interface.
Errors
Errors if the Tui cannot read an event 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.
fn move_to_column(&mut self, x: u16) -> Result<()>
fn move_to_column(&mut self, x: u16) -> Result<()>
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.
fn move_next_line(&mut self) -> Result<()>
fn move_next_line(&mut self) -> Result<()>
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.
Start the terminal interface interactions.
Errors
Errors if the Tui cannot move to a started state 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.