Trait netsim::node::ip::IpNode [−][src]
pub trait IpNode: Sized { type Output: Send + 'static; fn build(
self,
handle: &NetworkHandle,
ipv4_range: Option<Ipv4Range>,
ipv6_range: Option<Ipv6Range>
) -> (SpawnComplete<Self::Output>, IpPlug); }
An IpNode
describes a recipe for constructing a network when given the IP range that the
network should operate on. The functions in the node::ip
module return IpNode
s that you
can run as a network with the spawn::network_ip
function.
Associated Types
Required Methods
fn build(
self,
handle: &NetworkHandle,
ipv4_range: Option<Ipv4Range>,
ipv6_range: Option<Ipv6Range>
) -> (SpawnComplete<Self::Output>, IpPlug)
self,
handle: &NetworkHandle,
ipv4_range: Option<Ipv4Range>,
ipv6_range: Option<Ipv6Range>
) -> (SpawnComplete<Self::Output>, IpPlug)
Consume the IpNode
and build the network it describes. Returns a SpawnComplete
that
can be used to join the spawned thread and an IpPlug
that can be used to read-write
packets to the head node of the network.
Implementors
impl<N> IpNode for LatencyNode<N> where
N: IpNode, type Output = N::Output;impl<N> IpNode for PacketLossNode<N> where
N: IpNode, type Output = N::Output;impl<R, F> IpNode for MachineNode<F> where
R: Send + 'static,
F: FnOnce(Option<Ipv4Addr>, Option<Ipv6Addr>) -> R + Send + 'static, type Output = R;