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>
impl<'d> Runner<'d>
Sourcepub fn split(self) -> (StateRunner<'d>, RxRunner<'d>, TxRunner<'d>)
pub fn split(self) -> (StateRunner<'d>, RxRunner<'d>, TxRunner<'d>)
Split the runner into separate runners for controlling state, rx and tx.
Sourcepub fn borrow_split(&mut self) -> (StateRunner<'_>, RxRunner<'_>, TxRunner<'_>)
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.
Sourcepub fn state_runner(&self) -> StateRunner<'d>
pub fn state_runner(&self) -> StateRunner<'d>
Create a state runner sharing the state channel.
Sourcepub fn set_link_state(&mut self, state: LinkState)
pub fn set_link_state(&mut self, state: LinkState)
Set the link state.
Sourcepub fn set_hardware_address(&mut self, address: HardwareAddress)
pub fn set_hardware_address(&mut self, address: HardwareAddress)
Set the hardware address.
Sourcepub fn poll_rx_ready(&mut self, cx: &mut Context<'_>) -> Poll<()>
pub fn poll_rx_ready(&mut self, cx: &mut Context<'_>) -> Poll<()>
Poll whether there is space in the inbound queue.
Sourcepub fn try_rx_buf(&mut self) -> Option<PacketBuf>
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.
Sourcepub fn poll_rx_buf(&mut self, cx: &mut Context<'_>) -> Poll<PacketBuf>
pub fn poll_rx_buf(&mut self, cx: &mut Context<'_>) -> Poll<PacketBuf>
Poll for an empty buffer from the stack.
See rx_buf.
Sourcepub async fn rx(&mut self, buf: PacketBuf)
pub async fn rx(&mut self, buf: PacketBuf)
Push a received packet to the stack, waiting for space in the inbound queue.
Sourcepub fn try_rx(&mut self, buf: PacketBuf) -> Result<(), PacketBuf>
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.