Function servers::proto::split_to

source ·
fn split_to(buf: &mut Bytes, end: usize) -> Bytes
Expand 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.