trait CopyRead: Read {
// Required method
fn properties(&self) -> CopyParams;
// Provided methods
fn drain_to<W: Write>(
&mut self,
_writer: &mut W,
_limit: u64
) -> Result<u64> { ... }
fn taken(&mut self, _bytes: u64) { ... }
fn min_limit(&self) -> u64 { ... }
}
Required Methods§
sourcefn properties(&self) -> CopyParams
fn properties(&self) -> CopyParams
Extracts the file descriptor and hints/metadata, delegating through wrappers if necessary.
Provided Methods§
sourcefn drain_to<W: Write>(&mut self, _writer: &mut W, _limit: u64) -> Result<u64>
fn drain_to<W: Write>(&mut self, _writer: &mut W, _limit: u64) -> Result<u64>
Implementations that contain buffers (i.e. BufReader
) must transfer data from their internal
buffers into writer
until either the buffers are emptied or limit
bytes have been
transferred, whichever occurs sooner.
If nested buffers are present the outer buffers must be drained first.
This is necessary to directly bypass the wrapper types while preserving the data order when operating directly on the underlying file descriptors.