pub enum PortMapping {
Off,
Auto,
Always,
}Expand description
Whether a tunnel asks this network’s router (PCP, NAT-PMP or UPnP) to map
its direct endpoint’s UDP port, so that a peer’s first packet gets in
where the NAT drops what it has not seen. A mapping never holds up a
session, is renewed while the tunnel runs and released when it stops,
and is ignored while the tunnel keeps to the relay;
TunnelDiagnostics::port_mapping says where it stands.
Variants§
Off
Never ask the router.
Auto
The default: ask only once a direct attempt of this tunnel has failed
to punch through, a sign that a NAT drops unsolicited packets; later
sessions then offer the mapped address. Where punching works, the
router is never asked. In a build without the port-mapping feature
there is nothing to ask with, and this is Off.
Always
Ask as soon as the tunnel’s direct endpoint opens. Needs the
port-mapping feature: a build without it refuses the tunnel.
Implementations§
Trait Implementations§
Source§impl Clone for PortMapping
impl Clone for PortMapping
Source§fn clone(&self) -> PortMapping
fn clone(&self) -> PortMapping
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for PortMapping
Source§impl Debug for PortMapping
impl Debug for PortMapping
Source§impl Default for PortMapping
impl Default for PortMapping
Source§fn default() -> PortMapping
fn default() -> PortMapping
Source§impl<'de> Deserialize<'de> for PortMapping
impl<'de> Deserialize<'de> for PortMapping
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<PortMapping, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<PortMapping, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for PortMapping
Source§impl PartialEq for PortMapping
impl PartialEq for PortMapping
Source§impl Serialize for PortMapping
impl Serialize for PortMapping
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for PortMapping
Auto Trait Implementations§
impl Freeze for PortMapping
impl RefUnwindSafe for PortMapping
impl Send for PortMapping
impl Sync for PortMapping
impl Unpin for PortMapping
impl UnsafeUnpin for PortMapping
impl UnwindSafe for PortMapping
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more