Struct embedded_hal_mock::eh0::adc::Transaction
source · pub struct Transaction<T> { /* private fields */ }
Available on crate feature
eh0
only.Expand description
ADC transaction type
Models an ADC read
Implementations§
source§impl<T> Transaction<T>
impl<T> Transaction<T>
sourcepub fn read(chan: u8, resp: T) -> Transaction<T>
pub fn read(chan: u8, resp: T) -> Transaction<T>
Create a read transaction
sourcepub fn with_error(self, error: MockError) -> Self
pub fn with_error(self, error: MockError) -> Self
Add an error return to a transaction.
This is used to mock failure behaviour.
Trait Implementations§
source§impl<T: Clone> Clone for Transaction<T>
impl<T: Clone> Clone for Transaction<T>
source§fn clone(&self) -> Transaction<T>
fn clone(&self) -> Transaction<T>
Returns a copy 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<T: Debug> Debug for Transaction<T>
impl<T: Debug> Debug for Transaction<T>
source§impl<T: PartialEq> PartialEq for Transaction<T>
impl<T: PartialEq> PartialEq for Transaction<T>
source§fn eq(&self, other: &Transaction<T>) -> bool
fn eq(&self, other: &Transaction<T>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<T: Eq> Eq for Transaction<T>
impl<T> StructuralEq for Transaction<T>
impl<T> StructuralPartialEq for Transaction<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for Transaction<T>where
T: RefUnwindSafe,
impl<T> Send for Transaction<T>where
T: Send,
impl<T> Sync for Transaction<T>where
T: Sync,
impl<T> Unpin for Transaction<T>where
T: Unpin,
impl<T> UnwindSafe for Transaction<T>where
T: UnwindSafe,
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