prgrs

Crates.ioprgrs
lib.rsprgrs
version0.6.4
sourcesrc
created_at2020-02-20 22:54:09.941025
updated_at2020-09-08 18:34:45.740753
descriptionprgrs is a progress bar for rust, that aims to work like the python package tqdm
homepage
repositoryhttps://github.com/phil0x2e/prgrs/
max_upload_size
id211032
size13,130
(phil0x2e)

documentation

https://docs.rs/prgrs

README

prgrs - A simple to use progress bar for your iterators

prgrs is a simple progress bar for rust, that aims to work like the python package tqdm.

It is a small library with just a single dependency.

prgrs should work for almost any linux terminal emulator. Windows could work too, because terminal supports windows but I haven't tested yet, so please let me know if you have.

Have a look at the Documentation.

Please use Version 0.6.0 or higher, the older versions only work correctly with a small amount of terminals.

Example:

use prgrs::{Prgrs, writeln};
use std::{thread, time};

fn main() {
    for i in Prgrs::new(0..1000, 1000) {
        thread::sleep(time::Duration::from_millis(10));
        if i % 10 == 0{
            let str = format!("{}", i);
            writeln(&str).expect("prgrs::writeln: Some Problem occured while trying to print");
        }
    }
}

The output will look something like this:

[##############                     ] ( 42%)

Todos:

  • Feature to print current iteration from total iterations instead of a percentage
  • Prevent flickering
Commit count: 45

cargo fmt