embassy-net-driver-channel

Crates

git

Versions

default

Flavors

Skip to main content

Runner

Struct Runner 

Source
pub struct Runner<'d> { /* private fields */ }
Expand description

Channel runner.

Holds the shared state and the lower end of channels for inbound and outbound packets.

Implementations§

Source§

impl<'d> Runner<'d>

Source

pub fn split(self) -> (StateRunner<'d>, RxRunner<'d>, TxRunner<'d>)

Split the runner into separate runners for controlling state, rx and tx.

Source

pub fn borrow_split(&mut self) -> (StateRunner<'_>, RxRunner<'_>, TxRunner<'_>)

Split the runner into separate runners for controlling state, rx and tx borrowing the underlying state.

Source

pub fn state_runner(&self) -> StateRunner<'d>

Create a state runner sharing the state channel.

Set the link state.

Source

pub fn set_hardware_address(&mut self, address: HardwareAddress)

Set the hardware address.

Source

pub async fn rx_ready(&mut self)

Wait until there is space in the inbound queue.

Source

pub fn poll_rx_ready(&mut self, cx: &mut Context<'_>) -> Poll<()>

Poll whether there is space in the inbound queue.

Source

pub async fn rx_buf(&mut self) -> PacketBuf

Wait for an empty buffer from the stack, to receive a packet into.

The buffer has zero length. Its capacity is the stack’s packet buffer size, which may be smaller than the MTU.

Push it back filled with rx, or drop it to give it back to the stack’s pool.

Source

pub fn try_rx_buf(&mut self) -> Option<PacketBuf>

Get an empty buffer from the stack, if there is one right now.

See rx_buf.

Source

pub fn poll_rx_buf(&mut self, cx: &mut Context<'_>) -> Poll<PacketBuf>

Poll for an empty buffer from the stack.

See rx_buf.

Source

pub async fn rx(&mut self, buf: PacketBuf)

Push a received packet to the stack, waiting for space in the inbound queue.

Source

pub fn try_rx(&mut self, buf: PacketBuf) -> Result<(), PacketBuf>

Push a received packet to the stack, if the inbound queue has space right now.

If it doesn’t, the buffer is handed back in the Err variant.

Source

pub async fn tx(&mut self) -> PacketBuf

Wait for a packet the stack wants to transmit.

Source

pub fn try_tx(&mut self) -> Option<PacketBuf>

Get a packet the stack wants to transmit, if there is one right now.

Source

pub fn poll_tx(&mut self, cx: &mut Context<'_>) -> Poll<PacketBuf>

Poll for a packet the stack wants to transmit.

Auto Trait Implementations§

§

impl<'d> !RefUnwindSafe for Runner<'d>

§

impl<'d> !Send for Runner<'d>

§

impl<'d> !Sync for Runner<'d>

§

impl<'d> !UnwindSafe for Runner<'d>

§

impl<'d> Freeze for Runner<'d>

§

impl<'d> Unpin for Runner<'d>

§

impl<'d> UnsafeUnpin for Runner<'d>

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 = !

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.