read_iter
To any std::io::Read
implementor, add also Iterator<Item=u8>
implementation.
Installation
In Cargo.toml
of your project add:
[]
= "0.1"
Examples
use File;
use ReadIter;
let file = open.unwrap;
// "file" implements std::io::Read
let mut it = new;
// now "it" also implements std::io::Read
// and "&mut it" implements Iterator<Item=u8>
// also "it" has internal buffer, and implements std::io::BufRead
for byte in &mut it
// in case of i/o error, the iteration ends, and take_last_error() will return Err
it.take_last_error.unwrap;