Struct io::ByteWriterWrapper
source · pub struct ByteWriterWrapper<RW: BlockReader + BlockWriter>(/* private fields */);
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§
source§impl<RW> BlockIo for ByteWriterWrapper<RW>where
RW: BlockReader + BlockWriter,
impl<RW> BlockIo for ByteWriterWrapper<RW>where RW: BlockReader + BlockWriter,
source§fn block_size(&self) -> usize
fn block_size(&self) -> usize
Returns the size in bytes of a single block (i.e., sector),
the minimum granularity of I/O transfers.
source§impl<RW> BlockWriter for ByteWriterWrapper<RW>where
RW: BlockReader + BlockWriter,
impl<RW> BlockWriter for ByteWriterWrapper<RW>where RW: BlockReader + BlockWriter,
source§impl<RW> ByteWriter for ByteWriterWrapper<RW>where
RW: BlockReader + BlockWriter,
impl<RW> ByteWriter for ByteWriterWrapper<RW>where RW: BlockReader + BlockWriter,
source§impl<RW> From<RW> for ByteWriterWrapper<RW>where
RW: BlockReader + BlockWriter,
impl<RW> From<RW> for ByteWriterWrapper<RW>where RW: BlockReader + BlockWriter,
source§impl<RW> KnownLength for ByteWriterWrapper<RW>where
RW: KnownLength + BlockReader + BlockWriter,
impl<RW> KnownLength for ByteWriterWrapper<RW>where RW: KnownLength + BlockReader + BlockWriter,
Auto Trait Implementations§
impl<RW> RefUnwindSafe for ByteWriterWrapper<RW>where RW: RefUnwindSafe,
impl<RW> Send for ByteWriterWrapper<RW>where RW: Send,
impl<RW> Sync for ByteWriterWrapper<RW>where RW: Sync,
impl<RW> Unpin for ByteWriterWrapper<RW>where RW: Unpin,
impl<RW> UnwindSafe for ByteWriterWrapper<RW>where RW: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more