reprints for your terminal screen
Screenprints acts as a buffer for terminal display continuously printing output at a configured interval.
Find them here
Screensprints defines a Printer
which implements std::io::Write which means anywhere you would normally write output to, you could substitude in an instance of a Printer
.
```rust extern crate screenprints;
use screenprints::Printer; use std::io::{stdout, Write}; use std::time::Duration; use std::thread;
fn main() { let mut printer = Printer::new(stdout(), Duration::frommillis(10)); for f in vec!["foo.txt", "bar.txt", "baz.txt"] { for i in 0..51 { let _ = write!(printer, "Downloading {}.. ({}/{}) GB\n", f, i, 50); thread::sleep(Duration::frommillis(50)); } } } ```
The result should look something like the following
Doug Tangren (softprops) 2016