Skip to content

Fiedzia/rustbar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Set of progressbars for rust

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages