Skip to main content

NetDevice

Trait NetDevice 

Source
pub trait NetDevice: Send + Sync {
    // Required methods
    fn mac(&self) -> [u8; 6];
    fn rx_len(&self) -> usize;
    fn recv_frame(&self) -> Option<Vec<u8>>;
    fn send_frame(&self, frame: &[u8]);
    fn shutdown(&self);
}
Expand description

Abstract L2 Ethernet device wired to wasm_driver_net_* inside a guest VM.

Required Methods§

Source

fn mac(&self) -> [u8; 6]

Source

fn rx_len(&self) -> usize

Source

fn recv_frame(&self) -> Option<Vec<u8>>

Source

fn send_frame(&self, frame: &[u8])

Source

fn shutdown(&self)

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§