4 releases (2 breaking)
|0.3.0||Jun 17, 2020|
|0.2.1||Sep 18, 2019|
|0.2.0||Oct 28, 2018|
|0.1.0||Apr 24, 2016|
#90 in Rust patterns
2,128 downloads per month
Used in 9 crates (3 directly)
This crate is a small library that provides a type that implements
std::io::Read for iterators over bytes (
u8) and sequences of it, and also
Result<Vec<u8>, E> etc.
The iterators must be fused (i.e. guarantee a
None return from
after they have returned
None once); you need to call
iterators that don't implement
This crate works with Cargo and can be found on
crates.io with a
[dependencies] iter-read = "0.3"
Minimum supported Rust version is 1.31.0. No other dependencies.
A simple example:
use std::io::Read; use iter_read::IterRead; let source = vec![1, 2, 7, 42, 123]; let mut reader = IterRead::new(source.iter()); let mut buf = vec![0; 3]; reader.read_exact(&mut buf).unwrap(); assert_eq!(buf, b"\x01\x02\x07");
No runtime deps