Add the following to your Cargo.toml
:
toml
[dependencies]
pgbar = "*"
or install it with cargo add pgbar
.
``rust
use pgbar::ProgressBar;
use extern crate termion::color; // pgbar uses
termion` to color the progress bar
fn main(){ let mut progressbar = ProgressBar::new(100, 10, Style { symbol: String::from("*"), // The progress bar will be filled with * color: Some(&color::Cyan), // This is the color of the progress bar width: 50, // This is the width of the progress bar timetofinish: true, // This is the time to finish the progress bar wrapper: String::from("[]"), // This is the wrapper of the progress bar }); /// progressbar.track(); // This will start the progress bar progressbar.update(50); // This will update the progress bar progressbar.finish(); // This will finish the progress bar progressbar.recover(); // This will recover the progress bar progressbar.reset(); // This will reset the progress bar to 0 } ```
This project is licensed under the MIT License - see the LICENSE file for details