Struct embedded_hal_mock::eh1::pwm::Transaction
source · pub struct Transaction { /* private fields */ }
Available on crate feature
eh1
only.Expand description
MockPwm transaction
Implementations§
source§impl Transaction
impl Transaction
sourcepub fn new(kind: TransactionKind) -> Transaction
pub fn new(kind: TransactionKind) -> Transaction
Create a new PWM transaction
sourcepub fn max_duty_cycle(duty: u16) -> Transaction
pub fn max_duty_cycle(duty: u16) -> Transaction
Create a new TransactionKind::GetMaxDutyCycle
transaction for SetDutyCycle::max_duty_cycle
.
sourcepub fn set_duty_cycle(duty: u16) -> Transaction
pub fn set_duty_cycle(duty: u16) -> Transaction
Create a new TransactionKind::SetDutyCycle
transaction for SetDutyCycle::set_duty_cycle
.
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 behaviours.
Trait Implementations§
source§impl Clone for Transaction
impl Clone for Transaction
source§fn clone(&self) -> Transaction
fn clone(&self) -> Transaction
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 Debug for Transaction
impl Debug for Transaction
source§impl PartialEq for Transaction
impl PartialEq for Transaction
source§fn eq(&self, other: &Transaction) -> bool
fn eq(&self, other: &Transaction) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for Transaction
Auto Trait Implementations§
impl RefUnwindSafe for Transaction
impl Send for Transaction
impl Sync for Transaction
impl Unpin for Transaction
impl UnwindSafe for Transaction
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