use std::io::{Read, Write, Result}; pub struct RWBundle(pub R, pub W); impl Read for RWBundle{ fn read(&mut self, buf: &mut [u8]) -> Result{ self.0.read(buf) } //fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result; //fn read_to_end(&mut self, buf: &mut Vec) -> Result; //fn read_to_string(&mut self, buf: &mut String) -> Result; fn read_exact(&mut self, buf: &mut [u8]) -> Result<()>{ self.0.read_exact(buf) } //fn by_ref(&mut self) -> &mut Self // where Self: Sized; //fn bytes(self) -> Bytes // where Self: Sized; //fn chain(self, next: R) -> Chain // where Self: Sized; //fn take(self, limit: u64) -> Take // where Self: Sized; } impl Write for RWBundle{ fn write(&mut self, buf: &[u8]) -> Result{ self.1.write(buf) } fn flush(&mut self) -> Result<()>{ self.1.flush() } //fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> Result; fn write_all(&mut self, buf: &[u8]) -> Result<()>{ self.1.write_all(buf) } //fn write_fmt(&mut self, fmt: Arguments<'_>) -> Result<()>; //fn by_ref(&mut self) -> &mut Self // where Self: Sized; }