#progress-bar #demo #progressbars #rustbars

nightly bin+lib rustbar

Set of progressbars for rust

2 unstable releases

Uses old Rust 2015

0.2.0 Jul 8, 2015
0.1.0 Jun 18, 2015

#93 in #progress-bar

MIT license

6KB
119 lines

rustbar

Set of progressbars for rust

extern crate rustbar;

use std::thread::sleep_ms;

use rustbar::rustbars::ProgressBar;

pub fn main(){

    let mut pbar = rustbar::rustbars::PercentageProgressBar::new();
    println!("\nPercentageProgressBar demo");
    for idx in 0..101 {
        pbar.set_value(idx);
        pbar.set_msg("Calculating...");
        pbar.render().unwrap();
        sleep_ms(50);
    }

    println!("\nInifiniteProgressBar demo");
    let mut infbar  = rustbar::rustbars::InfiniteProgressBar::new().to_stderr();
    for _ in 0..101 {
        infbar.set_msg("Thinking...");
        infbar.render().unwrap();
        sleep_ms(50);
    }

}

See src/bin/demo.rs for usage example.

Alt text

No runtime deps