This is just a simple customizable loading bar that scales to the size of your terminal and has the ability to print a message
The current version is 0.2.2
##### Takes one argument, color and converts it into an ansi escape sequence,
The supported colors are: black, red, green, yellow, blue, magenta, cyan, & white
Anything else will result in the default terminal color
You may also use a custom ascii sequence and not use this
Chars: list of chars, going from left to right:
[beginning outline, filled, edge of filled, unfilled, ending outline]
The arguments are: percentage, message, messagebefore, barconfig
``` use rbar; use std::{thread, time};
// this example makes a loading bar similar to the one used by cargo fn main() { for i in 0..100 { let bar = rbar::BarConf { color: rbar::strtocolor("default"), chars: ['[','=','>','-',']'] };
rbar::draw_bar(i, "Loading...", false, bar);
thread::sleep(time::Duration::from_millis(100));
}
}
Output:
[=>--------------------------------] 1% Loading...
A little later...
[==================================] 100% Loading...
```