Skip to main content

Module io

Module io 

Available on crate feature tokio only.
Expand description

Low-level I/O helpers for the connection handshake.

Functionsยง

read_packet ๐Ÿ”’
Reads from read into reader until one whole packet is framed, returning its Frame. The packet remains buffered in reader (decode it with PacketReader::decode, then consume it). Any bytes read past it remain buffered too, so the same reader can be handed to the steady-state read loop without losing data.
write_packet ๐Ÿ”’
Encodes packet into buf (clearing and reusing it), writes it to writer, then flushes.