multi_reader 0.1.0

MultiReader - a composite reader implementation.
Documentation
  • Coverage
  • 25%
    1 out of 4 items documented1 out of 3 items with examples
  • Size
  • Source code size: 7.1 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 333.59 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 10s Average build duration of successful builds.
  • all releases: 10s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • iximiuz/multi_reader.rs
    3 1 1
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • iximiuz

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