killercup / convey

A Rust create for outputting information and log messages for humans and machines
https://docs.rs/convey
Apache License 2.0
39 stars 5 forks source link

Support progress bars #1

Open killercup opened 5 years ago

killercup commented 5 years ago
killercup commented 5 years ago

Cargo's impl lives here

killercup commented 5 years ago

Termcolor doesn't support advanced Windows stuff. We might be able to use some of what console does, though.

killercup commented 5 years ago

Some notes from talking with @waywardmonkeys:

killercup commented 5 years ago

This will require some more refactoring and design work before I'm happy with the API. Currently, my idea was to have something like

output.progress(convey::Progress::bar(i, 10).message(msg));

which would always replace the current progress bar. (Something like convey::Progress::none() would remove it.)

I think we should go one step further, though, and also help with managing the state of the progress bar in between calls. Maybe even have an iterator adapter to quickly update the progress bar in an iterator chain.

My experiments so far have been just that, experiments. I'll try to write more of this down in the future, and come up with more test cases to evaluate a design against.