Struct NatInfo

Source
pub struct NatInfo {
    pub nat_type: NatType,
    pub public_ips: Vec<Ipv4Addr>,
    pub public_udp_ports: Vec<u16>,
    pub mapping_tcp_addr: Vec<SocketAddr>,
    pub mapping_udp_addr: Vec<SocketAddr>,
    pub public_port_range: u16,
    pub local_ipv4: Ipv4Addr,
    pub ipv6: Option<Ipv6Addr>,
    pub local_udp_ports: Vec<u16>,
    pub local_tcp_port: u16,
    pub public_tcp_port: u16,
}

Fields§

§nat_type: NatType

nat type of the network

§public_ips: Vec<Ipv4Addr>

the set of public Ipv4

§public_udp_ports: Vec<u16>

the set of public ports mapped from the nat

§mapping_tcp_addr: Vec<SocketAddr>

the set of mapped addresses where TCP serves on

§mapping_udp_addr: Vec<SocketAddr>

the set of mapped addresses where UDP serves on

§public_port_range: u16

The predicted range of public ports, it is used when the nat_type is symmetric

§local_ipv4: Ipv4Addr

local IP address

§ipv6: Option<Ipv6Addr>

The public IPv6 address

§local_udp_ports: Vec<u16>

The local ports where the UDP services bind

§local_tcp_port: u16

The local ports where the TCP services bind

§public_tcp_port: u16

The public port of TCP service, which works when there is either nat1 or no nat exists

Implementations§

Trait Implementations§

Source§

impl Clone for NatInfo

Source§

fn clone(&self) -> NatInfo

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for NatInfo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for NatInfo

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for NatInfo

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> FromRef<T> for U
where T: Clone, U: From<T>,

Source§

fn from_ref(val_ref: &T) -> U

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> RefInto<T> for U
where U: Into<T> + Clone,

Source§

fn ref_into(&self) -> T

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,