Struct io::ByteWriterWrapper

source ·
pub struct ByteWriterWrapper<RW: BlockReader + BlockWriter>(_);
Expand description

A wrapper struct that implements a byte-wise writer atop a block-based reader and writer.

This is effectively the same struct as ByteReaderWriterWrapper, but it allows only writing to the underlying I/O stream, not reading.

See the ByteWriter trait docs for an explanation of why both BlockReader + BlockWriter are required.

Example

Use the From implementation around a BlockReader + BlockWriter instance, such as:

// Assume `storage_dev` implements `BlockReader + BlockWriter`
ByteReaderWriterWrapper::from(storage_dev).write_at(...);

Trait Implementations§

Returns the size in bytes of a single block (i.e., sector), the minimum granularity of I/O transfers.
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.
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.
Converts to this type from the input type.
Returns the length (size in bytes) of this I/O stream or device.

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
Converts to this type from the input type.

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.