[][src]Struct embedded_hal_mock::i2c::Transaction

pub struct Transaction { /* fields omitted */ }

I2C Transaction type

Models an I2C read or write

Methods

impl Transaction[src]

pub fn write(addr: u8, expected: Vec<u8>) -> Transaction[src]

Create a Write transaction

pub fn read(addr: u8, response: Vec<u8>) -> Transaction[src]

Create a Read transaction

pub fn write_read(addr: u8, expected: Vec<u8>, response: Vec<u8>) -> Transaction[src]

Create a WriteRead transaction

pub fn with_error(self, error: MockError) -> Self[src]

Add an error return to a transaction

This is used to mock failure behaviours.

Trait Implementations

impl Clone for Transaction[src]

impl Debug for Transaction[src]

impl PartialEq<Transaction> for Transaction[src]

impl StructuralPartialEq for Transaction[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.