loaders 0.0.0

A fully-featured, customisable progress bar and loading indicator library for Rust CLI and terminal applications
Documentation
use loaders::{MultiProgress, ProgressBar};
use std::thread;
use std::time::Duration;

fn worker(pb: ProgressBar, len: u64, delay_ms: u64, name: &'static str) {
    pb.set_length(len);
    pb.set_prefix(name);
    pb.set_message("running");
    for _ in 0..len {
        pb.inc(1);
        thread::sleep(Duration::from_millis(delay_ms));
    }
    pb.finish_with_message("done");
}

fn main() {
    let multi = MultiProgress::new();
    let a = multi.add(ProgressBar::new(100));
    let b = multi.add(ProgressBar::new(200));
    let c = multi.add(ProgressBar::new(150));

    let handles = vec![
        thread::spawn(move || worker(a, 100, 20, "assets")),
        thread::spawn(move || worker(b, 200, 10, "index")),
        thread::spawn(move || worker(c, 150, 15, "bundle")),
    ];

    multi.join();
    for handle in handles {
        let _ = handle.join();
    }
}