[−][src]Trait crossterm::Command
An interface for a command that performs an action on the terminal.
Crossterm provides a set of commands, and there is no immediate reason to implement a command yourself. In order to understand how to use and execute commands, it is recommended that you take a look at Command Api chapter.
Associated Types
Loading content...Required methods
fn ansi_code(&self) -> Self::AnsiType
Returns an ANSI code representation of this command. An ANSI code can manipulate the terminal by writing it to the terminal buffer. However, only Windows 10 and UNIX systems support this.
This method does not need to be accessed manually, as it is used by the crossterm's Command Api
fn execute_winapi(&self, writer: impl FnMut() -> Result<()>) -> Result<()>
Execute this command.
Windows versions lower than windows 10 do not support ANSI escape codes, therefore a direct WinAPI call is made.
This method does not need to be accessed manually, as it is used by the crossterm's Command Api
Provided methods
fn is_ansi_code_supported(&self) -> bool
Returns whether the ansi code representation of this command is supported by windows.
A list of supported ANSI escape codes can be found here.
Implementations on Foreign Types
impl<T: Command, '_> Command for &'_ T
[src]
type AnsiType = T::AnsiType
fn ansi_code(&self) -> Self::AnsiType
[src]
fn execute_winapi(&self, _writer: impl FnMut() -> Result<()>) -> Result<()>
[src]
fn is_ansi_code_supported(&self) -> bool
[src]
Implementors
impl Command for DisableBlinking
[src]
type AnsiType = &'static str
fn ansi_code(&self) -> Self::AnsiType
[src]
fn execute_winapi(&self, _writer: impl FnMut() -> Result<()>) -> Result<()>
[src]
impl Command for EnableBlinking
[src]
type AnsiType = &'static str
fn ansi_code(&self) -> Self::AnsiType
[src]
fn execute_winapi(&self, _writer: impl FnMut() -> Result<()>) -> Result<()>
[src]
impl Command for Hide
[src]
type AnsiType = &'static str
fn ansi_code(&self) -> Self::AnsiType
[src]
fn execute_winapi(&self, _writer: impl FnMut() -> Result<()>) -> Result<()>
[src]
impl Command for MoveDown
[src]
type AnsiType = Ansi<Self>
fn ansi_code(&self) -> Self::AnsiType
[src]
fn execute_winapi(&self, _writer: impl FnMut() -> Result<()>) -> Result<()>
[src]
impl Command for MoveLeft
[src]
type AnsiType = Ansi<Self>
fn ansi_code(&self) -> Self::AnsiType
[src]
fn execute_winapi(&self, _writer: impl FnMut() -> Result<()>) -> Result<()>
[src]
impl Command for MoveRight
[src]
type AnsiType = Ansi<Self>
fn ansi_code(&self) -> Self::AnsiType
[src]
fn execute_winapi(&self, _writer: impl FnMut() -> Result<()>) -> Result<()>
[src]
impl Command for MoveTo
[src]
type AnsiType = Ansi<Self>
fn ansi_code(&self) -> Self::AnsiType
[src]
fn execute_winapi(&self, _writer: impl FnMut() -> Result<()>) -> Result<()>
[src]
impl Command for MoveToColumn
[src]
type AnsiType = Ansi<Self>
fn ansi_code(&self) -> Self::AnsiType
[src]
fn execute_winapi(&self, _writer: impl FnMut() -> Result<()>) -> Result<()>
[src]
impl Command for MoveToNextLine
[src]
type AnsiType = Ansi<Self>
fn ansi_code(&self) -> Self::AnsiType
[src]
fn execute_winapi(&self, _writer: impl FnMut() -> Result<()>) -> Result<()>
[src]
impl Command for MoveToPreviousLine
[src]
type AnsiType = Ansi<Self>
fn ansi_code(&self) -> Self::AnsiType
[src]
fn execute_winapi(&self, _writer: impl FnMut() -> Result<()>) -> Result<()>
[src]
impl Command for MoveUp
[src]
type AnsiType = Ansi<Self>
fn ansi_code(&self) -> Self::AnsiType
[src]
fn execute_winapi(&self, _writer: impl FnMut() -> Result<()>) -> Result<()>
[src]
impl Command for RestorePosition
[src]
type AnsiType = &'static str
fn ansi_code(&self) -> Self::AnsiType
[src]
fn execute_winapi(&self, _writer: impl FnMut() -> Result<()>) -> Result<()>
[src]
impl Command for SavePosition
[src]
type AnsiType = &'static str
fn ansi_code(&self) -> Self::AnsiType
[src]
fn execute_winapi(&self, _writer: impl FnMut() -> Result<()>) -> Result<()>
[src]
impl Command for Show
[src]
type AnsiType = &'static str
fn ansi_code(&self) -> Self::AnsiType
[src]
fn execute_winapi(&self, _writer: impl FnMut() -> Result<()>) -> Result<()>
[src]
impl Command for DisableMouseCapture
[src]
type AnsiType = &'static str
fn ansi_code(&self) -> Self::AnsiType
[src]
fn execute_winapi(&self, _writer: impl FnMut() -> Result<()>) -> Result<()>
[src]
fn is_ansi_code_supported(&self) -> bool
[src]
impl Command for EnableMouseCapture
[src]
type AnsiType = &'static str
fn ansi_code(&self) -> Self::AnsiType
[src]
fn execute_winapi(&self, _writer: impl FnMut() -> Result<()>) -> Result<()>
[src]
fn is_ansi_code_supported(&self) -> bool
[src]
impl Command for ResetColor
[src]
type AnsiType = &'static str
fn ansi_code(&self) -> Self::AnsiType
[src]
fn execute_winapi(&self, _writer: impl FnMut() -> Result<()>) -> Result<()>
[src]
impl Command for SetAttribute
[src]
type AnsiType = Ansi<Self>
fn ansi_code(&self) -> Self::AnsiType
[src]
fn execute_winapi(&self, _writer: impl FnMut() -> Result<()>) -> Result<()>
[src]
impl Command for SetAttributes
[src]
type AnsiType = Ansi<Self>
fn ansi_code(&self) -> Self::AnsiType
[src]
fn execute_winapi(&self, _writer: impl FnMut() -> Result<()>) -> Result<()>
[src]
impl Command for SetBackgroundColor
[src]
type AnsiType = Ansi<Self>
fn ansi_code(&self) -> Self::AnsiType
[src]
fn execute_winapi(&self, _writer: impl FnMut() -> Result<()>) -> Result<()>
[src]
impl Command for SetColors
[src]
type AnsiType = Ansi<Self>
fn ansi_code(&self) -> Self::AnsiType
[src]
fn execute_winapi(&self, _writer: impl FnMut() -> Result<()>) -> Result<()>
[src]
impl Command for SetForegroundColor
[src]
type AnsiType = Ansi<Self>
fn ansi_code(&self) -> Self::AnsiType
[src]
fn execute_winapi(&self, _writer: impl FnMut() -> Result<()>) -> Result<()>
[src]
impl Command for Clear
[src]
type AnsiType = &'static str
fn ansi_code(&self) -> Self::AnsiType
[src]
fn execute_winapi(&self, _writer: impl FnMut() -> Result<()>) -> Result<()>
[src]
impl Command for DisableLineWrap
[src]
type AnsiType = &'static str
fn ansi_code(&self) -> Self::AnsiType
[src]
fn execute_winapi(&self, _writer: impl FnMut() -> Result<()>) -> Result<()>
[src]
impl Command for EnableLineWrap
[src]
type AnsiType = &'static str
fn ansi_code(&self) -> Self::AnsiType
[src]
fn execute_winapi(&self, _writer: impl FnMut() -> Result<()>) -> Result<()>
[src]
impl Command for EnterAlternateScreen
[src]
type AnsiType = &'static str
fn ansi_code(&self) -> Self::AnsiType
[src]
fn execute_winapi(&self, _writer: impl FnMut() -> Result<()>) -> Result<()>
[src]
impl Command for LeaveAlternateScreen
[src]
type AnsiType = &'static str
fn ansi_code(&self) -> Self::AnsiType
[src]
fn execute_winapi(&self, _writer: impl FnMut() -> Result<()>) -> Result<()>
[src]
impl Command for ScrollDown
[src]
type AnsiType = String
fn ansi_code(&self) -> Self::AnsiType
[src]
fn execute_winapi(&self, _writer: impl FnMut() -> Result<()>) -> Result<()>
[src]
impl Command for ScrollUp
[src]
type AnsiType = String
fn ansi_code(&self) -> Self::AnsiType
[src]
fn execute_winapi(&self, _writer: impl FnMut() -> Result<()>) -> Result<()>
[src]
impl Command for SetSize
[src]
type AnsiType = String
fn ansi_code(&self) -> Self::AnsiType
[src]
fn execute_winapi(&self, _writer: impl FnMut() -> Result<()>) -> Result<()>
[src]
impl<'a> Command for SetTitle<'a>
[src]
type AnsiType = String
fn ansi_code(&self) -> Self::AnsiType
[src]
fn execute_winapi(&self, _writer: impl FnMut() -> Result<()>) -> Result<()>
[src]
impl<D> Command for PrintStyledContent<D> where
D: Display + Clone,
[src]
D: Display + Clone,