Skip to main content

read_until_header_end

Function read_until_header_end 

Source
pub async fn read_until_header_end<R>(
    stdout: R,
    deadline: Instant,
) -> Result<(Vec<u8>, Vec<u8>, R), HeaderReadError>
where R: AsyncRead + Unpin + Send,
Expand description

Read from stdout until the RFC 3875 header / body separator (\r\n\r\n), or until deadline. Returns the header block (up to and including the separator), the leftover bytes that arrived in the same read() past the separator, and the still-open reader for downstream body streaming.

ยงErrors