kbar

Crates.iokbar
lib.rskbar
version0.1.5
sourcesrc
created_at2023-02-05 12:30:41.975936
updated_at2023-02-10 12:18:37.291728
descriptionA progress bar for cli
homepagehttps://crates.io/crates/kbar
repositoryhttps://github.com/prajnastra/kbar
max_upload_size
id777021
size6,747
Abhijit Paul (prajnastra)

documentation

https://docs.rs/kbar/latest/kbar

README

kbar

A progrss bar for cli. See Timer which is built using this library.

Example:

  • Simple
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);
    }
}
  • Custom
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);
    }
}
Commit count: 22

cargo fmt