Skip to content

Latest commit

 

History

History
36 lines (26 loc) · 761 Bytes

README.md

File metadata and controls

36 lines (26 loc) · 761 Bytes

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