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