Crate crossterm

source ·
Expand description

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

With this module you can perform actions that are color related. Like styling the font, foreground color and background.
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.
With this module you can perform actions that are input related. Like reading a line, reading a character and reading asynchronously.
This module contains the object style that can be applied to an styled object.
This module provides a way to work with an handle to an screen on different platforms.
Module that contains all the actions related to the styling of the terminal. like coloring adding attributes etc.
This module contains the logic to style an object that contains some state witch can be styled.
Module that contains all the actions related to the terminal. like clearing, resizing and scrolling the terminal.

Macros

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

Structs

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.
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.
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.
This is a wrapper for a styled object so that the styled object could be printed with the standard write functions in rust.
Struct that contains the style properties that can be applied to an displayable object.
This type represents an screen. This screen has an stdout which is used by the program to write to or to execute commands with.
Struct that contains both the style and the content wits can be styled.
Struct that stores an specific platform implementation for color related actions.
Struct that stores an specific platform implementation for cursor related actions.
Struct that stores an specific platform implementation for input related actions.
Struct that is an handle to an terminal screen. This handle could be used to write to the current screen

Enums

Attributes that could be applied on some text.
Colors that are available for coloring the terminal font.
Color types that can be used to determine if the Color enum is an Fore- or Background Color

Functions

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.
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.
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.
This could be used to style an Displayable with colors and attributes.