Skip to content

Commit 3343712

Browse files
committed
🔧 Updated Doc
1 parent 64cedc0 commit 3343712

File tree

4 files changed

+35
-4
lines changed

4 files changed

+35
-4
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "console-utils"
3-
version = "1.1.5"
3+
version = "1.1.6"
44
edition = "2021"
55
authors = ["Nils Wrenger <[email protected]>"]
66
description = "Cli input utilities."

README.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![Crate](https://img.shields.io/crates/v/console-utils.svg)](https://crates.io/crates/console-utils)
44
[![API](https://docs.rs/console-utils/badge.svg)](https://docs.rs/console-utils)
55

6-
A simple Rust library for console-based user input and option selection.
6+
A simple Rust library for console-based user input, option selection and more.
77

88
## Input Function
99

@@ -56,4 +56,30 @@ fn main() {
5656
}
5757
}
5858
```
59+
60+
## Spinner Function
61+
62+
The spinner function creates a console-based spinner animation, offering a visually appealing way to indicate ongoing processes.
63+
64+
### Usage
65+
66+
```rust
67+
use console_utils::{spinner, SpinnerType};
68+
69+
// Display a standard spinner for 3 seconds
70+
spinner(3.0, SpinnerType::Standard);
71+
72+
// Display a dots spinner for 2 seconds
73+
spinner(2.0, SpinnerType::Dots);
74+
75+
// Display a custom spinner for 1 second (using a custom frame)
76+
spinner(1.0, SpinnerType::Custom("@ "));
77+
78+
// Display a box spinner for 1.5 seconds
79+
spinner(1.5, SpinnerType::Box);
80+
81+
// Display a flip spinner for 2 seconds
82+
spinner(2.0, SpinnerType::Flip);
83+
```
84+
5985
For more detailed documentation, please refer to the [generated Rust Docs](https://crates.io/crates/console-utils).

src/lib.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,12 @@ pub enum SpinnerType {
190190
/// # Parameters
191191
///
192192
/// - `time`: A floating-point number representing the duration of the spinner animation in seconds.
193-
/// - `spinner_type`: The type of spinner to display.
193+
/// - `spinner_type`: The type of spinner to display, which can be one of the following:
194+
/// - `SpinnerType::Standard`: Standard spinner with characters / - \ |.
195+
/// - `SpinnerType::Dots`: Spinner with dots . .. ... .....
196+
/// - `SpinnerType::Box`: Spinner with box characters ▌ ▀ ▐ ▄.
197+
/// - `SpinnerType::Flip`: Spinner with flip characters _ _ _ - \ ' ´ - _ _ _.
198+
/// - `SpinnerType::Custom(frame)`: Custom spinner with a user-defined frame.
194199
///
195200
/// # Example
196201
///

0 commit comments

Comments
 (0)