pub enum Source {
Saved,
Udp,
Relay,
App,
Discovery {
name: String,
},
NamedApp {
name: String,
},
}
Expand description
The origin or source through which an address associated with a remote node was discovered.
An aggregate of the Source
s of all the addresses of a node describe the
Source
s of the node itself.
A Source
helps track how and where an address was learned. Multiple
sources can be associated with a single address, if we have discovered this
address through multiple means.
Each time a NodeAddr
is added to the node map, usually through
crate::endpoint::Endpoint::add_node_addr_with_source
, a Source
must be supplied to indicate
how the address was obtained.
A Source
can describe a variety of places that an address or node was
discovered, such as a configured discovery service, the network itself
(if another node has reached out to us), or as a user supplied NodeAddr
.
Variants§
Saved
Address was loaded from the fs.
Udp
A node communicated with us first via UDP.
Relay
A node communicated with us first via relay.
App
Application layer added the address directly.
Discovery
The address was discovered by a discovery service.
Fields
NamedApp
Application layer with a specific name added the node directly.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Source
impl<'de> Deserialize<'de> for Source
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Source
impl StructuralPartialEq for Source
Auto Trait Implementations§
impl Freeze for Source
impl RefUnwindSafe for Source
impl Send for Source
impl Sync for Source
impl Unpin for Source
impl UnwindSafe for Source
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.