/// [`MemoryReader`]: ./struct.MemoryReader.html
#[allow(dead_code)]
pub struct ByteReader<'a> {
- io: &'a mut ByteIO,
+ io: &'a mut dyn ByteIO,
}
/// Bytestream reader from memory.
/// # Ok(())
/// # }
/// ````
- pub fn new(io: &'a mut ByteIO) -> Self { ByteReader { io } }
+ pub fn new(io: &'a mut dyn ByteIO) -> Self { ByteReader { io } }
/// Reads data into provided buffer. Partial read is treated as success.
pub fn read_buf(&mut self, buf: &mut [u8]) -> ByteIOResult<usize> {
/// [`MemoryWriter`]: ./struct.MemoryWriter.html
#[allow(dead_code)]
pub struct ByteWriter<'a> {
- io: &'a mut ByteIO,
+ io: &'a mut dyn ByteIO,
}
/// Bytestream writer to memory.
impl<'a> ByteWriter<'a> {
/// Constructs a new instance of `ByteWriter`.
- pub fn new(io: &'a mut ByteIO) -> Self { ByteWriter { io } }
+ pub fn new(io: &'a mut dyn ByteIO) -> Self { ByteWriter { io } }
/// Writes byte array to the output.
pub fn write_buf(&mut self, buf: &[u8]) -> ByteIOResult<()> {