Crate progress_string
source · [−]Expand description
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
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()
.build();
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
Represents a progress bar which can be used to get your progress string.
Helper struct for building a progress bar.