Trait rust_uart::Stream [−][src]
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
Implementors
impl Stream for MockStream