pub enum MockTransaction {
Show 14 variants
None,
SpiWrite(Id, Vec<u8>, Vec<u8>),
SpiRead(Id, Vec<u8>, Vec<u8>),
SpiExec(Id, Vec<MockExec>),
Busy(Id, PinState),
Ready(Id, PinState),
Reset(Id, PinState),
Write(Id, Vec<u8>),
Transfer(Id, Vec<u8>, Vec<u8>),
IsHigh(Id, bool),
IsLow(Id, bool),
SetHigh(Id),
SetLow(Id),
DelayNs(u32),
}Expand description
Mock transaction type for setting and checking expectations
Variants§
None
SpiWrite(Id, Vec<u8>, Vec<u8>)
SpiRead(Id, Vec<u8>, Vec<u8>)
SpiExec(Id, Vec<MockExec>)
Busy(Id, PinState)
Ready(Id, PinState)
Reset(Id, PinState)
Write(Id, Vec<u8>)
Transfer(Id, Vec<u8>, Vec<u8>)
IsHigh(Id, bool)
IsLow(Id, bool)
SetHigh(Id)
SetLow(Id)
DelayNs(u32)
Implementations§
Source§impl MockTransaction
impl MockTransaction
pub fn spi_write<A, B>(spi: &Spi, prefix: A, outgoing: B) -> Self
pub fn spi_read<A, B>(spi: &Spi, prefix: A, incoming: B) -> Self
pub fn spi_exec<O>(spi: &Spi, o: O) -> Self
pub fn busy(spi: &Spi, value: PinState) -> Self
pub fn ready(spi: &Spi, value: PinState) -> Self
pub fn reset(spi: &Spi, value: PinState) -> Self
pub fn delay_ms(v: u32) -> Self
pub fn write<B>(spi: &Spi, outgoing: B) -> Self
pub fn transfer<B>(spi: &Spi, outgoing: B, incoming: B) -> Self
pub fn is_high(pin: &Pin, value: bool) -> Self
pub fn is_low(pin: &Pin, value: bool) -> Self
pub fn set_high(pin: &Pin) -> Self
pub fn set_low(pin: &Pin) -> Self
Trait Implementations§
Source§impl Clone for MockTransaction
impl Clone for MockTransaction
Source§fn clone(&self) -> MockTransaction
fn clone(&self) -> MockTransaction
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MockTransaction
impl Debug for MockTransaction
Source§impl PartialEq for MockTransaction
impl PartialEq for MockTransaction
impl StructuralPartialEq for MockTransaction
Auto Trait Implementations§
impl Freeze for MockTransaction
impl RefUnwindSafe for MockTransaction
impl Send for MockTransaction
impl Sync for MockTransaction
impl Unpin for MockTransaction
impl UnwindSafe for MockTransaction
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