pub trait Stream: Send {
fn write(&self, data: &[u8]) -> UartResult<()>;
fn read(&self, len: usize, timeout: Duration) -> UartResult<Vec<u8>>;
}
Expand description
This trait is used to represent streams and allows for mocking for api unit tests
Required Methods
fn write(&self, data: &[u8]) -> UartResult<()>
fn write(&self, data: &[u8]) -> UartResult<()>
Write raw bytes to stream