Struct io::Reader

source ·
pub struct Reader<R>(_);
Expand description

A stateful reader that keeps track of its current offset within the internal stateless ByteReader I/O stream.

This implements the [core2::io::Read] trait for read-only access, as well as the [core2::io::Seek] trait if the underlying I/O stream implements KnownLength. It also forwards all other read-only I/O-related traits implemented by the underlying I/O stream.

Note: this is implemented as a thin wrapper around ReaderWriter.

Implementations§

Creates a new Reader with an initial offset of 0.

Trait Implementations§

Returns the size in bytes of a single block (i.e., sector), the minimum granularity of I/O transfers.
Reads blocks of data from this reader into the given buffer. Read more
Reads bytes of data from this reader into the given buffer. Read more
Returns the length (size in bytes) of this I/O stream or device.
Pull some bytes from this source into the specified buffer, returning how many bytes were read. Read more
Read all bytes until EOF in this source, placing them into buf. Read more
Read all bytes until EOF in this source, appending them to buf. Read more
Determines if this Reader can work with buffers of uninitialized memory. Read more
Read the exact number of bytes required to fill buf. Read more
Creates a “by reference” adaptor for this instance of Read. Read more
Transforms this Read instance to an Iterator over its bytes. Read more
Creates an adaptor which will chain this stream with another. Read more
Creates an adaptor which will read at most limit bytes from it. Read more
Seek to an offset, in bytes, in a stream. Read more
Rewind to the beginning of a stream. Read more
Returns the length of this stream (in bytes). Read more
Returns the current seek position from the start of the stream. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.