Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mainrs/terminal-spinners-rs
A Rust library for displaying terminal spinners
https://github.com/mainrs/terminal-spinners-rs
rust-library
Last synced: about 2 months ago
JSON representation
A Rust library for displaying terminal spinners
- Host: GitHub
- URL: https://github.com/mainrs/terminal-spinners-rs
- Owner: mainrs
- License: apache-2.0
- Created: 2021-03-02T14:33:42.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-03-29T15:52:12.000Z (9 months ago)
- Last Synced: 2024-10-30T10:15:21.529Z (about 2 months ago)
- Topics: rust-library
- Language: Rust
- Homepage: https://crates.io/crates/terminal-spinners
- Size: 45.9 KB
- Stars: 13
- Watchers: 2
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# terminal-spinners
> A Rust library for showing terminal loading animations.
## Usage
```rust
use terminal_spinners::{SpinnerBuilder, DOTS};let handle = SpinnerBuilder::new().spinner(&DOTS).text("Loading unicorns").start();
// Do some other work...
std::thread::sleep(std::time::Duration::from_secs(3));
handle.done();
```The `examples/` directory contains an example for each available spinner. To see them in action, run `cargo run --example `. Additional examples for showcasing other functionality are:
| Filename | Desc |
| ------------ | ----------------------------------------- |
| `clear_line` | Showcases `SpinnerHandle::stop_and_clear` |## Shortcomings
- It's not possible to run multiple spinners at once. This probably needs an API change. Open for help/PR!
#### License
Licensed under either of Apache License, Version
2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
dual licensed as above, without any additional terms or conditions.