pub struct FakeSerial {
pub rx_queue: VecDeque<u8>,
pub tx_log: Vec<Vec<u8>>,
pub loopback: bool,
pub fault: bool,
}Expand description
In-memory fake Serial for tests.
Fields§
§rx_queue: VecDeque<u8>§tx_log: Vec<Vec<u8>>§loopback: bool§fault: boolImplementations§
Trait Implementations§
Source§impl Clone for FakeSerial
impl Clone for FakeSerial
Source§impl Debug for FakeSerial
impl Debug for FakeSerial
Source§impl Default for FakeSerial
impl Default for FakeSerial
Source§impl ResourceBackend for FakeSerial
impl ResourceBackend for FakeSerial
fn serial_read(&mut self) -> Result<Vec<u8>, BackendError>
fn serial_write(&mut self, data: &[u8]) -> Result<(), BackendError>
fn read32(&mut self, _offset: u64) -> Result<u32, BackendError>
fn write32(&mut self, _offset: u64, _value: u32) -> Result<(), BackendError>
fn barrier(&mut self)
fn gpio_read(&mut self) -> Result<bool, BackendError>
fn gpio_write(&mut self, _value: bool) -> Result<(), BackendError>
fn i2c_transfer( &mut self, _write_data: &[u8], _read_length: usize, ) -> Result<Vec<u8>, BackendError>
fn spi_transmit(&mut self, _tx_data: &[u8]) -> Result<Vec<u8>, BackendError>
fn clock_enable(&mut self) -> Result<(), BackendError>
fn clock_disable(&mut self) -> Result<(), BackendError>
fn clock_is_enabled(&mut self) -> Result<bool, BackendError>
fn clock_set_rate(&mut self, _hz: u64) -> Result<(), BackendError>
fn clock_query_rate(&mut self, _hz_in: u64) -> Result<u64, BackendError>
fn clock_get_rate(&mut self) -> Result<u64, BackendError>
fn reset_assert(&mut self) -> Result<(), BackendError>
fn reset_deassert(&mut self) -> Result<(), BackendError>
fn reset_toggle(&mut self) -> Result<(), BackendError>
fn reset_status(&mut self) -> Result<bool, BackendError>
Source§impl SerialBackend for FakeSerial
impl SerialBackend for FakeSerial
Auto Trait Implementations§
impl Freeze for FakeSerial
impl RefUnwindSafe for FakeSerial
impl Send for FakeSerial
impl Sync for FakeSerial
impl Unpin for FakeSerial
impl UnsafeUnpin for FakeSerial
impl UnwindSafe for FakeSerial
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more