Trait endbasic_std::console::Console [−][src]
Hooks to implement the commands that manipulate the console.
Required methods
fn clear(&mut self, how: ClearType) -> Result<()>
[src]
Clears the part of the console given by how
.
fn color(&mut self, fg: Option<u8>, bg: Option<u8>) -> Result<()>
[src]
Sets the console's foreground and background colors to fg
and bg
.
If any of the colors is None
, the color is left unchanged.
fn enter_alt(&mut self) -> Result<()>
[src]
Enters the alternate console.
fn hide_cursor(&mut self) -> Result<()>
[src]
Hides the cursor.
fn is_interactive(&self) -> bool
[src]
Returns true if the console is attached to an interactive terminal. This controls whether reading a line echoes back user input, for example.
fn leave_alt(&mut self) -> Result<()>
[src]
Leaves the alternate console.
fn locate(&mut self, pos: Position) -> Result<()>
[src]
Moves the cursor to the given position, which must be within the screen.
fn move_within_line(&mut self, off: i16) -> Result<()>
[src]
Moves the cursor within the line. Positive values move right, negative values move left.
fn print(&mut self, text: &str) -> Result<()>
[src]
Writes text
to the console, followed by a newline or CRLF pair depending on the needs of
the console to advance a line.
#[must_use]fn read_key<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<Key>> + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<Key>> + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Waits for and returns the next key press.
fn show_cursor(&mut self) -> Result<()>
[src]
Shows the cursor.
fn size(&self) -> Result<Position>
[src]
Queries the size of the console.
The returned position represents the first row and column that lay outside of the console.
fn write(&mut self, bytes: &[u8]) -> Result<()>
[src]
Writes the raw bytes
into the console.
Implementors
impl Console for TerminalConsole
[src]
fn clear(&mut self, how: ClearType) -> Result<()>
[src]
fn color(&mut self, fg: Option<u8>, bg: Option<u8>) -> Result<()>
[src]
fn enter_alt(&mut self) -> Result<()>
[src]
fn hide_cursor(&mut self) -> Result<()>
[src]
fn is_interactive(&self) -> bool
[src]
fn leave_alt(&mut self) -> Result<()>
[src]
fn locate(&mut self, pos: Position) -> Result<()>
[src]
fn move_within_line(&mut self, off: i16) -> Result<()>
[src]
fn print(&mut self, text: &str) -> Result<()>
[src]
fn read_key<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<Key>> + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<Key>> + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn show_cursor(&mut self) -> Result<()>
[src]
fn size(&self) -> Result<Position>
[src]
fn write(&mut self, bytes: &[u8]) -> Result<()>
[src]
impl Console for MockConsole
[src]
fn clear(&mut self, how: ClearType) -> Result<()>
[src]
fn color(&mut self, fg: Option<u8>, bg: Option<u8>) -> Result<()>
[src]
fn enter_alt(&mut self) -> Result<()>
[src]
fn hide_cursor(&mut self) -> Result<()>
[src]
fn is_interactive(&self) -> bool
[src]
fn leave_alt(&mut self) -> Result<()>
[src]
fn locate(&mut self, pos: Position) -> Result<()>
[src]
fn move_within_line(&mut self, off: i16) -> Result<()>
[src]
fn print(&mut self, text: &str) -> Result<()>
[src]
fn read_key<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<Key>> + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<Key>> + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,