Trait CopyRead
pub(in ::sys::io::kernel_copy::linux) trait CopyRead: Read
Required Methods
fn properties(&self) -> CopyParamsExtracts the file descriptor and hints/metadata, delegating through wrappers if necessary.
Provided Methods
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 intowriteruntil either the buffers are emptied orlimitbytes 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.
fn taken(&mut self, _bytes: u64)Updates
Takewrappers to remove the number of bytes copied.fn min_limit(&self) -> u64The minimum of the limit of all
Take<_>wrappers,u64::MAXotherwise. This method does not account for dataBufReaderbuffers and would underreport the limit of aTake<BufReader<Take<_>>>type. Thus its result is only valid after draining the buffers viadrain_to.
Implementors
impl CopyRead for &Fileimpl CopyRead for &PipeReaderimpl CopyRead for &TcpStreamimpl CopyRead for &UnixStreamimpl CopyRead for CachedFileMetadataimpl CopyRead for ChildStderrimpl CopyRead for ChildStdoutimpl CopyRead for Fileimpl CopyRead for PipeReaderimpl CopyRead for StdinLock<'_>impl CopyRead for TcpStreamimpl CopyRead for UnixStreamimpl<T> CopyRead for &mut T where T: CopyRead,impl<T: ?Sized + CopyRead> CopyRead for BufReader<T>impl<T: CopyRead> CopyRead for Take<T>