Crates.io | kbar |
lib.rs | kbar |
version | 0.1.5 |
source | src |
created_at | 2023-02-05 12:30:41.975936 |
updated_at | 2023-02-10 12:18:37.291728 |
description | A progress bar for cli |
homepage | https://crates.io/crates/kbar |
repository | https://github.com/prajnastra/kbar |
max_upload_size | |
id | 777021 |
size | 6,747 |
A progrss bar for cli. See Timer which is built using this library.
use kbar::Bar;
use std::thread::sleep;
use std::time::Duration;
fn main() {
let mut bar = Bar::new();
bar.set_job_label("Percentage");
for i in 0..101 {
sleep(Duration::from_millis(100));
bar.reach_percent(i);
}
}
use kbar::Bar;
use std::thread::sleep;
use std::time::Duration;
fn main() {
let mut bar = Bar::custom(
// left cap symbol
String::from("["),
// right cap symbol
String::from("]"),
// filled symbol
String::from("#"),
// empty symbol
String::from("-"),
);
bar.set_job_label("Percentage");
for i in 0..101 {
sleep(Duration::from_millis(100));
bar.reach_percent(i);
}
}