Skip to main content

drive_stream_until

Function drive_stream_until 

Source
pub fn drive_stream_until<H, T>(
    handshake: H,
    io: &mut T,
    deadline: Instant,
) -> Result<Established<H::Output>, DriveError<H::Error>>
Expand description

drive_stream that ends at deadline: every read and write waits at most what is left until it, through ReadTimeout and WriteTimeout, and both timeouts are cleared before it returns.

ยงErrors

DriveError::TimedOut when deadline passes first; otherwise as drive_stream.