multi_reader

Crates.iomulti_reader
lib.rsmulti_reader
version0.1.0
sourcesrc
created_at2016-08-24 21:18:48.136914
updated_at2016-08-24 21:18:48.136914
descriptionMultiReader - a composite reader implementation.
homepage
repositoryhttps://github.com/Ostrovski/multi_reader.rs
max_upload_size
id6097
size7,107
team-authorization (github:cloudwalk:team-authorization)

documentation

README

MultiReader - a composite reader implementation.

Build Status

Like std::io::Chain but allows to chain more than two readers together.

Usage

extern crate multi_reader;
use std::env;
use std::io::{BufRead, BufReader};
use std::fs::File;

fn main() {
    let args: Vec<_> = env::args().collect();
    let files = args[1..].iter().map(|f| File::open(f).expect("File not found"));
    let reader = BufReader::new(multi_reader::MultiReader::new(files));
    println!("Total lines count: {}", reader.lines().count());
}

Examples

Run cargo run --example main chained /path/to/file/a /path/to/file/b ....

Tests

cargo test
Commit count: 3

cargo fmt