pub struct ReaderWriter<IO> { /* private fields */ }
Expand description

A readable and writable “stateful” I/O stream that keeps track of its current offset within its internal stateless I/O stream.

Trait implementations

  • This implements the [core2::io::Read] and [core2::io::Write] traits for read and write access.
  • This implements the [core2::io::Seek] trait if the underlying I/O stream implements KnownLength.
  • This also forwards all other I/O-related traits implemented by the underlying I/O stream.
  • This derefs into the inner IO type, via both Deref and DerefMut.

Implementations

Creates a new ReaderWriter 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. Read more

Reads blocks of data from this reader into the given buffer. Read more

Writes blocks of data from the given buffer to this writer. Read more

Flushes this entire writer’s output stream, ensuring all contents in intermediate buffers are fully written out. Read more

Reads bytes of data from this reader into the given buffer. Read more

Writes bytes of data from the given buffer to this writer. Read more

Flushes this writer’s output stream, ensuring all contents in intermediate buffers are fully written out. Read more

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

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

Write a buffer into this writer, returning how many bytes were written. Read more

Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more

Attempts to write an entire buffer into this writer. Read more

Writes a formatted string into this writer, returning any error encountered. Read more

Creates a “by reference” adaptor for this instance of Write. 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.