Skip to main content

complete_io

Function complete_io 

Source
pub fn complete_io(
    io: &mut (impl Read + Write),
    input: &mut VecInput,
    conn: &mut dyn Connection,
) -> Result<(usize, usize), Error>
Expand description

This function uses io to complete any outstanding IO for the connection.

This is a convenience function which solely uses other parts of the public API.

What this means depends on the connection state:

The return value is the number of bytes read from and written to io, respectively. Once both read() and write() yield WouldBlock, this function will propagate the error.

Errors from TLS record handling (i.e., from process_new_packets()) are wrapped in an io::ErrorKind::InvalidData-kind error.