[][src]Crate term_basics_linux

Structs

InputHistory

A struct that holds information about a history of typed input's but the user.

Enums

FGBG

To specify if you set the foreground or background colour.

TextStyle

All styles that do not alter fg or bg colours.

UserColour

Colours available. The user has defined the exact values of these colours for there TTY or emulator.

Functions

flush

Flushes stdout. When you do print! or term-basics-linux equivalent, it will not print immediately. For example if you print! and then input_field(), it will print after you typed in the input. flush() will make sure everything is printed first.

getch

Returns the character as u8 typed by the user. It will return immediately after being typed, without the user pressing 'enter'.

input_field

Lets the user type text. It returns the string after the user presses 'enter'. It supports moving the cursor with the arrow keys, going to the begin and end of the line using 'home' and 'end' and deleting characters with backspace and the delete key.

input_field_scrollable

Lets the user type text. It returns the string after the user presses 'enter'. It supports all functions input_field() supports. It also supports scrolling through the history of earlier typed strings with the 'up' and 'down' arrow keys.

print

Print to stdout, it is just print!("{}", msg); Here to stay consistent

print_col

Print to stdout with a text colour.

print_cols

Print to stdout with text and background colours.

print_cols_style

Print to stdout with text and background colours and style.

print_style

Print to stdout with text style.

println

Print to stdout, it is just println!("{}", msg); Here to stay consistent

println_col

Print to stdout with a text colour.

println_cols

Print to stdout with text and background colours.

println_cols_style

Print to stdout with text and background colours and style.

println_style

Print to stdout with text style.

prompt

Prints a message to the user. The user can type its input next to the message on the same line. It will return the user input after the user pressed enter. It uses term_basics_linux::input_field and supports the same operations.

prompt_scrollable

Prints a message to the user. the user can type its input next to the message on the same line. It will return the user input after the user pressed enter. It uses term_basics_linux::input_field_scrollable and supports the same operations.

reset_all

Resets foreground colour, background colour and text style.

set_colour

Sets the colour of the text printed after this call. It will print linux colour escape characters to std out.

set_colours

Sets both foreground and background colours It will print linux colour escape characters to std out.

set_style

Sets the style of the text printed after this call. It will print linux colour escape characters to std out.

string_to_bool
string_to_value

Small helper to parse string to a value

test_chars

Prints the result of getch as u8, infinite loop. Can be used for testing.