pub struct NetworkSwitch { /* private fields */ }Expand description
The L2 switch. Owns ports grouped by network, runs a forwarding loop.
Implementations§
Source§impl NetworkSwitch
impl NetworkSwitch
pub fn new() -> Self
Sourcepub fn add_port(
&self,
network_id: &str,
_label: &str,
) -> Result<VmSocketEndpoint>
pub fn add_port( &self, network_id: &str, _label: &str, ) -> Result<VmSocketEndpoint>
Add a port to a network. Returns the VM’s end of the socketpair fd.
Creates a Unix SOCK_DGRAM socketpair. One end is kept by the switch (for reading/writing Ethernet frames), the other is returned so the caller can pass it to VZFileHandleNetworkDeviceAttachment.
Trait Implementations§
Source§impl Default for NetworkSwitch
impl Default for NetworkSwitch
Auto Trait Implementations§
impl !Freeze for NetworkSwitch
impl RefUnwindSafe for NetworkSwitch
impl Send for NetworkSwitch
impl Sync for NetworkSwitch
impl Unpin for NetworkSwitch
impl UnsafeUnpin for NetworkSwitch
impl UnwindSafe for NetworkSwitch
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