Trait ConsoleExt

Source
pub trait ConsoleExt {
    // Required methods
    fn read(&self, buf: &mut [u8]) -> Result<usize>;
    fn read_timeout(&self, buf: &mut [u8], timeout: Duration) -> Result<usize>;
}
Expand description

Extension trait to [Uart] where useful methods are provided.

Required Methods§

Source

fn read(&self, buf: &mut [u8]) -> Result<usize>

Reads UART receive data into buf, returning the number of bytes read. This function is blocking.

Source

fn read_timeout(&self, buf: &mut [u8], timeout: Duration) -> Result<usize>

Reads UART receive data into buf, returning the number of bytes read. The timeout may be used to specify a duration to wait for data. If timeout expires without any data arriving Ok(0) will be returned, never Err(_).

Implementors§