Expand description
A small crate that provides an adapter to Read from an iterator over bytes.
This is useful if you want to use an API that takes a Read
instance, but
want to feed it data from an iterator.
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");
Structs
- An adapter that allows treating iterators of bytes (and other types that implement
IterReadItem
) as aRead
.
Traits
- Trait that should be implemented for any type which can be used in an iterator given to
IterRead
.