Function netsim::spawn::with_ether_iface
[−]
[src]
pub fn with_ether_iface<F, R>(
handle: &Handle,
iface: EtherIfaceBuilder,
func: F
) -> (JoinHandle<R>, EtherPlug) where
R: Send + 'static,
F: FnOnce() -> R + Send + 'static,
Spawn a function into a new network namespace with a network interface described by iface
.
Returns a JoinHandle
which can be used to join the spawned thread, along with a channel which
can be used to read/write ethernet frames to the spawned thread's interface.