headway 0.1.2

An ergonomic progress bar library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use headway::ProgressBar;
use std::{thread::sleep, time::Duration};

pub fn main() {
    let p = ProgressBar::new();
    // Split the progress bar into 10 nested bars
    for (nested_bar, i) in p.split_each(0..10) {
        // Wrap the nested bar around an iterator representing this subtask
        nested_bar.set_message(format!("Subtask {}", i));
        for _ in nested_bar.wrap(0..200) {
            sleep(Duration::from_millis(5));
        }
    }
}