[][src]Trait crossterm::Command

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

A command is an action that can be performed on the terminal.

crossterm already delivers a number of commands. There is no need to implement them yourself. Also, you don't have to execute the commands yourself by calling a function.

Associated Types

Loading content...

Required methods

fn ansi_code(&self) -> Self::AnsiType

Returns the ANSI code representation of this command. You can manipulate the terminal behaviour by writing an ANSI escape code to the terminal. You are able to use ANSI escape codes only for windows 10 and UNIX systems.

This method is mainly used internally by crossterm!

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 = String

impl Command for MoveLeft[src]

type AnsiType = String

impl Command for MoveRight[src]

type AnsiType = String

impl Command for MoveTo[src]

type AnsiType = String

impl Command for MoveUp[src]

type AnsiType = String

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 = String

impl Command for EnableMouseCapture[src]

type AnsiType = String

impl Command for EnterAlternateScreen[src]

type AnsiType = &'static str

impl Command for LeaveAlternateScreen[src]

type AnsiType = &'static str

impl Command for ResetColor[src]

type AnsiType = String

impl Command for SetAttribute[src]

type AnsiType = String

impl Command for SetBackgroundColor[src]

type AnsiType = String

impl Command for SetForegroundColor[src]

type AnsiType = String

impl Command for Clear[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 Output<T>[src]

type AnsiType = T

Loading content...