nutmeg 0.1.6

An unopinionated progress bar library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
//! Use of [nutmeg::models::BasicModel].

pub fn main() {
    let view = nutmeg::View::new(
        nutmeg::models::BasicModel::new((0, 10), |(a, b)| format!("{a}/{b} complete")),
        nutmeg::Options::default(),
    );
    for _i in 0..10 {
        view.update(|model| model.value.0 += 1);
        std::thread::sleep(std::time::Duration::from_millis(150));
    }
}