All Projects → softprops → screenprints

softprops / screenprints

Licence: MIT license
reprints for your terminal screen

Programming Languages

rust
11053 projects
Makefile
30231 projects

screenprints

Build Status Software License crates.io

reprints for your terminal screen

Screenprints acts as a buffer for terminal display continuously printing output at a configured interval.

api docs

Find them here

usage

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.

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::from_millis(10));
    for f in &["foo.txt", "bar.txt", "baz.txt"] {
        for i in 0..51 {
            let _ = write!(printer, "Downloading {}.. ({}/{}) GB\n", f, i, 50);
            thread::sleep(Duration::from_millis(50));
        }
    }
}

The result should look something like the following

asciicast

Doug Tangren (softprops) 2016

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].