Crates.io | progressbars |
lib.rs | progressbars |
version | 0.1.0 |
source | src |
created_at | 2023-04-27 04:57:26.47468 |
updated_at | 2023-04-27 04:57:26.47468 |
description | piechart and spinner progressbars implemented in rust |
homepage | https://github.com/somatosensory/progressbars-rs |
repository | |
max_upload_size | |
id | 850050 |
size | 4,494 |
Add to dependencies
[dependencies]
progressbars = "0.1.0"
There are 2 types of progressbars available: PieChartProgressBar, SpinnerProgressBar.
PieChartProgressBar
use std::thread;
use std::time::Duration;
use progressbars::ProgressBar;
use progressbars::PieChartProgressBar;
fn main() {
let percentage_progress_bar = PieChartProgressBar::new("Percentage:", 10, 20);
for i in 0..10 {
percentage_progress_bar.update(i);
thread::sleep(Duration::from_millis(100));
}
println!();
}
Looks like:
Percentage: [████████░░░░░░░░░░░░] 40%
SpinnerProgressBar
use std::thread;
use std::time::Duration;
use progressbars::ProgressBar;
use progressbars::SpinnerProgressBar;
fn main() {
let spinner_bar = SpinnerProgressBar::new("Percentage:");
for i in 0..10 {
spinner_bar.update(i);
thread::sleep(Duration::from_millis(100));
}
println!();
}
Looks like:
Percentage: |