Skip to main content

drive_stream_until

Function drive_stream_until 

Source
pub async fn drive_stream_until<H, T>(
    handshake: H,
    io: &mut T,
    deadline: Instant,
) -> Result<Established<H::Output>, DriveError<H::Error>>
where H: Handshake, T: AsyncRead + AsyncWrite + Unpin,
Expand description

drive_stream that ends at deadline, through tokio::time: the runtime must have its timer enabled (tokio panics otherwise).

ยงErrors

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