Struct std::old_io::extensions::BytesUnstable [-] [+] [src]

pub struct Bytes<'r, T: 'r> {
    // some fields omitted
}

An iterator that reads a single byte on each iteration, until .read_byte() returns EndOfFile.

Notes about the Iteration Protocol

The Bytes may yield None and thus terminate an iteration, but continue to yield elements if iteration is attempted again.

Error

Any error other than EndOfFile that is produced by the underlying Reader is returned by the iterator and should be handled by the caller.

Methods

impl<'r, R: Reader> Bytes<'r, R>

fn new(r: &'r mut R) -> Bytes<'r, R>

Constructs a new byte iterator from the given Reader instance.

Trait Implementations

impl<'r, R: Reader> Iterator for Bytes<'r, R>

type Item = IoResult<u8>

fn next(&mut self) -> Option<IoResult<u8>>

fn size_hint(&self) -> (usize, Option<usize>)