#read-write #pipe #writer #reader-writer #io #reader

read-write-pipe

A trait for objects implementing Write, to write all content from a Read object

1 unstable release

0.1.0 Aug 23, 2019

#1837 in Data structures

Download history 60/week @ 2024-03-03 83/week @ 2024-03-10 125/week @ 2024-03-17 55/week @ 2024-03-24 118/week @ 2024-03-31 51/week @ 2024-04-07 118/week @ 2024-04-14 82/week @ 2024-04-21 46/week @ 2024-04-28 56/week @ 2024-05-05 77/week @ 2024-05-12 79/week @ 2024-05-19 78/week @ 2024-05-26 154/week @ 2024-06-02 98/week @ 2024-06-09 41/week @ 2024-06-16

378 downloads per month
Used in pg-trunk

Apache-2.0

7KB

read-write-pipe

A trait for objects implementing Write, to write all content from a Read object.

Build Status Crates.io

read-write-pipe is a library for Rust that contains a single utility Trait to write a generic Read object into a writer. The Trait in this library are not production ready. It serves as a utility for quick and dirty copies of read objects into files or stdout.

Example

  use read_write_pipe::*;
  use std::fs::{File, OpenOptions};
  use std::io;
  use std::io::Write;

  fn main() -> io::Result<()> {
      let input = File::open("a.txt")?;
      let mut output = OpenOptions::new()
          .read(true)
          .write(true)
          .create(true)
          .open("b.txt")?;
      let _ = output.write_reader(input)?;
      Ok(())
  }

Documentation: https://docs.rs/read-write-pipe

License

Apache License 2.0

No runtime deps