Skip to main content

push_bytes

Function push_bytes 

Source
pub fn push_bytes(out: &mut String, pending: &mut Vec<u8>, bytes: &[u8])
Expand description

Buffer raw response bytes into out, holding back split UTF-8.

TCP segments can split multi-byte chars; decoding per chunk would corrupt them into replacement characters, so a trailing partial sequence waits in pending until its remaining bytes arrive.