fn split_to(buf: &mut Bytes, end: usize) -> BytesExpand description
Similar to Bytes::split_to, but directly operates on underlying memory region.
ยงSafety
This function is safe as long as data is backed by a consecutive region of memory,
for example Vec<u8> or &[u8], and caller must ensure that buf outlives
the Bytes returned.