fn with_limited<R>(
buf: &mut ReadBuf<'_>,
n: u64,
f: impl FnOnce(&mut ReadBuf<'_>) -> R,
) -> RExpand description
Make a limited version of buf, consisting only of up to n bytes of the unfilled section, and call f with it.
After f returns, we propagate the filled cursor advancement back to buf.