How to create progress bar

Cli
Add the indicatif crate to Cargo.toml and use ProgressBar::new to display a progress bar in Rust.

Rust has no built-in progress bar; you must add the indicatif crate to your Cargo.toml and use ProgressBar::new to create one. Add indicatif = "0.17" to your dependencies, then initialize and update the bar in your loop using pb.tick() or pb.set_position().

use indicatif::ProgressBar;

fn main() {
    let pb = ProgressBar::new(100);
    for i in 0..100 {
        // do work
        pb.inc(1);
    }
    pb.finish();
}