tee_readwrite
tee_readwrite
This module allows you to mirror read/writes to another read/write (like POSIX tee)
Examples
TeeReader
use ;
// make a new reader
let reader = new;
let mut tee = new;
// read all of the elements from the cursor into this vec
// each 'read' call will be written to the wrapped writer
let mut results = vec!;
assert_eq!;
// consume the tee, returning the reader and the mirroring writer
let = tee.into_inner;
assert_eq!;
TeeWriter
use ;
let writer = vec!;
let mut tee = new;
for i in 1..=3
// we can borrow the output writer
assert_eq!;
// consume the tee, returning the writer and its tee output
let = tee.into_inner;
assert_eq!;
assert_eq!;
License: 0BSD