Console Utility Library
A simple Rust library for console-based user input, option selection and more.
Input Function
The input
function reads user input from the console. It prompts the user with a message, reads a line of input, and returns an Option<T>
.
Usage
use input;
Select Function
The select
function allows the user to interactively select options from a list. It uses arrow keys or 'w' and 's' keys for navigation, spacebar for selection, and Enter to confirm. It returns an Option<Vec<bool>>
indicating which options were selected.
Usage
use select;
Read Function
The read module provides cross-platform functionality for reading keyboard input. It includes the Key enum representing different keyboard keys and platform-specific implementations for Windows and Unix.
Usage
use ;
Spinner Function
The spinner function creates a console-based spinner animation, offering a visually appealing way to indicate ongoing processes.
Usage
use ;
Reveal Function
Displays a string gradually, revealing one character at a time with a specified time interval between each character.
Usage
use reveal;
Output Control and Cursor Movement
The library also provides functions for output control and precise cursor movement:
clear_line
flush
move_cursor_down
move_cursor_up
move_cursor_left
move_cursor_right
move_cursor_to
For more detailed documentation, please refer to the generated Rust Docs.