fn copy_from_buffer(&mut self, buf: &[u8]) -> usize {
        let max_size = self.max_buffer_size;
        let copy_size = std::cmp::min(max_size - self.data.len(), buf.len());
        self.data.extend_from_slice(&buf[0..copy_size]);
        self.buffer_pos += copy_size;
        copy_size
    }
// copies as many bytes as possible from buf to ourselves, return how many bytes
// we copied.
copies as many bytes as possible from buf to ourselves, return how many bytes
we copied.
copies as many bytes as possible from buf to ourselves return how many bytes we copied .
fn copy_from_buffer(&mut self, buf: &[u8]) -> usize {
        let max_size = self.max_buffer_size;
        let copy_size = std::cmp::min(max_size - self.data.len(), buf.len());
        self.data.extend_from_slice(&buf[0..copy_size]);
        self.buffer_pos += copy_size;
        copy_size
    }
fn copy_from_buffer ( & mut self , buf : & [ u8 ] ) -> usize { let max_size = self . max_buffer_size ; let copy_size = std :: cmp :: min ( max_size - self . data . len ( ) , buf . len ( ) ) ; self . data . extend_from_slice ( & buf [ 0 .. copy_size ] ) ; self . buffer_pos += copy_size ; copy_size }
copies as many bytes as possible from buf to ourselves, return how many bytes
we copied.
copies as many bytes as possible from buf to ourselves return how many bytes we copied .
&mut self
buf
&[u8]
&mut self
buf
&[u8]