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.