std_io_iterators 1.1.0

An iterator for `STDIN` and a wrapper for `STDOUT`. Allows easy piping, and graceful closing of application if pipe breaks
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std_io_iterators::prelude::*;

fn main() -> Result<(), std::io::Error> {
    // Pipe out array, send anything that does not get piped out to `STDERR`
    eprintln!("Launched");

    if let Err(mut e) = (["Test1", "Test2", "Test3"].iter()).pipe_out() {
        e.by_ref().for_each(|recovered_datum| {
            eprintln!("{recovered_datum} - Recovered")
        });

        eprintln!("Recovery Done");
        return Ok(());
    }

    eprintln!("Finished");
    Ok(())
}