progress_bar

Crates.ioprogress_bar
lib.rsprogress_bar
version1.0.6
sourcesrc
created_at2019-11-09 10:41:07.835338
updated_at2024-12-08 22:17:52.746616
descriptionA crate that allows you to display a progress bar (same style than the cargo progress bar).
homepage
repositoryhttps://github.com/Mubelotix/cli_progress_bar
max_upload_size
id179691
size25,838
(Mubelotix)

documentation

README

progress_bar

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

Able to estimate and display the remaining time.

LINUX ONLY

Example

use progress_bar::*;

// if you have 81 pages to load
init_progress_bar(81);
set_progress_bar_action("Loading", Color::Blue, Style::Bold);

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

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

    // increase the progress by 1
    inc_progress_bar();
}

finalize_progress_bar();

image displaying the output of the code above

License: MIT

Commit count: 41

cargo fmt