Trait sigma_ser::peekable_reader::Peekable [−][src]
Expand description
A wrapper around any struct implementing the Read
trait, additionally
allowing for peek
operations to be performed. Therefore, the
PeekableReader
struct also implements the Read
trait.
The primary invariant of the PeekableReader
is that after calling the
peek
method, the next read_byte
call will return the same result as
the peek
does. When the result is a byte (read off the wrapped reader),
any read-type method of the Reader
trait will include the byte as the
first one. On the other hand, if the result is an io::Error
, the error
will be returned regardless of which read-type method of the Reader
is
invoked. Consecutive peek
s before any read-type operation is used
always return the same io::Result
.
Required methods
Implementors
impl<R: Read> Peekable for PeekableReader<R>
[src]
impl<R: Read> Peekable for PeekableReader<R>
[src]