Crate crossterm[][src]

Crossterm provides the same core functionalities for both windows and unix systems. Crossterm aims to be simple and easy to call in code. True the simplicity of Crossterm you do not have to worry about the platform your working with. You can just call the action you want to perform and under water it will check what to do based on the current platform.

Modules

color

With this module you can perform actions that are color related. Like styling the font, foreground color and background.

cursor

With this module you can perform actions that are cursor related. Like moving the cursor position;saving and resetting the cursor position; hiding showing and control the blinking of the cursor.

input

With this module you can perform actions that are input related. Like reading a line, reading a character and reading asynchronously.

objectstyle

This module contains the object style that can be applied to an styled object.

output

This module provides a way to work with an handle to an screen on different platforms.

style

Module that contains all the actions related to the styling of the terminal. like coloring adding attributes etc.

styledobject

This module contains the logic to style an object that contains some state witch can be styled.

terminal

Module that contains all the actions related to the terminal. like clearing, resizing and scrolling the terminal.

Macros

csi

This macro will take an ANSI input and combines it with some default ANSI characters and returns the result

Structs

AlternateScreen

With this type you will be able to switch to alternate screen and back to main screen. Check also the Screen type for swishing to alternate mode.

AsyncReader

This is a wrapper for reading from the input asynchronously. This wrapper has a channel receiver that receives the input from the user whenever it typed something. You only need to check whether there are new characters available.

Crossterm

This type could be used to access the cursor, terminal, color, input, styling module more easily. You need to pass a reference to the screen where on you want to perform the actions to the Crossterm type.

ObjectStyle

Struct that contains the style properties that can be applied to an displayable object.

Screen

This type represents an screen. This screen has an stdout which is used by the program to write to or to execute commands with.

StyledObject

Struct that contains both the style and the content wits can be styled.

TerminalColor

Struct that stores an specific platform implementation for color related actions.

TerminalCursor

Struct that stores an specific platform implementation for cursor related actions.

TerminalInput

Struct that stores an specific platform implementation for input related actions.

TerminalOutput

Struct that is an handle to an terminal screen. This handle could be used to write to the current screen

Enums

Attribute

Attributes that could be applied on some text.

Color

Colors that are available for coloring the terminal font.

ColorType

Color types that can be used to determine if the Color enum is an Fore- or Background Color

Functions

color

Get an Terminal Color implementation whereon color related actions can be performed. Pass the reference to any screen you want this type to perform actions on.

cursor

Get an TerminalCursor implementation whereon cursor related actions can be performed. Pass the reference to any screen you want this type to perform actions on.

input

Get an Terminal Input implementation whereon input related actions can be performed. Pass the reference to any screen you want this type to perform actions on.

style

This could be used to style an Displayable with colors and attributes.