Struct iter_read::IterRead
[−]
[src]
pub struct IterRead<E: IterReadItem, I: Iterator<Item=E>> { // some fields omitted }
An adapter that allows treating iterators of bytes (and other types that
implement IterReadItem
) as a Read
.
IterReadItem
is implemented for u8
, &u8
, Vec<u8>
and its borrowed
variants as well as String
and its borrowed variants. It is also
implemented for all iterators that take a Result
type whose Ok
value is
an IterReadItem
and whose Err
value can be converted to an
std::io::Error
with into()
.
For inner types other than u8
the adapter might need to buffer some
contents of the iterator.
Methods
impl<E: IterReadItem, I: Iterator<Item=E>> IterRead<E, I>
fn new(iter: I) -> IterRead<E, I>
Create a new IterRead
which will read from the specified Iterator
.
fn into_inner(self) -> I
Unwrap the inner iterator. If the adapter uses buffering, the contents of the buffer are lost.