pub fn trace(&self,
                 uart: &mut Uart,
                 buffer: &mut Vec<u8>,
                 schedule: &mut Vec<(Instant, usize)>) -> Result<usize> {
        let buffer: &mut [u8] = buffer.as_mut_slice();
        let mut bytes_read: usize = 0;

        let max_runtime = self.max_runtime();
        let start = Instant::now();

        loop {
            let now = Instant::now();
            if now - start >= max_runtime { break; }

            let read = uart.read(&mut buffer[bytes_read..])?;
            if read > 0 {
                bytes_read += read;
                schedule.push((now, read));
            }
        }

        Ok(bytes_read)
    }
/// Perform the tracing specified by the test.
Perform the tracing specified by the test.
Perform the tracing specified by the test .
pub fn trace(&self,
                 uart: &mut Uart,
                 buffer: &mut Vec<u8>,
                 schedule: &mut Vec<(Instant, usize)>) -> Result<usize> {
        let buffer: &mut [u8] = buffer.as_mut_slice();
        let mut bytes_read: usize = 0;
        let max_runtime = self.max_runtime();
        let start = Instant::now();
        loop {
            let now = Instant::now();
            if now - start >= max_runtime { break; }
            let read = uart.read(&mut buffer[bytes_read..])?;
            if read > 0 {
                bytes_read += read;
                schedule.push((now, read));
            }
        }
        Ok(bytes_read)
    }
pub fn trace ( & self , uart : & mut Uart , buffer : & mut Vec < u8 > , schedule : & mut Vec < ( Instant , usize ) > ) -> Result < usize > { let buffer : & mut [ u8 ] = buffer . as_mut_slice ( ) ; let mut bytes_read : usize = 0 ; let max_runtime = self . max_runtime ( ) ; let start = Instant :: now ( ) ; loop { let now = Instant :: now ( ) ; if now - start >= max_runtime { break ; } let read = uart . read ( & mut buffer [ bytes_read .. ] ) ? ; if read > 0 { bytes_read += read ; schedule . push ( ( now , read ) ) ; } } Ok ( bytes_read ) }
Perform the tracing specified by the test.
Perform the tracing specified by the test .
&self
uart
&mut Uart
buffer
&mut Vec<u8>
schedule
&mut Vec<(Instant, usize)>
&self
uart
&mut Uart
buffer
&mut Vec<u8>
schedule
&mut Vec<(Instant, usize)>