spinoff
simple library for displaying spinners in the terminal

π¨ Install
Add as a dependency to your Cargo.toml:
[]
= "0.7.0"
β‘ Usage
use ;
use sleep;
use Duration;
let spinner = new;
sleep;
spinner.success;
Update a spinner
use ;
use sleep;
use Duration;
let mut spinner = new;
sleep;
spinner.update;
sleep;
spinner.stop
Specify an output stream
use ;
use sleep;
use Duration;
let spinner = new_with_stream;
sleep;
spinner.stop_and_persist;
π« Spinners
Note: This has been introduced in version 0.7.0
All spinner variants are treated as features that can be enabled or disabled. By default, all of them are enabled for ease of use.
To disable/enable variants, you will have to edit your cargo.toml file:
[]
= { = "0.7.0", = ["dots, arc, line"] }
Creating your own spinner
You can create your own spinner using the spinner! macro:
use *;
use sleep;
use Duration;
let frames = spinner!;
let sp = new;
sleep;
sp.stop;
βNote for Windows Users
For colors to work properly, you need to add a few extra lines to your code:
use control
enable_virtual_terminal.unwrap;
Other examples can be found in the documentation.
π Documentation
- All relevant documentation can be found on the Docs.rs page.
- If you want to see all the available
spinneroptions, refer to the source code.
β Examples
π§ Contributing
Any contributions to this crate are highly appreciated. If you have any ideas/suggestions/bug fixes, please open an issue or a pull request. If you like the project, star this project on GitHub.
π License
This crate is licensed under the MIT license.