pub fn read(&mut self, data: &mut [u8]) -> usize {
        let read_amt = data.len().min(self.ready as usize);
        for i in 0..read_amt {
            data[i] = self.buffer.pop_front().unwrap();
        }
        self.ready -= read_amt as u32;
        read_amt
    }
/// Read any ready data off of the beginning of the read buffer and return the number of bytes
/// read.
Read any ready data off of the beginning of the read buffer and return the number of bytes
read.
Read any ready data off of the beginning of the read buffer and return the number of bytes read .
pub fn read(&mut self, data: &mut [u8]) -> usize {
        let read_amt = data.len().min(self.ready as usize);
        for i in 0..read_amt {
            data[i] = self.buffer.pop_front().unwrap();
        }
        self.ready -= read_amt as u32;
        read_amt
    }
pub fn read ( & mut self , data : & mut [ u8 ] ) -> usize { let read_amt = data . len ( ) . min ( self . ready as usize ) ; for i in 0 .. read_amt { data [ i ] = self . buffer . pop_front ( ) . unwrap ( ) ; } self . ready -= read_amt as u32 ; read_amt }
Read any ready data off of the beginning of the read buffer and return the number of bytes
read.
Read any ready data off of the beginning of the read buffer and return the number of bytes read .
&mut self
data
&mut [u8]
&mut self
data
&mut [u8]