pub fn new(bytes: &[u8]) -> Self {
        let mut buf = BytesMut::new();

        buf.extend_from_slice(bytes);

        ByteStream {
            bytes: Some(buf.freeze()),
        }
    }
/// Create a new ByteStream based upon the byte slice (note: this will copy from the slice)
Create a new ByteStream based upon the byte slice (note: this will copy from the slice)
Create a new ByteStream based upon the byte slice ( note : this will copy from the slice )
pub fn new(bytes: &[u8]) -> Self {
        let mut buf = BytesMut::new();
        buf.extend_from_slice(bytes);
        ByteStream {
            bytes: Some(buf.freeze()),
        }
    }
pub fn new ( bytes : & [ u8 ] ) -> Self { let mut buf = BytesMut :: new ( ) ; buf . extend_from_slice ( bytes ) ; ByteStream { bytes : Some ( buf . freeze ( ) ) , } }
Create a new ByteStream based upon the byte slice (note: this will copy from the slice)
Create a new ByteStream based upon the byte slice ( note : this will copy from the slice )
bytes
&[u8]