pub struct DirectAddrInfo {
pub addr: SocketAddr,
pub latency: Option<Duration>,
pub last_control: Option<(Duration, ControlMsg)>,
pub last_payload: Option<Duration>,
pub last_alive: Option<Duration>,
pub sources: HashMap<Source, Duration>,
}
Expand description
Information about a direct address.
The direct addresses of an iroh-net node are those that could be used by other nodes to establish direct connectivity, depending on the network situation. Due to NAT configurations, for example, not all direct addresses of a node are usable by all peers.
Fields§
§addr: SocketAddr
The UDP address reported by the remote node.
latency: Option<Duration>
The latency to the remote node over this network path.
If there has never been any connectivity via this address no latency will be known.
last_control: Option<(Duration, ControlMsg)>
Last control message received by this node about this address.
This contains the elapsed duration since the control message was received and the kind of control message received at that time. Only the most recent control message is returned.
Note that ControlMsg::CallMeMaybe
is received via a relay path, while
ControlMsg::Ping
and ControlMsg::Pong
are received on the path to
DirectAddrInfo::addr
itself and thus convey very different information.
last_payload: Option<Duration>
Elapsed time since the last payload message was received on this network path.
This indicates how long ago a QUIC datagram was received from the remote node sent
from this DirectAddrInfo::addr
. It indicates the network path was in use to
transport payload data.
last_alive: Option<Duration>
Elapsed time since this network path was known to exist.
A network path is considered to exist only because the remote node advertised it. It may not mean the path is usable. However, if there was any communication with the remote node over this network path it also means the path exists.
The elapsed time since any confirmation of the path’s existence was received is
returned. If the remote node moved networks and no longer has this path, this could
be a long duration. If the path was added via Endpoint::add_node_addr
or some
node discovery the path may never have been known to exist.
sources: HashMap<Source, Duration>
A HashMap
of Source
s to Duration
s.
The Duration
indicates the elapsed time since this source last
recorded this address.
The Duration
will always indicate the most recent time the source
recorded this address.
Trait Implementations§
Source§impl Clone for DirectAddrInfo
impl Clone for DirectAddrInfo
Source§fn clone(&self) -> DirectAddrInfo
fn clone(&self) -> DirectAddrInfo
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for DirectAddrInfo
impl Debug for DirectAddrInfo
Source§impl<'de> Deserialize<'de> for DirectAddrInfo
impl<'de> Deserialize<'de> for DirectAddrInfo
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 PartialEq for DirectAddrInfo
impl PartialEq for DirectAddrInfo
Source§impl Serialize for DirectAddrInfo
impl Serialize for DirectAddrInfo
impl Eq for DirectAddrInfo
impl StructuralPartialEq for DirectAddrInfo
Auto Trait Implementations§
impl Freeze for DirectAddrInfo
impl RefUnwindSafe for DirectAddrInfo
impl Send for DirectAddrInfo
impl Sync for DirectAddrInfo
impl Unpin for DirectAddrInfo
impl UnwindSafe for DirectAddrInfo
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.