pub struct NetDeviceAdapter {
device: Arc<dyn NetDevice>,
rx_buffer: [u8; 2048],
}Expand description
网络设备适配器,用于将NetDevice适配到smoltcp需要的Device trait
Fields§
§device: Arc<dyn NetDevice>§rx_buffer: [u8; 2048]Implementations§
Trait Implementations§
Source§impl Device for NetDeviceAdapter
impl Device for NetDeviceAdapter
type RxToken<'a> = NetRxToken<'a>
type TxToken<'a> = NetTxToken<'a>
Source§fn receive(
&mut self,
_timestamp: Instant,
) -> Option<(Self::RxToken<'_>, Self::TxToken<'_>)>
fn receive( &mut self, _timestamp: Instant, ) -> Option<(Self::RxToken<'_>, Self::TxToken<'_>)>
Construct a token pair consisting of one receive token and one transmit token. Read more
Source§fn transmit(&mut self, _timestamp: Instant) -> Option<Self::TxToken<'_>>
fn transmit(&mut self, _timestamp: Instant) -> Option<Self::TxToken<'_>>
Construct a transmit token. Read more
Source§fn capabilities(&self) -> DeviceCapabilities
fn capabilities(&self) -> DeviceCapabilities
Get a description of device capabilities.