Struct netsim::device::NatV4Builder
[−]
[src]
pub struct NatV4Builder { /* fields omitted */ }
A builder for NatV4
Methods
impl NatV4Builder
[src]
fn new() -> NatV4Builder
[src]
Start building an Ipv4 NAT
fn subnet(self, subnet: SubnetV4) -> NatV4Builder
[src]
Set the subnet used on the local side of the NAT. If left unset, a random subnet will be chosen.
fn get_subnet(&self) -> Option<SubnetV4>
[src]
Get the subnet set by the last call to subnet
(if any).
fn hair_pinning(self, hair_pinning: bool) -> NatV4Builder
[src]
Enable/disable hair-pinning.
fn forward_udp_port(self, port: u16, local_addr: SocketAddrV4) -> NatV4Builder
[src]
Manually forward a UDP port.
fn forward_tcp_port(self, port: u16, local_addr: SocketAddrV4) -> NatV4Builder
[src]
Manually forward a TCP port.
fn build(
self,
public_plug: Ipv4Plug,
private_plug: Ipv4Plug,
public_ip: Ipv4Addr
) -> NatV4
[src]
self,
public_plug: Ipv4Plug,
private_plug: Ipv4Plug,
public_ip: Ipv4Addr
) -> NatV4
Build the NAT
fn spawn(
self,
handle: &Handle,
public_plug: Ipv4Plug,
private_plug: Ipv4Plug,
public_ip: Ipv4Addr
)
[src]
self,
handle: &Handle,
public_plug: Ipv4Plug,
private_plug: Ipv4Plug,
public_ip: Ipv4Addr
)
Build the NAT, spawning it directly onto the tokio event loop.
Trait Implementations
impl Default for NatV4Builder
[src]
fn default() -> NatV4Builder
[src]
Returns the "default value" for a type. Read more