Struct netsim_embed_nat::Ipv4Nat [−][src]
An Ipv4 NAT.
Implementations
impl Ipv4Nat
[src]
pub fn new(
public_plug: Plug,
private_plug: Plug,
public_ip: Ipv4Addr,
subnet: Ipv4Range
) -> Self
[src]
public_plug: Plug,
private_plug: Plug,
public_ip: Ipv4Addr,
subnet: Ipv4Range
) -> Self
pub fn set_port_allocator<T: Clone + PortAllocator + 'static>(
&mut self,
port_allocator: T
)
[src]
&mut self,
port_allocator: T
)
Set the port allocator.
pub fn set_hair_pinning(&mut self, hair_pinning: bool)
[src]
Enable/disable hair-pinning.
pub fn forward_port(
&mut self,
port: u16,
local_addr: SocketAddrV4,
protocol: Protocol
)
[src]
&mut self,
port: u16,
local_addr: SocketAddrV4,
protocol: Protocol
)
Manually forward a port.
pub fn set_blacklist_unrecognized_addrs(
&mut self,
blacklist_unrecognized_addrs: bool
)
[src]
&mut self,
blacklist_unrecognized_addrs: bool
)
Causes the NAT to permanently block all traffic from an address A if it recieves traffic from A directed at an endpoint for which it doesn’t have a mapping.
pub fn set_restrict_endpoints(&mut self, restrict_endpoints: bool)
[src]
Only allow incoming traffic on a port from remote addresses that we have already sent data to from that port. Makes this a port-restricted NAT.
pub fn set_symmetric(&mut self, symmetric: bool)
[src]
Makes this NAT a symmetric NAT, meaning packets sent to different remote addresses from the same internal address will appear to originate from different external ports.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Ipv4Nat
impl Send for Ipv4Nat
impl !Sync for Ipv4Nat
impl Unpin for Ipv4Nat
impl !UnwindSafe for Ipv4Nat
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> FutureExt for T where
T: Future + ?Sized,
T: Future + ?Sized,
pub fn map<U, F>(self, f: F) -> Map<Self, F> where
F: FnOnce(Self::Output) -> U,
F: FnOnce(Self::Output) -> U,
pub fn map_into<U>(self) -> MapInto<Self, U> where
Self::Output: Into<U>,
Self::Output: Into<U>,
pub fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F> where
F: FnOnce(Self::Output) -> Fut,
Fut: Future,
F: FnOnce(Self::Output) -> Fut,
Fut: Future,
pub fn left_future<B>(self) -> Either<Self, B> where
B: Future<Output = Self::Output>,
B: Future<Output = Self::Output>,
pub fn right_future<A>(self) -> Either<A, Self> where
A: Future<Output = Self::Output>,
A: Future<Output = Self::Output>,
pub fn into_stream(self) -> IntoStream<Self>
pub fn flatten(self) -> Flatten<Self> where
Self::Output: Future,
Self::Output: Future,
pub fn flatten_stream(self) -> FlattenStream<Self> where
Self::Output: Stream,
Self::Output: Stream,
pub fn fuse(self) -> Fuse<Self>
pub fn inspect<F>(self, f: F) -> Inspect<Self, F> where
F: FnOnce(&Self::Output),
F: FnOnce(&Self::Output),
pub fn catch_unwind(self) -> CatchUnwind<Self> where
Self: UnwindSafe,
Self: UnwindSafe,
pub fn shared(self) -> Shared<Self> where
Self::Output: Clone,
Self::Output: Clone,
pub fn remote_handle(self) -> (Remote<Self>, RemoteHandle<Self::Output>)
pub fn boxed<'a>(
self
) -> Pin<Box<dyn Future<Output = Self::Output> + 'a + Send, Global>> where
Self: Send + 'a,
self
) -> Pin<Box<dyn Future<Output = Self::Output> + 'a + Send, Global>> where
Self: Send + 'a,
pub fn boxed_local<'a>(
self
) -> Pin<Box<dyn Future<Output = Self::Output> + 'a, Global>> where
Self: 'a,
self
) -> Pin<Box<dyn Future<Output = Self::Output> + 'a, Global>> where
Self: 'a,
pub fn unit_error(self) -> UnitError<Self>
pub fn never_error(self) -> NeverError<Self>
pub fn poll_unpin(&mut self, cx: &mut Context<'_>) -> Poll<Self::Output> where
Self: Unpin,
Self: Unpin,
pub fn now_or_never(self) -> Option<Self::Output>
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<F> IntoFuture for F where
F: Future,
[src]
F: Future,
type Output = <F as Future>::Output
into_future
)The output that the future will produce on completion.
type Future = F
into_future
)Which kind of future are we turning this into?
pub fn into_future(self) -> <F as IntoFuture>::Future
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,