Crate progress_string[][src]

This library is primarily concerned with generating strings that can be used by your favorite terminal stream manipulation system to display a progress bar.

Example

extern crate progress_string;
extern crate termion;

use std::thread::sleep;
use std::time::Duration;

const TOTAL: usize = 1000;

fn main() {
    let mut bar = progress_string::BarBuilder::new()
        .total(TOTAL)
        .include_percent()
        .get_bar();

    println!("starting the progress");
    for i in 0..TOTAL {
        bar.replace(i);
        print!(
            "{}{}",
            termion::cursor::Left(bar.get_last_width() as u16),
            bar.to_string()
        );
        sleep(Duration::from_millis(10));
    }
    println!("\ndone with progress");
}

Structs

Bar

Represents a progress bar which can be used to get your progress string.

BarBuilder

Helper struct for building a progress bar.