pub fn copy_from_slice(src: &[u8]) -> BytesMut
Expand description
Creates a BytesMut and copies from src to a buffer. The created buffer contains the initial message header required for message encoding, which is an optimization to reduce data copying in the process.