pub struct MockDevice { /* private fields */ }
Expand description
A I2CMasterDevice implementation that exists solely for testing. The MockDevice delegates writes and reades to the supplied callback functions/data that are used in tests for checking the correct device communication.
Implementations§
Source§impl MockDevice
impl MockDevice
pub fn new_write_only(write_block_cb: WriteCb) -> MockDevice
pub fn new_read_only(read_block_data: Vec<u8>) -> MockDevice
pub fn new(write_block_cb: WriteCb, read_block_data: Vec<u8>) -> MockDevice
Trait Implementations§
Source§impl I2CMasterDevice for MockDevice
impl I2CMasterDevice for MockDevice
Auto Trait Implementations§
impl Freeze for MockDevice
impl RefUnwindSafe for MockDevice
impl Send for MockDevice
impl Sync for MockDevice
impl Unpin for MockDevice
impl UnwindSafe for MockDevice
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