pub trait NetworkDevice {
// Required methods
fn mac_address(&self) -> [u8; 6];
fn can_transmit(&self) -> bool;
fn can_receive(&self) -> bool;
fn transmit(&mut self, packet: &[u8]) -> Result<()>;
fn receive(&mut self, buffer: &mut [u8]) -> Result<Option<usize>>;
}Expand description
Unified network device interface MorpheusX drivers must implement.
Required Methods§
Sourcefn mac_address(&self) -> [u8; 6]
fn mac_address(&self) -> [u8; 6]
MAC address of the interface.
Sourcefn can_transmit(&self) -> bool
fn can_transmit(&self) -> bool
Whether the device has space to transmit a frame.
Sourcefn can_receive(&self) -> bool
fn can_receive(&self) -> bool
Whether the device has a frame ready to read.