pub enum AddressType {
Relay,
Direct,
Unverified,
Lan,
}Expand description
Address classification for priority ordering and staleness eviction.
Priority: Relay > Direct > Unverified > Lan. The merge_typed_address
method uses this for insertion ordering and the eviction of excess
Lan / Unverified entries.
Variants§
Relay
Address through a MASQUE relay server (always reachable)
Direct
Direct public IP address verified reachable without NAT traversal
Unverified
Self-published observed external address whose reachability has not been confirmed by the local classifier. Published by cold-start nodes that have not yet accepted an unsolicited inbound handshake and have not yet acquired a relay. Dialers try these after Relay/Direct and before LAN-only fallback and must accept the possibility of a timeout.
Lan
LAN or other local-scope address. This reuses the old NATted
variant slot for wire compatibility with older nodes.
Implementations§
Source§impl AddressType
impl AddressType
Sourcepub const fn priority(self) -> u8
pub const fn priority(self) -> u8
Priority index for ordering addresses by type. Lower is preferred.
Relay (0) → Direct (1) → Unverified (2) → Lan (3).
Used by NodeInfo::merge_typed_address, KBucket::replace_node_addresses,
DHTNode::addresses_by_priority, and DhtNetworkManager::dialable_addresses_typed
to maintain a consistent ordering invariant.
Trait Implementations§
Source§impl Clone for AddressType
impl Clone for AddressType
Source§fn clone(&self) -> AddressType
fn clone(&self) -> AddressType
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 AddressType
Source§impl Debug for AddressType
impl Debug for AddressType
Source§impl<'de> Deserialize<'de> for AddressType
impl<'de> Deserialize<'de> for AddressType
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<AddressType, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<AddressType, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for AddressType
Source§impl From<AddressType> for PeerRouteKind
impl From<AddressType> for PeerRouteKind
Source§fn from(ty: AddressType) -> PeerRouteKind
fn from(ty: AddressType) -> PeerRouteKind
Source§impl PartialEq for AddressType
impl PartialEq for AddressType
Source§impl Serialize for AddressType
impl Serialize for AddressType
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 AddressType
Auto Trait Implementations§
impl Freeze for AddressType
impl RefUnwindSafe for AddressType
impl Send for AddressType
impl Sync for AddressType
impl Unpin for AddressType
impl UnsafeUnpin for AddressType
impl UnwindSafe for AddressType
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<'de, T> BorrowedRpcObject<'de> for 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§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