prog_rs

Crates.ioprog_rs
lib.rsprog_rs
version0.2.0
sourcesrc
created_at2020-01-26 19:46:44.114119
updated_at2020-02-02 20:09:56.202205
descriptionConvenient progress bar
homepage
repositoryhttps://github.com/remi-dupre/prog-rs
max_upload_size
id202234
size155,666
Rémi Dupré (remi-dupre)

documentation

README

prog-rs

licence

A Rust library to help easily build a progress bar.

animated screenshot

Usage

First, add the following to your Cargo.toml:

[dependencies]
prog_rs = "0.1"

Next, add this to your crate root:

extern crate prog_rs;

To add a progress bar while iterating, just add .progress() behind your iterator:

use prog_rs::prelude::*;

fn main() {
    for _ in (0..1_000).progress() {
        std::thread::sleep(std::time::Duration::from_millis(5));
    }
}

Some parameters can be tweaked using with_ prefixed methods:

use prog_rs::prelude::*;

fn main() {
    for _ in (0..1_000)
        .progress()
        .with_prefix("Processing...")
        .with_output_stream(prog_rs::OutputStream::StdErr)
        .with_bar_position(prog_rs::BarPosition::Right)
    {
        do_something();
    }
}
Commit count: 21

cargo fmt