pub struct Runner<'d, const MTU: usize> { /* 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, const MTU: usize> Runner<'d, MTU>
impl<'d, const MTU: usize> Runner<'d, MTU>
Sourcepub fn split(self) -> (StateRunner<'d>, RxRunner<'d, MTU>, TxRunner<'d, MTU>)
pub fn split(self) -> (StateRunner<'d>, RxRunner<'d, MTU>, TxRunner<'d, MTU>)
Split the runner into separate runners for controlling state, rx and tx.
Sourcepub fn borrow_split(
&mut self,
) -> (StateRunner<'_>, RxRunner<'_, MTU>, TxRunner<'_, MTU>)
pub fn borrow_split( &mut self, ) -> (StateRunner<'_>, RxRunner<'_, MTU>, TxRunner<'_, MTU>)
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 async fn rx_buf(&mut self) -> &mut [u8]
pub async fn rx_buf(&mut self) -> &mut [u8]
Wait until there is space for more inbound packets and return a slice they can be copied into.
Sourcepub fn try_rx_buf(&mut self) -> Option<&mut [u8]>
pub fn try_rx_buf(&mut self) -> Option<&mut [u8]>
Check if there is space for more inbound packets right now.
Sourcepub fn poll_rx_buf(&mut self, cx: &mut Context<'_>) -> Poll<&mut [u8]>
pub fn poll_rx_buf(&mut self, cx: &mut Context<'_>) -> Poll<&mut [u8]>
Polling the inbound channel if there is space for packets.
Sourcepub fn rx_done(&mut self, len: usize)
pub fn rx_done(&mut self, len: usize)
Mark packet of len bytes as pushed to the inbound channel.
Sourcepub async fn tx_buf(&mut self) -> &mut [u8]
pub async fn tx_buf(&mut self) -> &mut [u8]
Wait until there is space for more outbound packets and return a slice they can be copied into.
Sourcepub fn try_tx_buf(&mut self) -> Option<&mut [u8]>
pub fn try_tx_buf(&mut self) -> Option<&mut [u8]>
Check if there is space for more outbound packets right now.
Sourcepub fn poll_tx_buf(&mut self, cx: &mut Context<'_>) -> Poll<&mut [u8]>
pub fn poll_tx_buf(&mut self, cx: &mut Context<'_>) -> Poll<&mut [u8]>
Polling the outbound channel if there is space for packets.