[][src]Trait rust_uart::Stream

pub trait Stream: Send {
    fn write(&self, data: &[u8]) -> UartResult<()>;
fn read(&self, len: usize, timeout: Duration) -> UartResult<Vec<u8>>; }

This trait is used to represent streams and allows for mocking for api unit tests

Required methods

fn write(&self, data: &[u8]) -> UartResult<()>

Write raw bytes to stream

fn read(&self, len: usize, timeout: Duration) -> UartResult<Vec<u8>>

Read upto a specified amount of raw bytes from the stream

Loading content...

Implementors

impl Stream for MockStream[src]

Loading content...