pub enum ConnectionType {
+ConnectionType in iroh::endpoint - Rust pub enum ConnectionType {
Direct(SocketAddr),
Relay(RelayUrl),
Mixed(SocketAddr, RelayUrl),
@@ -10,10 +10,10 @@
This is the case if we do have a UDP address, but are missing a recent confirmation that
the address works.
§None
We have no verified connection to this PublicKey
-Trait Implementations§
Source§impl Clone for ConnectionType
impl Clone for ConnectionType
Source§fn clone(&self) -> ConnectionType
fn clone(&self) -> ConnectionType
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ConnectionType
impl Debug for ConnectionType
Source§impl Default for ConnectionType
impl Default for ConnectionType
Source§fn default() -> ConnectionType
fn default() -> ConnectionType
Source§impl<'de> Deserialize<'de> for ConnectionType
impl<'de> Deserialize<'de> for ConnectionType
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 Display for ConnectionType
impl Display for ConnectionType
Source§impl PartialEq for ConnectionType
impl PartialEq for ConnectionType
Source§impl Serialize for ConnectionType
impl Serialize for ConnectionType
impl Eq for ConnectionType
impl StructuralPartialEq for ConnectionType
Auto Trait Implementations§
impl Freeze for ConnectionType
impl RefUnwindSafe for ConnectionType
impl Send for ConnectionType
impl Sync for ConnectionType
impl Unpin for ConnectionType
impl UnwindSafe for ConnectionType
Blanket Implementations§
Trait Implementations§
Source§impl Clone for ConnectionType
impl Clone for ConnectionType
Source§fn clone(&self) -> ConnectionType
fn clone(&self) -> ConnectionType
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ConnectionType
impl Debug for ConnectionType
Source§impl Default for ConnectionType
impl Default for ConnectionType
Source§fn default() -> ConnectionType
fn default() -> ConnectionType
Source§impl<'de> Deserialize<'de> for ConnectionType
impl<'de> Deserialize<'de> for ConnectionType
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 Display for ConnectionType
impl Display for ConnectionType
Source§impl PartialEq for ConnectionType
impl PartialEq for ConnectionType
Source§impl Serialize for ConnectionType
impl Serialize for ConnectionType
impl Eq for ConnectionType
impl StructuralPartialEq for ConnectionType
Auto Trait Implementations§
impl Freeze for ConnectionType
impl RefUnwindSafe for ConnectionType
impl Send for ConnectionType
impl Sync for ConnectionType
impl Unpin for ConnectionType
impl UnwindSafe for ConnectionType
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
fn implicit(
diff --git a/pr/3398/docs/iroh/endpoint/enum.ControlMsg.html b/pr/3398/docs/iroh/endpoint/enum.ControlMsg.html
index b391973c8b..744f86da63 100644
--- a/pr/3398/docs/iroh/endpoint/enum.ControlMsg.html
+++ b/pr/3398/docs/iroh/endpoint/enum.ControlMsg.html
@@ -1,4 +1,4 @@
-ControlMsg in iroh::endpoint - Rust pub enum ControlMsg {
+ControlMsg in iroh::endpoint - Rust pub enum ControlMsg {
Ping,
Pong,
CallMeMaybe,
@@ -6,10 +6,10 @@
Variants§
§Ping
We received a Ping from the node.
§Pong
We received a Pong from the node.
§CallMeMaybe
We received a CallMeMaybe.
-Trait Implementations§
Source§impl Clone for ControlMsg
Source§fn clone(&self) -> ControlMsg
Returns a copy of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for ControlMsg
Source§impl<'de> Deserialize<'de> for ControlMsg
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Display for ControlMsg
Source§impl PartialEq for ControlMsg
Source§impl Serialize for ControlMsg
Source§impl Copy for ControlMsg
Source§impl Eq for ControlMsg
Source§impl StructuralPartialEq for ControlMsg
Auto Trait Implementations§
§impl Freeze for ControlMsg
§impl RefUnwindSafe for ControlMsg
§impl Send for ControlMsg
§impl Sync for ControlMsg
§impl Unpin for ControlMsg
§impl UnwindSafe for ControlMsg
Blanket Implementations§
Trait Implementations§
Source§impl Clone for ControlMsg
Source§fn clone(&self) -> ControlMsg
Returns a copy of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for ControlMsg
Source§impl<'de> Deserialize<'de> for ControlMsg
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Display for ControlMsg
Source§impl PartialEq for ControlMsg
Source§impl Serialize for ControlMsg
Source§impl Copy for ControlMsg
Source§impl Eq for ControlMsg
Source§impl StructuralPartialEq for ControlMsg
Auto Trait Implementations§
§impl Freeze for ControlMsg
§impl RefUnwindSafe for ControlMsg
§impl Send for ControlMsg
§impl Sync for ControlMsg
§impl Unpin for ControlMsg
§impl UnwindSafe for ControlMsg
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3398/docs/iroh/endpoint/struct.DirectAddrInfo.html b/pr/3398/docs/iroh/endpoint/struct.DirectAddrInfo.html
index e22a8c9c7b..ab7faf4e9b 100644
--- a/pr/3398/docs/iroh/endpoint/struct.DirectAddrInfo.html
+++ b/pr/3398/docs/iroh/endpoint/struct.DirectAddrInfo.html
@@ -1,4 +1,4 @@
-DirectAddrInfo in iroh::endpoint - Rust pub struct DirectAddrInfo {
+DirectAddrInfo in iroh::endpoint - Rust pub struct DirectAddrInfo {
pub addr: SocketAddr,
pub latency: Option<Duration>,
pub last_control: Option<(Duration, ControlMsg)>,
@@ -36,10 +36,10 @@ node discovery the path may never have been known to exist.
recorded this address.
The Duration will always indicate the most recent time the source
recorded this address.
-
Trait Implementations§
Source§impl Clone for DirectAddrInfo
Source§fn clone(&self) -> DirectAddrInfo
Returns a copy of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for DirectAddrInfo
Source§impl<'de> Deserialize<'de> for DirectAddrInfo
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl PartialEq for DirectAddrInfo
Source§impl Serialize for DirectAddrInfo
Source§impl Eq for DirectAddrInfo
Source§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<T> Any for Twhere
+Trait Implementations§
Source§impl Clone for DirectAddrInfo
Source§fn clone(&self) -> DirectAddrInfo
Returns a copy of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for DirectAddrInfo
Source§impl<'de> Deserialize<'de> for DirectAddrInfo
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl PartialEq for DirectAddrInfo
Source§impl Serialize for DirectAddrInfo
Source§impl Eq for DirectAddrInfo
Source§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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3398/docs/iroh/endpoint/struct.RemoteInfo.html b/pr/3398/docs/iroh/endpoint/struct.RemoteInfo.html
index 591bd1e94d..934748182c 100644
--- a/pr/3398/docs/iroh/endpoint/struct.RemoteInfo.html
+++ b/pr/3398/docs/iroh/endpoint/struct.RemoteInfo.html
@@ -1,4 +1,4 @@
-RemoteInfo in iroh::endpoint - Rust pub struct RemoteInfo {
+RemoteInfo in iroh::endpoint - Rust pub struct RemoteInfo {
pub node_id: NodeId,
pub relay_url: Option<RelayUrlInfo>,
pub addrs: Vec<DirectAddrInfo>,
@@ -21,20 +21,20 @@ node might be a part of.
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
Sourcepub fn last_received(&self) -> Option<Duration>
Get the duration since the last activity we received from this endpoint
+
Implementations§
Source§impl RemoteInfo
Sourcepub 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
Whether there is a possible known network path to the remote node.
+Sourcepub 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)>
Returns a deduplicated list of Sources merged from all address in the RemoteInfo.
+Sourcepub fn sources(&self) -> Vec<(Source, Duration)>
Returns a deduplicated list of Sources merged from all address in the RemoteInfo.
Deduplication is on the (Source, Duration) tuple, so you will get multiple Sources
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
Source§fn clone(&self) -> RemoteInfo
Returns a copy of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for RemoteInfo
Source§impl<'de> Deserialize<'de> for RemoteInfo
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl From<RemoteInfo> for NodeAddr
Source§fn from(info: RemoteInfo) -> Self
Converts to this type from the input type.Source§impl PartialEq for RemoteInfo
Source§impl Serialize for RemoteInfo
Source§impl Eq for RemoteInfo
Source§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§
Trait Implementations§
Source§impl Clone for RemoteInfo
Source§fn clone(&self) -> RemoteInfo
Returns a copy of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for RemoteInfo
Source§impl<'de> Deserialize<'de> for RemoteInfo
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl From<RemoteInfo> for NodeAddr
Source§fn from(info: RemoteInfo) -> Self
Converts to this type from the input type.Source§impl PartialEq for RemoteInfo
Source§impl Serialize for RemoteInfo
Source§impl Eq for RemoteInfo
Source§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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3398/docs/iroh/struct.NodeAddr.html b/pr/3398/docs/iroh/struct.NodeAddr.html
index 7a53def369..a23c41d0d0 100644
--- a/pr/3398/docs/iroh/struct.NodeAddr.html
+++ b/pr/3398/docs/iroh/struct.NodeAddr.html
@@ -45,7 +45,7 @@ whenever a connection to other nodes needs to be established.
__deserializer: __D,
) -> Result<NodeAddr, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl From<NodeTicket> for NodeAddr
Source§fn from(ticket: NodeTicket) -> NodeAddr
Returns the addressing info from given ticket.
-Source§impl From<RemoteInfo> for NodeAddr
Source§fn from(info: RemoteInfo) -> Self
Converts to this type from the input type.Source§impl From<RemoteInfo> for NodeAddr
Source§fn from(info: RemoteInfo) -> Self
Converts to this type from the input type.Source§impl Ord for NodeAddr
Source§impl PartialEq for NodeAddr
Source§fn eq(&self, other: &NodeAddr) -> bool
Tests for self and other values to be equal, and is used by ==.1.0.0 · Source§fn ne(&self, other: &Rhs) -> bool
Tests for !=. The default implementation is almost always sufficient,
diff --git a/pr/3398/docs/iroh_bench/enum.ConnectionSelector.html b/pr/3398/docs/iroh_bench/enum.ConnectionSelector.html
index 03ed6eab6a..f3e2a84416 100644
--- a/pr/3398/docs/iroh_bench/enum.ConnectionSelector.html
+++ b/pr/3398/docs/iroh_bench/enum.ConnectionSelector.html
@@ -1,7 +1,7 @@
ConnectionSelector in iroh_bench - Rust pub enum ConnectionSelector {
- Iroh(Connection),
+ Iroh(Connection),
Quinn(Connection),
-}
Variants§
Implementations§
Auto Trait Implementations§
§impl Freeze for ConnectionSelector
§impl RefUnwindSafe for ConnectionSelector
§impl Send for ConnectionSelector
§impl Sync for ConnectionSelector
§impl Unpin for ConnectionSelector
§impl UnwindSafe for ConnectionSelector
Blanket Implementations§
Source§impl<T> Any for Twhere
+}Variants§
§Iroh(Connection)
§Quinn(Connection)
Implementations§
Auto Trait Implementations§
§impl Freeze for ConnectionSelector
§impl RefUnwindSafe for ConnectionSelector
§impl Send for ConnectionSelector
§impl Sync for ConnectionSelector
§impl Unpin for ConnectionSelector
§impl UnwindSafe for ConnectionSelector
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3398/docs/iroh_bench/enum.EndpointSelector.html b/pr/3398/docs/iroh_bench/enum.EndpointSelector.html
index 2160ad6f51..78f5e53f71 100644
--- a/pr/3398/docs/iroh_bench/enum.EndpointSelector.html
+++ b/pr/3398/docs/iroh_bench/enum.EndpointSelector.html
@@ -1,7 +1,7 @@
EndpointSelector in iroh_bench - Rust pub enum EndpointSelector {
- Iroh(Endpoint),
+ Iroh(Endpoint),
Quinn(Endpoint),
-}
Variants§
Implementations§
Auto Trait Implementations§
§impl Freeze for EndpointSelector
§impl !RefUnwindSafe for EndpointSelector
§impl Send for EndpointSelector
§impl Sync for EndpointSelector
§impl Unpin for EndpointSelector
§impl !UnwindSafe for EndpointSelector
Blanket Implementations§
Source§impl<T> Any for Twhere
+}Variants§
Implementations§
Auto Trait Implementations§
§impl Freeze for EndpointSelector
§impl !RefUnwindSafe for EndpointSelector
§impl Send for EndpointSelector
§impl Sync for EndpointSelector
§impl Unpin for EndpointSelector
§impl !UnwindSafe for EndpointSelector
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3398/docs/iroh_bench/iroh/fn.connect_client.html b/pr/3398/docs/iroh_bench/iroh/fn.connect_client.html
index c49257b256..0d80c4eae2 100644
--- a/pr/3398/docs/iroh_bench/iroh/fn.connect_client.html
+++ b/pr/3398/docs/iroh_bench/iroh/fn.connect_client.html
@@ -2,5 +2,5 @@
server_addr: NodeAddr,
relay_url: Option<RelayUrl>,
opt: Opt,
-) -> Result<(Endpoint, Connection)>Expand description
Create a client endpoint and client connection
+) -> Result<(Endpoint, Connection)>Expand description
Create a client endpoint and client connection
\ No newline at end of file
diff --git a/pr/3398/docs/iroh_bench/iroh/fn.handle_client_stream.html b/pr/3398/docs/iroh_bench/iroh/fn.handle_client_stream.html
index ccef33db3e..d0586fbba4 100644
--- a/pr/3398/docs/iroh_bench/iroh/fn.handle_client_stream.html
+++ b/pr/3398/docs/iroh_bench/iroh/fn.handle_client_stream.html
@@ -1,5 +1,5 @@
handle_client_stream in iroh_bench::iroh - Rust pub async fn handle_client_stream(
- connection: &Connection,
+ connection: &Connection,
upload_size: u64,
read_unordered: bool,
) -> Result<(TransferResult, TransferResult)>
\ No newline at end of file
diff --git a/pr/3398/docs/iroh_bench/iroh/fn.server.html b/pr/3398/docs/iroh_bench/iroh/fn.server.html
index 1a9b97acaa..9db7b08607 100644
--- a/pr/3398/docs/iroh_bench/iroh/fn.server.html
+++ b/pr/3398/docs/iroh_bench/iroh/fn.server.html
@@ -1,2 +1,2 @@
-server in iroh_bench::iroh - Rust pub async fn server(endpoint: Endpoint, opt: Opt) -> Result<()>
Expand description
Take the provided endpoint and run the server
+server in iroh_bench::iroh - Rust
\ No newline at end of file
diff --git a/pr/3398/docs/iroh_bench/iroh/fn.server_endpoint.html b/pr/3398/docs/iroh_bench/iroh/fn.server_endpoint.html
index 2de49dd53e..2fa138cdd8 100644
--- a/pr/3398/docs/iroh_bench/iroh/fn.server_endpoint.html
+++ b/pr/3398/docs/iroh_bench/iroh/fn.server_endpoint.html
@@ -2,5 +2,5 @@
rt: &Runtime,
relay_url: &Option<RelayUrl>,
opt: &Opt,
-) -> (NodeAddr, Endpoint)Expand description
Creates a server endpoint which runs on the given runtime
+) -> (NodeAddr, Endpoint)Expand description
Creates a server endpoint which runs on the given runtime
\ No newline at end of file
diff --git a/pr/3398/docs/iroh_relay/client/enum.ReceivedMessage.html b/pr/3398/docs/iroh_relay/client/enum.ReceivedMessage.html
index dd7a047aae..71c9ae3d55 100644
--- a/pr/3398/docs/iroh_relay/client/enum.ReceivedMessage.html
+++ b/pr/3398/docs/iroh_relay/client/enum.ReceivedMessage.html
@@ -1,9 +1,9 @@
ReceivedMessage in iroh_relay::client - Rust pub enum ReceivedMessage {
ReceivedPacket {
- remote_node_id: NodeId,
+ remote_node_id: NodeId,
data: Bytes,
},
- NodeGone(NodeId),
+ NodeGone(NodeId),
Ping([u8; 8]),
Pong([u8; 8]),
KeepAlive,
@@ -17,9 +17,9 @@
}
Expand description
The messages received from a framed relay stream.
This is a type-validated version of the Frames on the RelayCodec.
Variants§
§ReceivedPacket
Represents an incoming packet.
-Fields
§NodeGone(NodeId)
Indicates that the client identified by the underlying public key had previously sent you a
packet but has now disconnected from the server.
§Ping([u8; 8])
Request from a client or server to reply to the
other side with a ReceivedMessage::Pong with the given payload.
diff --git a/pr/3398/docs/iroh_relay/client/enum.SendMessage.html b/pr/3398/docs/iroh_relay/client/enum.SendMessage.html
index 30fa0d203b..aeeafe0b83 100644
--- a/pr/3398/docs/iroh_relay/client/enum.SendMessage.html
+++ b/pr/3398/docs/iroh_relay/client/enum.SendMessage.html
@@ -1,9 +1,9 @@
SendMessage in iroh_relay::client - Rust pub enum SendMessage {
- SendPacket(NodeId, Bytes),
+ SendPacket(NodeId, Bytes),
Ping([u8; 8]),
Pong([u8; 8]),
}
Expand description
Messages we can send to a relay server.
-Variants§
§SendPacket(NodeId, Bytes)
Send a packet of data to the [NodeId].
+Variants§
§SendPacket(NodeId, Bytes)
Send a packet of data to the NodeId.
§Ping([u8; 8])
Sends a ping message to the connected relay server.
§Pong([u8; 8])
Sends a pong message to the connected relay server.
Trait Implementations§
Source§impl Debug for SendMessage
Source§impl Sink<SendMessage> for Client
Source§type Error = ConnSendError
The type of value produced by the sink when an error occurs.Source§fn poll_ready(
diff --git a/pr/3398/docs/iroh_relay/client/struct.ClientBuilder.html b/pr/3398/docs/iroh_relay/client/struct.ClientBuilder.html
index 52065d31c7..fc3c3ebe05 100644
--- a/pr/3398/docs/iroh_relay/client/struct.ClientBuilder.html
+++ b/pr/3398/docs/iroh_relay/client/struct.ClientBuilder.html
@@ -1,7 +1,7 @@
ClientBuilder in iroh_relay::client - Rust pub struct ClientBuilder { /* private fields */ }
Expand description
Build a Client.
Implementations§
Source§impl ClientBuilder
Sourcepub fn new(
- url: impl Into<RelayUrl>,
- secret_key: SecretKey,
+ url: impl Into<RelayUrl>,
+ secret_key: SecretKey,
dns_resolver: DnsResolver,
) -> Self
Create a new ClientBuilder
Sourcepub fn protocol(self, protocol: Protocol) -> Self
Sets whether to connect to the relay via websockets or not.
diff --git a/pr/3398/docs/iroh_relay/dns/struct.DnsResolver.html b/pr/3398/docs/iroh_relay/dns/struct.DnsResolver.html
index c58227f1a6..b1f9a86539 100644
--- a/pr/3398/docs/iroh_relay/dns/struct.DnsResolver.html
+++ b/pr/3398/docs/iroh_relay/dns/struct.DnsResolver.html
@@ -67,9 +67,9 @@ at T+0ms, T+200ms and T+300ms. The timeout is applied as stated in
summary of all errors otherwise.
Sourcepub async fn lookup_node_by_id(
&self,
- node_id: &NodeId,
+ node_id: &NodeId,
origin: &str,
-) -> Result<NodeInfo>
Looks up node info by [NodeId] and origin domain name.
+) -> Result<NodeInfo>Looks up node info by NodeId and origin domain name.
To lookup nodes that published their node info to the DNS servers run by n0,
pass N0_DNS_NODE_ORIGIN_PROD as origin.
Sourcepub async fn lookup_node_by_domain_name(&self, name: &str) -> Result<NodeInfo>
Looks up node info by DNS name.
@@ -84,10 +84,10 @@ at T+0ms, T+200ms and T+300ms. The result of the first successful call is return
summary of all errors otherwise.
Sourcepub async fn lookup_node_by_id_staggered(
&self,
- node_id: &NodeId,
+ node_id: &NodeId,
origin: &str,
delays_ms: &[u64],
-) -> Result<NodeInfo>
Looks up node info by [NodeId] and origin domain name.
+) -> Result<NodeInfo>Looks up node info by NodeId and origin domain name.
From the moment this function is called, each lookup is scheduled after the delays in
delays_ms with the first call being done immediately. [200ms, 300ms] results in calls
at T+0ms, T+200ms and T+300ms. The result of the first successful call is returned, or a
diff --git a/pr/3398/docs/iroh_relay/index.html b/pr/3398/docs/iroh_relay/index.html
index 01d8ad04d6..72458b94e1 100644
--- a/pr/3398/docs/iroh_relay/index.html
+++ b/pr/3398/docs/iroh_relay/index.html
@@ -25,6 +25,6 @@ Tailscale.
STUN support and expose metrics.
-Re-exports§
pub use protos::relay::MAX_PACKET_SIZE;
Modules§
- Exposes
Client, which allows to establish connections to a relay server. - Default values used in the relay.
- dns
Non-wasm_browser DNS resolver - HTTP-specific constants for the relay server and client.
- Support for handling DNS resource records for dialing by [
NodeId]. - Protocols used by the iroh-relay
- Create a QUIC server that accepts connections
+
Re-exports§
pub use protos::relay::MAX_PACKET_SIZE;
Modules§
- Exposes
Client, which allows to establish connections to a relay server. - Default values used in the relay.
- dns
Non-wasm_browser DNS resolver - HTTP-specific constants for the relay server and client.
- Support for handling DNS resource records for dialing by
NodeId. - Protocols used by the iroh-relay
- Create a QUIC server that accepts connections
for QUIC address discovery.
- server
server A fully-fledged iroh-relay server over HTTP or HTTPS.
Structs§
- Tracks pings on a single relay connection.
- Configuration of all the relay servers that can be used.
- Information on a specific relay server.
- Configuration for speaking to the QUIC endpoint on the relay
server to do QUIC address discovery.
\ No newline at end of file
diff --git a/pr/3398/docs/iroh_relay/node_info/index.html b/pr/3398/docs/iroh_relay/node_info/index.html
index 893e7d3beb..647a6906b2 100644
--- a/pr/3398/docs/iroh_relay/node_info/index.html
+++ b/pr/3398/docs/iroh_relay/node_info/index.html
@@ -1,5 +1,5 @@
-iroh_relay::node_info - Rust Expand description
Support for handling DNS resource records for dialing by [NodeId].
-Dialing by [NodeId] is supported by iroh nodes publishing Pkarr records to DNS
+
iroh_relay::node_info - Rust Expand description
Support for handling DNS resource records for dialing by NodeId.
+Dialing by NodeId is supported by iroh nodes publishing Pkarr records to DNS
servers or the Mainline DHT. This module supports creating and parsing these records.
DNS records are published under the following names:
_iroh.<z32-node-id>.<origin-domain> TXT
@@ -8,7 +8,7 @@ servers or the Mainline DHT. This module supports creating and parsing these re
_iroh is the record name as defined by IROH_TXT_NAME.
-<z32-node-id> is the z-base-32 encoding of the [NodeId].
+
<origin-domain> is the domain name of the publishing DNS server,
@@ -23,12 +23,12 @@ servers or the Mainline DHT. This module supports creating and parsing these re
in RFC1464. The following attributes are defined:
- Structs§
- Error returned when an input value is too long for
UserData. - Data about a node that may be published to and resolved from discovery services.
- Information about a node that may be published to and resolved from discovery services.
- Under the hood this is a UTF-8 String is no longer than
UserData::MAX_LENGTH bytes.
Constants§
- The DNS name for the iroh TXT record.
Traits§
- Extension methods for [
NodeId] to encode to and decode from [z32],
+Structs§
- Error returned when an input value is too long for
UserData. - Data about a node that may be published to and resolved from discovery services.
- Information about a node that may be published to and resolved from discovery services.
- Under the hood this is a UTF-8 String is no longer than
UserData::MAX_LENGTH bytes.
Constants§
- The DNS name for the iroh TXT record.
Traits§
- Extension methods for
NodeId to encode to and decode from [z32],
which is the encoding used in [pkarr] domain names.
\ No newline at end of file
diff --git a/pr/3398/docs/iroh_relay/node_info/struct.NodeData.html b/pr/3398/docs/iroh_relay/node_info/struct.NodeData.html
index 2228868b94..4e4cd88141 100644
--- a/pr/3398/docs/iroh_relay/node_info/struct.NodeData.html
+++ b/pr/3398/docs/iroh_relay/node_info/struct.NodeData.html
@@ -1,20 +1,20 @@
NodeData in iroh_relay::node_info - Rust pub struct NodeData { /* private fields */ }
Expand description
Data about a node that may be published to and resolved from discovery services.
-This includes an optional [RelayUrl], a set of direct addresses, and the optional
+
This includes an optional RelayUrl, a set of direct addresses, and the optional
UserData, a string that can be set by applications and is not parsed or used by iroh
itself.
-This struct does not include the node’s [NodeId], only the data about a certain
-node. See NodeInfo for a struct that contains a [NodeId] with associated NodeData.
+This struct does not include the node’s NodeId, only the data about a certain
+node. See NodeInfo for a struct that contains a NodeId with associated NodeData.
Implementations§
Source§impl NodeData
Sourcepub fn new(
- relay_url: Option<RelayUrl>,
+ relay_url: Option<RelayUrl>,
direct_addresses: BTreeSet<SocketAddr>,
) -> Self
Creates a new NodeData with a relay URL and a set of direct addresses.
-Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> Self
Sets the relay URL and returns the updated node data.
+Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> Self
Sets the relay URL and returns the updated node data.
Sourcepub fn with_direct_addresses(
self,
direct_addresses: BTreeSet<SocketAddr>,
) -> Self
Sets the direct addresses and returns the updated node data.
Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> Self
Sets the user-defined data and returns the updated node data.
-Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the node.
Sourcepub fn direct_addresses(&self) -> &BTreeSet<SocketAddr>
Returns the direct addresses of the node.
Sourcepub fn clear_direct_addresses(&mut self)
Removes all direct addresses from the node data.
@@ -22,9 +22,9 @@ node. See IntoIterator<Item = SocketAddr>,
)Adds direct addresses to the node data.
-Sourcepub fn set_relay_url(&mut self, relay_url: Option<RelayUrl>)
Sets the relay URL of the node data.
+Sourcepub fn set_relay_url(&mut self, relay_url: Option<RelayUrl>)
Sets the relay URL of the node data.
Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the node data.
-Trait Implementations§
Trait Implementations§
Source§impl Eq for NodeData
Source§impl StructuralPartialEq for NodeData
Auto Trait Implementations§
§impl Freeze for NodeData
§impl RefUnwindSafe for NodeData
§impl Send for NodeData
§impl Sync for NodeData
§impl Unpin for NodeData
§impl UnwindSafe for NodeData
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3398/docs/iroh_relay/node_info/struct.NodeInfo.html b/pr/3398/docs/iroh_relay/node_info/struct.NodeInfo.html
index 5f3d543516..fd430e8236 100644
--- a/pr/3398/docs/iroh_relay/node_info/struct.NodeInfo.html
+++ b/pr/3398/docs/iroh_relay/node_info/struct.NodeInfo.html
@@ -1,30 +1,30 @@
NodeInfo in iroh_relay::node_info - Rust pub struct NodeInfo {
- pub node_id: NodeId,
+ pub node_id: NodeId,
pub data: NodeData,
}
Expand description
Information about a node that may be published to and resolved from discovery services.
-This struct couples a [NodeId] with its associated NodeData.
-Fields§
§node_id: NodeIdThe [NodeId] of the node this is about.
+
+Fields§
§node_id: NodeIdThe NodeId of the node this is about.
§data: NodeDataThe information published about the node.
-Implementations§
Source§impl NodeInfo
Sourcepub fn from_parts(node_id: NodeId, data: NodeData) -> Self
Creates a new NodeInfo from its parts.
-Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> Self
Sets the relay URL and returns the updated node info.
+Implementations§
Source§impl NodeInfo
Sourcepub fn from_parts(node_id: NodeId, data: NodeData) -> Self
Creates a new NodeInfo from its parts.
+Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> Self
Sets the relay URL and returns the updated node info.
Sourcepub fn with_direct_addresses(
self,
direct_addresses: BTreeSet<SocketAddr>,
) -> Self
Sets the direct addresses and returns the updated node info.
Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> Self
Sets the user-defined data and returns the updated node info.
-Sourcepub fn to_node_addr(&self) -> NodeAddr
Converts into a [NodeAddr] by cloning the needed fields.
-Sourcepub fn into_node_addr(self) -> NodeAddr
Converts into a [NodeAddr] without cloning.
+Sourcepub fn to_node_addr(&self) -> NodeAddr
Converts into a NodeAddr by cloning the needed fields.
+Sourcepub fn into_node_addr(self) -> NodeAddr
Converts into a NodeAddr without cloning.
Sourcepub fn from_txt_lookup(lookup: TxtLookup) -> Result<Self>
Available on non-wasm_browser only.
Parses a NodeInfo from a TXT records lookup.
Sourcepub fn from_pkarr_signed_packet(packet: &SignedPacket) -> Result<Self>
Parses a NodeInfo from a [pkarr::SignedPacket].
Sourcepub fn to_pkarr_signed_packet(
&self,
- secret_key: &SecretKey,
+ secret_key: &SecretKey,
ttl: u32,
) -> Result<SignedPacket>
Creates a [pkarr::SignedPacket].
-This constructs a DNS packet and signs it with a [SecretKey].
+This constructs a DNS packet and signs it with a SecretKey.
Sourcepub fn to_txt_strings(&self) -> Vec<String>
Converts into a list of {key}={value} strings.
-Methods from Deref<Target = NodeData>§
Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the node.
Sourcepub fn direct_addresses(&self) -> &BTreeSet<SocketAddr>
Returns the direct addresses of the node.
Sourcepub fn clear_direct_addresses(&mut self)
Removes all direct addresses from the node data.
@@ -32,9 +32,9 @@
&mut self,
addrs: impl IntoIterator<Item = SocketAddr>,
)Adds direct addresses to the node data.
-Sourcepub fn set_relay_url(&mut self, relay_url: Option<RelayUrl>)
Sets the relay URL of the node data.
+Sourcepub fn set_relay_url(&mut self, relay_url: Option<RelayUrl>)
Sets the relay URL of the node data.
Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the node data.
-Trait Implementations§
Trait Implementations§
Source§impl Eq for NodeInfo
Source§impl StructuralPartialEq for NodeInfo
Auto Trait Implementations§
§impl Freeze for NodeInfo
§impl RefUnwindSafe for NodeInfo
§impl Send for NodeInfo
§impl Sync for NodeInfo
§impl Unpin for NodeInfo
§impl UnwindSafe for NodeInfo
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3398/docs/iroh_relay/node_info/trait.NodeIdExt.html b/pr/3398/docs/iroh_relay/node_info/trait.NodeIdExt.html
index 055c747da1..c2bcaefaea 100644
--- a/pr/3398/docs/iroh_relay/node_info/trait.NodeIdExt.html
+++ b/pr/3398/docs/iroh_relay/node_info/trait.NodeIdExt.html
@@ -1,9 +1,9 @@
NodeIdExt in iroh_relay::node_info - Rust pub trait NodeIdExt {
// Required methods
fn to_z32(&self) -> String;
- fn from_z32(s: &str) -> Result<NodeId>;
-}
Expand description
Extension methods for [NodeId] to encode to and decode from [z32],
+ fn from_z32(s: &str) -> Result<NodeId>;
+}Expand description
Extension methods for NodeId to encode to and decode from [z32],
which is the encoding used in [pkarr] domain names.
-
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Implementors§
\ No newline at end of file
+Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Implementors§
\ No newline at end of file
diff --git a/pr/3398/docs/iroh_relay/server/enum.AccessConfig.html b/pr/3398/docs/iroh_relay/server/enum.AccessConfig.html
index a0bfb9d91d..6af5bfcce0 100644
--- a/pr/3398/docs/iroh_relay/server/enum.AccessConfig.html
+++ b/pr/3398/docs/iroh_relay/server/enum.AccessConfig.html
@@ -1,10 +1,10 @@
AccessConfig in iroh_relay::server - Rust pub enum AccessConfig {
Everyone,
- Restricted(Box<dyn Fn(NodeId) -> Boxed<Access> + Send + Sync + 'static>),
+ Restricted(Box<dyn Fn(NodeId) -> Boxed<Access> + Send + Sync + 'static>),
}
Available on crate feature server only.Expand description
Controls which nodes are allowed to use the relay.
Variants§
§Everyone
Everyone
-§Restricted(Box<dyn Fn(NodeId) -> Boxed<Access> + Send + Sync + 'static>)
Only nodes for which the function returns Access::Allow.
-Implementations§
Source§impl AccessConfig
Implementations§
Source§impl AccessConfig
Sourcepub async fn is_allowed(&self, node: NodeId) -> bool
Is this node allowed?
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for AccessConfig
§impl !RefUnwindSafe for AccessConfig
§impl Send for AccessConfig
§impl Sync for AccessConfig
§impl Unpin for AccessConfig
§impl !UnwindSafe for AccessConfig
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3398/docs/iroh_relay/server/struct.Server.html b/pr/3398/docs/iroh_relay/server/struct.Server.html
index 0c148e8f47..0522773fdc 100644
--- a/pr/3398/docs/iroh_relay/server/struct.Server.html
+++ b/pr/3398/docs/iroh_relay/server/struct.Server.html
@@ -14,9 +14,9 @@ case there is an error in the server before it is shut down.
Sourcepub fn quic_addr(&self) -> Option<SocketAddr>
The socket address the QUIC server is listening on.
Sourcepub fn stun_addr(&self) -> Option<SocketAddr>
The socket address the STUN server is listening on.
Sourcepub fn certificates(&self) -> Option<Vec<CertificateDer<'static>>>
The certificates chain if configured with manual TLS certificates.
-Sourcepub fn https_url(&self) -> Option<RelayUrl>
Available on crate feature test-utils only.
Get the server’s https [RelayUrl].
+Sourcepub fn https_url(&self) -> Option<RelayUrl>
Available on crate feature test-utils only.
Get the server’s https RelayUrl.
This uses Self::https_addr so it’s mostly useful for local development.
-Sourcepub fn http_url(&self) -> Option<RelayUrl>
Available on crate feature test-utils only.
Get the server’s http [RelayUrl].
+Sourcepub fn http_url(&self) -> Option<RelayUrl>
Available on crate feature test-utils only.
Get the server’s http RelayUrl.
This uses Self::http_addr so it’s mostly useful for local development.
Sourcepub fn metrics(&self) -> &RelayMetrics
Returns the metrics collected in the relay server.
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Server
§impl RefUnwindSafe for Server
§impl Send for Server
§impl Sync for Server
§impl Unpin for Server
§impl UnwindSafe for Server
Blanket Implementations§
Source§impl<T> Any for Twhere
diff --git a/pr/3398/docs/iroh_relay/struct.RelayMap.html b/pr/3398/docs/iroh_relay/struct.RelayMap.html
index 198be05e6d..c4384c1b86 100644
--- a/pr/3398/docs/iroh_relay/struct.RelayMap.html
+++ b/pr/3398/docs/iroh_relay/struct.RelayMap.html
@@ -1,15 +1,15 @@
RelayMap in iroh_relay - Rust pub struct RelayMap { /* private fields */ }
Expand description
Configuration of all the relay servers that can be used.
-Implementations§
Source§impl RelayMap
Implementations§
Trait Implementations§
Trait Implementations§
Source§impl FromIterator<RelayNode> for RelayMap
Source§impl FromIterator<RelayUrl> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayUrl>>(iter: T) -> Self
Creates a RelayMap from an iterator of [RelayUrl].
+Source§impl FromIterator<RelayNode> for RelayMap
Source§impl FromIterator<RelayUrl> for RelayMap
Source§impl PartialEq for RelayMap
Source§fn eq(&self, other: &RelayMap) -> bool
Tests for self and other values to be equal, and is used by ==.1.0.0 · Source§fn ne(&self, other: &Rhs) -> bool
Tests for !=. The default implementation is almost always sufficient,
diff --git a/pr/3398/docs/iroh_relay/struct.RelayNode.html b/pr/3398/docs/iroh_relay/struct.RelayNode.html
index 05292452e4..d5ea92ec7a 100644
--- a/pr/3398/docs/iroh_relay/struct.RelayNode.html
+++ b/pr/3398/docs/iroh_relay/struct.RelayNode.html
@@ -1,11 +1,11 @@
RelayNode in iroh_relay - Rust pub struct RelayNode {
- pub url: RelayUrl,
+ pub url: RelayUrl,
pub stun_only: bool,
pub stun_port: u16,
pub quic: Option<RelayQuicConfig>,
}
Expand description
Information on a specific relay server.
Includes the Url where it can be dialed.
-Fields§
§url: RelayUrlThe [RelayUrl] where this relay server can be dialed.
+Fields§
§url: RelayUrlThe RelayUrl where this relay server can be dialed.
§stun_only: boolWhether this relay server should only be used for STUN requests.
This essentially allows you to use a normal STUN server as a relay node, no relay
functionality is used.
@@ -15,7 +15,7 @@ functionality is used.
When None, we will not attempt to do QUIC address discovery
with this relay server.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RelayNode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl FromIterator<RelayNode> for RelayMap
Source§impl FromIterator<RelayNode> for RelayMap
Source§impl Ord for RelayNode
Source§impl PartialEq for RelayNode
Source§fn eq(&self, other: &RelayNode) -> bool
Tests for self and other values to be equal, and is used by ==.1.0.0 · Source§fn ne(&self, other: &Rhs) -> bool
Tests for !=. The default implementation is almost always sufficient,
diff --git a/pr/3398/docs/src/iroh/magicsock/node_map/node_state.rs.html b/pr/3398/docs/src/iroh/magicsock/node_map/node_state.rs.html
index b82a7379d0..4eb6fc2036 100644
--- a/pr/3398/docs/src/iroh/magicsock/node_map/node_state.rs.html
+++ b/pr/3398/docs/src/iroh/magicsock/node_map/node_state.rs.html
@@ -1742,7 +1742,9 @@
1741
1742
1743
-1744use std::{
+1744
+1745
+1746
use std::{
collections::{btree_map::Entry, BTreeSet, HashMap},
hash::Hash,
net::{IpAddr, SocketAddr},
@@ -2781,10 +2783,12 @@
}
}
}
- // Clear trust on our best_addr if it is not included in the updated set. Also
- // clear the last call-me-maybe send time so we will send one again.
- self.udp_paths.update_to_best_addr(now);
- self.last_call_me_maybe = None;
+ // Clear trust on our best_addr if it is not included in the updated set.
+ let changed = self.udp_paths.update_to_best_addr(now);
+ if changed {
+ // Clear the last call-me-maybe send time so we will send one again.
+ self.last_call_me_maybe = None;
+ }
debug!(
paths = %summarize_node_paths(&self.udp_paths.paths),
"updated endpoint paths from call-me-maybe",
diff --git a/pr/3398/docs/src/iroh/magicsock/node_map/udp_paths.rs.html b/pr/3398/docs/src/iroh/magicsock/node_map/udp_paths.rs.html
index cc78dce5b4..8c6632ef5a 100644
--- a/pr/3398/docs/src/iroh/magicsock/node_map/udp_paths.rs.html
+++ b/pr/3398/docs/src/iroh/magicsock/node_map/udp_paths.rs.html
@@ -169,7 +169,33 @@
168
169
170
-171
//! Path state for UDP addresses of a single peer node.
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
//! Path state for UDP addresses of a single peer node.
//!
//! This started as simply moving the [`NodeState`]'s `direct_addresses` and `best_addr`
//! into one place together. The aim is for external places to not directly interact with
@@ -179,6 +205,7 @@
use std::{collections::BTreeMap, net::SocketAddr};
use n0_future::time::Instant;
+use tracing::{event, Level};
use super::{path_state::PathState, IpPort};
@@ -195,7 +222,7 @@
///
/// [`MagicSock`]: crate::magicsock::MagicSock
/// [`NodeState`]: super::node_state::NodeState
-#[derive(Debug, Default, Clone, Copy)]
+#[derive(Debug, Default, Clone, Copy, PartialEq, Eq)]
pub(super) enum UdpSendAddr {
/// The UDP address can be relied on to deliver data to the remote node.
///
@@ -284,9 +311,34 @@
&self.best
}
- pub(super) fn update_to_best_addr(&mut self, now: Instant) {
- self.best_ipv4 = self.best_addr(false, now);
- self.best = self.best_addr(true, now);
+ /// Changes the current best address(es) to ones chosen as described in [`Self::best_addr`] docs.
+ ///
+ /// Returns whether one of the best addresses had to change.
+ ///
+ /// This should be called any time that `paths` is modified.
+ pub(super) fn update_to_best_addr(&mut self, now: Instant) -> bool {
+ let best_ipv4 = self.best_addr(false, now);
+ let best = self.best_addr(true, now);
+ let mut changed = false;
+ if best_ipv4 != self.best_ipv4 {
+ event!(
+ target: "iroh::_events::udp::best_ipv4",
+ Level::DEBUG,
+ ?best_ipv4,
+ );
+ changed = true;
+ }
+ if best != self.best {
+ event!(
+ target: "iroh::_events::udp::best",
+ Level::DEBUG,
+ ?best,
+ );
+ changed = true;
+ }
+ self.best_ipv4 = best_ipv4;
+ self.best = best;
+ changed
}
pub(super) fn best_addr(&self, have_ipv6: bool, now: Instant) -> UdpSendAddr {
diff --git a/pr/3398/docs/trait.impl/core/convert/trait.From.js b/pr/3398/docs/trait.impl/core/convert/trait.From.js
index 3c3eda16f7..f782f797c3 100644
--- a/pr/3398/docs/trait.impl/core/convert/trait.From.js
+++ b/pr/3398/docs/trait.impl/core/convert/trait.From.js
@@ -1,9 +1,9 @@
(function() {
- var implementors = Object.fromEntries([["iroh",[["impl From<DiscoveryItem> for NodeInfo"],["impl From<RemoteInfo> for NodeAddr"],["impl<T> From<T> for ConcurrentDiscovery"]]],["iroh_base",[["impl From<(PublicKey, Option<RelayUrl>, &[SocketAddr])> for NodeAddr"],["impl From<ParseError> for RelayUrlParseError"],["impl From<Url> for RelayUrl"],["impl From<NodeAddr> for NodeTicket"],["impl From<PublicKey> for NodeAddr"],["impl From<RelayUrl> for Url"],["impl From<NodeTicket> for NodeAddr"],["impl From<DecodeError> for KeyParsingError"],["impl From<DecodeError> for Error"],["impl From<Error> for KeyParsingError"],["impl From<Error> for Error"],["impl From<SigningKey> for SecretKey"],["impl From<VerifyingKey> for PublicKey"],["impl From<[u8; 32]> for SecretKey"]]],["iroh_relay",[["impl From<Error> for ConnSendError"],["impl From<NodeInfo> for NodeAddr"],["impl From<RelayNode> for RelayMap"],["impl From<Error> for ConnSendError"],["impl From<NodeAddr> for NodeData"],["impl From<NodeAddr> for NodeInfo"],["impl From<RelayUrl> for RelayMap"],["impl From<RelayUrl> for RelayNode"],["impl From<Resolver<GenericConnector<TokioRuntimeProvider>>> for DnsResolver"],["impl From<TxtLookup> for TxtLookup"]]]]);
+ var implementors = Object.fromEntries([["iroh",[["impl From<DiscoveryItem> for NodeInfo"],["impl From<RemoteInfo> for NodeAddr"],["impl<T> From<T> for ConcurrentDiscovery"]]],["iroh_base",[["impl From<(PublicKey, Option<RelayUrl>, &[SocketAddr])> for NodeAddr"],["impl From<ParseError> for RelayUrlParseError"],["impl From<Url> for RelayUrl"],["impl From<NodeAddr> for NodeTicket"],["impl From<PublicKey> for NodeAddr"],["impl From<RelayUrl> for Url"],["impl From<NodeTicket> for NodeAddr"],["impl From<DecodeError> for KeyParsingError"],["impl From<DecodeError> for Error"],["impl From<Error> for KeyParsingError"],["impl From<Error> for Error"],["impl From<SigningKey> for SecretKey"],["impl From<VerifyingKey> for PublicKey"],["impl From<[u8; 32]> for SecretKey"]]],["iroh_relay",[["impl From<Error> for ConnSendError"],["impl From<NodeAddr> for NodeData"],["impl From<NodeAddr> for NodeInfo"],["impl From<RelayUrl> for RelayMap"],["impl From<RelayUrl> for RelayNode"],["impl From<NodeInfo> for NodeAddr"],["impl From<RelayNode> for RelayMap"],["impl From<Error> for ConnSendError"],["impl From<Resolver<GenericConnector<TokioRuntimeProvider>>> for DnsResolver"],["impl From<TxtLookup> for TxtLookup"]]]]);
if (window.register_implementors) {
window.register_implementors(implementors);
} else {
window.pending_implementors = implementors;
}
})()
-//{"start":57,"fragment_lengths":[1632,5343,3221]}
\ No newline at end of file
+//{"start":57,"fragment_lengths":[1632,5343,3831]}
\ No newline at end of file
diff --git a/pr/3398/docs/trait.impl/core/iter/traits/collect/trait.FromIterator.js b/pr/3398/docs/trait.impl/core/iter/traits/collect/trait.FromIterator.js
index d104c409e3..8cd585bc9e 100644
--- a/pr/3398/docs/trait.impl/core/iter/traits/collect/trait.FromIterator.js
+++ b/pr/3398/docs/trait.impl/core/iter/traits/collect/trait.FromIterator.js
@@ -1,9 +1,9 @@
(function() {
- var implementors = Object.fromEntries([["iroh_relay",[["impl FromIterator<RelayNode> for RelayMap"],["impl FromIterator<RelayUrl> for RelayMap"]]]]);
+ var implementors = Object.fromEntries([["iroh_relay",[["impl FromIterator<RelayUrl> for RelayMap"],["impl FromIterator<RelayNode> for RelayMap"]]]]);
if (window.register_implementors) {
window.register_implementors(implementors);
} else {
window.pending_implementors = implementors;
}
})()
-//{"start":57,"fragment_lengths":[776]}
\ No newline at end of file
+//{"start":57,"fragment_lengths":[898]}
\ No newline at end of file
pub enum ControlMsg {
+ControlMsg in iroh::endpoint - Rust pub enum ControlMsg {
Ping,
Pong,
CallMeMaybe,
@@ -6,10 +6,10 @@
Variants§
§Ping
We received a Ping from the node.
§Pong
We received a Pong from the node.
§CallMeMaybe
We received a CallMeMaybe.
-Trait Implementations§
Source§impl Clone for ControlMsg
Source§fn clone(&self) -> ControlMsg
Returns a copy of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for ControlMsg
Source§impl<'de> Deserialize<'de> for ControlMsg
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Display for ControlMsg
Source§impl PartialEq for ControlMsg
Source§impl Serialize for ControlMsg
Source§impl Copy for ControlMsg
Source§impl Eq for ControlMsg
Source§impl StructuralPartialEq for ControlMsg
Auto Trait Implementations§
§impl Freeze for ControlMsg
§impl RefUnwindSafe for ControlMsg
§impl Send for ControlMsg
§impl Sync for ControlMsg
§impl Unpin for ControlMsg
§impl UnwindSafe for ControlMsg
Blanket Implementations§
Trait Implementations§
Source§impl Clone for ControlMsg
Source§fn clone(&self) -> ControlMsg
Returns a copy of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for ControlMsg
Source§impl<'de> Deserialize<'de> for ControlMsg
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Display for ControlMsg
Source§impl PartialEq for ControlMsg
Source§impl Serialize for ControlMsg
Source§impl Copy for ControlMsg
Source§impl Eq for ControlMsg
Source§impl StructuralPartialEq for ControlMsg
Auto Trait Implementations§
§impl Freeze for ControlMsg
§impl RefUnwindSafe for ControlMsg
§impl Send for ControlMsg
§impl Sync for ControlMsg
§impl Unpin for ControlMsg
§impl UnwindSafe for ControlMsg
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3398/docs/iroh/endpoint/struct.DirectAddrInfo.html b/pr/3398/docs/iroh/endpoint/struct.DirectAddrInfo.html
index e22a8c9c7b..ab7faf4e9b 100644
--- a/pr/3398/docs/iroh/endpoint/struct.DirectAddrInfo.html
+++ b/pr/3398/docs/iroh/endpoint/struct.DirectAddrInfo.html
@@ -1,4 +1,4 @@
-DirectAddrInfo in iroh::endpoint - Rust pub struct DirectAddrInfo {
+DirectAddrInfo in iroh::endpoint - Rust pub struct DirectAddrInfo {
pub addr: SocketAddr,
pub latency: Option<Duration>,
pub last_control: Option<(Duration, ControlMsg)>,
@@ -36,10 +36,10 @@ node discovery the path may never have been known to exist.
recorded this address.
The Duration will always indicate the most recent time the source
recorded this address.
-
Trait Implementations§
Source§impl Clone for DirectAddrInfo
Source§fn clone(&self) -> DirectAddrInfo
Returns a copy of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for DirectAddrInfo
Source§impl<'de> Deserialize<'de> for DirectAddrInfo
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl PartialEq for DirectAddrInfo
Source§impl Serialize for DirectAddrInfo
Source§impl Eq for DirectAddrInfo
Source§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<T> Any for Twhere
+Trait Implementations§
Source§impl Clone for DirectAddrInfo
Source§fn clone(&self) -> DirectAddrInfo
Returns a copy of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for DirectAddrInfo
Source§impl<'de> Deserialize<'de> for DirectAddrInfo
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl PartialEq for DirectAddrInfo
Source§impl Serialize for DirectAddrInfo
Source§impl Eq for DirectAddrInfo
Source§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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3398/docs/iroh/endpoint/struct.RemoteInfo.html b/pr/3398/docs/iroh/endpoint/struct.RemoteInfo.html
index 591bd1e94d..934748182c 100644
--- a/pr/3398/docs/iroh/endpoint/struct.RemoteInfo.html
+++ b/pr/3398/docs/iroh/endpoint/struct.RemoteInfo.html
@@ -1,4 +1,4 @@
-RemoteInfo in iroh::endpoint - Rust pub struct RemoteInfo {
+RemoteInfo in iroh::endpoint - Rust pub struct RemoteInfo {
pub node_id: NodeId,
pub relay_url: Option<RelayUrlInfo>,
pub addrs: Vec<DirectAddrInfo>,
@@ -21,20 +21,20 @@ node might be a part of.
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
Sourcepub fn last_received(&self) -> Option<Duration>
Get the duration since the last activity we received from this endpoint
+
Implementations§
Source§impl RemoteInfo
Sourcepub 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
Whether there is a possible known network path to the remote node.
+Sourcepub 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)>
Returns a deduplicated list of Sources merged from all address in the RemoteInfo.
+Sourcepub fn sources(&self) -> Vec<(Source, Duration)>
Returns a deduplicated list of Sources merged from all address in the RemoteInfo.
Deduplication is on the (Source, Duration) tuple, so you will get multiple Sources
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
Source§fn clone(&self) -> RemoteInfo
Returns a copy of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for RemoteInfo
Source§impl<'de> Deserialize<'de> for RemoteInfo
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl From<RemoteInfo> for NodeAddr
Source§fn from(info: RemoteInfo) -> Self
Converts to this type from the input type.Source§impl PartialEq for RemoteInfo
Source§impl Serialize for RemoteInfo
Source§impl Eq for RemoteInfo
Source§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§
Trait Implementations§
Source§impl Clone for RemoteInfo
Source§fn clone(&self) -> RemoteInfo
Returns a copy of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for RemoteInfo
Source§impl<'de> Deserialize<'de> for RemoteInfo
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl From<RemoteInfo> for NodeAddr
Source§fn from(info: RemoteInfo) -> Self
Converts to this type from the input type.Source§impl PartialEq for RemoteInfo
Source§impl Serialize for RemoteInfo
Source§impl Eq for RemoteInfo
Source§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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3398/docs/iroh/struct.NodeAddr.html b/pr/3398/docs/iroh/struct.NodeAddr.html
index 7a53def369..a23c41d0d0 100644
--- a/pr/3398/docs/iroh/struct.NodeAddr.html
+++ b/pr/3398/docs/iroh/struct.NodeAddr.html
@@ -45,7 +45,7 @@ whenever a connection to other nodes needs to be established.
__deserializer: __D,
) -> Result<NodeAddr, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl From<NodeTicket> for NodeAddr
Source§fn from(ticket: NodeTicket) -> NodeAddr
Returns the addressing info from given ticket.
-Source§impl From<RemoteInfo> for NodeAddr
Source§fn from(info: RemoteInfo) -> Self
Converts to this type from the input type.Source§impl From<RemoteInfo> for NodeAddr
Source§fn from(info: RemoteInfo) -> Self
Converts to this type from the input type.Source§impl Ord for NodeAddr
Source§impl PartialEq for NodeAddr
Source§fn eq(&self, other: &NodeAddr) -> bool
Tests for self and other values to be equal, and is used by ==.1.0.0 · Source§fn ne(&self, other: &Rhs) -> bool
Tests for !=. The default implementation is almost always sufficient,
diff --git a/pr/3398/docs/iroh_bench/enum.ConnectionSelector.html b/pr/3398/docs/iroh_bench/enum.ConnectionSelector.html
index 03ed6eab6a..f3e2a84416 100644
--- a/pr/3398/docs/iroh_bench/enum.ConnectionSelector.html
+++ b/pr/3398/docs/iroh_bench/enum.ConnectionSelector.html
@@ -1,7 +1,7 @@
ConnectionSelector in iroh_bench - Rust pub enum ConnectionSelector {
- Iroh(Connection),
+ Iroh(Connection),
Quinn(Connection),
-}
Variants§
Implementations§
Auto Trait Implementations§
§impl Freeze for ConnectionSelector
§impl RefUnwindSafe for ConnectionSelector
§impl Send for ConnectionSelector
§impl Sync for ConnectionSelector
§impl Unpin for ConnectionSelector
§impl UnwindSafe for ConnectionSelector
Blanket Implementations§
Source§impl<T> Any for Twhere
+}Variants§
§Iroh(Connection)
§Quinn(Connection)
Implementations§
Auto Trait Implementations§
§impl Freeze for ConnectionSelector
§impl RefUnwindSafe for ConnectionSelector
§impl Send for ConnectionSelector
§impl Sync for ConnectionSelector
§impl Unpin for ConnectionSelector
§impl UnwindSafe for ConnectionSelector
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3398/docs/iroh_bench/enum.EndpointSelector.html b/pr/3398/docs/iroh_bench/enum.EndpointSelector.html
index 2160ad6f51..78f5e53f71 100644
--- a/pr/3398/docs/iroh_bench/enum.EndpointSelector.html
+++ b/pr/3398/docs/iroh_bench/enum.EndpointSelector.html
@@ -1,7 +1,7 @@
EndpointSelector in iroh_bench - Rust pub enum EndpointSelector {
- Iroh(Endpoint),
+ Iroh(Endpoint),
Quinn(Endpoint),
-}
Variants§
Implementations§
Auto Trait Implementations§
§impl Freeze for EndpointSelector
§impl !RefUnwindSafe for EndpointSelector
§impl Send for EndpointSelector
§impl Sync for EndpointSelector
§impl Unpin for EndpointSelector
§impl !UnwindSafe for EndpointSelector
Blanket Implementations§
Source§impl<T> Any for Twhere
+}Variants§
Implementations§
Auto Trait Implementations§
§impl Freeze for EndpointSelector
§impl !RefUnwindSafe for EndpointSelector
§impl Send for EndpointSelector
§impl Sync for EndpointSelector
§impl Unpin for EndpointSelector
§impl !UnwindSafe for EndpointSelector
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3398/docs/iroh_bench/iroh/fn.connect_client.html b/pr/3398/docs/iroh_bench/iroh/fn.connect_client.html
index c49257b256..0d80c4eae2 100644
--- a/pr/3398/docs/iroh_bench/iroh/fn.connect_client.html
+++ b/pr/3398/docs/iroh_bench/iroh/fn.connect_client.html
@@ -2,5 +2,5 @@
server_addr: NodeAddr,
relay_url: Option<RelayUrl>,
opt: Opt,
-) -> Result<(Endpoint, Connection)>Expand description
Create a client endpoint and client connection
+) -> Result<(Endpoint, Connection)>Expand description
Create a client endpoint and client connection
\ No newline at end of file
diff --git a/pr/3398/docs/iroh_bench/iroh/fn.handle_client_stream.html b/pr/3398/docs/iroh_bench/iroh/fn.handle_client_stream.html
index ccef33db3e..d0586fbba4 100644
--- a/pr/3398/docs/iroh_bench/iroh/fn.handle_client_stream.html
+++ b/pr/3398/docs/iroh_bench/iroh/fn.handle_client_stream.html
@@ -1,5 +1,5 @@
handle_client_stream in iroh_bench::iroh - Rust pub async fn handle_client_stream(
- connection: &Connection,
+ connection: &Connection,
upload_size: u64,
read_unordered: bool,
) -> Result<(TransferResult, TransferResult)>
\ No newline at end of file
diff --git a/pr/3398/docs/iroh_bench/iroh/fn.server.html b/pr/3398/docs/iroh_bench/iroh/fn.server.html
index 1a9b97acaa..9db7b08607 100644
--- a/pr/3398/docs/iroh_bench/iroh/fn.server.html
+++ b/pr/3398/docs/iroh_bench/iroh/fn.server.html
@@ -1,2 +1,2 @@
-server in iroh_bench::iroh - Rust pub async fn server(endpoint: Endpoint, opt: Opt) -> Result<()>
Expand description
Take the provided endpoint and run the server
+server in iroh_bench::iroh - Rust
\ No newline at end of file
diff --git a/pr/3398/docs/iroh_bench/iroh/fn.server_endpoint.html b/pr/3398/docs/iroh_bench/iroh/fn.server_endpoint.html
index 2de49dd53e..2fa138cdd8 100644
--- a/pr/3398/docs/iroh_bench/iroh/fn.server_endpoint.html
+++ b/pr/3398/docs/iroh_bench/iroh/fn.server_endpoint.html
@@ -2,5 +2,5 @@
rt: &Runtime,
relay_url: &Option<RelayUrl>,
opt: &Opt,
-) -> (NodeAddr, Endpoint)Expand description
Creates a server endpoint which runs on the given runtime
+) -> (NodeAddr, Endpoint)Expand description
Creates a server endpoint which runs on the given runtime
\ No newline at end of file
diff --git a/pr/3398/docs/iroh_relay/client/enum.ReceivedMessage.html b/pr/3398/docs/iroh_relay/client/enum.ReceivedMessage.html
index dd7a047aae..71c9ae3d55 100644
--- a/pr/3398/docs/iroh_relay/client/enum.ReceivedMessage.html
+++ b/pr/3398/docs/iroh_relay/client/enum.ReceivedMessage.html
@@ -1,9 +1,9 @@
ReceivedMessage in iroh_relay::client - Rust pub enum ReceivedMessage {
ReceivedPacket {
- remote_node_id: NodeId,
+ remote_node_id: NodeId,
data: Bytes,
},
- NodeGone(NodeId),
+ NodeGone(NodeId),
Ping([u8; 8]),
Pong([u8; 8]),
KeepAlive,
@@ -17,9 +17,9 @@
}
Expand description
The messages received from a framed relay stream.
This is a type-validated version of the Frames on the RelayCodec.
Variants§
§ReceivedPacket
Represents an incoming packet.
-Fields
§NodeGone(NodeId)
Indicates that the client identified by the underlying public key had previously sent you a
packet but has now disconnected from the server.
§Ping([u8; 8])
Request from a client or server to reply to the
other side with a ReceivedMessage::Pong with the given payload.
diff --git a/pr/3398/docs/iroh_relay/client/enum.SendMessage.html b/pr/3398/docs/iroh_relay/client/enum.SendMessage.html
index 30fa0d203b..aeeafe0b83 100644
--- a/pr/3398/docs/iroh_relay/client/enum.SendMessage.html
+++ b/pr/3398/docs/iroh_relay/client/enum.SendMessage.html
@@ -1,9 +1,9 @@
SendMessage in iroh_relay::client - Rust pub enum SendMessage {
- SendPacket(NodeId, Bytes),
+ SendPacket(NodeId, Bytes),
Ping([u8; 8]),
Pong([u8; 8]),
}
Expand description
Messages we can send to a relay server.
-Variants§
§SendPacket(NodeId, Bytes)
Send a packet of data to the [NodeId].
+Variants§
§SendPacket(NodeId, Bytes)
Send a packet of data to the NodeId.
§Ping([u8; 8])
Sends a ping message to the connected relay server.
§Pong([u8; 8])
Sends a pong message to the connected relay server.
Trait Implementations§
Source§impl Debug for SendMessage
Source§impl Sink<SendMessage> for Client
Source§type Error = ConnSendError
The type of value produced by the sink when an error occurs.Source§fn poll_ready(
diff --git a/pr/3398/docs/iroh_relay/client/struct.ClientBuilder.html b/pr/3398/docs/iroh_relay/client/struct.ClientBuilder.html
index 52065d31c7..fc3c3ebe05 100644
--- a/pr/3398/docs/iroh_relay/client/struct.ClientBuilder.html
+++ b/pr/3398/docs/iroh_relay/client/struct.ClientBuilder.html
@@ -1,7 +1,7 @@
ClientBuilder in iroh_relay::client - Rust pub struct ClientBuilder { /* private fields */ }
Expand description
Build a Client.
Implementations§
Source§impl ClientBuilder
Sourcepub fn new(
- url: impl Into<RelayUrl>,
- secret_key: SecretKey,
+ url: impl Into<RelayUrl>,
+ secret_key: SecretKey,
dns_resolver: DnsResolver,
) -> Self
Create a new ClientBuilder
Sourcepub fn protocol(self, protocol: Protocol) -> Self
Sets whether to connect to the relay via websockets or not.
diff --git a/pr/3398/docs/iroh_relay/dns/struct.DnsResolver.html b/pr/3398/docs/iroh_relay/dns/struct.DnsResolver.html
index c58227f1a6..b1f9a86539 100644
--- a/pr/3398/docs/iroh_relay/dns/struct.DnsResolver.html
+++ b/pr/3398/docs/iroh_relay/dns/struct.DnsResolver.html
@@ -67,9 +67,9 @@ at T+0ms, T+200ms and T+300ms. The timeout is applied as stated in
summary of all errors otherwise.
Sourcepub async fn lookup_node_by_id(
&self,
- node_id: &NodeId,
+ node_id: &NodeId,
origin: &str,
-) -> Result<NodeInfo>
Looks up node info by [NodeId] and origin domain name.
+) -> Result<NodeInfo>Looks up node info by NodeId and origin domain name.
To lookup nodes that published their node info to the DNS servers run by n0,
pass N0_DNS_NODE_ORIGIN_PROD as origin.
Sourcepub async fn lookup_node_by_domain_name(&self, name: &str) -> Result<NodeInfo>
Looks up node info by DNS name.
@@ -84,10 +84,10 @@ at T+0ms, T+200ms and T+300ms. The result of the first successful call is return
summary of all errors otherwise.
Sourcepub async fn lookup_node_by_id_staggered(
&self,
- node_id: &NodeId,
+ node_id: &NodeId,
origin: &str,
delays_ms: &[u64],
-) -> Result<NodeInfo>
Looks up node info by [NodeId] and origin domain name.
+) -> Result<NodeInfo>Looks up node info by NodeId and origin domain name.
From the moment this function is called, each lookup is scheduled after the delays in
delays_ms with the first call being done immediately. [200ms, 300ms] results in calls
at T+0ms, T+200ms and T+300ms. The result of the first successful call is returned, or a
diff --git a/pr/3398/docs/iroh_relay/index.html b/pr/3398/docs/iroh_relay/index.html
index 01d8ad04d6..72458b94e1 100644
--- a/pr/3398/docs/iroh_relay/index.html
+++ b/pr/3398/docs/iroh_relay/index.html
@@ -25,6 +25,6 @@ Tailscale.
STUN support and expose metrics.
-Re-exports§
pub use protos::relay::MAX_PACKET_SIZE;
Modules§
- Exposes
Client, which allows to establish connections to a relay server. - Default values used in the relay.
- dns
Non-wasm_browser DNS resolver - HTTP-specific constants for the relay server and client.
- Support for handling DNS resource records for dialing by [
NodeId]. - Protocols used by the iroh-relay
- Create a QUIC server that accepts connections
+
Re-exports§
pub use protos::relay::MAX_PACKET_SIZE;
Modules§
- Exposes
Client, which allows to establish connections to a relay server. - Default values used in the relay.
- dns
Non-wasm_browser DNS resolver - HTTP-specific constants for the relay server and client.
- Support for handling DNS resource records for dialing by
NodeId. - Protocols used by the iroh-relay
- Create a QUIC server that accepts connections
for QUIC address discovery.
- server
server A fully-fledged iroh-relay server over HTTP or HTTPS.
Structs§
- Tracks pings on a single relay connection.
- Configuration of all the relay servers that can be used.
- Information on a specific relay server.
- Configuration for speaking to the QUIC endpoint on the relay
server to do QUIC address discovery.
\ No newline at end of file
diff --git a/pr/3398/docs/iroh_relay/node_info/index.html b/pr/3398/docs/iroh_relay/node_info/index.html
index 893e7d3beb..647a6906b2 100644
--- a/pr/3398/docs/iroh_relay/node_info/index.html
+++ b/pr/3398/docs/iroh_relay/node_info/index.html
@@ -1,5 +1,5 @@
-iroh_relay::node_info - Rust Expand description
Support for handling DNS resource records for dialing by [NodeId].
-Dialing by [NodeId] is supported by iroh nodes publishing Pkarr records to DNS
+
iroh_relay::node_info - Rust Expand description
Support for handling DNS resource records for dialing by NodeId.
+Dialing by NodeId is supported by iroh nodes publishing Pkarr records to DNS
servers or the Mainline DHT. This module supports creating and parsing these records.
DNS records are published under the following names:
_iroh.<z32-node-id>.<origin-domain> TXT
@@ -8,7 +8,7 @@ servers or the Mainline DHT. This module supports creating and parsing these re
_iroh is the record name as defined by IROH_TXT_NAME.
-<z32-node-id> is the z-base-32 encoding of the [NodeId].
+
<origin-domain> is the domain name of the publishing DNS server,
@@ -23,12 +23,12 @@ servers or the Mainline DHT. This module supports creating and parsing these re
in RFC1464. The following attributes are defined:
- Structs§
- Error returned when an input value is too long for
UserData. - Data about a node that may be published to and resolved from discovery services.
- Information about a node that may be published to and resolved from discovery services.
- Under the hood this is a UTF-8 String is no longer than
UserData::MAX_LENGTH bytes.
Constants§
- The DNS name for the iroh TXT record.
Traits§
- Extension methods for [
NodeId] to encode to and decode from [z32],
+Structs§
- Error returned when an input value is too long for
UserData. - Data about a node that may be published to and resolved from discovery services.
- Information about a node that may be published to and resolved from discovery services.
- Under the hood this is a UTF-8 String is no longer than
UserData::MAX_LENGTH bytes.
Constants§
- The DNS name for the iroh TXT record.
Traits§
- Extension methods for
NodeId to encode to and decode from [z32],
which is the encoding used in [pkarr] domain names.
\ No newline at end of file
diff --git a/pr/3398/docs/iroh_relay/node_info/struct.NodeData.html b/pr/3398/docs/iroh_relay/node_info/struct.NodeData.html
index 2228868b94..4e4cd88141 100644
--- a/pr/3398/docs/iroh_relay/node_info/struct.NodeData.html
+++ b/pr/3398/docs/iroh_relay/node_info/struct.NodeData.html
@@ -1,20 +1,20 @@
NodeData in iroh_relay::node_info - Rust pub struct NodeData { /* private fields */ }
Expand description
Data about a node that may be published to and resolved from discovery services.
-This includes an optional [RelayUrl], a set of direct addresses, and the optional
+
This includes an optional RelayUrl, a set of direct addresses, and the optional
UserData, a string that can be set by applications and is not parsed or used by iroh
itself.
-This struct does not include the node’s [NodeId], only the data about a certain
-node. See NodeInfo for a struct that contains a [NodeId] with associated NodeData.
+This struct does not include the node’s NodeId, only the data about a certain
+node. See NodeInfo for a struct that contains a NodeId with associated NodeData.
Implementations§
Source§impl NodeData
Sourcepub fn new(
- relay_url: Option<RelayUrl>,
+ relay_url: Option<RelayUrl>,
direct_addresses: BTreeSet<SocketAddr>,
) -> Self
Creates a new NodeData with a relay URL and a set of direct addresses.
-Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> Self
Sets the relay URL and returns the updated node data.
+Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> Self
Sets the relay URL and returns the updated node data.
Sourcepub fn with_direct_addresses(
self,
direct_addresses: BTreeSet<SocketAddr>,
) -> Self
Sets the direct addresses and returns the updated node data.
Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> Self
Sets the user-defined data and returns the updated node data.
-Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the node.
Sourcepub fn direct_addresses(&self) -> &BTreeSet<SocketAddr>
Returns the direct addresses of the node.
Sourcepub fn clear_direct_addresses(&mut self)
Removes all direct addresses from the node data.
@@ -22,9 +22,9 @@ node. See IntoIterator<Item = SocketAddr>,
)Adds direct addresses to the node data.
-Sourcepub fn set_relay_url(&mut self, relay_url: Option<RelayUrl>)
Sets the relay URL of the node data.
+Sourcepub fn set_relay_url(&mut self, relay_url: Option<RelayUrl>)
Sets the relay URL of the node data.
Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the node data.
-Trait Implementations§
Trait Implementations§
Source§impl Eq for NodeData
Source§impl StructuralPartialEq for NodeData
Auto Trait Implementations§
§impl Freeze for NodeData
§impl RefUnwindSafe for NodeData
§impl Send for NodeData
§impl Sync for NodeData
§impl Unpin for NodeData
§impl UnwindSafe for NodeData
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3398/docs/iroh_relay/node_info/struct.NodeInfo.html b/pr/3398/docs/iroh_relay/node_info/struct.NodeInfo.html
index 5f3d543516..fd430e8236 100644
--- a/pr/3398/docs/iroh_relay/node_info/struct.NodeInfo.html
+++ b/pr/3398/docs/iroh_relay/node_info/struct.NodeInfo.html
@@ -1,30 +1,30 @@
NodeInfo in iroh_relay::node_info - Rust pub struct NodeInfo {
- pub node_id: NodeId,
+ pub node_id: NodeId,
pub data: NodeData,
}
Expand description
Information about a node that may be published to and resolved from discovery services.
-This struct couples a [NodeId] with its associated NodeData.
-Fields§
§node_id: NodeIdThe [NodeId] of the node this is about.
+
+Fields§
§node_id: NodeIdThe NodeId of the node this is about.
§data: NodeDataThe information published about the node.
-Implementations§
Source§impl NodeInfo
Sourcepub fn from_parts(node_id: NodeId, data: NodeData) -> Self
Creates a new NodeInfo from its parts.
-Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> Self
Sets the relay URL and returns the updated node info.
+Implementations§
Source§impl NodeInfo
Sourcepub fn from_parts(node_id: NodeId, data: NodeData) -> Self
Creates a new NodeInfo from its parts.
+Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> Self
Sets the relay URL and returns the updated node info.
Sourcepub fn with_direct_addresses(
self,
direct_addresses: BTreeSet<SocketAddr>,
) -> Self
Sets the direct addresses and returns the updated node info.
Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> Self
Sets the user-defined data and returns the updated node info.
-Sourcepub fn to_node_addr(&self) -> NodeAddr
Converts into a [NodeAddr] by cloning the needed fields.
-Sourcepub fn into_node_addr(self) -> NodeAddr
Converts into a [NodeAddr] without cloning.
+Sourcepub fn to_node_addr(&self) -> NodeAddr
Converts into a NodeAddr by cloning the needed fields.
+Sourcepub fn into_node_addr(self) -> NodeAddr
Converts into a NodeAddr without cloning.
Sourcepub fn from_txt_lookup(lookup: TxtLookup) -> Result<Self>
Available on non-wasm_browser only.
Parses a NodeInfo from a TXT records lookup.
Sourcepub fn from_pkarr_signed_packet(packet: &SignedPacket) -> Result<Self>
Parses a NodeInfo from a [pkarr::SignedPacket].
Sourcepub fn to_pkarr_signed_packet(
&self,
- secret_key: &SecretKey,
+ secret_key: &SecretKey,
ttl: u32,
) -> Result<SignedPacket>
Creates a [pkarr::SignedPacket].
-This constructs a DNS packet and signs it with a [SecretKey].
+This constructs a DNS packet and signs it with a SecretKey.
Sourcepub fn to_txt_strings(&self) -> Vec<String>
Converts into a list of {key}={value} strings.
-Methods from Deref<Target = NodeData>§
Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the node.
Sourcepub fn direct_addresses(&self) -> &BTreeSet<SocketAddr>
Returns the direct addresses of the node.
Sourcepub fn clear_direct_addresses(&mut self)
Removes all direct addresses from the node data.
@@ -32,9 +32,9 @@
&mut self,
addrs: impl IntoIterator<Item = SocketAddr>,
)Adds direct addresses to the node data.
-Sourcepub fn set_relay_url(&mut self, relay_url: Option<RelayUrl>)
Sets the relay URL of the node data.
+Sourcepub fn set_relay_url(&mut self, relay_url: Option<RelayUrl>)
Sets the relay URL of the node data.
Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the node data.
-Trait Implementations§
Trait Implementations§
Source§impl Eq for NodeInfo
Source§impl StructuralPartialEq for NodeInfo
Auto Trait Implementations§
§impl Freeze for NodeInfo
§impl RefUnwindSafe for NodeInfo
§impl Send for NodeInfo
§impl Sync for NodeInfo
§impl Unpin for NodeInfo
§impl UnwindSafe for NodeInfo
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3398/docs/iroh_relay/node_info/trait.NodeIdExt.html b/pr/3398/docs/iroh_relay/node_info/trait.NodeIdExt.html
index 055c747da1..c2bcaefaea 100644
--- a/pr/3398/docs/iroh_relay/node_info/trait.NodeIdExt.html
+++ b/pr/3398/docs/iroh_relay/node_info/trait.NodeIdExt.html
@@ -1,9 +1,9 @@
NodeIdExt in iroh_relay::node_info - Rust pub trait NodeIdExt {
// Required methods
fn to_z32(&self) -> String;
- fn from_z32(s: &str) -> Result<NodeId>;
-}
Expand description
Extension methods for [NodeId] to encode to and decode from [z32],
+ fn from_z32(s: &str) -> Result<NodeId>;
+}Expand description
Extension methods for NodeId to encode to and decode from [z32],
which is the encoding used in [pkarr] domain names.
-
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Implementors§
\ No newline at end of file
+Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Implementors§
\ No newline at end of file
diff --git a/pr/3398/docs/iroh_relay/server/enum.AccessConfig.html b/pr/3398/docs/iroh_relay/server/enum.AccessConfig.html
index a0bfb9d91d..6af5bfcce0 100644
--- a/pr/3398/docs/iroh_relay/server/enum.AccessConfig.html
+++ b/pr/3398/docs/iroh_relay/server/enum.AccessConfig.html
@@ -1,10 +1,10 @@
AccessConfig in iroh_relay::server - Rust pub enum AccessConfig {
Everyone,
- Restricted(Box<dyn Fn(NodeId) -> Boxed<Access> + Send + Sync + 'static>),
+ Restricted(Box<dyn Fn(NodeId) -> Boxed<Access> + Send + Sync + 'static>),
}
Available on crate feature server only.Expand description
Controls which nodes are allowed to use the relay.
Variants§
§Everyone
Everyone
-§Restricted(Box<dyn Fn(NodeId) -> Boxed<Access> + Send + Sync + 'static>)
Only nodes for which the function returns Access::Allow.
-Implementations§
Source§impl AccessConfig
Implementations§
Source§impl AccessConfig
Sourcepub async fn is_allowed(&self, node: NodeId) -> bool
Is this node allowed?
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for AccessConfig
§impl !RefUnwindSafe for AccessConfig
§impl Send for AccessConfig
§impl Sync for AccessConfig
§impl Unpin for AccessConfig
§impl !UnwindSafe for AccessConfig
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3398/docs/iroh_relay/server/struct.Server.html b/pr/3398/docs/iroh_relay/server/struct.Server.html
index 0c148e8f47..0522773fdc 100644
--- a/pr/3398/docs/iroh_relay/server/struct.Server.html
+++ b/pr/3398/docs/iroh_relay/server/struct.Server.html
@@ -14,9 +14,9 @@ case there is an error in the server before it is shut down.
Sourcepub fn quic_addr(&self) -> Option<SocketAddr>
The socket address the QUIC server is listening on.
Sourcepub fn stun_addr(&self) -> Option<SocketAddr>
The socket address the STUN server is listening on.
Sourcepub fn certificates(&self) -> Option<Vec<CertificateDer<'static>>>
The certificates chain if configured with manual TLS certificates.
-Sourcepub fn https_url(&self) -> Option<RelayUrl>
Available on crate feature test-utils only.
Get the server’s https [RelayUrl].
+Sourcepub fn https_url(&self) -> Option<RelayUrl>
Available on crate feature test-utils only.
Get the server’s https RelayUrl.
This uses Self::https_addr so it’s mostly useful for local development.
-Sourcepub fn http_url(&self) -> Option<RelayUrl>
Available on crate feature test-utils only.
Get the server’s http [RelayUrl].
+Sourcepub fn http_url(&self) -> Option<RelayUrl>
Available on crate feature test-utils only.
Get the server’s http RelayUrl.
This uses Self::http_addr so it’s mostly useful for local development.
Sourcepub fn metrics(&self) -> &RelayMetrics
Returns the metrics collected in the relay server.
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Server
§impl RefUnwindSafe for Server
§impl Send for Server
§impl Sync for Server
§impl Unpin for Server
§impl UnwindSafe for Server
Blanket Implementations§
Source§impl<T> Any for Twhere
diff --git a/pr/3398/docs/iroh_relay/struct.RelayMap.html b/pr/3398/docs/iroh_relay/struct.RelayMap.html
index 198be05e6d..c4384c1b86 100644
--- a/pr/3398/docs/iroh_relay/struct.RelayMap.html
+++ b/pr/3398/docs/iroh_relay/struct.RelayMap.html
@@ -1,15 +1,15 @@
RelayMap in iroh_relay - Rust pub struct RelayMap { /* private fields */ }
Expand description
Configuration of all the relay servers that can be used.
-Implementations§
Source§impl RelayMap
Implementations§
Trait Implementations§
Trait Implementations§
Source§impl FromIterator<RelayNode> for RelayMap
Source§impl FromIterator<RelayUrl> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayUrl>>(iter: T) -> Self
Creates a RelayMap from an iterator of [RelayUrl].
+Source§impl FromIterator<RelayNode> for RelayMap
Source§impl FromIterator<RelayUrl> for RelayMap
Source§impl PartialEq for RelayMap
Source§fn eq(&self, other: &RelayMap) -> bool
Tests for self and other values to be equal, and is used by ==.1.0.0 · Source§fn ne(&self, other: &Rhs) -> bool
Tests for !=. The default implementation is almost always sufficient,
diff --git a/pr/3398/docs/iroh_relay/struct.RelayNode.html b/pr/3398/docs/iroh_relay/struct.RelayNode.html
index 05292452e4..d5ea92ec7a 100644
--- a/pr/3398/docs/iroh_relay/struct.RelayNode.html
+++ b/pr/3398/docs/iroh_relay/struct.RelayNode.html
@@ -1,11 +1,11 @@
RelayNode in iroh_relay - Rust pub struct RelayNode {
- pub url: RelayUrl,
+ pub url: RelayUrl,
pub stun_only: bool,
pub stun_port: u16,
pub quic: Option<RelayQuicConfig>,
}
Expand description
Information on a specific relay server.
Includes the Url where it can be dialed.
-Fields§
§url: RelayUrlThe [RelayUrl] where this relay server can be dialed.
+Fields§
§url: RelayUrlThe RelayUrl where this relay server can be dialed.
§stun_only: boolWhether this relay server should only be used for STUN requests.
This essentially allows you to use a normal STUN server as a relay node, no relay
functionality is used.
@@ -15,7 +15,7 @@ functionality is used.
When None, we will not attempt to do QUIC address discovery
with this relay server.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RelayNode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl FromIterator<RelayNode> for RelayMap
Source§impl FromIterator<RelayNode> for RelayMap
Source§impl Ord for RelayNode
Source§impl PartialEq for RelayNode
Source§fn eq(&self, other: &RelayNode) -> bool
Tests for self and other values to be equal, and is used by ==.1.0.0 · Source§fn ne(&self, other: &Rhs) -> bool
Tests for !=. The default implementation is almost always sufficient,
diff --git a/pr/3398/docs/src/iroh/magicsock/node_map/node_state.rs.html b/pr/3398/docs/src/iroh/magicsock/node_map/node_state.rs.html
index b82a7379d0..4eb6fc2036 100644
--- a/pr/3398/docs/src/iroh/magicsock/node_map/node_state.rs.html
+++ b/pr/3398/docs/src/iroh/magicsock/node_map/node_state.rs.html
@@ -1742,7 +1742,9 @@
1741
1742
1743
-1744use std::{
+1744
+1745
+1746
use std::{
collections::{btree_map::Entry, BTreeSet, HashMap},
hash::Hash,
net::{IpAddr, SocketAddr},
@@ -2781,10 +2783,12 @@
}
}
}
- // Clear trust on our best_addr if it is not included in the updated set. Also
- // clear the last call-me-maybe send time so we will send one again.
- self.udp_paths.update_to_best_addr(now);
- self.last_call_me_maybe = None;
+ // Clear trust on our best_addr if it is not included in the updated set.
+ let changed = self.udp_paths.update_to_best_addr(now);
+ if changed {
+ // Clear the last call-me-maybe send time so we will send one again.
+ self.last_call_me_maybe = None;
+ }
debug!(
paths = %summarize_node_paths(&self.udp_paths.paths),
"updated endpoint paths from call-me-maybe",
diff --git a/pr/3398/docs/src/iroh/magicsock/node_map/udp_paths.rs.html b/pr/3398/docs/src/iroh/magicsock/node_map/udp_paths.rs.html
index cc78dce5b4..8c6632ef5a 100644
--- a/pr/3398/docs/src/iroh/magicsock/node_map/udp_paths.rs.html
+++ b/pr/3398/docs/src/iroh/magicsock/node_map/udp_paths.rs.html
@@ -169,7 +169,33 @@
168
169
170
-171
//! Path state for UDP addresses of a single peer node.
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
//! Path state for UDP addresses of a single peer node.
//!
//! This started as simply moving the [`NodeState`]'s `direct_addresses` and `best_addr`
//! into one place together. The aim is for external places to not directly interact with
@@ -179,6 +205,7 @@
use std::{collections::BTreeMap, net::SocketAddr};
use n0_future::time::Instant;
+use tracing::{event, Level};
use super::{path_state::PathState, IpPort};
@@ -195,7 +222,7 @@
///
/// [`MagicSock`]: crate::magicsock::MagicSock
/// [`NodeState`]: super::node_state::NodeState
-#[derive(Debug, Default, Clone, Copy)]
+#[derive(Debug, Default, Clone, Copy, PartialEq, Eq)]
pub(super) enum UdpSendAddr {
/// The UDP address can be relied on to deliver data to the remote node.
///
@@ -284,9 +311,34 @@
&self.best
}
- pub(super) fn update_to_best_addr(&mut self, now: Instant) {
- self.best_ipv4 = self.best_addr(false, now);
- self.best = self.best_addr(true, now);
+ /// Changes the current best address(es) to ones chosen as described in [`Self::best_addr`] docs.
+ ///
+ /// Returns whether one of the best addresses had to change.
+ ///
+ /// This should be called any time that `paths` is modified.
+ pub(super) fn update_to_best_addr(&mut self, now: Instant) -> bool {
+ let best_ipv4 = self.best_addr(false, now);
+ let best = self.best_addr(true, now);
+ let mut changed = false;
+ if best_ipv4 != self.best_ipv4 {
+ event!(
+ target: "iroh::_events::udp::best_ipv4",
+ Level::DEBUG,
+ ?best_ipv4,
+ );
+ changed = true;
+ }
+ if best != self.best {
+ event!(
+ target: "iroh::_events::udp::best",
+ Level::DEBUG,
+ ?best,
+ );
+ changed = true;
+ }
+ self.best_ipv4 = best_ipv4;
+ self.best = best;
+ changed
}
pub(super) fn best_addr(&self, have_ipv6: bool, now: Instant) -> UdpSendAddr {
diff --git a/pr/3398/docs/trait.impl/core/convert/trait.From.js b/pr/3398/docs/trait.impl/core/convert/trait.From.js
index 3c3eda16f7..f782f797c3 100644
--- a/pr/3398/docs/trait.impl/core/convert/trait.From.js
+++ b/pr/3398/docs/trait.impl/core/convert/trait.From.js
@@ -1,9 +1,9 @@
(function() {
- var implementors = Object.fromEntries([["iroh",[["impl From<DiscoveryItem> for NodeInfo"],["impl From<RemoteInfo> for NodeAddr"],["impl<T> From<T> for ConcurrentDiscovery"]]],["iroh_base",[["impl From<(PublicKey, Option<RelayUrl>, &[SocketAddr])> for NodeAddr"],["impl From<ParseError> for RelayUrlParseError"],["impl From<Url> for RelayUrl"],["impl From<NodeAddr> for NodeTicket"],["impl From<PublicKey> for NodeAddr"],["impl From<RelayUrl> for Url"],["impl From<NodeTicket> for NodeAddr"],["impl From<DecodeError> for KeyParsingError"],["impl From<DecodeError> for Error"],["impl From<Error> for KeyParsingError"],["impl From<Error> for Error"],["impl From<SigningKey> for SecretKey"],["impl From<VerifyingKey> for PublicKey"],["impl From<[u8; 32]> for SecretKey"]]],["iroh_relay",[["impl From<Error> for ConnSendError"],["impl From<NodeInfo> for NodeAddr"],["impl From<RelayNode> for RelayMap"],["impl From<Error> for ConnSendError"],["impl From<NodeAddr> for NodeData"],["impl From<NodeAddr> for NodeInfo"],["impl From<RelayUrl> for RelayMap"],["impl From<RelayUrl> for RelayNode"],["impl From<Resolver<GenericConnector<TokioRuntimeProvider>>> for DnsResolver"],["impl From<TxtLookup> for TxtLookup"]]]]);
+ var implementors = Object.fromEntries([["iroh",[["impl From<DiscoveryItem> for NodeInfo"],["impl From<RemoteInfo> for NodeAddr"],["impl<T> From<T> for ConcurrentDiscovery"]]],["iroh_base",[["impl From<(PublicKey, Option<RelayUrl>, &[SocketAddr])> for NodeAddr"],["impl From<ParseError> for RelayUrlParseError"],["impl From<Url> for RelayUrl"],["impl From<NodeAddr> for NodeTicket"],["impl From<PublicKey> for NodeAddr"],["impl From<RelayUrl> for Url"],["impl From<NodeTicket> for NodeAddr"],["impl From<DecodeError> for KeyParsingError"],["impl From<DecodeError> for Error"],["impl From<Error> for KeyParsingError"],["impl From<Error> for Error"],["impl From<SigningKey> for SecretKey"],["impl From<VerifyingKey> for PublicKey"],["impl From<[u8; 32]> for SecretKey"]]],["iroh_relay",[["impl From<Error> for ConnSendError"],["impl From<NodeAddr> for NodeData"],["impl From<NodeAddr> for NodeInfo"],["impl From<RelayUrl> for RelayMap"],["impl From<RelayUrl> for RelayNode"],["impl From<NodeInfo> for NodeAddr"],["impl From<RelayNode> for RelayMap"],["impl From<Error> for ConnSendError"],["impl From<Resolver<GenericConnector<TokioRuntimeProvider>>> for DnsResolver"],["impl From<TxtLookup> for TxtLookup"]]]]);
if (window.register_implementors) {
window.register_implementors(implementors);
} else {
window.pending_implementors = implementors;
}
})()
-//{"start":57,"fragment_lengths":[1632,5343,3221]}
\ No newline at end of file
+//{"start":57,"fragment_lengths":[1632,5343,3831]}
\ No newline at end of file
diff --git a/pr/3398/docs/trait.impl/core/iter/traits/collect/trait.FromIterator.js b/pr/3398/docs/trait.impl/core/iter/traits/collect/trait.FromIterator.js
index d104c409e3..8cd585bc9e 100644
--- a/pr/3398/docs/trait.impl/core/iter/traits/collect/trait.FromIterator.js
+++ b/pr/3398/docs/trait.impl/core/iter/traits/collect/trait.FromIterator.js
@@ -1,9 +1,9 @@
(function() {
- var implementors = Object.fromEntries([["iroh_relay",[["impl FromIterator<RelayNode> for RelayMap"],["impl FromIterator<RelayUrl> for RelayMap"]]]]);
+ var implementors = Object.fromEntries([["iroh_relay",[["impl FromIterator<RelayUrl> for RelayMap"],["impl FromIterator<RelayNode> for RelayMap"]]]]);
if (window.register_implementors) {
window.register_implementors(implementors);
} else {
window.pending_implementors = implementors;
}
})()
-//{"start":57,"fragment_lengths":[776]}
\ No newline at end of file
+//{"start":57,"fragment_lengths":[898]}
\ No newline at end of file