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;
Spinner Function
The spinner function creates a console-based spinner animation, offering a visually appealing way to indicate ongoing processes.
Usage
use ;
// Display a standard spinner for 3 seconds
spinner;
// Display a dots spinner for 2 seconds
spinner;
// Display a custom spinner for 1 second (using custom frames)
spinner;
// Display a box spinner for 1.5 seconds
spinner;
// Display a flip spinner for 2 seconds
spinner;
Reveal Function
Displays a string gradually, revealing one character at a time with a specified time interval between each character.
Usage
use reveal;
// Display "Hello World!" with a time interval of 0.1 seconds between each character and a new line after it's finished.
reveal;
For more detailed documentation, please refer to the generated Rust Docs.