[−][src]Enum rust_ipv8::payloads::connectiontype::ConnectionType
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]
fn eq(&self, other: &ConnectionType) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.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]
U: From<T>,
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.
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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,