copy_with_timeout

Function copy_with_timeout 

Source
pub fn copy_with_timeout<R, W>(
    reader: &mut R,
    writer: &mut W,
    deadline: Instant,
) -> Result<u64>
where R: Read + ?Sized, W: Write + ?Sized,
Expand description

Copies data from reader to writer until the deadline is reached. Limitations of current implementation may cause exceeding the deadline. Returns how many bytes has been read.