pub struct DeviceTxToken<'a> { /* private fields */ }Expand description
TX token representing one outgoing frame from smoltcp.
The token borrows the device so it can enqueue the produced frame when smoltcp finishes writing into the provided buffer.
Trait Implementations§
Source§impl<'a> TxToken for DeviceTxToken<'a>
impl<'a> TxToken for DeviceTxToken<'a>
Source§fn consume<R, F>(self, len: usize, f: F) -> R
fn consume<R, F>(self, len: usize, f: F) -> R
Let smoltcp build one Ethernet frame and enqueue it for libkrun.
Flow:
smoltcp fills provided buffer
-> adapter enqueues frame into host_to_guest
-> sets frames_emitted
-> poll loop later wakes the Unix-stream writerThe queue push is the handoff point. After that, this adapter no longer owns the frame bytes; the frame writer thread eventually serializes them onto the libkrun Unix stream.
Source§fn set_meta(&mut self, meta: PacketMeta)
fn set_meta(&mut self, meta: PacketMeta)
The Packet ID to be associated with the frame to be transmitted by this
TxToken.Auto Trait Implementations§
impl<'a> !UnwindSafe for DeviceTxToken<'a>
impl<'a> Freeze for DeviceTxToken<'a>
impl<'a> RefUnwindSafe for DeviceTxToken<'a>
impl<'a> Send for DeviceTxToken<'a>
impl<'a> Sync for DeviceTxToken<'a>
impl<'a> Unpin for DeviceTxToken<'a>
impl<'a> UnsafeUnpin for DeviceTxToken<'a>
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