Skip to main content

read_body_limited

Function read_body_limited 

Source
async fn read_body_limited(
    response: Response,
    needed_lines: usize,
) -> Result<String, GitHubExpandError>
Expand description

Reads the response body chunk by chunk, stopping as soon as needed_lines complete lines have been received.

Dropping response before the transfer finishes aborts it, so the bytes past the last displayed line are never downloaded.