pub struct EthernetDevice { /* private fields */ }Expand description
Ethernet device (placeholder for real hardware)
Implementations§
Source§impl EthernetDevice
impl EthernetDevice
pub fn new(name: String, mac: MacAddress) -> Self
Trait Implementations§
Source§impl NetworkDevice for EthernetDevice
impl NetworkDevice for EthernetDevice
Source§fn mac_address(&self) -> MacAddress
fn mac_address(&self) -> MacAddress
Get device MAC address
Source§fn capabilities(&self) -> DeviceCapabilities
fn capabilities(&self) -> DeviceCapabilities
Get device capabilities
Source§fn state(&self) -> DeviceState
fn state(&self) -> DeviceState
Get device state
Source§fn set_state(&mut self, state: DeviceState) -> Result<(), KernelError>
fn set_state(&mut self, state: DeviceState) -> Result<(), KernelError>
Set device state
Source§fn statistics(&self) -> DeviceStatistics
fn statistics(&self) -> DeviceStatistics
Get device statistics
Source§fn transmit(&mut self, packet: &Packet) -> Result<(), KernelError>
fn transmit(&mut self, packet: &Packet) -> Result<(), KernelError>
Transmit a packet
Source§fn receive(&mut self) -> Result<Option<Packet>, KernelError>
fn receive(&mut self) -> Result<Option<Packet>, KernelError>
Receive a packet (non-blocking)