#bar #progress #same #terminal #cargo #display #style #progress-bar

progress_bar

A crate that allows you to display a progress bar (same style than the cargo progress bar)

4 releases

0.1.3 Jan 19, 2020
0.1.2 Jan 19, 2020
0.1.1 Jan 17, 2020
0.1.0 Nov 9, 2019

#186 in Command-line interface

Download history 65/week @ 2021-02-16 56/week @ 2021-02-23 63/week @ 2021-03-02 43/week @ 2021-03-09 49/week @ 2021-03-16 114/week @ 2021-03-23 93/week @ 2021-03-30 69/week @ 2021-04-06 100/week @ 2021-04-13 117/week @ 2021-04-20 36/week @ 2021-04-27 58/week @ 2021-05-04 89/week @ 2021-05-11 64/week @ 2021-05-18 36/week @ 2021-05-25 19/week @ 2021-06-01

312 downloads per month

MIT license

10KB
157 lines

progress_bar

This crate allows you to display a progress bar in a terminal.

Example

use progress_bar::progress_bar::ProgressBar;
use progress_bar::color::{Color, Style};
use std::{thread, time};

// if you have 81 pages to load
let mut progress_bar = ProgressBar::new(81);
progress_bar.set_action("Loading", Color::Blue, Style::Bold);

for i in 0..81 {
    // load page
    thread::sleep(time::Duration::from_millis(500));

    // log the result
    if i == 14 {
        progress_bar.print_info("Failed", "https://zefzef.zef", Color::Red, Style::Normal);
    } else if i == 41 {
       rogress_bar.print_info("Success", "https://example.com", Color::Green, Style::Bold);
    }

    // update the progression by 1
    progress_bar.inc();
}

image displaying the output of the code above

License: MIT


lib.rs:

This crate allows you to display a progress bar in a terminal.

Example

use progress_bar::progress_bar::ProgressBar;
use progress_bar::color::{Color, Style};
use std::{thread, time};

// if you have 81 pages to load
let mut progress_bar = ProgressBar::new(81);
progress_bar.set_action("Loading", Color::Blue, Style::Bold);

for i in 0..81 {
    // load page
    thread::sleep(time::Duration::from_millis(500));

    // log the result
    if i == 14 {
        progress_bar.print_info("Failed", "https://zefzef.zef", Color::Red, Style::Normal);
    } else if i == 41 {
       rogress_bar.print_info("Success", "https://example.com", Color::Green, Style::Bold);
    }
    
    // update the progression by 1
    progress_bar.inc();
}

image displaying the output of the code above

No runtime deps