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.

Trait Implementations

impl<E: IterReadItem, I: Iterator<Item=E>> Read for IterRead<E, I>

fn read(&mut self, buf: &mut [u8]) -> Result<usize>

1.0.0fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize, Error>

1.0.0fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>

1.6.0fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>

1.0.0fn by_ref(&mut self) -> &mut Self

1.0.0fn bytes(self) -> Bytes<Self>

fn chars(self) -> Chars<Self>

1.0.0fn chain<R>(self, next: R) -> Chain<Self, R> where R: Read

1.0.0fn take(self, limit: u64) -> Take<Self>