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:
- If the connection
is_handshaking(), then IO is performed until the handshake is complete. - Otherwise, if
wants_write()is true,write_tls()is invoked until it is all written. - Otherwise, if
wants_read()is true,VecInput::read()is invoked once.
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.