pub trait ReadDual: Read {
// Required method
fn read_into<W: Write>(&mut self, write: W, count: usize) -> Result<usize>;
}
Expand description
The Read
trait requires the caller to supply the buffer to be read into. This trait is its
dual in the sense that the trait implementor is expected to supply its own buffer, which a
Write
instance is given. This can be used to avoid copying in cases where the trait
implementor is already buffering data, so it can give a reference to this buffer to the caller
(for example in SectoredBuf
)