[][src]Trait crossterm::Command

pub trait Command {
    type AnsiType: Display;
    fn ansi_code(&self) -> Self::AnsiType;
}

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

Loading content...

Implementations on Foreign Types

impl<'_, T: Command> Command for &'_ T[src]

type AnsiType = T::AnsiType

Loading content...

Implementors

impl Command for DisableBlinking[src]

type AnsiType = &'static str

impl Command for EnableBlinking[src]

type AnsiType = &'static str

impl Command for Hide[src]

type AnsiType = &'static str

impl Command for MoveDown[src]

type AnsiType = Ansi<Self>

impl Command for MoveLeft[src]

type AnsiType = Ansi<Self>

impl Command for MoveRight[src]

type AnsiType = Ansi<Self>

impl Command for MoveTo[src]

type AnsiType = Ansi<Self>

impl Command for MoveToColumn[src]

type AnsiType = Ansi<Self>

impl Command for MoveToNextLine[src]

type AnsiType = Ansi<Self>

impl Command for MoveToPreviousLine[src]

type AnsiType = Ansi<Self>

impl Command for MoveUp[src]

type AnsiType = Ansi<Self>

impl Command for RestorePosition[src]

type AnsiType = &'static str

impl Command for SavePosition[src]

type AnsiType = &'static str

impl Command for Show[src]

type AnsiType = &'static str

impl Command for DisableMouseCapture[src]

type AnsiType = &'static str

impl Command for EnableMouseCapture[src]

type AnsiType = &'static str

impl Command for ResetColor[src]

type AnsiType = &'static str

impl Command for SetAttribute[src]

type AnsiType = Ansi<Self>

impl Command for SetAttributes[src]

type AnsiType = Ansi<Self>

impl Command for SetBackgroundColor[src]

type AnsiType = Ansi<Self>

impl Command for SetForegroundColor[src]

type AnsiType = Ansi<Self>

impl Command for Clear[src]

type AnsiType = &'static str

impl Command for EnterAlternateScreen[src]

type AnsiType = &'static str

impl Command for LeaveAlternateScreen[src]

type AnsiType = &'static str

impl Command for ScrollDown[src]

type AnsiType = String

impl Command for ScrollUp[src]

type AnsiType = String

impl Command for SetSize[src]

type AnsiType = String

impl<D> Command for PrintStyledContent<D> where
    D: Display + Clone
[src]

type AnsiType = StyledContent<D>

impl<T: Display + Clone> Command for Print<T>[src]

type AnsiType = T

Loading content...