Skip to main content

drain_with_cap

Function drain_with_cap 

Source
pub async fn drain_with_cap<R: AsyncRead + Unpin>(
    r: R,
    cap: usize,
) -> (Bytes, bool)
Expand description

Drain a reader into Bytes, stopping storage (but continuing to drain) once cap is reached. Sets truncated=true if the stream exceeded the cap.