Trait ReadWriteExt

Source
pub trait ReadWriteExt: Read + Write {
    // Provided methods
    fn chain_after<R: Read>(
        &mut self,
        reader: R,
    ) -> ReadWriteChain<R, &mut Self>  { ... }
    fn take_rw(&mut self, len: u64) -> ReadWriteTake<&mut Self>  { ... }
}

Provided Methods§

Source

fn chain_after<R: Read>(&mut self, reader: R) -> ReadWriteChain<R, &mut Self>

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.

Source

fn take_rw(&mut self, len: u64) -> ReadWriteTake<&mut Self>

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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<RW: Read + Write + ?Sized> ReadWriteExt for RW