Skip to main content

read_text_excerpt

Function read_text_excerpt 

Source
pub async fn read_text_excerpt(response: Response, limit: usize) -> String
Expand description

Read at most limit bytes of the body as text for a diagnostic message.

Never fails: an oversized body is cut at limit and a transport error ends the read early, because the caller is already reporting a failure and only wants a bounded excerpt.