[][src]Enum rust_ipv8::payloads::connectiontype::ConnectionType

pub enum ConnectionType {
    PUBLIC,
    SYMMETRICNAT,
    UNKNOWN,
}

Sent as a member of a number of payloads like the IntroductionRequestPayload, in their flags fields.

NOTE: with IPv6 support, another connection type might be added to signify this.

Variants

PUBLIC

A Public connnection meaning: Easily reachable and no NAT Puncturing needed.

SYMMETRICNAT

The ConnectionType specifiying both parties being behind a NAT used to indicate NAT puncturing is required.

UNKNOWN

Fallback if connectiontype could not be determined or is not known.

Methods

impl ConnectionType[src]

pub fn encode(&self) -> (bool, bool)[src]

encodes a connection type into 2 booleans. Combinations are chosen semi-arbitrarily but are standardized. Booleans are used to go into a BITS field in a packet.

pub fn decode(bits: (bool, bool)) -> Self[src]

Decodes two booleans into the corresponding connection type as encoded with the above encode method.

Trait Implementations

impl PartialEq<ConnectionType> for ConnectionType[src]

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

impl Debug for ConnectionType[src]

Auto Trait Implementations

impl Unpin for ConnectionType

impl Sync for ConnectionType

impl Send for ConnectionType

impl RefUnwindSafe for ConnectionType

impl UnwindSafe for ConnectionType

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]