Skip to main content

Runner

Struct Runner 

Source
pub struct Runner<'a, TRX> { /* private fields */ }
Expand description

Long-running task that owns the radio. Spawn it once; call its Runner::run method, which never returns.

Implementations§

Source§

impl<'a, TRX: Transceiver> Runner<'a, TRX>

Source

pub async fn run(&mut self) -> !

Run forever. Intended to be spawned as an #[embassy_executor::task].

The body is select(tx_request_recv, trx.recv()) – whichever fires first wins, and the loser’s future is dropped. That’s safe by construction: trx.recv() hasn’t started any SPI work while sitting in RX, and tx_request.receive() is a passive channel poll. The radio is never left in a half-configured state.

Auto Trait Implementations§

§

impl<'a, TRX> !RefUnwindSafe for Runner<'a, TRX>

§

impl<'a, TRX> !Send for Runner<'a, TRX>

§

impl<'a, TRX> !Sync for Runner<'a, TRX>

§

impl<'a, TRX> !UnwindSafe for Runner<'a, TRX>

§

impl<'a, TRX> Freeze for Runner<'a, TRX>
where TRX: Freeze,

§

impl<'a, TRX> Unpin for Runner<'a, TRX>
where TRX: Unpin,

§

impl<'a, TRX> UnsafeUnpin for Runner<'a, TRX>
where TRX: UnsafeUnpin,

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

Source§

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.