pub trait Command {
// Required method
fn write_ansi(&self, f: &mut impl Write) -> Result;
}Expand description
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.
Required Methods§
Sourcefn write_ansi(&self, f: &mut impl Write) -> Result
fn write_ansi(&self, f: &mut impl Write) -> Result
Write an ANSI representation of this command to the given writer. 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
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl<T: Command + ?Sized> Command for &T
impl<T: Command + ?Sized> Command for &T
fn write_ansi(&self, f: &mut impl Write) -> Result
Implementors§
impl Command for DisableBlinking
impl Command for EnableBlinking
impl Command for Hide
impl Command for MoveDown
impl Command for MoveLeft
impl Command for MoveRight
impl Command for MoveTo
impl Command for MoveToColumn
impl Command for MoveToNextLine
impl Command for MoveToPreviousLine
impl Command for MoveToRow
impl Command for MoveUp
impl Command for RestorePosition
impl Command for SavePosition
impl Command for SetCursorShape
impl Command for Show
impl Command for DisableBracketedPaste
Available on crate feature
bracketed-paste only.impl Command for DisableFocusChange
impl Command for DisableMouseCapture
impl Command for EnableBracketedPaste
Available on crate feature
bracketed-paste only.