Crate rpian_terminal

Source
Expand description

rpian-terminal: A Rust library for terminal manipulation and drawing

This library provides a set of functions for manipulating the terminal, including cursor movement, color settings, and drawing various shapes.

Re-exports§

pub use line::Line;
pub use line::Direction;
pub use line::LineStyle;
pub use rbox::BoxStyle;
pub use rbox::ShadeStyle;
pub use circle::CircleSymbol;

Modules§

arrow
braille
chess
circle
emoji
error
line
math
rbox
This module provides functionality for drawing various types of boxes and lines in a terminal environment. It includes enums for different box styles, line styles, and shading options, as well as functions to convert these enum variants to their corresponding Unicode characters.
star
triangle

Enums§

Attribute
Represents text attributes for styling.
Color
Represents the available colors for text and background.

Functions§

clear_line
Clears the entire line.
clear_screen
Clears the entire screen and moves the cursor to the top-left corner.
clear_to_line_end
Clears from the cursor to the end of the line.
clear_to_line_start
Clears from the cursor to the start of the line.
clear_to_screen_end
Clears from the cursor to the end of the screen.
clear_to_screen_start
Clears from the cursor to the start of the screen.
get_viewport
Gets the current viewport size.
hide_cursor
Hides the cursor.
move_cursor_to
Moves the cursor to the specified position in the terminal.
print
Writes the given text to the standard output and flushes the buffer.
println
Writes the given text to the standard output, followed by a newline, and flushes the buffer.
put_char
Writes a single character to the standard output and flushes the buffer.
read_key
Reads a key press from the standard input.
read_line
Reads a line from the standard input, trimming whitespace.
reset_attributes
Resets all text attributes to their default values.
reset_color
Resets both the foreground and background colors to their default values.
restore_cursor_location
Restores the cursor to the previously saved location.
save_cursor_location
Saves the current cursor location.
set_attribute
Sets the specified text attribute for subsequent text output.
set_background_color
Sets the background color for subsequent text output in the terminal.
set_foreground_color
Sets the foreground color for subsequent text output in the terminal.
set_viewport
Sets the viewport size.
show_cursor
Makes the cursor visible.
wait_for_micros
Waits for the specified number of microseconds.
wait_for_millis
Waits for the specified number of milliseconds.
wait_for_seconds
Waits for the specified number of seconds.