progressbars

Crates.ioprogressbars
lib.rsprogressbars
version0.1.0
sourcesrc
created_at2023-04-27 04:57:26.47468
updated_at2023-04-27 04:57:26.47468
descriptionpiechart and spinner progressbars implemented in rust
homepagehttps://github.com/somatosensory/progressbars-rs
repository
max_upload_size
id850050
size4,494
Nikita (somatosensory)

documentation

README

Usage

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: |
Commit count: 0

cargo fmt