pub struct RemoteInfo {
pub node_id: NodeId,
pub relay_url: Option<RelayUrlInfo>,
pub addrs: Vec<DirectAddrInfo>,
pub conn_type: ConnectionType,
pub latency: Option<Duration>,
pub last_used: Option<Duration>,
}
Expand description
Details about a remote iroh-net node which is known to this node.
Having details of a node does not mean it can be connected to, nor that it has ever been
connected to in the past. There are various reasons a node might be known: it could have
been manually added via Endpoint::add_node_addr
, it could have been added by some
discovery mechanism, the node could have contacted this node, etc.
Fields§
§node_id: NodeId
The globally unique identifier for this node.
relay_url: Option<RelayUrlInfo>
Relay server information, if available.
addrs: Vec<DirectAddrInfo>
The addresses at which this node might be reachable.
Some of these addresses might only be valid for networks we are not part of, but the remote node might be a part of.
conn_type: ConnectionType
The type of connection we have to the node, either direct or over relay.
latency: Option<Duration>
The latency of the current network path to the remote node.
last_used: Option<Duration>
Time elapsed time since last we have sent to or received from the node.
This is the duration since any data (payload or control messages) was sent or receive from the remote node. Note that sending to the remote node does not imply the remote node received anything.
Implementations§
Source§impl RemoteInfo
impl RemoteInfo
Sourcepub fn last_received(&self) -> Option<Duration>
pub fn last_received(&self) -> Option<Duration>
Get the duration since the last activity we received from this endpoint on any of its direct addresses.
Sourcepub fn has_send_address(&self) -> bool
pub fn has_send_address(&self) -> bool
Whether there is a possible known network path to the remote node.
Note that this does not provide any guarantees of whether any network path is usable.
Sourcepub fn sources(&self) -> Vec<(Source, Duration)>
pub fn sources(&self) -> Vec<(Source, Duration)>
Returns a deduplicated list of Source
s merged from all address in the RemoteInfo
.
Deduplication is on the (Source
, Duration
) tuple, so you will get multiple Source
s
for each Source
variant, if different addresses were discovered from the same Source
at different times.
The list is sorted from least to most recent Source
.
Trait Implementations§
Source§impl Clone for RemoteInfo
impl Clone for RemoteInfo
Source§fn clone(&self) -> RemoteInfo
fn clone(&self) -> RemoteInfo
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for RemoteInfo
impl Debug for RemoteInfo
Source§impl<'de> Deserialize<'de> for RemoteInfo
impl<'de> Deserialize<'de> for RemoteInfo
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>,
Source§impl From<RemoteInfo> for NodeAddr
impl From<RemoteInfo> for NodeAddr
Source§fn from(info: RemoteInfo) -> Self
fn from(info: RemoteInfo) -> Self
Source§impl PartialEq for RemoteInfo
impl PartialEq for RemoteInfo
Source§impl Serialize for RemoteInfo
impl Serialize for RemoteInfo
impl Eq for RemoteInfo
impl StructuralPartialEq for RemoteInfo
Auto Trait Implementations§
impl Freeze for RemoteInfo
impl RefUnwindSafe for RemoteInfo
impl Send for RemoteInfo
impl Sync for RemoteInfo
impl Unpin for RemoteInfo
impl UnwindSafe for RemoteInfo
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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.