Trait read_write_ext::ReadWriteExt
source · [−]pub trait ReadWriteExt: Read + Write {
fn chain_after<R: Read>(
&mut self,
reader: R
) -> ReadWriteChain<R, &mut Self>ⓘNotable traits for ReadWriteChain<R, RW>impl<R: Read, RW: Read + Write> Read for ReadWriteChain<R, RW>impl<R: Read, RW: Read + Write> Write for ReadWriteChain<R, RW>
{ ... }
fn take_rw(&mut self, len: u64) -> ReadWriteTake<&mut Self>ⓘNotable traits for ReadWriteTake<RW>impl<RW: Read + Write> Read for ReadWriteTake<RW>impl<RW: Read + Write> Write for ReadWriteTake<RW>
{ ... }
}
Provided methods
fn chain_after<R: Read>(&mut self, reader: R) -> ReadWriteChain<R, &mut Self>ⓘNotable traits for ReadWriteChain<R, RW>impl<R: Read, RW: Read + Write> Read for ReadWriteChain<R, RW>impl<R: Read, RW: Read + Write> Write for ReadWriteChain<R, RW>
fn chain_after<R: Read>(&mut self, reader: R) -> ReadWriteChain<R, &mut Self>ⓘNotable traits for ReadWriteChain<R, RW>impl<R: Read, RW: Read + Write> Read for ReadWriteChain<R, RW>impl<R: Read, RW: Read + Write> Write for ReadWriteChain<R, RW>
Returns a struct that implements std::io::Read
and std::io::Write
.
It reads from reader
until it is empty, then reads from self
.
It passes all writes through to self
.
This is like std::io::Read::chain
that also passes through writes.
fn take_rw(&mut self, len: u64) -> ReadWriteTake<&mut Self>ⓘNotable traits for ReadWriteTake<RW>impl<RW: Read + Write> Read for ReadWriteTake<RW>impl<RW: Read + Write> Write for ReadWriteTake<RW>
fn take_rw(&mut self, len: u64) -> ReadWriteTake<&mut Self>ⓘNotable traits for ReadWriteTake<RW>impl<RW: Read + Write> Read for ReadWriteTake<RW>impl<RW: Read + Write> Write for ReadWriteTake<RW>
Wraps a struct that implements std::io::Read
and std::io::Write
.
The returned struct passes through reads and writes to the struct.
It limits the number of bytes that can be read.
This is like std::io::Read::take
that also passes through writes.