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) -> RxSlot<'_, MTU>
pub async fn rx_buf(&mut self) -> RxSlot<'_, MTU>
Wait until there is space for more inbound packets and return a slot.
Sourcepub fn try_rx_buf(&mut self) -> Option<RxSlot<'_, MTU>>
pub fn try_rx_buf(&mut self) -> Option<RxSlot<'_, MTU>>
Check if there is space for more inbound packets right now.
Sourcepub fn poll_rx_buf(&mut self, cx: &mut Context<'_>) -> Poll<RxSlot<'_, MTU>>
pub fn poll_rx_buf(&mut self, cx: &mut Context<'_>) -> Poll<RxSlot<'_, MTU>>
Polling the inbound channel if there is space for packets.
Sourcepub async fn tx_buf(&mut self) -> TxSlot<'_, MTU>
pub async fn tx_buf(&mut self) -> TxSlot<'_, MTU>
Wait until there is space for more outbound packets and return a slot.
Sourcepub fn try_tx_buf(&mut self) -> Option<TxSlot<'_, MTU>>
pub fn try_tx_buf(&mut self) -> Option<TxSlot<'_, MTU>>
Check if there is space for more outbound packets right now.
Sourcepub fn poll_tx_buf(&mut self, cx: &mut Context<'_>) -> Poll<TxSlot<'_, MTU>>
pub fn poll_tx_buf(&mut self, cx: &mut Context<'_>) -> Poll<TxSlot<'_, MTU>>
Polling the outbound channel if there is space for packets.
Auto Trait Implementations§
impl<'d, const MTU: usize> Freeze for Runner<'d, MTU>
impl<'d, const MTU: usize> !RefUnwindSafe for Runner<'d, MTU>
impl<'d, const MTU: usize> !Send for Runner<'d, MTU>
impl<'d, const MTU: usize> !Sync for Runner<'d, MTU>
impl<'d, const MTU: usize> Unpin for Runner<'d, MTU>
impl<'d, const MTU: usize> !UnwindSafe for Runner<'d, MTU>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more