Struct radio::mock::Transaction

source ·
pub struct Transaction<St, Reg, Ch, Inf, Irq, E> { /* private fields */ }
Expand description

Transactions describe interactions with a radio device

Implementations§

source§

impl<St, Reg, Ch, Inf, Irq, E> Transaction<St, Reg, Ch, Inf, Irq, E>

source

pub fn set_state(state: St, err: Option<E>) -> Self

Set the radio state

source

pub fn get_state(res: Result<St, E>) -> Self

Get the radio state

source

pub fn is_busy(res: Result<bool, E>) -> Self

Check whether radio is currently busy

source

pub fn set_register(reg: Reg, value: u8, err: Option<E>) -> Self

Set a radio register

source

pub fn get_register(res: Result<u8, E>) -> Self

Get a radio register

source

pub fn set_channel(ch: Ch, err: Option<E>) -> Self

Set a radio channel

source

pub fn set_power(power: i8, err: Option<E>) -> Self

Set radio power

source

pub fn start_transmit(data: Vec<u8>, err: Option<E>) -> Self

Start radio transmission

source

pub fn check_transmit(res: Result<bool, E>) -> Self

Check for transmission completed

source

pub fn start_receive(err: Option<E>) -> Self

Start radio reception

source

pub fn check_receive(restart: bool, res: Result<bool, E>) -> Self

Check for radio reception

source

pub fn get_received(res: Result<(Vec<u8>, Inf), E>) -> Self

Fetch received data and information

source

pub fn get_irq(clear: bool, res: Result<Irq, E>) -> Self

Fetch radio IRQs

source

pub fn poll_rssi(res: Result<i16, E>) -> Self

Poll for RSSI

source

pub fn delay_ns(ns: u32) -> Self

Delay for a certain time

Trait Implementations§

source§

impl<St: Clone, Reg: Clone, Ch: Clone, Inf: Clone, Irq: Clone, E: Clone> Clone for Transaction<St, Reg, Ch, Inf, Irq, E>

source§

fn clone(&self) -> Transaction<St, Reg, Ch, Inf, Irq, E>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<St: Debug, Reg: Debug, Ch: Debug, Inf: Debug, Irq: Debug, E: Debug> Debug for Transaction<St, Reg, Ch, Inf, Irq, E>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<St: PartialEq, Reg: PartialEq, Ch: PartialEq, Inf: PartialEq, Irq: PartialEq, E: PartialEq> PartialEq for Transaction<St, Reg, Ch, Inf, Irq, E>

source§

fn eq(&self, other: &Transaction<St, Reg, Ch, Inf, Irq, E>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<St, Reg, Ch, Inf, Irq, E> StructuralPartialEq for Transaction<St, Reg, Ch, Inf, Irq, E>

Auto Trait Implementations§

§

impl<St, Reg, Ch, Inf, Irq, E> Freeze for Transaction<St, Reg, Ch, Inf, Irq, E>
where St: Freeze, Reg: Freeze, Ch: Freeze, Irq: Freeze, Inf: Freeze, E: Freeze,

§

impl<St, Reg, Ch, Inf, Irq, E> RefUnwindSafe for Transaction<St, Reg, Ch, Inf, Irq, E>

§

impl<St, Reg, Ch, Inf, Irq, E> Send for Transaction<St, Reg, Ch, Inf, Irq, E>
where St: Send, Reg: Send, Ch: Send, Irq: Send, Inf: Send, E: Send,

§

impl<St, Reg, Ch, Inf, Irq, E> Sync for Transaction<St, Reg, Ch, Inf, Irq, E>
where St: Sync, Reg: Sync, Ch: Sync, Irq: Sync, Inf: Sync, E: Sync,

§

impl<St, Reg, Ch, Inf, Irq, E> Unpin for Transaction<St, Reg, Ch, Inf, Irq, E>
where St: Unpin, Reg: Unpin, Ch: Unpin, Irq: Unpin, Inf: Unpin, E: Unpin,

§

impl<St, Reg, Ch, Inf, Irq, E> UnwindSafe for Transaction<St, Reg, Ch, Inf, Irq, E>
where St: UnwindSafe, Reg: UnwindSafe, Ch: UnwindSafe, Irq: UnwindSafe, Inf: UnwindSafe, E: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.