pub const DEFAULT_RELAY_QUIC_PORT: u16 = 7842; // 7_842u16Expand description
The default QUIC port used by the Relay server to accept QUIC connections +
Constant DEFAULT_RELAY_QUIC_PORT
pub const DEFAULT_RELAY_QUIC_PORT: u16 = 7842; // 7_842u16Expand description
The default QUIC port used by the Relay server to accept QUIC connections for QUIC address discovery
The port is “QUIC” typed on a phone keypad. The default QUIC port used by the Relay server to accept QUIC connections diff --git a/pr/3254/docs/iroh/defaults/constant.DEFAULT_STUN_PORT.html b/pr/3254/docs/iroh/defaults/constant.DEFAULT_STUN_PORT.html index bcaf8d2a33..7b929eeefd 100644 --- a/pr/3254/docs/iroh/defaults/constant.DEFAULT_STUN_PORT.html +++ b/pr/3254/docs/iroh/defaults/constant.DEFAULT_STUN_PORT.html @@ -1,4 +1,4 @@ -
pub const DEFAULT_STUN_PORT: u16 = 3478; // 3_478u16Expand description
The default STUN port used by the Relay server.
+Constant DEFAULT_STUN_PORT
pub const DEFAULT_STUN_PORT: u16 = 3478; // 3_478u16Expand description
The default STUN port used by the Relay server.
The STUN port as defined by RFC 8489 The default STUN port used by the Relay server.
diff --git a/pr/3254/docs/iroh/discovery/dns/constant.N0_DNS_NODE_ORIGIN_PROD.html b/pr/3254/docs/iroh/discovery/dns/constant.N0_DNS_NODE_ORIGIN_PROD.html index 108ca21590..51b2f605eb 100644 --- a/pr/3254/docs/iroh/discovery/dns/constant.N0_DNS_NODE_ORIGIN_PROD.html +++ b/pr/3254/docs/iroh/discovery/dns/constant.N0_DNS_NODE_ORIGIN_PROD.html @@ -1,2 +1,2 @@ -pub const N0_DNS_NODE_ORIGIN_PROD: &'static str;wasm_browser only.Expand description
The n0 testing DNS node origin, for production.
+Constant N0_DNS_NODE_ORIGIN_PROD
pub const N0_DNS_NODE_ORIGIN_PROD: &'static str;wasm_browser only.Expand description
The n0 testing DNS node origin, for production.
pub const N0_DNS_NODE_ORIGIN_STAGING: &'static str;wasm_browser only.Expand description
The n0 testing DNS node origin, for testing.
+Constant N0_DNS_NODE_ORIGIN_STAGING
pub const N0_DNS_NODE_ORIGIN_STAGING: &'static str;wasm_browser only.Expand description
The n0 testing DNS node origin, for testing.
Sourcepub fn to_node_addr(&self) -> NodeAddr
pub fn to_node_addr(&self) -> NodeAddr
Converts into a NodeAddr by cloning the needed fields.
Sourcepub fn into_node_addr(self) -> NodeAddr
pub fn into_node_addr(self) -> NodeAddr
Converts into a NodeAddr without cloning.
Methods from Deref<Target = NodeData>§
pub fn direct_addresses(&self) -> &BTreeSet<SocketAddr>
pub fn direct_addresses(&self) -> &BTreeSet<SocketAddr>
Returns the direct addresses of the node.
Trait Implementations§
Source§impl Clone for DiscoveryItem
impl Clone for DiscoveryItem
Source§fn clone(&self) -> DiscoveryItem
fn clone(&self) -> DiscoveryItem
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DiscoveryItem
impl Debug for DiscoveryItem
Source§impl Deref for DiscoveryItem
impl Deref for DiscoveryItem
Source§impl From<DiscoveryItem> for NodeInfo
impl From<DiscoveryItem> for NodeInfo
Source§fn from(item: DiscoveryItem) -> Self
fn from(item: DiscoveryItem) -> Self
Auto Trait Implementations§
impl Freeze for DiscoveryItem
impl RefUnwindSafe for DiscoveryItem
impl Send for DiscoveryItem
impl Sync for DiscoveryItem
impl Unpin for DiscoveryItem
impl UnwindSafe for DiscoveryItem
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
diff --git a/pr/3254/docs/iroh/discovery/struct.NodeData.html b/pr/3254/docs/iroh/discovery/struct.NodeData.html
index 88d24bd42d..b3a9ec4402 100644
--- a/pr/3254/docs/iroh/discovery/struct.NodeData.html
+++ b/pr/3254/docs/iroh/discovery/struct.NodeData.html
@@ -1,31 +1,31 @@
-NodeData in iroh::discovery - Rust pub struct NodeData { /* private fields */ }
Expand description
Data about a node that may be published to and resolved from discovery services.
+NodeData in iroh::discovery - Rust Struct NodeData
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
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.
-Implementations§
Implementations§
§impl NodeData
pub fn new(
relay_url: Option<RelayUrl>,
direct_addresses: BTreeSet<SocketAddr>,
) -> NodeData
Creates a new NodeData with a relay URL and a set of direct addresses.
-Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> NodeData
Sets the relay URL and returns the updated node data.
-Sourcepub fn with_direct_addresses(
+
pub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> NodeData
Sets the relay URL and returns the updated node data.
+pub fn with_direct_addresses(
self,
direct_addresses: BTreeSet<SocketAddr>,
) -> NodeData
Sets the direct addresses and returns the updated node data.
-Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> NodeData
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.
-Sourcepub fn add_direct_addresses(
+
pub fn with_user_data(self, user_data: Option<UserData>) -> NodeData
Sets the user-defined data and returns the updated node data.
+pub fn direct_addresses(&self) -> &BTreeSet<SocketAddr>
Returns the direct addresses of the node.
+pub fn clear_direct_addresses(&mut self)
Removes all direct addresses from the node data.
+pub fn add_direct_addresses(
&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_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the node data.
-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§
pub fn set_relay_url(&mut self, relay_url: Option<RelayUrl>)
Sets the relay URL of the node data.
+pub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the node data.
+Trait Implementations§
§impl Eq for NodeData
§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
T: 'a,
§fn implicit(
diff --git a/pr/3254/docs/iroh/discovery/struct.NodeInfo.html b/pr/3254/docs/iroh/discovery/struct.NodeInfo.html
index 021976d4db..991766d098 100644
--- a/pr/3254/docs/iroh/discovery/struct.NodeInfo.html
+++ b/pr/3254/docs/iroh/discovery/struct.NodeInfo.html
@@ -1,43 +1,43 @@
-NodeInfo in iroh::discovery - Rust pub struct NodeInfo {
+NodeInfo in iroh::discovery - Rust Struct NodeInfo
pub struct NodeInfo {
pub node_id: PublicKey,
pub data: NodeData,
}
Expand description
Fields§
§node_id: PublicKeyThe NodeId of the node this is about.
§data: NodeDataThe information published about the node.
-Implementations§
Source§impl NodeInfo
Sourcepub fn from_parts(node_id: PublicKey, data: NodeData) -> NodeInfo
Creates a new NodeInfo from its parts.
-Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> NodeInfo
Sets the relay URL and returns the updated node info.
-Sourcepub fn with_direct_addresses(
+
Implementations§
§impl NodeInfo
pub fn from_parts(node_id: PublicKey, data: NodeData) -> NodeInfo
Creates a new NodeInfo from its parts.
+pub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> NodeInfo
Sets the relay URL and returns the updated node info.
+pub fn with_direct_addresses(
self,
direct_addresses: BTreeSet<SocketAddr>,
) -> NodeInfo
Sets the direct addresses and returns the updated node info.
-Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> NodeInfo
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 from_txt_lookup(lookup: TxtLookup) -> Result<NodeInfo, Error>
Available on non-wasm_browser only.
Parses a NodeInfo from a TXT records lookup.
-Sourcepub fn from_pkarr_signed_packet(
+
pub fn with_user_data(self, user_data: Option<UserData>) -> NodeInfo
Sets the user-defined data and returns the updated node info.
+pub fn to_node_addr(&self) -> NodeAddr
Converts into a NodeAddr by cloning the needed fields.
+pub fn into_node_addr(self) -> NodeAddr
Converts into a NodeAddr without cloning.
+pub fn from_txt_lookup(lookup: TxtLookup) -> Result<NodeInfo, Error>
Available on non-wasm_browser only.
Parses a NodeInfo from a TXT records lookup.
+pub fn from_pkarr_signed_packet(
packet: &SignedPacket,
) -> Result<NodeInfo, Error>
Parses a NodeInfo from a [pkarr::SignedPacket].
-Sourcepub fn to_pkarr_signed_packet(
+
pub fn to_pkarr_signed_packet(
&self,
secret_key: &SecretKey,
ttl: u32,
) -> Result<SignedPacket, Error>
Creates a [pkarr::SignedPacket].
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.
-Sourcepub fn add_direct_addresses(
+
pub fn to_txt_strings(&self) -> Vec<String>
Converts into a list of {key}={value} strings.
+
Methods from Deref<Target = NodeData>§
pub fn direct_addresses(&self) -> &BTreeSet<SocketAddr>
Returns the direct addresses of the node.
+pub fn clear_direct_addresses(&mut self)
Removes all direct addresses from the node data.
+pub fn add_direct_addresses(
&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_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the node data.
-Trait Implementations§
Source§impl From<DiscoveryItem> for NodeInfo
Source§fn from(item: DiscoveryItem) -> Self
Converts to this type from the input type.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§
pub fn set_relay_url(&mut self, relay_url: Option<RelayUrl>)
Sets the relay URL of the node data.
+pub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the node data.
+Trait Implementations§
Source§impl From<DiscoveryItem> for NodeInfo
Source§fn from(item: DiscoveryItem) -> Self
Converts to this type from the input type.§impl Eq for NodeInfo
§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
T: 'a,
§fn implicit(
diff --git a/pr/3254/docs/iroh/discovery/struct.UserData.html b/pr/3254/docs/iroh/discovery/struct.UserData.html
index 134f039717..74cd45e3c7 100644
--- a/pr/3254/docs/iroh/discovery/struct.UserData.html
+++ b/pr/3254/docs/iroh/discovery/struct.UserData.html
@@ -1,24 +1,24 @@
-UserData in iroh::discovery - Rust pub struct UserData(/* private fields */);
Expand description
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
+UserData in iroh::discovery - Rust Struct UserData
pub struct UserData(/* private fields */);
Expand description
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
Iroh does not keep track of or examine the user-defined data.
UserData implements FromStr and TryFrom<String>, so you can
convert &str and String into UserData easily.
-Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
+Implementations§
§impl UserData
pub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
In DNS discovery services, the user-defined data is stored in a TXT record character string,
which has a max length of 255 bytes. We need to subtract the user-data= prefix,
which leaves 245 bytes for the actual user-defined data.
-Trait Implementations§
Trait Implementations§
§impl Ord for UserData
Source§impl PartialOrd for UserData
Source§impl Eq for UserData
Source§impl StructuralPartialEq for UserData
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
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/3254/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_PROD.html b/pr/3254/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_PROD.html
index dd2f30450f..1e378e6be9 100644
--- a/pr/3254/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_PROD.html
+++ b/pr/3254/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_PROD.html
@@ -1,2 +1,2 @@
-N0_DNS_NODE_ORIGIN_PROD in iroh::dns - Rust pub const N0_DNS_NODE_ORIGIN_PROD: &'static str;
Available on non-wasm_browser only.Expand description
The n0 testing DNS node origin, for production.
+N0_DNS_NODE_ORIGIN_PROD in iroh::dns - Rust Constant N0_DNS_NODE_ORIGIN_PROD
pub const N0_DNS_NODE_ORIGIN_PROD: &'static str;
Available on non-wasm_browser only.Expand description
The n0 testing DNS node origin, for production.
\ No newline at end of file
diff --git a/pr/3254/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_STAGING.html b/pr/3254/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_STAGING.html
index fa61f0f616..00c49c891d 100644
--- a/pr/3254/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_STAGING.html
+++ b/pr/3254/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_STAGING.html
@@ -1,2 +1,2 @@
-N0_DNS_NODE_ORIGIN_STAGING in iroh::dns - Rust pub const N0_DNS_NODE_ORIGIN_STAGING: &'static str;
Available on non-wasm_browser only.Expand description
The n0 testing DNS node origin, for testing.
+N0_DNS_NODE_ORIGIN_STAGING in iroh::dns - Rust Constant N0_DNS_NODE_ORIGIN_STAGING
pub const N0_DNS_NODE_ORIGIN_STAGING: &'static str;
Available on non-wasm_browser only.Expand description
The n0 testing DNS node origin, for testing.
\ No newline at end of file
diff --git a/pr/3254/docs/iroh/dns/struct.DnsResolver.html b/pr/3254/docs/iroh/dns/struct.DnsResolver.html
index cd04f1ce17..53843cda16 100644
--- a/pr/3254/docs/iroh/dns/struct.DnsResolver.html
+++ b/pr/3254/docs/iroh/dns/struct.DnsResolver.html
@@ -1,26 +1,26 @@
-DnsResolver in iroh::dns - Rust pub struct DnsResolver(/* private fields */);
Available on non-wasm_browser only.Expand description
The DNS resolver used throughout iroh.
-Implementations§
Source§impl DnsResolver
Sourcepub fn new() -> DnsResolver
Create a new DNS resolver with sensible cross-platform defaults.
+DnsResolver in iroh::dns - Rust Struct DnsResolver
pub struct DnsResolver(/* private fields */);
Available on non-wasm_browser only.Expand description
The DNS resolver used throughout iroh.
+Implementations§
§impl DnsResolver
pub fn new() -> DnsResolver
Create a new DNS resolver with sensible cross-platform defaults.
We first try to read the system’s resolver from /etc/resolv.conf.
This does not work at least on some Androids, therefore we fallback
to the default ResolverConfig which uses eg. to google’s 8.8.8.8 or 8.8.4.4.
-Sourcepub fn with_nameserver(nameserver: SocketAddr) -> DnsResolver
Create a new DNS resolver configured with a single UDP DNS nameserver.
-Sourcepub fn clear_cache(&self)
Removes all entries from the cache.
-Sourcepub async fn lookup_txt(
+
pub fn with_nameserver(nameserver: SocketAddr) -> DnsResolver
Create a new DNS resolver configured with a single UDP DNS nameserver.
+pub fn clear_cache(&self)
Removes all entries from the cache.
+pub async fn lookup_txt(
&self,
host: impl ToString,
timeout: Duration,
-) -> Result<TxtLookup, Error>
Lookup a TXT record.
-Sourcepub async fn lookup_ipv4(
+) -> Result<TxtLookup, Error>
Lookup a TXT record.
+pub async fn lookup_ipv4(
&self,
host: impl ToString,
timeout: Duration,
) -> Result<impl Iterator<Item = IpAddr>, Error>
Perform an ipv4 lookup with a timeout.
-Sourcepub async fn lookup_ipv6(
+
pub async fn lookup_ipv6(
&self,
host: impl ToString,
timeout: Duration,
) -> Result<impl Iterator<Item = IpAddr>, Error>
Perform an ipv6 lookup with a timeout.
-Sourcepub async fn lookup_ipv4_ipv6(
+
pub async fn lookup_ipv4_ipv6(
&self,
host: impl ToString,
timeout: Duration,
@@ -28,13 +28,13 @@ to the default ResolverConfig which uses eg. to google’s 8.
LookupIpStrategy::Ipv4AndIpv6 will wait for ipv6 resolution timeout, even if it is
not usable on the stack, so we manually query both lookups concurrently and time them out
individually.
-
Sourcepub async fn resolve_host(
+
pub async fn resolve_host(
&self,
url: &Url,
prefer_ipv6: bool,
timeout: Duration,
) -> Result<IpAddr, Error>
Resolve a hostname from a URL to an IP address.
-Sourcepub async fn lookup_ipv4_staggered(
+
pub async fn lookup_ipv4_staggered(
&self,
host: impl ToString,
timeout: Duration,
@@ -44,7 +44,7 @@ individually.
delays_ms with the first call being done immediately. [200ms, 300ms] results in calls
at T+0ms, T+200ms and T+300ms. The timeout is applied to each call individually. The
result of the first successful call is returned, or a summary of all errors otherwise.
-
Sourcepub async fn lookup_ipv6_staggered(
+
pub async fn lookup_ipv6_staggered(
&self,
host: impl ToString,
timeout: Duration,
@@ -54,7 +54,7 @@ result of the first successful call is returned, or a summary of all errors othe
delays_ms with the first call being done immediately. [200ms, 300ms] results in calls
at T+0ms, T+200ms and T+300ms. The timeout is applied to each call individually. The
result of the first successful call is returned, or a summary of all errors otherwise.
-
Sourcepub async fn lookup_ipv4_ipv6_staggered(
+
pub async fn lookup_ipv4_ipv6_staggered(
&self,
host: impl ToString,
timeout: Duration,
@@ -65,18 +65,18 @@ result of the first successful call is returned, or a summary of all errors othe
at T+0ms, T+200ms and T+300ms. The timeout is applied as stated in
Self::lookup_ipv4_ipv6. The result of the first successful call is returned, or a
summary of all errors otherwise.
-
Sourcepub async fn lookup_node_by_id(
+
pub async fn lookup_node_by_id(
&self,
node_id: &PublicKey,
origin: &str,
) -> Result<NodeInfo, Error>
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(
+
pub async fn lookup_node_by_domain_name(
&self,
name: &str,
) -> Result<NodeInfo, Error>
Looks up node info by DNS name.
-Sourcepub async fn lookup_node_by_domain_name_staggered(
+
pub async fn lookup_node_by_domain_name_staggered(
&self,
name: &str,
delays_ms: &[u64],
@@ -85,7 +85,7 @@ pass Sourcepub async fn lookup_node_by_id_staggered(
+
pub async fn lookup_node_by_id_staggered(
&self,
node_id: &PublicKey,
origin: &str,
@@ -95,7 +95,7 @@ summary of all errors otherwise.
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
summary of all errors otherwise.
-
Trait Implementations§
Source§impl Clone for DnsResolver
Source§fn clone(&self) -> DnsResolver
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 DnsResolver
Source§impl Default for DnsResolver
Source§fn default() -> DnsResolver
Returns the “default value” for a type. Read moreTrait Implementations§
§impl Clone for DnsResolver
§fn clone(&self) -> DnsResolver
Returns a copy of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more§impl Debug for DnsResolver
§impl Default for DnsResolver
§fn default() -> DnsResolver
Returns the “default value” for a type. Read more§impl From<Resolver<GenericConnector<TokioRuntimeProvider>>> for DnsResolver
§fn from(
resolver: Resolver<GenericConnector<TokioRuntimeProvider>>,
) -> DnsResolver
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for DnsResolver
§impl !RefUnwindSafe for DnsResolver
§impl Send for DnsResolver
§impl Sync for DnsResolver
§impl Unpin for DnsResolver
§impl !UnwindSafe for DnsResolver
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/3254/docs/iroh/metrics/struct.RelayMetrics.html b/pr/3254/docs/iroh/metrics/struct.RelayMetrics.html
index 83ae1acdcc..6f22d04f93 100644
--- a/pr/3254/docs/iroh/metrics/struct.RelayMetrics.html
+++ b/pr/3254/docs/iroh/metrics/struct.RelayMetrics.html
@@ -1,4 +1,4 @@
-RelayMetrics in iroh::metrics - Rust pub struct RelayMetrics {Show 21 fields
+RelayMetrics in iroh::metrics - Rust Struct RelayMetrics
pub struct RelayMetrics {Show 21 fields
pub bytes_sent: Counter,
pub bytes_recv: Counter,
pub send_packets_sent: Counter,
@@ -42,7 +42,7 @@
§unique_client_keys: CounterNumber of unique client keys per day
§websocket_accepts: CounterNumber of accepted websocket connections
§relay_accepts: CounterNumber of accepted ‘iroh derp http’ connection upgrades
-Trait Implementations§
Source§impl Metric for Metrics
§fn new(registry: &mut Registry) -> Self
Available on crate feature metrics only.Initializes this metric group.§fn with_metric<T, F>(f: F)where
+Trait Implementations§
§impl Metric for Metrics
§fn new(registry: &mut Registry) -> Self
Available on crate feature metrics only.Initializes this metric group.§fn with_metric<T, F>(f: F)where
F: FnOnce(&Self) -> T,
Available on crate feature metrics only.Access to this metrics group to record a metric.
Only records if this metric is registered in the global registry.Auto Trait Implementations§
§impl Freeze for Metrics
§impl RefUnwindSafe for Metrics
§impl Send for Metrics
§impl Sync for Metrics
§impl Unpin for Metrics
§impl UnwindSafe for Metrics
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/3254/docs/iroh/node_info/constant.IROH_TXT_NAME.html b/pr/3254/docs/iroh/node_info/constant.IROH_TXT_NAME.html
index c78d056a1f..0c1e657fb3 100644
--- a/pr/3254/docs/iroh/node_info/constant.IROH_TXT_NAME.html
+++ b/pr/3254/docs/iroh/node_info/constant.IROH_TXT_NAME.html
@@ -1,2 +1,2 @@
-IROH_TXT_NAME in iroh::node_info - Rust pub const IROH_TXT_NAME: &'static str;
Expand description
The DNS name for the iroh TXT record.
+IROH_TXT_NAME in iroh::node_info - Rust Constant IROH_TXT_NAME
pub const IROH_TXT_NAME: &'static str;
Expand description
The DNS name for the iroh TXT record.
\ No newline at end of file
diff --git a/pr/3254/docs/iroh/node_info/index.html b/pr/3254/docs/iroh/node_info/index.html
index 9884414f78..5130358fc8 100644
--- a/pr/3254/docs/iroh/node_info/index.html
+++ b/pr/3254/docs/iroh/node_info/index.html
@@ -1,4 +1,4 @@
-iroh::node_info - Rust Expand description
Support for handling DNS resource records for dialing by NodeId.
+iroh::node_info - Rust Module node_info
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:
diff --git a/pr/3254/docs/iroh/node_info/struct.MaxLengthExceededError.html b/pr/3254/docs/iroh/node_info/struct.MaxLengthExceededError.html
index 2f1c9b7234..33cd3a33fc 100644
--- a/pr/3254/docs/iroh/node_info/struct.MaxLengthExceededError.html
+++ b/pr/3254/docs/iroh/node_info/struct.MaxLengthExceededError.html
@@ -1,5 +1,5 @@
-MaxLengthExceededError in iroh::node_info - Rust pub struct MaxLengthExceededError;
Expand description
Error returned when an input value is too long for UserData.
-Trait Implementations§
Source§impl Debug for MaxLengthExceededError
Source§impl Display for MaxLengthExceededError
Source§impl Error for MaxLengthExceededError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Auto Trait Implementations§
§impl Freeze for MaxLengthExceededError
§impl RefUnwindSafe for MaxLengthExceededError
§impl Send for MaxLengthExceededError
§impl Sync for MaxLengthExceededError
§impl Unpin for MaxLengthExceededError
§impl UnwindSafe for MaxLengthExceededError
Blanket Implementations§
Source§impl<T> Any for Twhere
+MaxLengthExceededError in iroh::node_info - Rust Struct MaxLengthExceededError
pub struct MaxLengthExceededError;
Expand description
Error returned when an input value is too long for UserData.
+Trait Implementations§
§impl Debug for MaxLengthExceededError
§impl Display for MaxLengthExceededError
§impl Error for MaxLengthExceededError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Auto Trait Implementations§
§impl Freeze for MaxLengthExceededError
§impl RefUnwindSafe for MaxLengthExceededError
§impl Send for MaxLengthExceededError
§impl Sync for MaxLengthExceededError
§impl Unpin for MaxLengthExceededError
§impl UnwindSafe for MaxLengthExceededError
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/3254/docs/iroh/node_info/struct.NodeData.html b/pr/3254/docs/iroh/node_info/struct.NodeData.html
index 8315fa3859..6a489b4160 100644
--- a/pr/3254/docs/iroh/node_info/struct.NodeData.html
+++ b/pr/3254/docs/iroh/node_info/struct.NodeData.html
@@ -1,31 +1,31 @@
-NodeData in iroh::node_info - Rust pub struct NodeData { /* private fields */ }
Expand description
Data about a node that may be published to and resolved from discovery services.
+NodeData in iroh::node_info - Rust Struct NodeData
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
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.
-Implementations§
Implementations§
§impl NodeData
pub fn new(
relay_url: Option<RelayUrl>,
direct_addresses: BTreeSet<SocketAddr>,
) -> NodeData
Creates a new NodeData with a relay URL and a set of direct addresses.
-Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> NodeData
Sets the relay URL and returns the updated node data.
-Sourcepub fn with_direct_addresses(
+
pub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> NodeData
Sets the relay URL and returns the updated node data.
+pub fn with_direct_addresses(
self,
direct_addresses: BTreeSet<SocketAddr>,
) -> NodeData
Sets the direct addresses and returns the updated node data.
-Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> NodeData
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.
-Sourcepub fn add_direct_addresses(
+
pub fn with_user_data(self, user_data: Option<UserData>) -> NodeData
Sets the user-defined data and returns the updated node data.
+pub fn direct_addresses(&self) -> &BTreeSet<SocketAddr>
Returns the direct addresses of the node.
+pub fn clear_direct_addresses(&mut self)
Removes all direct addresses from the node data.
+pub fn add_direct_addresses(
&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_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the node data.
-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§
pub fn set_relay_url(&mut self, relay_url: Option<RelayUrl>)
Sets the relay URL of the node data.
+pub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the node data.
+Trait Implementations§
§impl Eq for NodeData
§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
T: 'a,
§fn implicit(
diff --git a/pr/3254/docs/iroh/node_info/struct.NodeInfo.html b/pr/3254/docs/iroh/node_info/struct.NodeInfo.html
index d477ae0321..8adc2da63a 100644
--- a/pr/3254/docs/iroh/node_info/struct.NodeInfo.html
+++ b/pr/3254/docs/iroh/node_info/struct.NodeInfo.html
@@ -1,43 +1,43 @@
-NodeInfo in iroh::node_info - Rust pub struct NodeInfo {
+NodeInfo in iroh::node_info - Rust Struct NodeInfo
pub struct NodeInfo {
pub node_id: PublicKey,
pub data: NodeData,
}
Expand description
Fields§
§node_id: PublicKeyThe NodeId of the node this is about.
§data: NodeDataThe information published about the node.
-Implementations§
Source§impl NodeInfo
Sourcepub fn from_parts(node_id: PublicKey, data: NodeData) -> NodeInfo
Creates a new NodeInfo from its parts.
-Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> NodeInfo
Sets the relay URL and returns the updated node info.
-Sourcepub fn with_direct_addresses(
+
Implementations§
§impl NodeInfo
pub fn from_parts(node_id: PublicKey, data: NodeData) -> NodeInfo
Creates a new NodeInfo from its parts.
+pub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> NodeInfo
Sets the relay URL and returns the updated node info.
+pub fn with_direct_addresses(
self,
direct_addresses: BTreeSet<SocketAddr>,
) -> NodeInfo
Sets the direct addresses and returns the updated node info.
-Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> NodeInfo
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 from_txt_lookup(lookup: TxtLookup) -> Result<NodeInfo, Error>
Available on non-wasm_browser only.
Parses a NodeInfo from a TXT records lookup.
-Sourcepub fn from_pkarr_signed_packet(
+
pub fn with_user_data(self, user_data: Option<UserData>) -> NodeInfo
Sets the user-defined data and returns the updated node info.
+pub fn to_node_addr(&self) -> NodeAddr
Converts into a NodeAddr by cloning the needed fields.
+pub fn into_node_addr(self) -> NodeAddr
Converts into a NodeAddr without cloning.
+pub fn from_txt_lookup(lookup: TxtLookup) -> Result<NodeInfo, Error>
Available on non-wasm_browser only.
Parses a NodeInfo from a TXT records lookup.
+pub fn from_pkarr_signed_packet(
packet: &SignedPacket,
) -> Result<NodeInfo, Error>
Parses a NodeInfo from a [pkarr::SignedPacket].
-Sourcepub fn to_pkarr_signed_packet(
+
pub fn to_pkarr_signed_packet(
&self,
secret_key: &SecretKey,
ttl: u32,
) -> Result<SignedPacket, Error>
Creates a [pkarr::SignedPacket].
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.
-Sourcepub fn add_direct_addresses(
+
pub fn to_txt_strings(&self) -> Vec<String>
Converts into a list of {key}={value} strings.
+
Methods from Deref<Target = NodeData>§
pub fn direct_addresses(&self) -> &BTreeSet<SocketAddr>
Returns the direct addresses of the node.
+pub fn clear_direct_addresses(&mut self)
Removes all direct addresses from the node data.
+pub fn add_direct_addresses(
&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_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the node data.
-Trait Implementations§
Source§impl From<DiscoveryItem> for NodeInfo
Source§fn from(item: DiscoveryItem) -> Self
Converts to this type from the input type.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§
pub fn set_relay_url(&mut self, relay_url: Option<RelayUrl>)
Sets the relay URL of the node data.
+pub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the node data.
+Trait Implementations§
Source§impl From<DiscoveryItem> for NodeInfo
Source§fn from(item: DiscoveryItem) -> Self
Converts to this type from the input type.§impl Eq for NodeInfo
§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
T: 'a,
§fn implicit(
diff --git a/pr/3254/docs/iroh/node_info/struct.UserData.html b/pr/3254/docs/iroh/node_info/struct.UserData.html
index 4f76e55134..fb7ea9a345 100644
--- a/pr/3254/docs/iroh/node_info/struct.UserData.html
+++ b/pr/3254/docs/iroh/node_info/struct.UserData.html
@@ -1,24 +1,24 @@
-UserData in iroh::node_info - Rust pub struct UserData(/* private fields */);
Expand description
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
+UserData in iroh::node_info - Rust Struct UserData
pub struct UserData(/* private fields */);
Expand description
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
Iroh does not keep track of or examine the user-defined data.
UserData implements FromStr and TryFrom<String>, so you can
convert &str and String into UserData easily.
-Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
+Implementations§
§impl UserData
pub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
In DNS discovery services, the user-defined data is stored in a TXT record character string,
which has a max length of 255 bytes. We need to subtract the user-data= prefix,
which leaves 245 bytes for the actual user-defined data.
-Trait Implementations§
Trait Implementations§
§impl Ord for UserData
Source§impl PartialOrd for UserData
Source§impl Eq for UserData
Source§impl StructuralPartialEq for UserData
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
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/3254/docs/iroh/node_info/trait.NodeIdExt.html b/pr/3254/docs/iroh/node_info/trait.NodeIdExt.html
index 554c8c6e66..6d8273fb7e 100644
--- a/pr/3254/docs/iroh/node_info/trait.NodeIdExt.html
+++ b/pr/3254/docs/iroh/node_info/trait.NodeIdExt.html
@@ -1,9 +1,9 @@
-NodeIdExt in iroh::node_info - Rust pub trait NodeIdExt {
+NodeIdExt in iroh::node_info - Rust Trait NodeIdExt
pub trait NodeIdExt {
// Required methods
fn to_z32(&self) -> String;
fn from_z32(s: &str) -> Result<PublicKey, Error>;
}
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.
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.
Implementors§
\ No newline at end of file
diff --git a/pr/3254/docs/iroh/struct.NodeAddr.html b/pr/3254/docs/iroh/struct.NodeAddr.html
index cd39aabacf..b2e98874c3 100644
--- a/pr/3254/docs/iroh/struct.NodeAddr.html
+++ b/pr/3254/docs/iroh/struct.NodeAddr.html
@@ -44,7 +44,7 @@ whenever a connection to other nodes needs to be established.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for NodeAddr
Source§fn deserialize<__D>(
__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.
+ __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 Ord for NodeAddr
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more1.21.0 · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more1.50.0 · Source§fn clamp(self, min: Self, max: Self) -> Selfwhere
diff --git a/pr/3254/docs/iroh/struct.PublicKey.html b/pr/3254/docs/iroh/struct.PublicKey.html
index 140d5f9452..94f97f44d1 100644
--- a/pr/3254/docs/iroh/struct.PublicKey.html
+++ b/pr/3254/docs/iroh/struct.PublicKey.html
@@ -22,7 +22,7 @@ representation of the key.
Source§impl Ord for PublicKey
Source§impl PartialEq for PublicKey
Source§fn eq(&self, other: &PublicKey) -> 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/3254/docs/iroh/struct.RelayMap.html b/pr/3254/docs/iroh/struct.RelayMap.html
index d44542c103..c331ec3208 100644
--- a/pr/3254/docs/iroh/struct.RelayMap.html
+++ b/pr/3254/docs/iroh/struct.RelayMap.html
@@ -1,26 +1,26 @@
-RelayMap in iroh - Rust pub struct RelayMap { /* private fields */ }
Expand description
Configuration of all the relay servers that can be used.
-Implementations§
Source§impl RelayMap
Sourcepub fn nodes(&self) -> impl Iterator<Item = &Arc<RelayNode>>
Returns an Iterator over all known nodes.
-Sourcepub fn contains_node(&self, url: &RelayUrl) -> bool
Is this a known node?
-Sourcepub fn default_from_node(url: RelayUrl, stun_port: u16) -> RelayMap
Creates a new RelayMap with a single relay server configured.
+RelayMap in iroh - Rust Struct RelayMap
pub struct RelayMap { /* private fields */ }
Expand description
Configuration of all the relay servers that can be used.
+Implementations§
§impl RelayMap
pub fn nodes(&self) -> impl Iterator<Item = &Arc<RelayNode>>
Returns an Iterator over all known nodes.
+pub fn contains_node(&self, url: &RelayUrl) -> bool
Is this a known node?
+pub fn default_from_node(url: RelayUrl, stun_port: u16) -> RelayMap
Creates a new RelayMap with a single relay server configured.
Allows to set a custom STUN port and different IP addresses for IPv4 and IPv6.
If IP addresses are provided, no DNS lookup will be performed.
Sets the port to the default DEFAULT_RELAY_QUIC_PORT.
-Sourcepub fn from_nodes<I>(
+
pub fn from_nodes<I>(
value: impl IntoIterator<Item = I>,
) -> Result<RelayMap, Error>
Trait Implementations§
Source§impl Eq for RelayMap
Source§impl StructuralPartialEq for RelayMap
Auto Trait Implementations§
§impl Freeze for RelayMap
§impl RefUnwindSafe for RelayMap
§impl Send for RelayMap
§impl Sync for RelayMap
§impl Unpin for RelayMap
§impl UnwindSafe for RelayMap
Blanket Implementations§
Trait Implementations§
§impl Eq for RelayMap
§impl StructuralPartialEq for RelayMap
Auto Trait Implementations§
§impl Freeze for RelayMap
§impl RefUnwindSafe for RelayMap
§impl Send for RelayMap
§impl Sync for RelayMap
§impl Unpin for RelayMap
§impl UnwindSafe for RelayMap
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/3254/docs/iroh/struct.RelayNode.html b/pr/3254/docs/iroh/struct.RelayNode.html
index efbb608578..9ab2cddcc0 100644
--- a/pr/3254/docs/iroh/struct.RelayNode.html
+++ b/pr/3254/docs/iroh/struct.RelayNode.html
@@ -1,8 +1,8 @@
-RelayNode in iroh - Rust pub struct RelayNode {
+RelayNode in iroh - Rust Struct RelayNode
pub struct RelayNode {
pub url: RelayUrl,
pub stun_only: bool,
pub stun_port: u16,
- pub quic: Option<RelayQuicConfig>,
+ 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.
@@ -11,24 +11,24 @@
functionality is used.
§stun_port: u16The stun port of the relay server.
Setting this to 0 means the default STUN port is used.
-§quic: Option<RelayQuicConfig>Configuration to speak to the QUIC endpoint on the relay server.
+§quic: Option<RelayQuicConfig>Configuration to speak to the QUIC endpoint on the relay server.
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>(
+
Trait Implementations§
§impl<'de> Deserialize<'de> for RelayNode
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<RelayNode, <__D as Deserializer<'de>>::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more§impl Ord for RelayNode
Source§impl PartialOrd for RelayNode
§impl Serialize for RelayNode
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
- __S: Serializer,
Serialize this value into the given Serde serializer. Read moreSource§impl Eq for RelayNode
Source§impl StructuralPartialEq for RelayNode
Auto Trait Implementations§
§impl Freeze for RelayNode
§impl RefUnwindSafe for RelayNode
§impl Send for RelayNode
§impl Sync for RelayNode
§impl Unpin for RelayNode
§impl UnwindSafe for RelayNode
Blanket Implementations§
Source§impl<T> Any for Twhere
+ __S: Serializer,
Serialize this value into the given Serde serializer. Read more§impl Eq for RelayNode
§impl StructuralPartialEq for RelayNode
Auto Trait Implementations§
§impl Freeze for RelayNode
§impl RefUnwindSafe for RelayNode
§impl Send for RelayNode
§impl Sync for RelayNode
§impl Unpin for RelayNode
§impl UnwindSafe for RelayNode
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/3254/docs/iroh/test_utils/fn.run_relay_server.html b/pr/3254/docs/iroh/test_utils/fn.run_relay_server.html
index 4f41fd2d31..d738a1d8e1 100644
--- a/pr/3254/docs/iroh/test_utils/fn.run_relay_server.html
+++ b/pr/3254/docs/iroh/test_utils/fn.run_relay_server.html
@@ -1,4 +1,4 @@
-run_relay_server in iroh::test_utils - Rust pub async fn run_relay_server() -> Result<(RelayMap, RelayUrl, Server)>
Available on crate feature test-utils only.Expand description
Runs a relay server with STUN and QUIC enabled suitable for tests.
+run_relay_server in iroh::test_utils - Rust
\ No newline at end of file
diff --git a/pr/3254/docs/iroh/test_utils/fn.run_relay_server_with.html b/pr/3254/docs/iroh/test_utils/fn.run_relay_server_with.html
index c31b8b2572..5b179c2f1d 100644
--- a/pr/3254/docs/iroh/test_utils/fn.run_relay_server_with.html
+++ b/pr/3254/docs/iroh/test_utils/fn.run_relay_server_with.html
@@ -1,9 +1,9 @@
run_relay_server_with in iroh::test_utils - Rust pub async fn run_relay_server_with(
- stun: Option<StunConfig>,
+ stun: Option<StunConfig>,
quic: bool,
-) -> Result<(RelayMap, RelayUrl, Server)>
Available on crate feature test-utils only.Expand description
Runs a relay server.
+) -> Result<(RelayMap, RelayUrl, Server)>Available on crate feature test-utils only.Expand description
Runs a relay server.
stun can be set to None to disable stun, or set to Some StunConfig,
to enable stun on a specific socket.
-If quic is set to true, it will make the appropriate QuicConfig from the generated tls certificates and run the quic server at a random free port.
+If quic is set to true, it will make the appropriate [QuicConfig] from the generated tls certificates and run the quic server at a random free port.
The return value is similar to run_relay_server.
\ No newline at end of file
diff --git a/pr/3254/docs/iroh/test_utils/fn.run_relay_server_with_stun.html b/pr/3254/docs/iroh/test_utils/fn.run_relay_server_with_stun.html
index 436f9d1200..ce014daffa 100644
--- a/pr/3254/docs/iroh/test_utils/fn.run_relay_server_with_stun.html
+++ b/pr/3254/docs/iroh/test_utils/fn.run_relay_server_with_stun.html
@@ -1,4 +1,4 @@
-run_relay_server_with_stun in iroh::test_utils - Rust pub async fn run_relay_server_with_stun() -> Result<(RelayMap, RelayUrl, Server)>
Available on crate feature test-utils only.Expand description
Runs a relay server with STUN enabled suitable for tests.
+run_relay_server_with_stun in iroh::test_utils - Rust
\ No newline at end of file
diff --git a/pr/3254/docs/iroh_net_report/struct.Client.html b/pr/3254/docs/iroh_net_report/struct.Client.html
index f8932f43eb..774654c5d3 100644
--- a/pr/3254/docs/iroh_net_report/struct.Client.html
+++ b/pr/3254/docs/iroh_net_report/struct.Client.html
@@ -7,7 +7,7 @@ If all Addr::receive_stun_packet.
Implementations§
Source§impl Client
Sourcepub fn new(
port_mapper: Option<Client>,
- dns_resolver: DnsResolver,
+ dns_resolver: DnsResolver,
ip_mapped_addrs: Option<IpMappedAddresses>,
) -> Result<Self>
Creates a new net_report client.
This starts a connected actor in the background. Once the client is dropped it will
@@ -17,7 +17,7 @@ stop running.
allows sending messages to the actor.
Sourcepub async fn get_report(
&mut self,
- relay_map: RelayMap,
+ relay_map: RelayMap,
stun_sock_v4: Option<Arc<UdpSocket>>,
stun_sock_v6: Option<Arc<UdpSocket>>,
quic_config: Option<QuicConfig>,
@@ -39,14 +39,14 @@ using QUIC address discovery.
This will attempt to use all probe protocols.
Sourcepub async fn get_report_with_opts(
&mut self,
- relay_map: RelayMap,
+ relay_map: RelayMap,
opts: Options,
) -> Result<Arc<Report>>
Runs a net_report, returning the report.
It may not be called concurrently with itself, &mut self takes care of that.
Look at Options for the different configuration options.
Sourcepub async fn get_report_channel(
&mut self,
- relay_map: RelayMap,
+ relay_map: RelayMap,
opts: Options,
) -> Result<Receiver<Result<Arc<Report>>>>
Get report with channel
Look at Options for the different configuration options.
diff --git a/pr/3254/docs/iroh_net_report/struct.RelayLatencies.html b/pr/3254/docs/iroh_net_report/struct.RelayLatencies.html
index cab40bff24..bbbe92b500 100644
--- a/pr/3254/docs/iroh_net_report/struct.RelayLatencies.html
+++ b/pr/3254/docs/iroh_net_report/struct.RelayLatencies.html
@@ -1,5 +1,5 @@
RelayLatencies in iroh_net_report - Rust pub struct RelayLatencies(/* private fields */);
Expand description
Latencies per relay node.
-Implementations§
Source§impl RelayLatencies
Sourcepub fn iter(&self) -> impl Iterator<Item = (&RelayUrl, Duration)> + '_
Returns an iterator over all the relays and their latencies.
+Implementations§
Trait Implementations§
Source§impl Clone for RelayLatencies
Source§fn clone(&self) -> RelayLatencies
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 RelayLatencies
Source§impl Default for RelayLatencies
Source§fn default() -> RelayLatencies
Returns the “default value” for a type. Read moreSource§impl PartialEq for RelayLatencies
Source§impl Eq for RelayLatencies
Source§impl StructuralPartialEq for RelayLatencies
Auto Trait Implementations§
§impl Freeze for RelayLatencies
§impl RefUnwindSafe for RelayLatencies
§impl Send for RelayLatencies
§impl Sync for RelayLatencies
§impl Unpin for RelayLatencies
§impl UnwindSafe for RelayLatencies
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/3254/docs/iroh_net_report/struct.Report.html b/pr/3254/docs/iroh_net_report/struct.Report.html
index b6dda01fab..1cdf766458 100644
--- a/pr/3254/docs/iroh_net_report/struct.Report.html
+++ b/pr/3254/docs/iroh_net_report/struct.Report.html
@@ -11,7 +11,7 @@
pub mapping_varies_by_dest_ipv6: Option<bool>,
pub hair_pinning: Option<bool>,
pub portmap_probe: Option<ProbeOutput>,
- pub preferred_relay: Option<RelayUrl>,
+ pub preferred_relay: Option<RelayUrl>,
pub relay_latency: RelayLatencies,
pub relay_v4_latency: RelayLatencies,
pub relay_v6_latency: RelayLatencies,
@@ -35,7 +35,7 @@ detecting rather than using it. For now.
§hair_pinning: Option<bool>Whether the router supports communicating between two local devices through the NATted
public IP address (on IPv4).
§portmap_probe: Option<ProbeOutput>Probe indicating the presence of port mapping protocols on the LAN.
-§preferred_relay: Option<RelayUrl>None for unknown
+§preferred_relay: Option<RelayUrl>None for unknown
§relay_latency: RelayLatencieskeyed by relay Url
§relay_v4_latency: RelayLatencieskeyed by relay Url
§relay_v6_latency: RelayLatencieskeyed by relay Url
diff --git a/pr/3254/docs/src/iroh/magicsock/relay_actor.rs.html b/pr/3254/docs/src/iroh/magicsock/relay_actor.rs.html
index 8a3318169b..10265b471c 100644
--- a/pr/3254/docs/src/iroh/magicsock/relay_actor.rs.html
+++ b/pr/3254/docs/src/iroh/magicsock/relay_actor.rs.html
@@ -1582,13 +1582,7 @@
1581
1582
1583
-1584
-1585
-1586
-1587
-1588
-1589
-1590//! The relay actor.
+1584
//! The relay actor.
//!
//! The [`RelayActor`] handles all the relay connections. It is helped by the
//! [`ActiveRelayActor`] which handles a single relay connection.
@@ -1871,25 +1865,19 @@
let mut backoff = Self::build_backoff();
- loop {
- match self.run_once().await {
- Err(err) => {
- warn!("Relay connection failed: {err:#}");
- if self.pong_received {
- // If the relay connection remained established long enough so that we received a pong
- // from the relay server, we reset the backoff and attempt to reconnect immediately.
- self.pong_received = false;
- backoff = Self::build_backoff();
- continue;
- } else {
- // If dialing failed, or if the relay connection failed before we received a pong,
- // we wait an exponentially increasing time until we attempt to reconnect again.
- let sleep = backoff.next().context("Retries exceeded")?;
- debug!("Retry in {sleep:?}");
- time::sleep(sleep).await;
- }
- }
- Ok(()) => break,
+ while let Err(err) = self.run_once().await {
+ warn!("Relay connection failed: {err:#}");
+ if self.pong_received {
+ // If the relay connection remained established long enough so that we received a pong
+ // from the relay server, we reset the backoff and attempt to reconnect immediately.
+ self.pong_received = false;
+ backoff = Self::build_backoff();
+ } else {
+ // If dialing failed, or if the relay connection failed before we received a pong,
+ // we wait an exponentially increasing time until we attempt to reconnect again.
+ let sleep = backoff.next().context("Retries exceeded")?;
+ debug!("Retry in {sleep:?}");
+ time::sleep(sleep).await;
}
}
debug!("exiting");
diff --git a/pr/3254/docs/type.impl/iroh/struct.PublicKey.js b/pr/3254/docs/type.impl/iroh/struct.PublicKey.js
index d01f8c9287..9c9039082f 100644
--- a/pr/3254/docs/type.impl/iroh/struct.PublicKey.js
+++ b/pr/3254/docs/type.impl/iroh/struct.PublicKey.js
@@ -1,9 +1,9 @@
(function() {
- var type_impls = Object.fromEntries([["iroh",[["","AsRef<[u8]>","iroh::NodeId"],["","Borrow<[u8; 32]>","iroh::NodeId"],["","Clone","iroh::NodeId"],["","Debug","iroh::NodeId"],["Source§impl<'de> Deserialize<'de> for PublicKey
Source§fn deserialize<D>(\n deserializer: D,\n) -> Result<PublicKey, <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh::NodeId"],["","Display","iroh::NodeId"],["","From","iroh::NodeId"],["Source§impl FromStr for PublicKey
","FromStr","iroh::NodeId"],["","Hash","iroh::NodeId"],["","NodeIdExt","iroh::NodeId"],["Source§impl Ord for PublicKey
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh::NodeId"],["","PartialEq","iroh::NodeId"],["Source§impl PartialOrd for PublicKey
","PartialOrd","iroh::NodeId"],["Source§impl PublicKey
Sourcepub fn from_bytes(bytes: &[u8; 32]) -> Result<PublicKey, Error>
Construct a PublicKey from a slice of bytes.
\n§Warning
\nThis will return a [SignatureError] if the bytes passed into this method do not represent\na valid ed25519_dalek curve point. Will never fail for bytes return from Self::as_bytes.\nSee [VerifyingKey::from_bytes] for details.
\n",0,"iroh::NodeId"],["Source§impl Serialize for PublicKey
Source§fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
Serialize this value into the given Serde serializer. Read more","Serialize","iroh::NodeId"],["","TryFrom<&[u8]>","iroh::NodeId"],["","TryFrom<&[u8; 32]>","iroh::NodeId"],["Source§impl Copy for PublicKey
","Copy","iroh::NodeId"],["Source§impl Eq for PublicKey
","Eq","iroh::NodeId"],["Source§impl StructuralPartialEq for PublicKey
","StructuralPartialEq","iroh::NodeId"]]]]);
+ var type_impls = Object.fromEntries([["iroh",[["","AsRef<[u8]>","iroh::NodeId"],["","Borrow<[u8; 32]>","iroh::NodeId"],["","Clone","iroh::NodeId"],["","Debug","iroh::NodeId"],["Source§impl<'de> Deserialize<'de> for PublicKey
Source§fn deserialize<D>(\n deserializer: D,\n) -> Result<PublicKey, <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh::NodeId"],["","Display","iroh::NodeId"],["","From","iroh::NodeId"],["Source§impl FromStr for PublicKey
","FromStr","iroh::NodeId"],["","Hash","iroh::NodeId"],["","NodeIdExt","iroh::NodeId"],["Source§impl Ord for PublicKey
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh::NodeId"],["","PartialEq","iroh::NodeId"],["Source§impl PartialOrd for PublicKey
","PartialOrd","iroh::NodeId"],["Source§impl PublicKey
Sourcepub fn from_bytes(bytes: &[u8; 32]) -> Result<PublicKey, Error>
Construct a PublicKey from a slice of bytes.
\n§Warning
\nThis will return a [SignatureError] if the bytes passed into this method do not represent\na valid ed25519_dalek curve point. Will never fail for bytes return from Self::as_bytes.\nSee [VerifyingKey::from_bytes] for details.
\n",0,"iroh::NodeId"],["Source§impl Serialize for PublicKey
Source§fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
Serialize this value into the given Serde serializer. Read more","Serialize","iroh::NodeId"],["","TryFrom<&[u8]>","iroh::NodeId"],["","TryFrom<&[u8; 32]>","iroh::NodeId"],["Source§impl Copy for PublicKey
","Copy","iroh::NodeId"],["Source§impl Eq for PublicKey
","Eq","iroh::NodeId"],["Source§impl StructuralPartialEq for PublicKey
","StructuralPartialEq","iroh::NodeId"]]]]);
if (window.register_type_impls) {
window.register_type_impls(type_impls);
} else {
window.pending_type_impls = type_impls;
}
})()
-//{"start":55,"fragment_lengths":[47903]}
\ No newline at end of file
+//{"start":55,"fragment_lengths":[47657]}
\ No newline at end of file
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3254/docs/iroh/discovery/struct.NodeData.html b/pr/3254/docs/iroh/discovery/struct.NodeData.html
index 88d24bd42d..b3a9ec4402 100644
--- a/pr/3254/docs/iroh/discovery/struct.NodeData.html
+++ b/pr/3254/docs/iroh/discovery/struct.NodeData.html
@@ -1,31 +1,31 @@
-NodeData in iroh::discovery - Rust pub struct NodeData { /* private fields */ }
Expand description
Data about a node that may be published to and resolved from discovery services.
+NodeData in iroh::discovery - Rust Struct NodeData
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
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.
-Implementations§
Implementations§
§impl NodeData
pub fn new(
relay_url: Option<RelayUrl>,
direct_addresses: BTreeSet<SocketAddr>,
) -> NodeData
Creates a new NodeData with a relay URL and a set of direct addresses.
-Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> NodeData
Sets the relay URL and returns the updated node data.
-Sourcepub fn with_direct_addresses(
+
pub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> NodeData
Sets the relay URL and returns the updated node data.
+pub fn with_direct_addresses(
self,
direct_addresses: BTreeSet<SocketAddr>,
) -> NodeData
Sets the direct addresses and returns the updated node data.
-Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> NodeData
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.
-Sourcepub fn add_direct_addresses(
+
pub fn with_user_data(self, user_data: Option<UserData>) -> NodeData
Sets the user-defined data and returns the updated node data.
+pub fn direct_addresses(&self) -> &BTreeSet<SocketAddr>
Returns the direct addresses of the node.
+pub fn clear_direct_addresses(&mut self)
Removes all direct addresses from the node data.
+pub fn add_direct_addresses(
&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_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the node data.
-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§
pub fn set_relay_url(&mut self, relay_url: Option<RelayUrl>)
Sets the relay URL of the node data.
+pub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the node data.
+Trait Implementations§
§impl Eq for NodeData
§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
T: 'a,
§fn implicit(
diff --git a/pr/3254/docs/iroh/discovery/struct.NodeInfo.html b/pr/3254/docs/iroh/discovery/struct.NodeInfo.html
index 021976d4db..991766d098 100644
--- a/pr/3254/docs/iroh/discovery/struct.NodeInfo.html
+++ b/pr/3254/docs/iroh/discovery/struct.NodeInfo.html
@@ -1,43 +1,43 @@
-NodeInfo in iroh::discovery - Rust pub struct NodeInfo {
+NodeInfo in iroh::discovery - Rust Struct NodeInfo
pub struct NodeInfo {
pub node_id: PublicKey,
pub data: NodeData,
}
Expand description
Fields§
§node_id: PublicKeyThe NodeId of the node this is about.
§data: NodeDataThe information published about the node.
-Implementations§
Source§impl NodeInfo
Sourcepub fn from_parts(node_id: PublicKey, data: NodeData) -> NodeInfo
Creates a new NodeInfo from its parts.
-Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> NodeInfo
Sets the relay URL and returns the updated node info.
-Sourcepub fn with_direct_addresses(
+
Implementations§
§impl NodeInfo
pub fn from_parts(node_id: PublicKey, data: NodeData) -> NodeInfo
Creates a new NodeInfo from its parts.
+pub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> NodeInfo
Sets the relay URL and returns the updated node info.
+pub fn with_direct_addresses(
self,
direct_addresses: BTreeSet<SocketAddr>,
) -> NodeInfo
Sets the direct addresses and returns the updated node info.
-Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> NodeInfo
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 from_txt_lookup(lookup: TxtLookup) -> Result<NodeInfo, Error>
Available on non-wasm_browser only.
Parses a NodeInfo from a TXT records lookup.
-Sourcepub fn from_pkarr_signed_packet(
+
pub fn with_user_data(self, user_data: Option<UserData>) -> NodeInfo
Sets the user-defined data and returns the updated node info.
+pub fn to_node_addr(&self) -> NodeAddr
Converts into a NodeAddr by cloning the needed fields.
+pub fn into_node_addr(self) -> NodeAddr
Converts into a NodeAddr without cloning.
+pub fn from_txt_lookup(lookup: TxtLookup) -> Result<NodeInfo, Error>
Available on non-wasm_browser only.
Parses a NodeInfo from a TXT records lookup.
+pub fn from_pkarr_signed_packet(
packet: &SignedPacket,
) -> Result<NodeInfo, Error>
Parses a NodeInfo from a [pkarr::SignedPacket].
-Sourcepub fn to_pkarr_signed_packet(
+
pub fn to_pkarr_signed_packet(
&self,
secret_key: &SecretKey,
ttl: u32,
) -> Result<SignedPacket, Error>
Creates a [pkarr::SignedPacket].
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.
-Sourcepub fn add_direct_addresses(
+
pub fn to_txt_strings(&self) -> Vec<String>
Converts into a list of {key}={value} strings.
+
Methods from Deref<Target = NodeData>§
pub fn direct_addresses(&self) -> &BTreeSet<SocketAddr>
Returns the direct addresses of the node.
+pub fn clear_direct_addresses(&mut self)
Removes all direct addresses from the node data.
+pub fn add_direct_addresses(
&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_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the node data.
-Trait Implementations§
Source§impl From<DiscoveryItem> for NodeInfo
Source§fn from(item: DiscoveryItem) -> Self
Converts to this type from the input type.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§
pub fn set_relay_url(&mut self, relay_url: Option<RelayUrl>)
Sets the relay URL of the node data.
+pub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the node data.
+Trait Implementations§
Source§impl From<DiscoveryItem> for NodeInfo
Source§fn from(item: DiscoveryItem) -> Self
Converts to this type from the input type.§impl Eq for NodeInfo
§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
T: 'a,
§fn implicit(
diff --git a/pr/3254/docs/iroh/discovery/struct.UserData.html b/pr/3254/docs/iroh/discovery/struct.UserData.html
index 134f039717..74cd45e3c7 100644
--- a/pr/3254/docs/iroh/discovery/struct.UserData.html
+++ b/pr/3254/docs/iroh/discovery/struct.UserData.html
@@ -1,24 +1,24 @@
-UserData in iroh::discovery - Rust pub struct UserData(/* private fields */);
Expand description
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
+UserData in iroh::discovery - Rust Struct UserData
pub struct UserData(/* private fields */);
Expand description
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
Iroh does not keep track of or examine the user-defined data.
UserData implements FromStr and TryFrom<String>, so you can
convert &str and String into UserData easily.
-Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
+Implementations§
§impl UserData
pub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
In DNS discovery services, the user-defined data is stored in a TXT record character string,
which has a max length of 255 bytes. We need to subtract the user-data= prefix,
which leaves 245 bytes for the actual user-defined data.
-Trait Implementations§
Trait Implementations§
§impl Ord for UserData
Source§impl PartialOrd for UserData
Source§impl Eq for UserData
Source§impl StructuralPartialEq for UserData
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
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/3254/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_PROD.html b/pr/3254/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_PROD.html
index dd2f30450f..1e378e6be9 100644
--- a/pr/3254/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_PROD.html
+++ b/pr/3254/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_PROD.html
@@ -1,2 +1,2 @@
-N0_DNS_NODE_ORIGIN_PROD in iroh::dns - Rust pub const N0_DNS_NODE_ORIGIN_PROD: &'static str;
Available on non-wasm_browser only.Expand description
The n0 testing DNS node origin, for production.
+N0_DNS_NODE_ORIGIN_PROD in iroh::dns - Rust Constant N0_DNS_NODE_ORIGIN_PROD
pub const N0_DNS_NODE_ORIGIN_PROD: &'static str;
Available on non-wasm_browser only.Expand description
The n0 testing DNS node origin, for production.
\ No newline at end of file
diff --git a/pr/3254/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_STAGING.html b/pr/3254/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_STAGING.html
index fa61f0f616..00c49c891d 100644
--- a/pr/3254/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_STAGING.html
+++ b/pr/3254/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_STAGING.html
@@ -1,2 +1,2 @@
-N0_DNS_NODE_ORIGIN_STAGING in iroh::dns - Rust pub const N0_DNS_NODE_ORIGIN_STAGING: &'static str;
Available on non-wasm_browser only.Expand description
The n0 testing DNS node origin, for testing.
+N0_DNS_NODE_ORIGIN_STAGING in iroh::dns - Rust Constant N0_DNS_NODE_ORIGIN_STAGING
pub const N0_DNS_NODE_ORIGIN_STAGING: &'static str;
Available on non-wasm_browser only.Expand description
The n0 testing DNS node origin, for testing.
\ No newline at end of file
diff --git a/pr/3254/docs/iroh/dns/struct.DnsResolver.html b/pr/3254/docs/iroh/dns/struct.DnsResolver.html
index cd04f1ce17..53843cda16 100644
--- a/pr/3254/docs/iroh/dns/struct.DnsResolver.html
+++ b/pr/3254/docs/iroh/dns/struct.DnsResolver.html
@@ -1,26 +1,26 @@
-DnsResolver in iroh::dns - Rust pub struct DnsResolver(/* private fields */);
Available on non-wasm_browser only.Expand description
The DNS resolver used throughout iroh.
-Implementations§
Source§impl DnsResolver
Sourcepub fn new() -> DnsResolver
Create a new DNS resolver with sensible cross-platform defaults.
+DnsResolver in iroh::dns - Rust Struct DnsResolver
pub struct DnsResolver(/* private fields */);
Available on non-wasm_browser only.Expand description
The DNS resolver used throughout iroh.
+Implementations§
§impl DnsResolver
pub fn new() -> DnsResolver
Create a new DNS resolver with sensible cross-platform defaults.
We first try to read the system’s resolver from /etc/resolv.conf.
This does not work at least on some Androids, therefore we fallback
to the default ResolverConfig which uses eg. to google’s 8.8.8.8 or 8.8.4.4.
-Sourcepub fn with_nameserver(nameserver: SocketAddr) -> DnsResolver
Create a new DNS resolver configured with a single UDP DNS nameserver.
-Sourcepub fn clear_cache(&self)
Removes all entries from the cache.
-Sourcepub async fn lookup_txt(
+
pub fn with_nameserver(nameserver: SocketAddr) -> DnsResolver
Create a new DNS resolver configured with a single UDP DNS nameserver.
+pub fn clear_cache(&self)
Removes all entries from the cache.
+pub async fn lookup_txt(
&self,
host: impl ToString,
timeout: Duration,
-) -> Result<TxtLookup, Error>
Lookup a TXT record.
-Sourcepub async fn lookup_ipv4(
+) -> Result<TxtLookup, Error>
Lookup a TXT record.
+pub async fn lookup_ipv4(
&self,
host: impl ToString,
timeout: Duration,
) -> Result<impl Iterator<Item = IpAddr>, Error>
Perform an ipv4 lookup with a timeout.
-Sourcepub async fn lookup_ipv6(
+
pub async fn lookup_ipv6(
&self,
host: impl ToString,
timeout: Duration,
) -> Result<impl Iterator<Item = IpAddr>, Error>
Perform an ipv6 lookup with a timeout.
-Sourcepub async fn lookup_ipv4_ipv6(
+
pub async fn lookup_ipv4_ipv6(
&self,
host: impl ToString,
timeout: Duration,
@@ -28,13 +28,13 @@ to the default ResolverConfig which uses eg. to google’s 8.
LookupIpStrategy::Ipv4AndIpv6 will wait for ipv6 resolution timeout, even if it is
not usable on the stack, so we manually query both lookups concurrently and time them out
individually.
-
Sourcepub async fn resolve_host(
+
pub async fn resolve_host(
&self,
url: &Url,
prefer_ipv6: bool,
timeout: Duration,
) -> Result<IpAddr, Error>
Resolve a hostname from a URL to an IP address.
-Sourcepub async fn lookup_ipv4_staggered(
+
pub async fn lookup_ipv4_staggered(
&self,
host: impl ToString,
timeout: Duration,
@@ -44,7 +44,7 @@ individually.
delays_ms with the first call being done immediately. [200ms, 300ms] results in calls
at T+0ms, T+200ms and T+300ms. The timeout is applied to each call individually. The
result of the first successful call is returned, or a summary of all errors otherwise.
-
Sourcepub async fn lookup_ipv6_staggered(
+
pub async fn lookup_ipv6_staggered(
&self,
host: impl ToString,
timeout: Duration,
@@ -54,7 +54,7 @@ result of the first successful call is returned, or a summary of all errors othe
delays_ms with the first call being done immediately. [200ms, 300ms] results in calls
at T+0ms, T+200ms and T+300ms. The timeout is applied to each call individually. The
result of the first successful call is returned, or a summary of all errors otherwise.
-
Sourcepub async fn lookup_ipv4_ipv6_staggered(
+
pub async fn lookup_ipv4_ipv6_staggered(
&self,
host: impl ToString,
timeout: Duration,
@@ -65,18 +65,18 @@ result of the first successful call is returned, or a summary of all errors othe
at T+0ms, T+200ms and T+300ms. The timeout is applied as stated in
Self::lookup_ipv4_ipv6. The result of the first successful call is returned, or a
summary of all errors otherwise.
-
Sourcepub async fn lookup_node_by_id(
+
pub async fn lookup_node_by_id(
&self,
node_id: &PublicKey,
origin: &str,
) -> Result<NodeInfo, Error>
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(
+
pub async fn lookup_node_by_domain_name(
&self,
name: &str,
) -> Result<NodeInfo, Error>
Looks up node info by DNS name.
-Sourcepub async fn lookup_node_by_domain_name_staggered(
+
pub async fn lookup_node_by_domain_name_staggered(
&self,
name: &str,
delays_ms: &[u64],
@@ -85,7 +85,7 @@ pass Sourcepub async fn lookup_node_by_id_staggered(
+
pub async fn lookup_node_by_id_staggered(
&self,
node_id: &PublicKey,
origin: &str,
@@ -95,7 +95,7 @@ summary of all errors otherwise.
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
summary of all errors otherwise.
-
Trait Implementations§
Source§impl Clone for DnsResolver
Source§fn clone(&self) -> DnsResolver
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 DnsResolver
Source§impl Default for DnsResolver
Source§fn default() -> DnsResolver
Returns the “default value” for a type. Read moreTrait Implementations§
§impl Clone for DnsResolver
§fn clone(&self) -> DnsResolver
Returns a copy of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more§impl Debug for DnsResolver
§impl Default for DnsResolver
§fn default() -> DnsResolver
Returns the “default value” for a type. Read more§impl From<Resolver<GenericConnector<TokioRuntimeProvider>>> for DnsResolver
§fn from(
resolver: Resolver<GenericConnector<TokioRuntimeProvider>>,
) -> DnsResolver
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for DnsResolver
§impl !RefUnwindSafe for DnsResolver
§impl Send for DnsResolver
§impl Sync for DnsResolver
§impl Unpin for DnsResolver
§impl !UnwindSafe for DnsResolver
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/3254/docs/iroh/metrics/struct.RelayMetrics.html b/pr/3254/docs/iroh/metrics/struct.RelayMetrics.html
index 83ae1acdcc..6f22d04f93 100644
--- a/pr/3254/docs/iroh/metrics/struct.RelayMetrics.html
+++ b/pr/3254/docs/iroh/metrics/struct.RelayMetrics.html
@@ -1,4 +1,4 @@
-RelayMetrics in iroh::metrics - Rust pub struct RelayMetrics {Show 21 fields
+RelayMetrics in iroh::metrics - Rust Struct RelayMetrics
pub struct RelayMetrics {Show 21 fields
pub bytes_sent: Counter,
pub bytes_recv: Counter,
pub send_packets_sent: Counter,
@@ -42,7 +42,7 @@
§unique_client_keys: CounterNumber of unique client keys per day
§websocket_accepts: CounterNumber of accepted websocket connections
§relay_accepts: CounterNumber of accepted ‘iroh derp http’ connection upgrades
-Trait Implementations§
Source§impl Metric for Metrics
§fn new(registry: &mut Registry) -> Self
Available on crate feature metrics only.Initializes this metric group.§fn with_metric<T, F>(f: F)where
+Trait Implementations§
§impl Metric for Metrics
§fn new(registry: &mut Registry) -> Self
Available on crate feature metrics only.Initializes this metric group.§fn with_metric<T, F>(f: F)where
F: FnOnce(&Self) -> T,
Available on crate feature metrics only.Access to this metrics group to record a metric.
Only records if this metric is registered in the global registry.Auto Trait Implementations§
§impl Freeze for Metrics
§impl RefUnwindSafe for Metrics
§impl Send for Metrics
§impl Sync for Metrics
§impl Unpin for Metrics
§impl UnwindSafe for Metrics
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/3254/docs/iroh/node_info/constant.IROH_TXT_NAME.html b/pr/3254/docs/iroh/node_info/constant.IROH_TXT_NAME.html
index c78d056a1f..0c1e657fb3 100644
--- a/pr/3254/docs/iroh/node_info/constant.IROH_TXT_NAME.html
+++ b/pr/3254/docs/iroh/node_info/constant.IROH_TXT_NAME.html
@@ -1,2 +1,2 @@
-IROH_TXT_NAME in iroh::node_info - Rust pub const IROH_TXT_NAME: &'static str;
Expand description
The DNS name for the iroh TXT record.
+IROH_TXT_NAME in iroh::node_info - Rust Constant IROH_TXT_NAME
pub const IROH_TXT_NAME: &'static str;
Expand description
The DNS name for the iroh TXT record.
\ No newline at end of file
diff --git a/pr/3254/docs/iroh/node_info/index.html b/pr/3254/docs/iroh/node_info/index.html
index 9884414f78..5130358fc8 100644
--- a/pr/3254/docs/iroh/node_info/index.html
+++ b/pr/3254/docs/iroh/node_info/index.html
@@ -1,4 +1,4 @@
-iroh::node_info - Rust Expand description
Support for handling DNS resource records for dialing by NodeId.
+iroh::node_info - Rust Module node_info
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:
diff --git a/pr/3254/docs/iroh/node_info/struct.MaxLengthExceededError.html b/pr/3254/docs/iroh/node_info/struct.MaxLengthExceededError.html
index 2f1c9b7234..33cd3a33fc 100644
--- a/pr/3254/docs/iroh/node_info/struct.MaxLengthExceededError.html
+++ b/pr/3254/docs/iroh/node_info/struct.MaxLengthExceededError.html
@@ -1,5 +1,5 @@
-MaxLengthExceededError in iroh::node_info - Rust pub struct MaxLengthExceededError;
Expand description
Error returned when an input value is too long for UserData.
-Trait Implementations§
Source§impl Debug for MaxLengthExceededError
Source§impl Display for MaxLengthExceededError
Source§impl Error for MaxLengthExceededError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Auto Trait Implementations§
§impl Freeze for MaxLengthExceededError
§impl RefUnwindSafe for MaxLengthExceededError
§impl Send for MaxLengthExceededError
§impl Sync for MaxLengthExceededError
§impl Unpin for MaxLengthExceededError
§impl UnwindSafe for MaxLengthExceededError
Blanket Implementations§
Source§impl<T> Any for Twhere
+MaxLengthExceededError in iroh::node_info - Rust Struct MaxLengthExceededError
pub struct MaxLengthExceededError;
Expand description
Error returned when an input value is too long for UserData.
+Trait Implementations§
§impl Debug for MaxLengthExceededError
§impl Display for MaxLengthExceededError
§impl Error for MaxLengthExceededError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Auto Trait Implementations§
§impl Freeze for MaxLengthExceededError
§impl RefUnwindSafe for MaxLengthExceededError
§impl Send for MaxLengthExceededError
§impl Sync for MaxLengthExceededError
§impl Unpin for MaxLengthExceededError
§impl UnwindSafe for MaxLengthExceededError
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/3254/docs/iroh/node_info/struct.NodeData.html b/pr/3254/docs/iroh/node_info/struct.NodeData.html
index 8315fa3859..6a489b4160 100644
--- a/pr/3254/docs/iroh/node_info/struct.NodeData.html
+++ b/pr/3254/docs/iroh/node_info/struct.NodeData.html
@@ -1,31 +1,31 @@
-NodeData in iroh::node_info - Rust pub struct NodeData { /* private fields */ }
Expand description
Data about a node that may be published to and resolved from discovery services.
+NodeData in iroh::node_info - Rust Struct NodeData
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
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.
-Implementations§
Implementations§
§impl NodeData
pub fn new(
relay_url: Option<RelayUrl>,
direct_addresses: BTreeSet<SocketAddr>,
) -> NodeData
Creates a new NodeData with a relay URL and a set of direct addresses.
-Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> NodeData
Sets the relay URL and returns the updated node data.
-Sourcepub fn with_direct_addresses(
+
pub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> NodeData
Sets the relay URL and returns the updated node data.
+pub fn with_direct_addresses(
self,
direct_addresses: BTreeSet<SocketAddr>,
) -> NodeData
Sets the direct addresses and returns the updated node data.
-Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> NodeData
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.
-Sourcepub fn add_direct_addresses(
+
pub fn with_user_data(self, user_data: Option<UserData>) -> NodeData
Sets the user-defined data and returns the updated node data.
+pub fn direct_addresses(&self) -> &BTreeSet<SocketAddr>
Returns the direct addresses of the node.
+pub fn clear_direct_addresses(&mut self)
Removes all direct addresses from the node data.
+pub fn add_direct_addresses(
&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_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the node data.
-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§
pub fn set_relay_url(&mut self, relay_url: Option<RelayUrl>)
Sets the relay URL of the node data.
+pub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the node data.
+Trait Implementations§
§impl Eq for NodeData
§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
T: 'a,
§fn implicit(
diff --git a/pr/3254/docs/iroh/node_info/struct.NodeInfo.html b/pr/3254/docs/iroh/node_info/struct.NodeInfo.html
index d477ae0321..8adc2da63a 100644
--- a/pr/3254/docs/iroh/node_info/struct.NodeInfo.html
+++ b/pr/3254/docs/iroh/node_info/struct.NodeInfo.html
@@ -1,43 +1,43 @@
-NodeInfo in iroh::node_info - Rust pub struct NodeInfo {
+NodeInfo in iroh::node_info - Rust Struct NodeInfo
pub struct NodeInfo {
pub node_id: PublicKey,
pub data: NodeData,
}
Expand description
Fields§
§node_id: PublicKeyThe NodeId of the node this is about.
§data: NodeDataThe information published about the node.
-Implementations§
Source§impl NodeInfo
Sourcepub fn from_parts(node_id: PublicKey, data: NodeData) -> NodeInfo
Creates a new NodeInfo from its parts.
-Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> NodeInfo
Sets the relay URL and returns the updated node info.
-Sourcepub fn with_direct_addresses(
+
Implementations§
§impl NodeInfo
pub fn from_parts(node_id: PublicKey, data: NodeData) -> NodeInfo
Creates a new NodeInfo from its parts.
+pub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> NodeInfo
Sets the relay URL and returns the updated node info.
+pub fn with_direct_addresses(
self,
direct_addresses: BTreeSet<SocketAddr>,
) -> NodeInfo
Sets the direct addresses and returns the updated node info.
-Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> NodeInfo
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 from_txt_lookup(lookup: TxtLookup) -> Result<NodeInfo, Error>
Available on non-wasm_browser only.
Parses a NodeInfo from a TXT records lookup.
-Sourcepub fn from_pkarr_signed_packet(
+
pub fn with_user_data(self, user_data: Option<UserData>) -> NodeInfo
Sets the user-defined data and returns the updated node info.
+pub fn to_node_addr(&self) -> NodeAddr
Converts into a NodeAddr by cloning the needed fields.
+pub fn into_node_addr(self) -> NodeAddr
Converts into a NodeAddr without cloning.
+pub fn from_txt_lookup(lookup: TxtLookup) -> Result<NodeInfo, Error>
Available on non-wasm_browser only.
Parses a NodeInfo from a TXT records lookup.
+pub fn from_pkarr_signed_packet(
packet: &SignedPacket,
) -> Result<NodeInfo, Error>
Parses a NodeInfo from a [pkarr::SignedPacket].
-Sourcepub fn to_pkarr_signed_packet(
+
pub fn to_pkarr_signed_packet(
&self,
secret_key: &SecretKey,
ttl: u32,
) -> Result<SignedPacket, Error>
Creates a [pkarr::SignedPacket].
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.
-Sourcepub fn add_direct_addresses(
+
pub fn to_txt_strings(&self) -> Vec<String>
Converts into a list of {key}={value} strings.
+
Methods from Deref<Target = NodeData>§
pub fn direct_addresses(&self) -> &BTreeSet<SocketAddr>
Returns the direct addresses of the node.
+pub fn clear_direct_addresses(&mut self)
Removes all direct addresses from the node data.
+pub fn add_direct_addresses(
&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_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the node data.
-Trait Implementations§
Source§impl From<DiscoveryItem> for NodeInfo
Source§fn from(item: DiscoveryItem) -> Self
Converts to this type from the input type.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§
pub fn set_relay_url(&mut self, relay_url: Option<RelayUrl>)
Sets the relay URL of the node data.
+pub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the node data.
+Trait Implementations§
Source§impl From<DiscoveryItem> for NodeInfo
Source§fn from(item: DiscoveryItem) -> Self
Converts to this type from the input type.§impl Eq for NodeInfo
§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
T: 'a,
§fn implicit(
diff --git a/pr/3254/docs/iroh/node_info/struct.UserData.html b/pr/3254/docs/iroh/node_info/struct.UserData.html
index 4f76e55134..fb7ea9a345 100644
--- a/pr/3254/docs/iroh/node_info/struct.UserData.html
+++ b/pr/3254/docs/iroh/node_info/struct.UserData.html
@@ -1,24 +1,24 @@
-UserData in iroh::node_info - Rust pub struct UserData(/* private fields */);
Expand description
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
+UserData in iroh::node_info - Rust Struct UserData
pub struct UserData(/* private fields */);
Expand description
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
Iroh does not keep track of or examine the user-defined data.
UserData implements FromStr and TryFrom<String>, so you can
convert &str and String into UserData easily.
-Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
+Implementations§
§impl UserData
pub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
In DNS discovery services, the user-defined data is stored in a TXT record character string,
which has a max length of 255 bytes. We need to subtract the user-data= prefix,
which leaves 245 bytes for the actual user-defined data.
-Trait Implementations§
Trait Implementations§
§impl Ord for UserData
Source§impl PartialOrd for UserData
Source§impl Eq for UserData
Source§impl StructuralPartialEq for UserData
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
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/3254/docs/iroh/node_info/trait.NodeIdExt.html b/pr/3254/docs/iroh/node_info/trait.NodeIdExt.html
index 554c8c6e66..6d8273fb7e 100644
--- a/pr/3254/docs/iroh/node_info/trait.NodeIdExt.html
+++ b/pr/3254/docs/iroh/node_info/trait.NodeIdExt.html
@@ -1,9 +1,9 @@
-NodeIdExt in iroh::node_info - Rust pub trait NodeIdExt {
+NodeIdExt in iroh::node_info - Rust Trait NodeIdExt
pub trait NodeIdExt {
// Required methods
fn to_z32(&self) -> String;
fn from_z32(s: &str) -> Result<PublicKey, Error>;
}
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.
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.
Implementors§
\ No newline at end of file
diff --git a/pr/3254/docs/iroh/struct.NodeAddr.html b/pr/3254/docs/iroh/struct.NodeAddr.html
index cd39aabacf..b2e98874c3 100644
--- a/pr/3254/docs/iroh/struct.NodeAddr.html
+++ b/pr/3254/docs/iroh/struct.NodeAddr.html
@@ -44,7 +44,7 @@ whenever a connection to other nodes needs to be established.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for NodeAddr
Source§fn deserialize<__D>(
__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.
+ __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 Ord for NodeAddr
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more1.21.0 · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more1.50.0 · Source§fn clamp(self, min: Self, max: Self) -> Selfwhere
diff --git a/pr/3254/docs/iroh/struct.PublicKey.html b/pr/3254/docs/iroh/struct.PublicKey.html
index 140d5f9452..94f97f44d1 100644
--- a/pr/3254/docs/iroh/struct.PublicKey.html
+++ b/pr/3254/docs/iroh/struct.PublicKey.html
@@ -22,7 +22,7 @@ representation of the key.
Source§impl Ord for PublicKey
Source§impl PartialEq for PublicKey
Source§fn eq(&self, other: &PublicKey) -> 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/3254/docs/iroh/struct.RelayMap.html b/pr/3254/docs/iroh/struct.RelayMap.html
index d44542c103..c331ec3208 100644
--- a/pr/3254/docs/iroh/struct.RelayMap.html
+++ b/pr/3254/docs/iroh/struct.RelayMap.html
@@ -1,26 +1,26 @@
-RelayMap in iroh - Rust pub struct RelayMap { /* private fields */ }
Expand description
Configuration of all the relay servers that can be used.
-Implementations§
Source§impl RelayMap
Sourcepub fn nodes(&self) -> impl Iterator<Item = &Arc<RelayNode>>
Returns an Iterator over all known nodes.
-Sourcepub fn contains_node(&self, url: &RelayUrl) -> bool
Is this a known node?
-Sourcepub fn default_from_node(url: RelayUrl, stun_port: u16) -> RelayMap
Creates a new RelayMap with a single relay server configured.
+RelayMap in iroh - Rust Struct RelayMap
pub struct RelayMap { /* private fields */ }
Expand description
Configuration of all the relay servers that can be used.
+Implementations§
§impl RelayMap
pub fn nodes(&self) -> impl Iterator<Item = &Arc<RelayNode>>
Returns an Iterator over all known nodes.
+pub fn contains_node(&self, url: &RelayUrl) -> bool
Is this a known node?
+pub fn default_from_node(url: RelayUrl, stun_port: u16) -> RelayMap
Creates a new RelayMap with a single relay server configured.
Allows to set a custom STUN port and different IP addresses for IPv4 and IPv6.
If IP addresses are provided, no DNS lookup will be performed.
Sets the port to the default DEFAULT_RELAY_QUIC_PORT.
-Sourcepub fn from_nodes<I>(
+
pub fn from_nodes<I>(
value: impl IntoIterator<Item = I>,
) -> Result<RelayMap, Error>
Trait Implementations§
Source§impl Eq for RelayMap
Source§impl StructuralPartialEq for RelayMap
Auto Trait Implementations§
§impl Freeze for RelayMap
§impl RefUnwindSafe for RelayMap
§impl Send for RelayMap
§impl Sync for RelayMap
§impl Unpin for RelayMap
§impl UnwindSafe for RelayMap
Blanket Implementations§
Trait Implementations§
§impl Eq for RelayMap
§impl StructuralPartialEq for RelayMap
Auto Trait Implementations§
§impl Freeze for RelayMap
§impl RefUnwindSafe for RelayMap
§impl Send for RelayMap
§impl Sync for RelayMap
§impl Unpin for RelayMap
§impl UnwindSafe for RelayMap
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/3254/docs/iroh/struct.RelayNode.html b/pr/3254/docs/iroh/struct.RelayNode.html
index efbb608578..9ab2cddcc0 100644
--- a/pr/3254/docs/iroh/struct.RelayNode.html
+++ b/pr/3254/docs/iroh/struct.RelayNode.html
@@ -1,8 +1,8 @@
-RelayNode in iroh - Rust pub struct RelayNode {
+RelayNode in iroh - Rust Struct RelayNode
pub struct RelayNode {
pub url: RelayUrl,
pub stun_only: bool,
pub stun_port: u16,
- pub quic: Option<RelayQuicConfig>,
+ 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.
@@ -11,24 +11,24 @@
functionality is used.
§stun_port: u16The stun port of the relay server.
Setting this to 0 means the default STUN port is used.
-§quic: Option<RelayQuicConfig>Configuration to speak to the QUIC endpoint on the relay server.
+§quic: Option<RelayQuicConfig>Configuration to speak to the QUIC endpoint on the relay server.
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>(
+
Trait Implementations§
§impl<'de> Deserialize<'de> for RelayNode
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<RelayNode, <__D as Deserializer<'de>>::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more§impl Ord for RelayNode
Source§impl PartialOrd for RelayNode
§impl Serialize for RelayNode
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
- __S: Serializer,
Serialize this value into the given Serde serializer. Read moreSource§impl Eq for RelayNode
Source§impl StructuralPartialEq for RelayNode
Auto Trait Implementations§
§impl Freeze for RelayNode
§impl RefUnwindSafe for RelayNode
§impl Send for RelayNode
§impl Sync for RelayNode
§impl Unpin for RelayNode
§impl UnwindSafe for RelayNode
Blanket Implementations§
Source§impl<T> Any for Twhere
+ __S: Serializer,
Serialize this value into the given Serde serializer. Read more§impl Eq for RelayNode
§impl StructuralPartialEq for RelayNode
Auto Trait Implementations§
§impl Freeze for RelayNode
§impl RefUnwindSafe for RelayNode
§impl Send for RelayNode
§impl Sync for RelayNode
§impl Unpin for RelayNode
§impl UnwindSafe for RelayNode
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/3254/docs/iroh/test_utils/fn.run_relay_server.html b/pr/3254/docs/iroh/test_utils/fn.run_relay_server.html
index 4f41fd2d31..d738a1d8e1 100644
--- a/pr/3254/docs/iroh/test_utils/fn.run_relay_server.html
+++ b/pr/3254/docs/iroh/test_utils/fn.run_relay_server.html
@@ -1,4 +1,4 @@
-run_relay_server in iroh::test_utils - Rust pub async fn run_relay_server() -> Result<(RelayMap, RelayUrl, Server)>
Available on crate feature test-utils only.Expand description
Runs a relay server with STUN and QUIC enabled suitable for tests.
+run_relay_server in iroh::test_utils - Rust
\ No newline at end of file
diff --git a/pr/3254/docs/iroh/test_utils/fn.run_relay_server_with.html b/pr/3254/docs/iroh/test_utils/fn.run_relay_server_with.html
index c31b8b2572..5b179c2f1d 100644
--- a/pr/3254/docs/iroh/test_utils/fn.run_relay_server_with.html
+++ b/pr/3254/docs/iroh/test_utils/fn.run_relay_server_with.html
@@ -1,9 +1,9 @@
run_relay_server_with in iroh::test_utils - Rust pub async fn run_relay_server_with(
- stun: Option<StunConfig>,
+ stun: Option<StunConfig>,
quic: bool,
-) -> Result<(RelayMap, RelayUrl, Server)>
Available on crate feature test-utils only.Expand description
Runs a relay server.
+) -> Result<(RelayMap, RelayUrl, Server)>Available on crate feature test-utils only.Expand description
Runs a relay server.
stun can be set to None to disable stun, or set to Some StunConfig,
to enable stun on a specific socket.
-If quic is set to true, it will make the appropriate QuicConfig from the generated tls certificates and run the quic server at a random free port.
+If quic is set to true, it will make the appropriate [QuicConfig] from the generated tls certificates and run the quic server at a random free port.
The return value is similar to run_relay_server.
\ No newline at end of file
diff --git a/pr/3254/docs/iroh/test_utils/fn.run_relay_server_with_stun.html b/pr/3254/docs/iroh/test_utils/fn.run_relay_server_with_stun.html
index 436f9d1200..ce014daffa 100644
--- a/pr/3254/docs/iroh/test_utils/fn.run_relay_server_with_stun.html
+++ b/pr/3254/docs/iroh/test_utils/fn.run_relay_server_with_stun.html
@@ -1,4 +1,4 @@
-run_relay_server_with_stun in iroh::test_utils - Rust pub async fn run_relay_server_with_stun() -> Result<(RelayMap, RelayUrl, Server)>
Available on crate feature test-utils only.Expand description
Runs a relay server with STUN enabled suitable for tests.
+run_relay_server_with_stun in iroh::test_utils - Rust
\ No newline at end of file
diff --git a/pr/3254/docs/iroh_net_report/struct.Client.html b/pr/3254/docs/iroh_net_report/struct.Client.html
index f8932f43eb..774654c5d3 100644
--- a/pr/3254/docs/iroh_net_report/struct.Client.html
+++ b/pr/3254/docs/iroh_net_report/struct.Client.html
@@ -7,7 +7,7 @@ If all Addr::receive_stun_packet.
Implementations§
Source§impl Client
Sourcepub fn new(
port_mapper: Option<Client>,
- dns_resolver: DnsResolver,
+ dns_resolver: DnsResolver,
ip_mapped_addrs: Option<IpMappedAddresses>,
) -> Result<Self>
Creates a new net_report client.
This starts a connected actor in the background. Once the client is dropped it will
@@ -17,7 +17,7 @@ stop running.
allows sending messages to the actor.
Sourcepub async fn get_report(
&mut self,
- relay_map: RelayMap,
+ relay_map: RelayMap,
stun_sock_v4: Option<Arc<UdpSocket>>,
stun_sock_v6: Option<Arc<UdpSocket>>,
quic_config: Option<QuicConfig>,
@@ -39,14 +39,14 @@ using QUIC address discovery.
This will attempt to use all probe protocols.
Sourcepub async fn get_report_with_opts(
&mut self,
- relay_map: RelayMap,
+ relay_map: RelayMap,
opts: Options,
) -> Result<Arc<Report>>
Runs a net_report, returning the report.
It may not be called concurrently with itself, &mut self takes care of that.
Look at Options for the different configuration options.
Sourcepub async fn get_report_channel(
&mut self,
- relay_map: RelayMap,
+ relay_map: RelayMap,
opts: Options,
) -> Result<Receiver<Result<Arc<Report>>>>
Get report with channel
Look at Options for the different configuration options.
diff --git a/pr/3254/docs/iroh_net_report/struct.RelayLatencies.html b/pr/3254/docs/iroh_net_report/struct.RelayLatencies.html
index cab40bff24..bbbe92b500 100644
--- a/pr/3254/docs/iroh_net_report/struct.RelayLatencies.html
+++ b/pr/3254/docs/iroh_net_report/struct.RelayLatencies.html
@@ -1,5 +1,5 @@
RelayLatencies in iroh_net_report - Rust pub struct RelayLatencies(/* private fields */);
Expand description
Latencies per relay node.
-Implementations§
Source§impl RelayLatencies
Sourcepub fn iter(&self) -> impl Iterator<Item = (&RelayUrl, Duration)> + '_
Returns an iterator over all the relays and their latencies.
+Implementations§
Trait Implementations§
Source§impl Clone for RelayLatencies
Source§fn clone(&self) -> RelayLatencies
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 RelayLatencies
Source§impl Default for RelayLatencies
Source§fn default() -> RelayLatencies
Returns the “default value” for a type. Read moreSource§impl PartialEq for RelayLatencies
Source§impl Eq for RelayLatencies
Source§impl StructuralPartialEq for RelayLatencies
Auto Trait Implementations§
§impl Freeze for RelayLatencies
§impl RefUnwindSafe for RelayLatencies
§impl Send for RelayLatencies
§impl Sync for RelayLatencies
§impl Unpin for RelayLatencies
§impl UnwindSafe for RelayLatencies
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/3254/docs/iroh_net_report/struct.Report.html b/pr/3254/docs/iroh_net_report/struct.Report.html
index b6dda01fab..1cdf766458 100644
--- a/pr/3254/docs/iroh_net_report/struct.Report.html
+++ b/pr/3254/docs/iroh_net_report/struct.Report.html
@@ -11,7 +11,7 @@
pub mapping_varies_by_dest_ipv6: Option<bool>,
pub hair_pinning: Option<bool>,
pub portmap_probe: Option<ProbeOutput>,
- pub preferred_relay: Option<RelayUrl>,
+ pub preferred_relay: Option<RelayUrl>,
pub relay_latency: RelayLatencies,
pub relay_v4_latency: RelayLatencies,
pub relay_v6_latency: RelayLatencies,
@@ -35,7 +35,7 @@ detecting rather than using it. For now.
§hair_pinning: Option<bool>Whether the router supports communicating between two local devices through the NATted
public IP address (on IPv4).
§portmap_probe: Option<ProbeOutput>Probe indicating the presence of port mapping protocols on the LAN.
-§preferred_relay: Option<RelayUrl>None for unknown
+§preferred_relay: Option<RelayUrl>None for unknown
§relay_latency: RelayLatencieskeyed by relay Url
§relay_v4_latency: RelayLatencieskeyed by relay Url
§relay_v6_latency: RelayLatencieskeyed by relay Url
diff --git a/pr/3254/docs/src/iroh/magicsock/relay_actor.rs.html b/pr/3254/docs/src/iroh/magicsock/relay_actor.rs.html
index 8a3318169b..10265b471c 100644
--- a/pr/3254/docs/src/iroh/magicsock/relay_actor.rs.html
+++ b/pr/3254/docs/src/iroh/magicsock/relay_actor.rs.html
@@ -1582,13 +1582,7 @@
1581
1582
1583
-1584
-1585
-1586
-1587
-1588
-1589
-1590//! The relay actor.
+1584
//! The relay actor.
//!
//! The [`RelayActor`] handles all the relay connections. It is helped by the
//! [`ActiveRelayActor`] which handles a single relay connection.
@@ -1871,25 +1865,19 @@
let mut backoff = Self::build_backoff();
- loop {
- match self.run_once().await {
- Err(err) => {
- warn!("Relay connection failed: {err:#}");
- if self.pong_received {
- // If the relay connection remained established long enough so that we received a pong
- // from the relay server, we reset the backoff and attempt to reconnect immediately.
- self.pong_received = false;
- backoff = Self::build_backoff();
- continue;
- } else {
- // If dialing failed, or if the relay connection failed before we received a pong,
- // we wait an exponentially increasing time until we attempt to reconnect again.
- let sleep = backoff.next().context("Retries exceeded")?;
- debug!("Retry in {sleep:?}");
- time::sleep(sleep).await;
- }
- }
- Ok(()) => break,
+ while let Err(err) = self.run_once().await {
+ warn!("Relay connection failed: {err:#}");
+ if self.pong_received {
+ // If the relay connection remained established long enough so that we received a pong
+ // from the relay server, we reset the backoff and attempt to reconnect immediately.
+ self.pong_received = false;
+ backoff = Self::build_backoff();
+ } else {
+ // If dialing failed, or if the relay connection failed before we received a pong,
+ // we wait an exponentially increasing time until we attempt to reconnect again.
+ let sleep = backoff.next().context("Retries exceeded")?;
+ debug!("Retry in {sleep:?}");
+ time::sleep(sleep).await;
}
}
debug!("exiting");
diff --git a/pr/3254/docs/type.impl/iroh/struct.PublicKey.js b/pr/3254/docs/type.impl/iroh/struct.PublicKey.js
index d01f8c9287..9c9039082f 100644
--- a/pr/3254/docs/type.impl/iroh/struct.PublicKey.js
+++ b/pr/3254/docs/type.impl/iroh/struct.PublicKey.js
@@ -1,9 +1,9 @@
(function() {
- var type_impls = Object.fromEntries([["iroh",[["","AsRef<[u8]>","iroh::NodeId"],["","Borrow<[u8; 32]>","iroh::NodeId"],["","Clone","iroh::NodeId"],["","Debug","iroh::NodeId"],["Source§impl<'de> Deserialize<'de> for PublicKey
Source§fn deserialize<D>(\n deserializer: D,\n) -> Result<PublicKey, <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh::NodeId"],["","Display","iroh::NodeId"],["","From","iroh::NodeId"],["Source§impl FromStr for PublicKey
","FromStr","iroh::NodeId"],["","Hash","iroh::NodeId"],["","NodeIdExt","iroh::NodeId"],["Source§impl Ord for PublicKey
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh::NodeId"],["","PartialEq","iroh::NodeId"],["Source§impl PartialOrd for PublicKey
","PartialOrd","iroh::NodeId"],["Source§impl PublicKey
Sourcepub fn from_bytes(bytes: &[u8; 32]) -> Result<PublicKey, Error>
Construct a PublicKey from a slice of bytes.
\n§Warning
\nThis will return a [SignatureError] if the bytes passed into this method do not represent\na valid ed25519_dalek curve point. Will never fail for bytes return from Self::as_bytes.\nSee [VerifyingKey::from_bytes] for details.
\n",0,"iroh::NodeId"],["Source§impl Serialize for PublicKey
Source§fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
Serialize this value into the given Serde serializer. Read more","Serialize","iroh::NodeId"],["","TryFrom<&[u8]>","iroh::NodeId"],["","TryFrom<&[u8; 32]>","iroh::NodeId"],["Source§impl Copy for PublicKey
","Copy","iroh::NodeId"],["Source§impl Eq for PublicKey
","Eq","iroh::NodeId"],["Source§impl StructuralPartialEq for PublicKey
","StructuralPartialEq","iroh::NodeId"]]]]);
+ var type_impls = Object.fromEntries([["iroh",[["","AsRef<[u8]>","iroh::NodeId"],["","Borrow<[u8; 32]>","iroh::NodeId"],["","Clone","iroh::NodeId"],["","Debug","iroh::NodeId"],["Source§impl<'de> Deserialize<'de> for PublicKey
Source§fn deserialize<D>(\n deserializer: D,\n) -> Result<PublicKey, <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh::NodeId"],["","Display","iroh::NodeId"],["","From","iroh::NodeId"],["Source§impl FromStr for PublicKey
","FromStr","iroh::NodeId"],["","Hash","iroh::NodeId"],["","NodeIdExt","iroh::NodeId"],["Source§impl Ord for PublicKey
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh::NodeId"],["","PartialEq","iroh::NodeId"],["Source§impl PartialOrd for PublicKey
","PartialOrd","iroh::NodeId"],["Source§impl PublicKey
Sourcepub fn from_bytes(bytes: &[u8; 32]) -> Result<PublicKey, Error>
Construct a PublicKey from a slice of bytes.
\n§Warning
\nThis will return a [SignatureError] if the bytes passed into this method do not represent\na valid ed25519_dalek curve point. Will never fail for bytes return from Self::as_bytes.\nSee [VerifyingKey::from_bytes] for details.
\n",0,"iroh::NodeId"],["Source§impl Serialize for PublicKey
Source§fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
Serialize this value into the given Serde serializer. Read more","Serialize","iroh::NodeId"],["","TryFrom<&[u8]>","iroh::NodeId"],["","TryFrom<&[u8; 32]>","iroh::NodeId"],["Source§impl Copy for PublicKey
","Copy","iroh::NodeId"],["Source§impl Eq for PublicKey
","Eq","iroh::NodeId"],["Source§impl StructuralPartialEq for PublicKey
","StructuralPartialEq","iroh::NodeId"]]]]);
if (window.register_type_impls) {
window.register_type_impls(type_impls);
} else {
window.pending_type_impls = type_impls;
}
})()
-//{"start":55,"fragment_lengths":[47903]}
\ No newline at end of file
+//{"start":55,"fragment_lengths":[47657]}
\ No newline at end of file
pub struct NodeData { /* private fields */ }Expand description
Data about a node that may be published to and resolved from discovery services.
+Struct NodeData
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
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.
Implementations§
Implementations§
§impl NodeData
impl NodeData
pub fn new(
relay_url: Option<RelayUrl>,
direct_addresses: BTreeSet<SocketAddr>,
) -> NodeData
pub fn new( relay_url: Option<RelayUrl>, direct_addresses: BTreeSet<SocketAddr>, ) -> NodeData
Creates a new NodeData with a relay URL and a set of direct addresses.
Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> NodeData
pub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> NodeData
Sets the relay URL and returns the updated node data.
-Sourcepub fn with_direct_addresses(
+
pub fn with_direct_addresses( +
pub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> NodeData
pub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> NodeData
Sets the relay URL and returns the updated node data.
+pub fn with_direct_addresses(
self,
direct_addresses: BTreeSet<SocketAddr>,
) -> NodeData
pub fn with_direct_addresses( self, direct_addresses: BTreeSet<SocketAddr>, ) -> NodeData
Sets the direct addresses and returns the updated node data.
-Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> NodeData
pub fn with_user_data(self, user_data: Option<UserData>) -> NodeData
Sets the user-defined data and returns the updated node data.
-Sourcepub fn user_data(&self) -> Option<&UserData>
pub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the node.
-Sourcepub fn direct_addresses(&self) -> &BTreeSet<SocketAddr>
pub fn direct_addresses(&self) -> &BTreeSet<SocketAddr>
Returns the direct addresses of the node.
-Sourcepub fn clear_direct_addresses(&mut self)
pub fn clear_direct_addresses(&mut self)
Removes all direct addresses from the node data.
-Sourcepub fn add_direct_addresses(
+
pub fn add_direct_addresses( +
pub fn with_user_data(self, user_data: Option<UserData>) -> NodeData
pub fn with_user_data(self, user_data: Option<UserData>) -> NodeData
Sets the user-defined data and returns the updated node data.
+pub fn direct_addresses(&self) -> &BTreeSet<SocketAddr>
pub fn direct_addresses(&self) -> &BTreeSet<SocketAddr>
Returns the direct addresses of the node.
+pub fn clear_direct_addresses(&mut self)
pub fn clear_direct_addresses(&mut self)
Removes all direct addresses from the node data.
+pub fn add_direct_addresses(
&mut self,
addrs: impl IntoIterator<Item = SocketAddr>,
)
pub fn add_direct_addresses( &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>)
pub 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>)
pub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the node data.
-Trait Implementations§
impl Eq for NodeData
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§
pub fn set_relay_url(&mut self, relay_url: Option<RelayUrl>)
pub fn set_relay_url(&mut self, relay_url: Option<RelayUrl>)
Sets the relay URL of the node data.
+pub fn set_user_data(&mut self, user_data: Option<UserData>)
pub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the node data.
+Trait Implementations§
impl Eq for NodeData
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> 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/3254/docs/iroh/discovery/struct.NodeInfo.html b/pr/3254/docs/iroh/discovery/struct.NodeInfo.html
index 021976d4db..991766d098 100644
--- a/pr/3254/docs/iroh/discovery/struct.NodeInfo.html
+++ b/pr/3254/docs/iroh/discovery/struct.NodeInfo.html
@@ -1,43 +1,43 @@
-NodeInfo in iroh::discovery - Rust pub struct NodeInfo {
+NodeInfo in iroh::discovery - Rust Struct NodeInfo
pub struct NodeInfo {
pub node_id: PublicKey,
pub data: NodeData,
}
Expand description
Fields§
§node_id: PublicKeyThe NodeId of the node this is about.
§data: NodeDataThe information published about the node.
-Implementations§
Source§impl NodeInfo
Sourcepub fn from_parts(node_id: PublicKey, data: NodeData) -> NodeInfo
Creates a new NodeInfo from its parts.
-Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> NodeInfo
Sets the relay URL and returns the updated node info.
-Sourcepub fn with_direct_addresses(
+
Implementations§
§impl NodeInfo
pub fn from_parts(node_id: PublicKey, data: NodeData) -> NodeInfo
Creates a new NodeInfo from its parts.
+pub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> NodeInfo
Sets the relay URL and returns the updated node info.
+pub fn with_direct_addresses(
self,
direct_addresses: BTreeSet<SocketAddr>,
) -> NodeInfo
Sets the direct addresses and returns the updated node info.
-Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> NodeInfo
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 from_txt_lookup(lookup: TxtLookup) -> Result<NodeInfo, Error>
Available on non-wasm_browser only.
Parses a NodeInfo from a TXT records lookup.
-Sourcepub fn from_pkarr_signed_packet(
+
pub fn with_user_data(self, user_data: Option<UserData>) -> NodeInfo
Sets the user-defined data and returns the updated node info.
+pub fn to_node_addr(&self) -> NodeAddr
Converts into a NodeAddr by cloning the needed fields.
+pub fn into_node_addr(self) -> NodeAddr
Converts into a NodeAddr without cloning.
+pub fn from_txt_lookup(lookup: TxtLookup) -> Result<NodeInfo, Error>
Available on non-wasm_browser only.
Parses a NodeInfo from a TXT records lookup.
+pub fn from_pkarr_signed_packet(
packet: &SignedPacket,
) -> Result<NodeInfo, Error>
Parses a NodeInfo from a [pkarr::SignedPacket].
-Sourcepub fn to_pkarr_signed_packet(
+
pub fn to_pkarr_signed_packet(
&self,
secret_key: &SecretKey,
ttl: u32,
) -> Result<SignedPacket, Error>
Creates a [pkarr::SignedPacket].
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.
-Sourcepub fn add_direct_addresses(
+
pub fn to_txt_strings(&self) -> Vec<String>
Converts into a list of {key}={value} strings.
+
pub struct NodeInfo {
+NodeInfo in iroh::discovery - Rust Struct NodeInfo
pub struct NodeInfo {
pub node_id: PublicKey,
pub data: NodeData,
}
Expand description
Fields§
§node_id: PublicKeyThe NodeId of the node this is about.
§data: NodeDataThe information published about the node.
-Implementations§
Source§impl NodeInfo
Sourcepub fn from_parts(node_id: PublicKey, data: NodeData) -> NodeInfo
Creates a new NodeInfo from its parts.
-Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> NodeInfo
Sets the relay URL and returns the updated node info.
-Sourcepub fn with_direct_addresses(
+
Implementations§
§impl NodeInfo
pub fn from_parts(node_id: PublicKey, data: NodeData) -> NodeInfo
Creates a new NodeInfo from its parts.
+pub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> NodeInfo
Sets the relay URL and returns the updated node info.
+pub fn with_direct_addresses(
self,
direct_addresses: BTreeSet<SocketAddr>,
) -> NodeInfo
Sets the direct addresses and returns the updated node info.
-Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> NodeInfo
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 from_txt_lookup(lookup: TxtLookup) -> Result<NodeInfo, Error>
Available on non-wasm_browser only.
Parses a NodeInfo from a TXT records lookup.
-Sourcepub fn from_pkarr_signed_packet(
+
pub fn with_user_data(self, user_data: Option<UserData>) -> NodeInfo
Sets the user-defined data and returns the updated node info.
+pub fn to_node_addr(&self) -> NodeAddr
Converts into a NodeAddr by cloning the needed fields.
+pub fn into_node_addr(self) -> NodeAddr
Converts into a NodeAddr without cloning.
+pub fn from_txt_lookup(lookup: TxtLookup) -> Result<NodeInfo, Error>
Available on non-wasm_browser only.
Parses a NodeInfo from a TXT records lookup.
+pub fn from_pkarr_signed_packet(
packet: &SignedPacket,
) -> Result<NodeInfo, Error>
Parses a NodeInfo from a [pkarr::SignedPacket].
-Sourcepub fn to_pkarr_signed_packet(
+
pub fn to_pkarr_signed_packet(
&self,
secret_key: &SecretKey,
ttl: u32,
) -> Result<SignedPacket, Error>
Creates a [pkarr::SignedPacket].
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.
-Sourcepub fn add_direct_addresses(
+
pub fn to_txt_strings(&self) -> Vec<String>
Converts into a list of {key}={value} strings.
+Methods from Deref<Target = NodeData>§
pub fn direct_addresses(&self) -> &BTreeSet<SocketAddr>
pub fn direct_addresses(&self) -> &BTreeSet<SocketAddr>
Returns the direct addresses of the node.
+pub fn clear_direct_addresses(&mut self)
pub fn clear_direct_addresses(&mut self)
Removes all direct addresses from the node data.
+pub fn add_direct_addresses(
&mut self,
addrs: impl IntoIterator<Item = SocketAddr>,
)
pub fn add_direct_addresses( &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>)
pub 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>)
pub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the node data.
-Trait Implementations§
Source§impl From<DiscoveryItem> for NodeInfo
impl From<DiscoveryItem> for NodeInfo
Source§fn from(item: DiscoveryItem) -> Self
fn from(item: DiscoveryItem) -> Self
impl Eq for NodeInfo
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§
pub fn set_relay_url(&mut self, relay_url: Option<RelayUrl>)
pub fn set_relay_url(&mut self, relay_url: Option<RelayUrl>)
Sets the relay URL of the node data.
+pub fn set_user_data(&mut self, user_data: Option<UserData>)
pub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the node data.
+Trait Implementations§
Source§impl From<DiscoveryItem> for NodeInfo
impl From<DiscoveryItem> for NodeInfo
Source§fn from(item: DiscoveryItem) -> Self
fn from(item: DiscoveryItem) -> Self
impl Eq for NodeInfo
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> 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/3254/docs/iroh/discovery/struct.UserData.html b/pr/3254/docs/iroh/discovery/struct.UserData.html
index 134f039717..74cd45e3c7 100644
--- a/pr/3254/docs/iroh/discovery/struct.UserData.html
+++ b/pr/3254/docs/iroh/discovery/struct.UserData.html
@@ -1,24 +1,24 @@
-UserData in iroh::discovery - Rust pub struct UserData(/* private fields */);
Expand description
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
+UserData in iroh::discovery - Rust Struct UserData
pub struct UserData(/* private fields */);
Expand description
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
Iroh does not keep track of or examine the user-defined data.
UserData implements FromStr and TryFrom<String>, so you can
convert &str and String into UserData easily.
-Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
+Implementations§
§impl UserData
pub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
In DNS discovery services, the user-defined data is stored in a TXT record character string,
which has a max length of 255 bytes. We need to subtract the user-data= prefix,
which leaves 245 bytes for the actual user-defined data.
-Trait Implementations§
Trait Implementations§
§impl Ord for UserData
Source§impl PartialOrd for UserData
Source§impl Eq for UserData
Source§impl StructuralPartialEq for UserData
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
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/3254/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_PROD.html b/pr/3254/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_PROD.html
index dd2f30450f..1e378e6be9 100644
--- a/pr/3254/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_PROD.html
+++ b/pr/3254/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_PROD.html
@@ -1,2 +1,2 @@
-N0_DNS_NODE_ORIGIN_PROD in iroh::dns - Rust pub const N0_DNS_NODE_ORIGIN_PROD: &'static str;
Available on non-wasm_browser only.Expand description
The n0 testing DNS node origin, for production.
+N0_DNS_NODE_ORIGIN_PROD in iroh::dns - Rust Constant N0_DNS_NODE_ORIGIN_PROD
pub const N0_DNS_NODE_ORIGIN_PROD: &'static str;
Available on non-wasm_browser only.Expand description
The n0 testing DNS node origin, for production.
\ No newline at end of file
diff --git a/pr/3254/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_STAGING.html b/pr/3254/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_STAGING.html
index fa61f0f616..00c49c891d 100644
--- a/pr/3254/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_STAGING.html
+++ b/pr/3254/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_STAGING.html
@@ -1,2 +1,2 @@
-N0_DNS_NODE_ORIGIN_STAGING in iroh::dns - Rust pub const N0_DNS_NODE_ORIGIN_STAGING: &'static str;
Available on non-wasm_browser only.Expand description
The n0 testing DNS node origin, for testing.
+N0_DNS_NODE_ORIGIN_STAGING in iroh::dns - Rust Constant N0_DNS_NODE_ORIGIN_STAGING
pub const N0_DNS_NODE_ORIGIN_STAGING: &'static str;
Available on non-wasm_browser only.Expand description
The n0 testing DNS node origin, for testing.
\ No newline at end of file
diff --git a/pr/3254/docs/iroh/dns/struct.DnsResolver.html b/pr/3254/docs/iroh/dns/struct.DnsResolver.html
index cd04f1ce17..53843cda16 100644
--- a/pr/3254/docs/iroh/dns/struct.DnsResolver.html
+++ b/pr/3254/docs/iroh/dns/struct.DnsResolver.html
@@ -1,26 +1,26 @@
-DnsResolver in iroh::dns - Rust pub struct DnsResolver(/* private fields */);
Available on non-wasm_browser only.Expand description
The DNS resolver used throughout iroh.
-Implementations§
Source§impl DnsResolver
Sourcepub fn new() -> DnsResolver
Create a new DNS resolver with sensible cross-platform defaults.
+DnsResolver in iroh::dns - Rust Struct DnsResolver
pub struct DnsResolver(/* private fields */);
Available on non-wasm_browser only.Expand description
The DNS resolver used throughout iroh.
+Implementations§
§impl DnsResolver
pub fn new() -> DnsResolver
Create a new DNS resolver with sensible cross-platform defaults.
We first try to read the system’s resolver from /etc/resolv.conf.
This does not work at least on some Androids, therefore we fallback
to the default ResolverConfig which uses eg. to google’s 8.8.8.8 or 8.8.4.4.
-Sourcepub fn with_nameserver(nameserver: SocketAddr) -> DnsResolver
Create a new DNS resolver configured with a single UDP DNS nameserver.
-Sourcepub fn clear_cache(&self)
Removes all entries from the cache.
-Sourcepub async fn lookup_txt(
+
pub fn with_nameserver(nameserver: SocketAddr) -> DnsResolver
Create a new DNS resolver configured with a single UDP DNS nameserver.
+pub fn clear_cache(&self)
Removes all entries from the cache.
+pub async fn lookup_txt(
&self,
host: impl ToString,
timeout: Duration,
-) -> Result<TxtLookup, Error>
Lookup a TXT record.
-Sourcepub async fn lookup_ipv4(
+) -> Result<TxtLookup, Error>
Lookup a TXT record.
+pub async fn lookup_ipv4(
&self,
host: impl ToString,
timeout: Duration,
) -> Result<impl Iterator<Item = IpAddr>, Error>
Perform an ipv4 lookup with a timeout.
-Sourcepub async fn lookup_ipv6(
+
pub async fn lookup_ipv6(
&self,
host: impl ToString,
timeout: Duration,
) -> Result<impl Iterator<Item = IpAddr>, Error>
Perform an ipv6 lookup with a timeout.
-Sourcepub async fn lookup_ipv4_ipv6(
+
pub async fn lookup_ipv4_ipv6(
&self,
host: impl ToString,
timeout: Duration,
@@ -28,13 +28,13 @@ to the default ResolverConfig which uses eg. to google’s 8.
LookupIpStrategy::Ipv4AndIpv6 will wait for ipv6 resolution timeout, even if it is
not usable on the stack, so we manually query both lookups concurrently and time them out
individually.
-
Sourcepub async fn resolve_host(
+
pub async fn resolve_host(
&self,
url: &Url,
prefer_ipv6: bool,
timeout: Duration,
) -> Result<IpAddr, Error>
Resolve a hostname from a URL to an IP address.
-Sourcepub async fn lookup_ipv4_staggered(
+
pub async fn lookup_ipv4_staggered(
&self,
host: impl ToString,
timeout: Duration,
@@ -44,7 +44,7 @@ individually.
delays_ms with the first call being done immediately. [200ms, 300ms] results in calls
at T+0ms, T+200ms and T+300ms. The timeout is applied to each call individually. The
result of the first successful call is returned, or a summary of all errors otherwise.
-
Sourcepub async fn lookup_ipv6_staggered(
+
pub async fn lookup_ipv6_staggered(
&self,
host: impl ToString,
timeout: Duration,
@@ -54,7 +54,7 @@ result of the first successful call is returned, or a summary of all errors othe
delays_ms with the first call being done immediately. [200ms, 300ms] results in calls
at T+0ms, T+200ms and T+300ms. The timeout is applied to each call individually. The
result of the first successful call is returned, or a summary of all errors otherwise.
-
Sourcepub async fn lookup_ipv4_ipv6_staggered(
+
pub async fn lookup_ipv4_ipv6_staggered(
&self,
host: impl ToString,
timeout: Duration,
@@ -65,18 +65,18 @@ result of the first successful call is returned, or a summary of all errors othe
at T+0ms, T+200ms and T+300ms. The timeout is applied as stated in
Self::lookup_ipv4_ipv6. The result of the first successful call is returned, or a
summary of all errors otherwise.
-
Sourcepub async fn lookup_node_by_id(
+
pub async fn lookup_node_by_id(
&self,
node_id: &PublicKey,
origin: &str,
) -> Result<NodeInfo, Error>
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(
+
pub async fn lookup_node_by_domain_name(
&self,
name: &str,
) -> Result<NodeInfo, Error>
Looks up node info by DNS name.
-Sourcepub async fn lookup_node_by_domain_name_staggered(
+
pub async fn lookup_node_by_domain_name_staggered(
&self,
name: &str,
delays_ms: &[u64],
@@ -85,7 +85,7 @@ pass Sourcepub async fn lookup_node_by_id_staggered(
+
pub async fn lookup_node_by_id_staggered(
&self,
node_id: &PublicKey,
origin: &str,
@@ -95,7 +95,7 @@ summary of all errors otherwise.
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
summary of all errors otherwise.
-
pub struct UserData(/* private fields */);Expand description
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
Struct UserData
pub struct UserData(/* private fields */);Expand description
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
Iroh does not keep track of or examine the user-defined data.
UserData implements FromStr and TryFrom<String>, so you can
convert &str and String into UserData easily.
Implementations§
Source§impl UserData
impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
pub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
+Implementations§
§impl UserData
impl UserData
pub const MAX_LENGTH: usize = 245usize
pub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
In DNS discovery services, the user-defined data is stored in a TXT record character string,
which has a max length of 255 bytes. We need to subtract the user-data= prefix,
which leaves 245 bytes for the actual user-defined data.
Trait Implementations§
Trait Implementations§
§impl Ord for UserData
impl Ord for UserData
Source§impl PartialOrd for UserData
impl PartialOrd for UserData
impl Eq for UserData
impl StructuralPartialEq for UserData
Auto Trait Implementations§
impl Freeze for UserData
impl RefUnwindSafe for UserData
impl Send for UserData
impl Sync for UserData
impl Unpin for UserData
impl UnwindSafe for UserData
Blanket Implementations§
Auto Trait Implementations§
impl Freeze for UserData
impl RefUnwindSafe for UserData
impl Send for UserData
impl Sync for UserData
impl Unpin for UserData
impl UnwindSafe for UserData
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/3254/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_PROD.html b/pr/3254/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_PROD.html
index dd2f30450f..1e378e6be9 100644
--- a/pr/3254/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_PROD.html
+++ b/pr/3254/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_PROD.html
@@ -1,2 +1,2 @@
-N0_DNS_NODE_ORIGIN_PROD in iroh::dns - Rust pub const N0_DNS_NODE_ORIGIN_PROD: &'static str;
Available on non-wasm_browser only.Expand description
The n0 testing DNS node origin, for production.
+N0_DNS_NODE_ORIGIN_PROD in iroh::dns - Rust Constant N0_DNS_NODE_ORIGIN_PROD
pub const N0_DNS_NODE_ORIGIN_PROD: &'static str;
Available on non-wasm_browser only.Expand description
The n0 testing DNS node origin, for production.
\ No newline at end of file
diff --git a/pr/3254/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_STAGING.html b/pr/3254/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_STAGING.html
index fa61f0f616..00c49c891d 100644
--- a/pr/3254/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_STAGING.html
+++ b/pr/3254/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_STAGING.html
@@ -1,2 +1,2 @@
-N0_DNS_NODE_ORIGIN_STAGING in iroh::dns - Rust pub const N0_DNS_NODE_ORIGIN_STAGING: &'static str;
Available on non-wasm_browser only.Expand description
The n0 testing DNS node origin, for testing.
+N0_DNS_NODE_ORIGIN_STAGING in iroh::dns - Rust Constant N0_DNS_NODE_ORIGIN_STAGING
pub const N0_DNS_NODE_ORIGIN_STAGING: &'static str;
Available on non-wasm_browser only.Expand description
The n0 testing DNS node origin, for testing.
\ No newline at end of file
diff --git a/pr/3254/docs/iroh/dns/struct.DnsResolver.html b/pr/3254/docs/iroh/dns/struct.DnsResolver.html
index cd04f1ce17..53843cda16 100644
--- a/pr/3254/docs/iroh/dns/struct.DnsResolver.html
+++ b/pr/3254/docs/iroh/dns/struct.DnsResolver.html
@@ -1,26 +1,26 @@
-DnsResolver in iroh::dns - Rust pub struct DnsResolver(/* private fields */);
Available on non-wasm_browser only.Expand description
The DNS resolver used throughout iroh.
-Implementations§
Source§impl DnsResolver
Sourcepub fn new() -> DnsResolver
Create a new DNS resolver with sensible cross-platform defaults.
+DnsResolver in iroh::dns - Rust Struct DnsResolver
pub struct DnsResolver(/* private fields */);
Available on non-wasm_browser only.Expand description
The DNS resolver used throughout iroh.
+Implementations§
§impl DnsResolver
pub fn new() -> DnsResolver
Create a new DNS resolver with sensible cross-platform defaults.
We first try to read the system’s resolver from /etc/resolv.conf.
This does not work at least on some Androids, therefore we fallback
to the default ResolverConfig which uses eg. to google’s 8.8.8.8 or 8.8.4.4.
-Sourcepub fn with_nameserver(nameserver: SocketAddr) -> DnsResolver
Create a new DNS resolver configured with a single UDP DNS nameserver.
-Sourcepub fn clear_cache(&self)
Removes all entries from the cache.
-Sourcepub async fn lookup_txt(
+
pub fn with_nameserver(nameserver: SocketAddr) -> DnsResolver
Create a new DNS resolver configured with a single UDP DNS nameserver.
+pub fn clear_cache(&self)
Removes all entries from the cache.
+pub async fn lookup_txt(
&self,
host: impl ToString,
timeout: Duration,
-) -> Result<TxtLookup, Error>
Lookup a TXT record.
-Sourcepub async fn lookup_ipv4(
+) -> Result<TxtLookup, Error>
Lookup a TXT record.
+pub async fn lookup_ipv4(
&self,
host: impl ToString,
timeout: Duration,
) -> Result<impl Iterator<Item = IpAddr>, Error>
Perform an ipv4 lookup with a timeout.
-Sourcepub async fn lookup_ipv6(
+
pub async fn lookup_ipv6(
&self,
host: impl ToString,
timeout: Duration,
) -> Result<impl Iterator<Item = IpAddr>, Error>
Perform an ipv6 lookup with a timeout.
-Sourcepub async fn lookup_ipv4_ipv6(
+
pub async fn lookup_ipv4_ipv6(
&self,
host: impl ToString,
timeout: Duration,
@@ -28,13 +28,13 @@ to the default ResolverConfig which uses eg. to google’s 8.
LookupIpStrategy::Ipv4AndIpv6 will wait for ipv6 resolution timeout, even if it is
not usable on the stack, so we manually query both lookups concurrently and time them out
individually.
-
Sourcepub async fn resolve_host(
+
pub async fn resolve_host(
&self,
url: &Url,
prefer_ipv6: bool,
timeout: Duration,
) -> Result<IpAddr, Error>
Resolve a hostname from a URL to an IP address.
-Sourcepub async fn lookup_ipv4_staggered(
+
pub async fn lookup_ipv4_staggered(
&self,
host: impl ToString,
timeout: Duration,
@@ -44,7 +44,7 @@ individually.
delays_ms with the first call being done immediately. [200ms, 300ms] results in calls
at T+0ms, T+200ms and T+300ms. The timeout is applied to each call individually. The
result of the first successful call is returned, or a summary of all errors otherwise.
-
Sourcepub async fn lookup_ipv6_staggered(
+
pub async fn lookup_ipv6_staggered(
&self,
host: impl ToString,
timeout: Duration,
@@ -54,7 +54,7 @@ result of the first successful call is returned, or a summary of all errors othe
delays_ms with the first call being done immediately. [200ms, 300ms] results in calls
at T+0ms, T+200ms and T+300ms. The timeout is applied to each call individually. The
result of the first successful call is returned, or a summary of all errors otherwise.
-
Sourcepub async fn lookup_ipv4_ipv6_staggered(
+
pub async fn lookup_ipv4_ipv6_staggered(
&self,
host: impl ToString,
timeout: Duration,
@@ -65,18 +65,18 @@ result of the first successful call is returned, or a summary of all errors othe
at T+0ms, T+200ms and T+300ms. The timeout is applied as stated in
Self::lookup_ipv4_ipv6. The result of the first successful call is returned, or a
summary of all errors otherwise.
-
Sourcepub async fn lookup_node_by_id(
+
pub const N0_DNS_NODE_ORIGIN_PROD: &'static str;wasm_browser only.Expand description
The n0 testing DNS node origin, for production.
+Constant N0_DNS_NODE_ORIGIN_PROD
pub const N0_DNS_NODE_ORIGIN_PROD: &'static str;wasm_browser only.Expand description
The n0 testing DNS node origin, for production.
pub const N0_DNS_NODE_ORIGIN_STAGING: &'static str;wasm_browser only.Expand description
The n0 testing DNS node origin, for testing.
+Constant N0_DNS_NODE_ORIGIN_STAGING
pub const N0_DNS_NODE_ORIGIN_STAGING: &'static str;wasm_browser only.Expand description
The n0 testing DNS node origin, for testing.
pub struct DnsResolver(/* private fields */);wasm_browser only.Expand description
The DNS resolver used throughout iroh.
Implementations§
Source§impl DnsResolver
impl DnsResolver
Sourcepub fn new() -> DnsResolver
pub fn new() -> DnsResolver
Create a new DNS resolver with sensible cross-platform defaults.
+Struct DnsResolver
pub struct DnsResolver(/* private fields */);wasm_browser only.Expand description
The DNS resolver used throughout iroh.
Implementations§
§impl DnsResolver
impl DnsResolver
pub fn new() -> DnsResolver
pub fn new() -> DnsResolver
Create a new DNS resolver with sensible cross-platform defaults.
We first try to read the system’s resolver from /etc/resolv.conf.
This does not work at least on some Androids, therefore we fallback
to the default ResolverConfig which uses eg. to google’s 8.8.8.8 or 8.8.4.4.
Sourcepub fn with_nameserver(nameserver: SocketAddr) -> DnsResolver
pub fn with_nameserver(nameserver: SocketAddr) -> DnsResolver
Create a new DNS resolver configured with a single UDP DNS nameserver.
-Sourcepub fn clear_cache(&self)
pub fn clear_cache(&self)
Removes all entries from the cache.
-Sourcepub async fn lookup_txt(
+
pub async fn lookup_txt( +
pub fn with_nameserver(nameserver: SocketAddr) -> DnsResolver
pub fn with_nameserver(nameserver: SocketAddr) -> DnsResolver
Create a new DNS resolver configured with a single UDP DNS nameserver.
+pub fn clear_cache(&self)
pub fn clear_cache(&self)
Removes all entries from the cache.
+pub async fn lookup_txt(
&self,
host: impl ToString,
timeout: Duration,
-) -> Result<TxtLookup, Error>
pub async fn lookup_txt( &self, host: impl ToString, timeout: Duration, -) -> Result<TxtLookup, Error>
Lookup a TXT record.
-Sourcepub async fn lookup_ipv4(
+) -> Result<TxtLookup, Error>
pub async fn lookup_ipv4( +) -> Result<TxtLookup, Error>
Lookup a TXT record.
+pub async fn lookup_ipv4(
&self,
host: impl ToString,
timeout: Duration,
) -> Result<impl Iterator<Item = IpAddr>, Error>
pub async fn lookup_ipv4( &self, host: impl ToString, timeout: Duration, ) -> Result<impl Iterator<Item = IpAddr>, Error>
Perform an ipv4 lookup with a timeout.
-Sourcepub async fn lookup_ipv6(
+
pub async fn lookup_ipv6( +
pub async fn lookup_ipv6(
&self,
host: impl ToString,
timeout: Duration,
) -> Result<impl Iterator<Item = IpAddr>, Error>
pub async fn lookup_ipv6( &self, host: impl ToString, timeout: Duration, ) -> Result<impl Iterator<Item = IpAddr>, Error>
Perform an ipv6 lookup with a timeout.
-Sourcepub async fn lookup_ipv4_ipv6(
+
pub async fn lookup_ipv4_ipv6( +
pub async fn lookup_ipv4_ipv6(
&self,
host: impl ToString,
timeout: Duration,
@@ -28,13 +28,13 @@ to the default ResolverConfig which uses eg. to google’s 8.
LookupIpStrategy::Ipv4AndIpv6 will wait for ipv6 resolution timeout, even if it is
not usable on the stack, so we manually query both lookups concurrently and time them out
individually.
-
pub async fn lookup_ipv4_ipv6(
&self,
host: impl ToString,
timeout: Duration,
@@ -28,13 +28,13 @@ to the default ResolverConfig which uses eg. to google’s 8.
LookupIpStrategy::Ipv4AndIpv6 will wait for ipv6 resolution timeout, even if it is
not usable on the stack, so we manually query both lookups concurrently and time them out
individually.
-
LookupIpStrategy::Ipv4AndIpv6 will wait for ipv6 resolution timeout, even if it is
not usable on the stack, so we manually query both lookups concurrently and time them out
individually.
Sourcepub async fn resolve_host(
+
pub async fn resolve_host( +
pub async fn resolve_host(
&self,
url: &Url,
prefer_ipv6: bool,
timeout: Duration,
) -> Result<IpAddr, Error>
pub async fn resolve_host( &self, url: &Url, prefer_ipv6: bool, timeout: Duration, ) -> Result<IpAddr, Error>
Resolve a hostname from a URL to an IP address.
-Sourcepub async fn lookup_ipv4_staggered(
+
pub async fn lookup_ipv4_staggered( +
pub async fn lookup_ipv4_staggered(
&self,
host: impl ToString,
timeout: Duration,
@@ -44,7 +44,7 @@ individually.
delays_ms with the first call being done immediately. [200ms, 300ms] results in calls
at T+0ms, T+200ms and T+300ms. The timeout is applied to each call individually. The
result of the first successful call is returned, or a summary of all errors otherwise.
-
pub async fn lookup_ipv4_staggered(
&self,
host: impl ToString,
timeout: Duration,
@@ -44,7 +44,7 @@ individually.
delays_ms with the first call being done immediately. [200ms, 300ms] results in calls
at T+0ms, T+200ms and T+300ms. The timeout is applied to each call individually. The
result of the first successful call is returned, or a summary of all errors otherwise.
-
Sourcepub async fn lookup_ipv6_staggered(
+
pub async fn lookup_ipv6_staggered( +
pub async fn lookup_ipv6_staggered(
&self,
host: impl ToString,
timeout: Duration,
@@ -54,7 +54,7 @@ result of the first successful call is returned, or a summary of all errors othe
delays_ms with the first call being done immediately. [200ms, 300ms] results in calls
at T+0ms, T+200ms and T+300ms. The timeout is applied to each call individually. The
result of the first successful call is returned, or a summary of all errors otherwise.
-
pub async fn lookup_ipv6_staggered(
&self,
host: impl ToString,
timeout: Duration,
@@ -54,7 +54,7 @@ result of the first successful call is returned, or a summary of all errors othe
delays_ms with the first call being done immediately. [200ms, 300ms] results in calls
at T+0ms, T+200ms and T+300ms. The timeout is applied to each call individually. The
result of the first successful call is returned, or a summary of all errors otherwise.
-
Sourcepub async fn lookup_ipv4_ipv6_staggered(
+
pub async fn lookup_ipv4_ipv6_staggered( +
pub async fn lookup_ipv4_ipv6_staggered(
&self,
host: impl ToString,
timeout: Duration,
@@ -65,18 +65,18 @@ result of the first successful call is returned, or a summary of all errors othe
at T+0ms, T+200ms and T+300ms. The timeout is applied as stated in
Self::lookup_ipv4_ipv6. The result of the first successful call is returned, or a
summary of all errors otherwise.
-
pub async fn lookup_ipv4_ipv6_staggered(
&self,
host: impl ToString,
timeout: Duration,
@@ -65,18 +65,18 @@ result of the first successful call is returned, or a summary of all errors othe
at T+0ms, T+200ms and T+300ms. The timeout is applied as stated in
Self::lookup_ipv4_ipv6. The result of the first successful call is returned, or a
summary of all errors otherwise.
-
Sourcepub async fn lookup_node_by_id(
+
pub async fn lookup_node_by_id( +
pub async fn lookup_node_by_id(
&self,
node_id: &PublicKey,
origin: &str,
) -> Result<NodeInfo, Error>
pub async fn lookup_node_by_id( &self, node_id: &PublicKey, origin: &str, ) -> Result<NodeInfo, Error>
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(
+
pub async fn lookup_node_by_domain_name( +
pub async fn lookup_node_by_domain_name(
&self,
name: &str,
) -> Result<NodeInfo, Error>
pub async fn lookup_node_by_domain_name( &self, name: &str, ) -> Result<NodeInfo, Error>
Looks up node info by DNS name.
-Sourcepub async fn lookup_node_by_domain_name_staggered(
+
pub async fn lookup_node_by_domain_name_staggered( +
pub async fn lookup_node_by_domain_name_staggered(
&self,
name: &str,
delays_ms: &[u64],
@@ -85,7 +85,7 @@ pass Sourcepub async fn lookup_node_by_id_staggered(
+
pub async fn lookup_node_by_domain_name_staggered(
&self,
name: &str,
delays_ms: &[u64],
@@ -85,7 +85,7 @@ pass Sourcepub async fn lookup_node_by_id_staggered(
+
pub async fn lookup_node_by_id_staggered( +
pub async fn lookup_node_by_id_staggered(
&self,
node_id: &PublicKey,
origin: &str,
@@ -95,7 +95,7 @@ summary of all errors otherwise.
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
summary of all errors otherwise.
-
pub async fn lookup_node_by_id_staggered(
&self,
node_id: &PublicKey,
origin: &str,
@@ -95,7 +95,7 @@ summary of all errors otherwise.
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
summary of all errors otherwise.
-
Trait Implementations§
Source§impl Clone for DnsResolver
impl Clone for DnsResolver
Source§fn clone(&self) -> DnsResolver
fn clone(&self) -> DnsResolver
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DnsResolver
impl Debug for DnsResolver
Source§impl Default for DnsResolver
impl Default for DnsResolver
Source§fn default() -> DnsResolver
fn default() -> DnsResolver
Trait Implementations§
§impl Clone for DnsResolver
impl Clone for DnsResolver
§fn clone(&self) -> DnsResolver
fn clone(&self) -> DnsResolver
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for DnsResolver
impl Debug for DnsResolver
§impl Default for DnsResolver
impl Default for DnsResolver
§fn default() -> DnsResolver
fn default() -> DnsResolver
§impl From<Resolver<GenericConnector<TokioRuntimeProvider>>> for DnsResolver
impl From<Resolver<GenericConnector<TokioRuntimeProvider>>> for DnsResolver
§fn from(
resolver: Resolver<GenericConnector<TokioRuntimeProvider>>,
) -> DnsResolver
fn from( resolver: Resolver<GenericConnector<TokioRuntimeProvider>>, ) -> DnsResolver
Auto Trait Implementations§
impl Freeze for DnsResolver
impl !RefUnwindSafe for DnsResolver
impl Send for DnsResolver
impl Sync for DnsResolver
impl Unpin for DnsResolver
impl !UnwindSafe for DnsResolver
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/3254/docs/iroh/metrics/struct.RelayMetrics.html b/pr/3254/docs/iroh/metrics/struct.RelayMetrics.html
index 83ae1acdcc..6f22d04f93 100644
--- a/pr/3254/docs/iroh/metrics/struct.RelayMetrics.html
+++ b/pr/3254/docs/iroh/metrics/struct.RelayMetrics.html
@@ -1,4 +1,4 @@
-RelayMetrics in iroh::metrics - Rust pub struct RelayMetrics {Show 21 fields
+RelayMetrics in iroh::metrics - Rust Struct RelayMetrics
pub struct RelayMetrics {Show 21 fields
pub bytes_sent: Counter,
pub bytes_recv: Counter,
pub send_packets_sent: Counter,
@@ -42,7 +42,7 @@
§unique_client_keys: CounterNumber of unique client keys per day
§websocket_accepts: CounterNumber of accepted websocket connections
§relay_accepts: CounterNumber of accepted ‘iroh derp http’ connection upgrades
-Trait Implementations§
Source§impl Metric for Metrics
§fn new(registry: &mut Registry) -> Self
Available on crate feature metrics only.Initializes this metric group.§fn with_metric<T, F>(f: F)where
+Trait Implementations§
§impl Metric for Metrics
§fn new(registry: &mut Registry) -> Self
Available on crate feature metrics only.Initializes this metric group.§fn with_metric<T, F>(f: F)where
F: FnOnce(&Self) -> T,
Available on crate feature metrics only.Access to this metrics group to record a metric.
Only records if this metric is registered in the global registry.Auto Trait Implementations§
§impl Freeze for Metrics
§impl RefUnwindSafe for Metrics
§impl Send for Metrics
§impl Sync for Metrics
§impl Unpin for Metrics
§impl UnwindSafe for Metrics
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/3254/docs/iroh/node_info/constant.IROH_TXT_NAME.html b/pr/3254/docs/iroh/node_info/constant.IROH_TXT_NAME.html
index c78d056a1f..0c1e657fb3 100644
--- a/pr/3254/docs/iroh/node_info/constant.IROH_TXT_NAME.html
+++ b/pr/3254/docs/iroh/node_info/constant.IROH_TXT_NAME.html
@@ -1,2 +1,2 @@
-IROH_TXT_NAME in iroh::node_info - Rust pub const IROH_TXT_NAME: &'static str;
Expand description
The DNS name for the iroh TXT record.
+IROH_TXT_NAME in iroh::node_info - Rust Constant IROH_TXT_NAME
pub const IROH_TXT_NAME: &'static str;
Expand description
The DNS name for the iroh TXT record.
\ No newline at end of file
diff --git a/pr/3254/docs/iroh/node_info/index.html b/pr/3254/docs/iroh/node_info/index.html
index 9884414f78..5130358fc8 100644
--- a/pr/3254/docs/iroh/node_info/index.html
+++ b/pr/3254/docs/iroh/node_info/index.html
@@ -1,4 +1,4 @@
-iroh::node_info - Rust Expand description
Support for handling DNS resource records for dialing by NodeId.
+iroh::node_info - Rust Module node_info
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:
diff --git a/pr/3254/docs/iroh/node_info/struct.MaxLengthExceededError.html b/pr/3254/docs/iroh/node_info/struct.MaxLengthExceededError.html
index 2f1c9b7234..33cd3a33fc 100644
--- a/pr/3254/docs/iroh/node_info/struct.MaxLengthExceededError.html
+++ b/pr/3254/docs/iroh/node_info/struct.MaxLengthExceededError.html
@@ -1,5 +1,5 @@
-MaxLengthExceededError in iroh::node_info - Rust pub struct MaxLengthExceededError;
Expand description
Error returned when an input value is too long for UserData.
-Trait Implementations§
Source§impl Debug for MaxLengthExceededError
Source§impl Display for MaxLengthExceededError
Source§impl Error for MaxLengthExceededError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Auto Trait Implementations§
§impl Freeze for MaxLengthExceededError
§impl RefUnwindSafe for MaxLengthExceededError
§impl Send for MaxLengthExceededError
§impl Sync for MaxLengthExceededError
§impl Unpin for MaxLengthExceededError
§impl UnwindSafe for MaxLengthExceededError
Blanket Implementations§
Source§impl<T> Any for Twhere
+MaxLengthExceededError in iroh::node_info - Rust Struct MaxLengthExceededError
pub struct MaxLengthExceededError;
Expand description
Error returned when an input value is too long for UserData.
+Trait Implementations§
§impl Debug for MaxLengthExceededError
§impl Display for MaxLengthExceededError
§impl Error for MaxLengthExceededError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Auto Trait Implementations§
§impl Freeze for MaxLengthExceededError
§impl RefUnwindSafe for MaxLengthExceededError
§impl Send for MaxLengthExceededError
§impl Sync for MaxLengthExceededError
§impl Unpin for MaxLengthExceededError
§impl UnwindSafe for MaxLengthExceededError
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/3254/docs/iroh/node_info/struct.NodeData.html b/pr/3254/docs/iroh/node_info/struct.NodeData.html
index 8315fa3859..6a489b4160 100644
--- a/pr/3254/docs/iroh/node_info/struct.NodeData.html
+++ b/pr/3254/docs/iroh/node_info/struct.NodeData.html
@@ -1,31 +1,31 @@
-NodeData in iroh::node_info - Rust pub struct NodeData { /* private fields */ }
Expand description
Data about a node that may be published to and resolved from discovery services.
+NodeData in iroh::node_info - Rust Struct NodeData
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
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.
-Implementations§
Implementations§
§impl NodeData
pub fn new(
relay_url: Option<RelayUrl>,
direct_addresses: BTreeSet<SocketAddr>,
) -> NodeData
Creates a new NodeData with a relay URL and a set of direct addresses.
-Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> NodeData
Sets the relay URL and returns the updated node data.
-Sourcepub fn with_direct_addresses(
+
pub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> NodeData
Sets the relay URL and returns the updated node data.
+pub fn with_direct_addresses(
self,
direct_addresses: BTreeSet<SocketAddr>,
) -> NodeData
Sets the direct addresses and returns the updated node data.
-Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> NodeData
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.
-Sourcepub fn add_direct_addresses(
+
pub fn with_user_data(self, user_data: Option<UserData>) -> NodeData
Sets the user-defined data and returns the updated node data.
+pub fn direct_addresses(&self) -> &BTreeSet<SocketAddr>
Returns the direct addresses of the node.
+pub fn clear_direct_addresses(&mut self)
Removes all direct addresses from the node data.
+pub fn add_direct_addresses(
&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_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the node data.
-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§
pub fn set_relay_url(&mut self, relay_url: Option<RelayUrl>)
Sets the relay URL of the node data.
+pub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the node data.
+Trait Implementations§
§impl Eq for NodeData
§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
T: 'a,
§fn implicit(
diff --git a/pr/3254/docs/iroh/node_info/struct.NodeInfo.html b/pr/3254/docs/iroh/node_info/struct.NodeInfo.html
index d477ae0321..8adc2da63a 100644
--- a/pr/3254/docs/iroh/node_info/struct.NodeInfo.html
+++ b/pr/3254/docs/iroh/node_info/struct.NodeInfo.html
@@ -1,43 +1,43 @@
-NodeInfo in iroh::node_info - Rust pub struct NodeInfo {
+NodeInfo in iroh::node_info - Rust Struct NodeInfo
pub struct NodeInfo {
pub node_id: PublicKey,
pub data: NodeData,
}
Expand description
Fields§
§node_id: PublicKeyThe NodeId of the node this is about.
§data: NodeDataThe information published about the node.
-Implementations§
Source§impl NodeInfo
Sourcepub fn from_parts(node_id: PublicKey, data: NodeData) -> NodeInfo
Creates a new NodeInfo from its parts.
-Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> NodeInfo
Sets the relay URL and returns the updated node info.
-Sourcepub fn with_direct_addresses(
+
Implementations§
§impl NodeInfo
pub fn from_parts(node_id: PublicKey, data: NodeData) -> NodeInfo
Creates a new NodeInfo from its parts.
+pub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> NodeInfo
Sets the relay URL and returns the updated node info.
+pub fn with_direct_addresses(
self,
direct_addresses: BTreeSet<SocketAddr>,
) -> NodeInfo
Sets the direct addresses and returns the updated node info.
-Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> NodeInfo
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 from_txt_lookup(lookup: TxtLookup) -> Result<NodeInfo, Error>
Available on non-wasm_browser only.
Parses a NodeInfo from a TXT records lookup.
-Sourcepub fn from_pkarr_signed_packet(
+
pub fn with_user_data(self, user_data: Option<UserData>) -> NodeInfo
Sets the user-defined data and returns the updated node info.
+pub fn to_node_addr(&self) -> NodeAddr
Converts into a NodeAddr by cloning the needed fields.
+pub fn into_node_addr(self) -> NodeAddr
Converts into a NodeAddr without cloning.
+pub fn from_txt_lookup(lookup: TxtLookup) -> Result<NodeInfo, Error>
Available on non-wasm_browser only.
Parses a NodeInfo from a TXT records lookup.
+pub fn from_pkarr_signed_packet(
packet: &SignedPacket,
) -> Result<NodeInfo, Error>
Parses a NodeInfo from a [pkarr::SignedPacket].
-Sourcepub fn to_pkarr_signed_packet(
+
pub fn to_pkarr_signed_packet(
&self,
secret_key: &SecretKey,
ttl: u32,
) -> Result<SignedPacket, Error>
Creates a [pkarr::SignedPacket].
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.
-Sourcepub fn add_direct_addresses(
+
pub fn to_txt_strings(&self) -> Vec<String>
Converts into a list of {key}={value} strings.
+
Methods from Deref<Target = NodeData>§
pub fn direct_addresses(&self) -> &BTreeSet<SocketAddr>
Returns the direct addresses of the node.
+pub fn clear_direct_addresses(&mut self)
Removes all direct addresses from the node data.
+pub fn add_direct_addresses(
&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_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the node data.
-Trait Implementations§
Source§impl From<DiscoveryItem> for NodeInfo
Source§fn from(item: DiscoveryItem) -> Self
Converts to this type from the input type.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§
pub fn set_relay_url(&mut self, relay_url: Option<RelayUrl>)
Sets the relay URL of the node data.
+pub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the node data.
+Trait Implementations§
Source§impl From<DiscoveryItem> for NodeInfo
Source§fn from(item: DiscoveryItem) -> Self
Converts to this type from the input type.§impl Eq for NodeInfo
§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
T: 'a,
§fn implicit(
diff --git a/pr/3254/docs/iroh/node_info/struct.UserData.html b/pr/3254/docs/iroh/node_info/struct.UserData.html
index 4f76e55134..fb7ea9a345 100644
--- a/pr/3254/docs/iroh/node_info/struct.UserData.html
+++ b/pr/3254/docs/iroh/node_info/struct.UserData.html
@@ -1,24 +1,24 @@
-UserData in iroh::node_info - Rust pub struct UserData(/* private fields */);
Expand description
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
+UserData in iroh::node_info - Rust Struct UserData
pub struct UserData(/* private fields */);
Expand description
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
Iroh does not keep track of or examine the user-defined data.
UserData implements FromStr and TryFrom<String>, so you can
convert &str and String into UserData easily.
-Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
+Implementations§
§impl UserData
pub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
In DNS discovery services, the user-defined data is stored in a TXT record character string,
which has a max length of 255 bytes. We need to subtract the user-data= prefix,
which leaves 245 bytes for the actual user-defined data.
-Trait Implementations§
Trait Implementations§
§impl Ord for UserData
Source§impl PartialOrd for UserData
Source§impl Eq for UserData
Source§impl StructuralPartialEq for UserData
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
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/3254/docs/iroh/node_info/trait.NodeIdExt.html b/pr/3254/docs/iroh/node_info/trait.NodeIdExt.html
index 554c8c6e66..6d8273fb7e 100644
--- a/pr/3254/docs/iroh/node_info/trait.NodeIdExt.html
+++ b/pr/3254/docs/iroh/node_info/trait.NodeIdExt.html
@@ -1,9 +1,9 @@
-NodeIdExt in iroh::node_info - Rust pub trait NodeIdExt {
+NodeIdExt in iroh::node_info - Rust Trait NodeIdExt
pub trait NodeIdExt {
// Required methods
fn to_z32(&self) -> String;
fn from_z32(s: &str) -> Result<PublicKey, Error>;
}
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.
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.
Implementors§
\ No newline at end of file
diff --git a/pr/3254/docs/iroh/struct.NodeAddr.html b/pr/3254/docs/iroh/struct.NodeAddr.html
index cd39aabacf..b2e98874c3 100644
--- a/pr/3254/docs/iroh/struct.NodeAddr.html
+++ b/pr/3254/docs/iroh/struct.NodeAddr.html
@@ -44,7 +44,7 @@ whenever a connection to other nodes needs to be established.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for NodeAddr
Source§fn deserialize<__D>(
__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.
+ __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 Ord for NodeAddr
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more1.21.0 · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more1.50.0 · Source§fn clamp(self, min: Self, max: Self) -> Selfwhere
diff --git a/pr/3254/docs/iroh/struct.PublicKey.html b/pr/3254/docs/iroh/struct.PublicKey.html
index 140d5f9452..94f97f44d1 100644
--- a/pr/3254/docs/iroh/struct.PublicKey.html
+++ b/pr/3254/docs/iroh/struct.PublicKey.html
@@ -22,7 +22,7 @@ representation of the key.
Source§impl Ord for PublicKey
Source§impl PartialEq for PublicKey
Source§fn eq(&self, other: &PublicKey) -> 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/3254/docs/iroh/struct.RelayMap.html b/pr/3254/docs/iroh/struct.RelayMap.html
index d44542c103..c331ec3208 100644
--- a/pr/3254/docs/iroh/struct.RelayMap.html
+++ b/pr/3254/docs/iroh/struct.RelayMap.html
@@ -1,26 +1,26 @@
-RelayMap in iroh - Rust pub struct RelayMap { /* private fields */ }
Expand description
Configuration of all the relay servers that can be used.
-Implementations§
Source§impl RelayMap
Sourcepub fn nodes(&self) -> impl Iterator<Item = &Arc<RelayNode>>
Returns an Iterator over all known nodes.
-Sourcepub fn contains_node(&self, url: &RelayUrl) -> bool
Is this a known node?
-Sourcepub fn default_from_node(url: RelayUrl, stun_port: u16) -> RelayMap
Creates a new RelayMap with a single relay server configured.
+RelayMap in iroh - Rust Struct RelayMap
pub struct RelayMap { /* private fields */ }
Expand description
Configuration of all the relay servers that can be used.
+Implementations§
§impl RelayMap
pub fn nodes(&self) -> impl Iterator<Item = &Arc<RelayNode>>
Returns an Iterator over all known nodes.
+pub fn contains_node(&self, url: &RelayUrl) -> bool
Is this a known node?
+pub fn default_from_node(url: RelayUrl, stun_port: u16) -> RelayMap
Creates a new RelayMap with a single relay server configured.
Allows to set a custom STUN port and different IP addresses for IPv4 and IPv6.
If IP addresses are provided, no DNS lookup will be performed.
Sets the port to the default DEFAULT_RELAY_QUIC_PORT.
-Sourcepub fn from_nodes<I>(
+
pub fn from_nodes<I>(
value: impl IntoIterator<Item = I>,
) -> Result<RelayMap, Error>
Trait Implementations§
Source§impl Eq for RelayMap
Source§impl StructuralPartialEq for RelayMap
Auto Trait Implementations§
§impl Freeze for RelayMap
§impl RefUnwindSafe for RelayMap
§impl Send for RelayMap
§impl Sync for RelayMap
§impl Unpin for RelayMap
§impl UnwindSafe for RelayMap
Blanket Implementations§
Trait Implementations§
§impl Eq for RelayMap
§impl StructuralPartialEq for RelayMap
Auto Trait Implementations§
§impl Freeze for RelayMap
§impl RefUnwindSafe for RelayMap
§impl Send for RelayMap
§impl Sync for RelayMap
§impl Unpin for RelayMap
§impl UnwindSafe for RelayMap
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/3254/docs/iroh/struct.RelayNode.html b/pr/3254/docs/iroh/struct.RelayNode.html
index efbb608578..9ab2cddcc0 100644
--- a/pr/3254/docs/iroh/struct.RelayNode.html
+++ b/pr/3254/docs/iroh/struct.RelayNode.html
@@ -1,8 +1,8 @@
-RelayNode in iroh - Rust pub struct RelayNode {
+RelayNode in iroh - Rust Struct RelayNode
pub struct RelayNode {
pub url: RelayUrl,
pub stun_only: bool,
pub stun_port: u16,
- pub quic: Option<RelayQuicConfig>,
+ 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.
@@ -11,24 +11,24 @@
functionality is used.
§stun_port: u16The stun port of the relay server.
Setting this to 0 means the default STUN port is used.
-§quic: Option<RelayQuicConfig>Configuration to speak to the QUIC endpoint on the relay server.
+§quic: Option<RelayQuicConfig>Configuration to speak to the QUIC endpoint on the relay server.
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>(
+
Trait Implementations§
§impl<'de> Deserialize<'de> for RelayNode
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<RelayNode, <__D as Deserializer<'de>>::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more§impl Ord for RelayNode
Source§impl PartialOrd for RelayNode
§impl Serialize for RelayNode
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
- __S: Serializer,
Serialize this value into the given Serde serializer. Read moreSource§impl Eq for RelayNode
Source§impl StructuralPartialEq for RelayNode
Auto Trait Implementations§
§impl Freeze for RelayNode
§impl RefUnwindSafe for RelayNode
§impl Send for RelayNode
§impl Sync for RelayNode
§impl Unpin for RelayNode
§impl UnwindSafe for RelayNode
Blanket Implementations§
Source§impl<T> Any for Twhere
+ __S: Serializer,
Serialize this value into the given Serde serializer. Read more§impl Eq for RelayNode
§impl StructuralPartialEq for RelayNode
Auto Trait Implementations§
§impl Freeze for RelayNode
§impl RefUnwindSafe for RelayNode
§impl Send for RelayNode
§impl Sync for RelayNode
§impl Unpin for RelayNode
§impl UnwindSafe for RelayNode
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/3254/docs/iroh/test_utils/fn.run_relay_server.html b/pr/3254/docs/iroh/test_utils/fn.run_relay_server.html
index 4f41fd2d31..d738a1d8e1 100644
--- a/pr/3254/docs/iroh/test_utils/fn.run_relay_server.html
+++ b/pr/3254/docs/iroh/test_utils/fn.run_relay_server.html
@@ -1,4 +1,4 @@
-run_relay_server in iroh::test_utils - Rust pub async fn run_relay_server() -> Result<(RelayMap, RelayUrl, Server)>
Available on crate feature test-utils only.Expand description
Runs a relay server with STUN and QUIC enabled suitable for tests.
+run_relay_server in iroh::test_utils - Rust
\ No newline at end of file
diff --git a/pr/3254/docs/iroh/test_utils/fn.run_relay_server_with.html b/pr/3254/docs/iroh/test_utils/fn.run_relay_server_with.html
index c31b8b2572..5b179c2f1d 100644
--- a/pr/3254/docs/iroh/test_utils/fn.run_relay_server_with.html
+++ b/pr/3254/docs/iroh/test_utils/fn.run_relay_server_with.html
@@ -1,9 +1,9 @@
run_relay_server_with in iroh::test_utils - Rust pub async fn run_relay_server_with(
- stun: Option<StunConfig>,
+ stun: Option<StunConfig>,
quic: bool,
-) -> Result<(RelayMap, RelayUrl, Server)>
Available on crate feature test-utils only.Expand description
Runs a relay server.
+) -> Result<(RelayMap, RelayUrl, Server)>Available on crate feature test-utils only.Expand description
Runs a relay server.
stun can be set to None to disable stun, or set to Some StunConfig,
to enable stun on a specific socket.
-If quic is set to true, it will make the appropriate QuicConfig from the generated tls certificates and run the quic server at a random free port.
+If quic is set to true, it will make the appropriate [QuicConfig] from the generated tls certificates and run the quic server at a random free port.
The return value is similar to run_relay_server.
\ No newline at end of file
diff --git a/pr/3254/docs/iroh/test_utils/fn.run_relay_server_with_stun.html b/pr/3254/docs/iroh/test_utils/fn.run_relay_server_with_stun.html
index 436f9d1200..ce014daffa 100644
--- a/pr/3254/docs/iroh/test_utils/fn.run_relay_server_with_stun.html
+++ b/pr/3254/docs/iroh/test_utils/fn.run_relay_server_with_stun.html
@@ -1,4 +1,4 @@
-run_relay_server_with_stun in iroh::test_utils - Rust pub async fn run_relay_server_with_stun() -> Result<(RelayMap, RelayUrl, Server)>
Available on crate feature test-utils only.Expand description
Runs a relay server with STUN enabled suitable for tests.
+run_relay_server_with_stun in iroh::test_utils - Rust
\ No newline at end of file
diff --git a/pr/3254/docs/iroh_net_report/struct.Client.html b/pr/3254/docs/iroh_net_report/struct.Client.html
index f8932f43eb..774654c5d3 100644
--- a/pr/3254/docs/iroh_net_report/struct.Client.html
+++ b/pr/3254/docs/iroh_net_report/struct.Client.html
@@ -7,7 +7,7 @@ If all Addr::receive_stun_packet.
Implementations§
Source§impl Client
Sourcepub fn new(
port_mapper: Option<Client>,
- dns_resolver: DnsResolver,
+ dns_resolver: DnsResolver,
ip_mapped_addrs: Option<IpMappedAddresses>,
) -> Result<Self>
Creates a new net_report client.
This starts a connected actor in the background. Once the client is dropped it will
@@ -17,7 +17,7 @@ stop running.
allows sending messages to the actor.
Sourcepub async fn get_report(
&mut self,
- relay_map: RelayMap,
+ relay_map: RelayMap,
stun_sock_v4: Option<Arc<UdpSocket>>,
stun_sock_v6: Option<Arc<UdpSocket>>,
quic_config: Option<QuicConfig>,
@@ -39,14 +39,14 @@ using QUIC address discovery.
This will attempt to use all probe protocols.
Sourcepub async fn get_report_with_opts(
&mut self,
- relay_map: RelayMap,
+ relay_map: RelayMap,
opts: Options,
) -> Result<Arc<Report>>
Runs a net_report, returning the report.
It may not be called concurrently with itself, &mut self takes care of that.
Look at Options for the different configuration options.
Sourcepub async fn get_report_channel(
&mut self,
- relay_map: RelayMap,
+ relay_map: RelayMap,
opts: Options,
) -> Result<Receiver<Result<Arc<Report>>>>
Get report with channel
Look at Options for the different configuration options.
diff --git a/pr/3254/docs/iroh_net_report/struct.RelayLatencies.html b/pr/3254/docs/iroh_net_report/struct.RelayLatencies.html
index cab40bff24..bbbe92b500 100644
--- a/pr/3254/docs/iroh_net_report/struct.RelayLatencies.html
+++ b/pr/3254/docs/iroh_net_report/struct.RelayLatencies.html
@@ -1,5 +1,5 @@
RelayLatencies in iroh_net_report - Rust pub struct RelayLatencies(/* private fields */);
Expand description
Latencies per relay node.
-Implementations§
Source§impl RelayLatencies
Sourcepub fn iter(&self) -> impl Iterator<Item = (&RelayUrl, Duration)> + '_
Returns an iterator over all the relays and their latencies.
+Implementations§
Trait Implementations§
Source§impl Clone for RelayLatencies
Source§fn clone(&self) -> RelayLatencies
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 RelayLatencies
Source§impl Default for RelayLatencies
Source§fn default() -> RelayLatencies
Returns the “default value” for a type. Read moreSource§impl PartialEq for RelayLatencies
Source§impl Eq for RelayLatencies
Source§impl StructuralPartialEq for RelayLatencies
Auto Trait Implementations§
§impl Freeze for RelayLatencies
§impl RefUnwindSafe for RelayLatencies
§impl Send for RelayLatencies
§impl Sync for RelayLatencies
§impl Unpin for RelayLatencies
§impl UnwindSafe for RelayLatencies
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/3254/docs/iroh_net_report/struct.Report.html b/pr/3254/docs/iroh_net_report/struct.Report.html
index b6dda01fab..1cdf766458 100644
--- a/pr/3254/docs/iroh_net_report/struct.Report.html
+++ b/pr/3254/docs/iroh_net_report/struct.Report.html
@@ -11,7 +11,7 @@
pub mapping_varies_by_dest_ipv6: Option<bool>,
pub hair_pinning: Option<bool>,
pub portmap_probe: Option<ProbeOutput>,
- pub preferred_relay: Option<RelayUrl>,
+ pub preferred_relay: Option<RelayUrl>,
pub relay_latency: RelayLatencies,
pub relay_v4_latency: RelayLatencies,
pub relay_v6_latency: RelayLatencies,
@@ -35,7 +35,7 @@ detecting rather than using it. For now.
§hair_pinning: Option<bool>Whether the router supports communicating between two local devices through the NATted
public IP address (on IPv4).
§portmap_probe: Option<ProbeOutput>Probe indicating the presence of port mapping protocols on the LAN.
-§preferred_relay: Option<RelayUrl>None for unknown
+§preferred_relay: Option<RelayUrl>None for unknown
§relay_latency: RelayLatencieskeyed by relay Url
§relay_v4_latency: RelayLatencieskeyed by relay Url
§relay_v6_latency: RelayLatencieskeyed by relay Url
diff --git a/pr/3254/docs/src/iroh/magicsock/relay_actor.rs.html b/pr/3254/docs/src/iroh/magicsock/relay_actor.rs.html
index 8a3318169b..10265b471c 100644
--- a/pr/3254/docs/src/iroh/magicsock/relay_actor.rs.html
+++ b/pr/3254/docs/src/iroh/magicsock/relay_actor.rs.html
@@ -1582,13 +1582,7 @@
1581
1582
1583
-1584
-1585
-1586
-1587
-1588
-1589
-1590//! The relay actor.
+1584
//! The relay actor.
//!
//! The [`RelayActor`] handles all the relay connections. It is helped by the
//! [`ActiveRelayActor`] which handles a single relay connection.
@@ -1871,25 +1865,19 @@
let mut backoff = Self::build_backoff();
- loop {
- match self.run_once().await {
- Err(err) => {
- warn!("Relay connection failed: {err:#}");
- if self.pong_received {
- // If the relay connection remained established long enough so that we received a pong
- // from the relay server, we reset the backoff and attempt to reconnect immediately.
- self.pong_received = false;
- backoff = Self::build_backoff();
- continue;
- } else {
- // If dialing failed, or if the relay connection failed before we received a pong,
- // we wait an exponentially increasing time until we attempt to reconnect again.
- let sleep = backoff.next().context("Retries exceeded")?;
- debug!("Retry in {sleep:?}");
- time::sleep(sleep).await;
- }
- }
- Ok(()) => break,
+ while let Err(err) = self.run_once().await {
+ warn!("Relay connection failed: {err:#}");
+ if self.pong_received {
+ // If the relay connection remained established long enough so that we received a pong
+ // from the relay server, we reset the backoff and attempt to reconnect immediately.
+ self.pong_received = false;
+ backoff = Self::build_backoff();
+ } else {
+ // If dialing failed, or if the relay connection failed before we received a pong,
+ // we wait an exponentially increasing time until we attempt to reconnect again.
+ let sleep = backoff.next().context("Retries exceeded")?;
+ debug!("Retry in {sleep:?}");
+ time::sleep(sleep).await;
}
}
debug!("exiting");
diff --git a/pr/3254/docs/type.impl/iroh/struct.PublicKey.js b/pr/3254/docs/type.impl/iroh/struct.PublicKey.js
index d01f8c9287..9c9039082f 100644
--- a/pr/3254/docs/type.impl/iroh/struct.PublicKey.js
+++ b/pr/3254/docs/type.impl/iroh/struct.PublicKey.js
@@ -1,9 +1,9 @@
(function() {
- var type_impls = Object.fromEntries([["iroh",[["","AsRef<[u8]>","iroh::NodeId"],["","Borrow<[u8; 32]>","iroh::NodeId"],["","Clone","iroh::NodeId"],["","Debug","iroh::NodeId"],["Source§impl<'de> Deserialize<'de> for PublicKey
Source§fn deserialize<D>(\n deserializer: D,\n) -> Result<PublicKey, <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh::NodeId"],["","Display","iroh::NodeId"],["","From","iroh::NodeId"],["Source§impl FromStr for PublicKey
","FromStr","iroh::NodeId"],["","Hash","iroh::NodeId"],["","NodeIdExt","iroh::NodeId"],["Source§impl Ord for PublicKey
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh::NodeId"],["","PartialEq","iroh::NodeId"],["Source§impl PartialOrd for PublicKey
","PartialOrd","iroh::NodeId"],["Source§impl PublicKey
Sourcepub fn from_bytes(bytes: &[u8; 32]) -> Result<PublicKey, Error>
Construct a PublicKey from a slice of bytes.
\n§Warning
\nThis will return a [SignatureError] if the bytes passed into this method do not represent\na valid ed25519_dalek curve point. Will never fail for bytes return from Self::as_bytes.\nSee [VerifyingKey::from_bytes] for details.
\n",0,"iroh::NodeId"],["Source§impl Serialize for PublicKey
Source§fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
Serialize this value into the given Serde serializer. Read more","Serialize","iroh::NodeId"],["","TryFrom<&[u8]>","iroh::NodeId"],["","TryFrom<&[u8; 32]>","iroh::NodeId"],["Source§impl Copy for PublicKey
","Copy","iroh::NodeId"],["Source§impl Eq for PublicKey
","Eq","iroh::NodeId"],["Source§impl StructuralPartialEq for PublicKey
","StructuralPartialEq","iroh::NodeId"]]]]);
+ var type_impls = Object.fromEntries([["iroh",[["","AsRef<[u8]>","iroh::NodeId"],["","Borrow<[u8; 32]>","iroh::NodeId"],["","Clone","iroh::NodeId"],["","Debug","iroh::NodeId"],["Source§impl<'de> Deserialize<'de> for PublicKey
Source§fn deserialize<D>(\n deserializer: D,\n) -> Result<PublicKey, <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh::NodeId"],["","Display","iroh::NodeId"],["","From","iroh::NodeId"],["Source§impl FromStr for PublicKey
","FromStr","iroh::NodeId"],["","Hash","iroh::NodeId"],["","NodeIdExt","iroh::NodeId"],["Source§impl Ord for PublicKey
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh::NodeId"],["","PartialEq","iroh::NodeId"],["Source§impl PartialOrd for PublicKey
","PartialOrd","iroh::NodeId"],["Source§impl PublicKey
Sourcepub fn from_bytes(bytes: &[u8; 32]) -> Result<PublicKey, Error>
Construct a PublicKey from a slice of bytes.
\n§Warning
\nThis will return a [SignatureError] if the bytes passed into this method do not represent\na valid ed25519_dalek curve point. Will never fail for bytes return from Self::as_bytes.\nSee [VerifyingKey::from_bytes] for details.
\n",0,"iroh::NodeId"],["Source§impl Serialize for PublicKey
Source§fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
Serialize this value into the given Serde serializer. Read more","Serialize","iroh::NodeId"],["","TryFrom<&[u8]>","iroh::NodeId"],["","TryFrom<&[u8; 32]>","iroh::NodeId"],["Source§impl Copy for PublicKey
","Copy","iroh::NodeId"],["Source§impl Eq for PublicKey
","Eq","iroh::NodeId"],["Source§impl StructuralPartialEq for PublicKey
","StructuralPartialEq","iroh::NodeId"]]]]);
if (window.register_type_impls) {
window.register_type_impls(type_impls);
} else {
window.pending_type_impls = type_impls;
}
})()
-//{"start":55,"fragment_lengths":[47903]}
\ No newline at end of file
+//{"start":55,"fragment_lengths":[47657]}
\ No newline at end of file
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/3254/docs/iroh/metrics/struct.RelayMetrics.html b/pr/3254/docs/iroh/metrics/struct.RelayMetrics.html
index 83ae1acdcc..6f22d04f93 100644
--- a/pr/3254/docs/iroh/metrics/struct.RelayMetrics.html
+++ b/pr/3254/docs/iroh/metrics/struct.RelayMetrics.html
@@ -1,4 +1,4 @@
-RelayMetrics in iroh::metrics - Rust pub struct RelayMetrics {Show 21 fields
+RelayMetrics in iroh::metrics - Rust Struct RelayMetrics
pub struct RelayMetrics {Show 21 fields
pub bytes_sent: Counter,
pub bytes_recv: Counter,
pub send_packets_sent: Counter,
@@ -42,7 +42,7 @@
§unique_client_keys: CounterNumber of unique client keys per day
§websocket_accepts: CounterNumber of accepted websocket connections
§relay_accepts: CounterNumber of accepted ‘iroh derp http’ connection upgrades
-Trait Implementations§
Source§impl Metric for Metrics
§fn new(registry: &mut Registry) -> Self
Available on crate feature metrics only.Initializes this metric group.§fn with_metric<T, F>(f: F)where
+Trait Implementations§
§impl Metric for Metrics
§fn new(registry: &mut Registry) -> Self
Available on crate feature metrics only.Initializes this metric group.§fn with_metric<T, F>(f: F)where
F: FnOnce(&Self) -> T,
Available on crate feature metrics only.Access to this metrics group to record a metric.
Only records if this metric is registered in the global registry.Auto Trait Implementations§
§impl Freeze for Metrics
§impl RefUnwindSafe for Metrics
§impl Send for Metrics
§impl Sync for Metrics
§impl Unpin for Metrics
§impl UnwindSafe for Metrics
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/3254/docs/iroh/node_info/constant.IROH_TXT_NAME.html b/pr/3254/docs/iroh/node_info/constant.IROH_TXT_NAME.html
index c78d056a1f..0c1e657fb3 100644
--- a/pr/3254/docs/iroh/node_info/constant.IROH_TXT_NAME.html
+++ b/pr/3254/docs/iroh/node_info/constant.IROH_TXT_NAME.html
@@ -1,2 +1,2 @@
-IROH_TXT_NAME in iroh::node_info - Rust pub const IROH_TXT_NAME: &'static str;
Expand description
The DNS name for the iroh TXT record.
+IROH_TXT_NAME in iroh::node_info - Rust Constant IROH_TXT_NAME
pub const IROH_TXT_NAME: &'static str;
Expand description
The DNS name for the iroh TXT record.
\ No newline at end of file
diff --git a/pr/3254/docs/iroh/node_info/index.html b/pr/3254/docs/iroh/node_info/index.html
index 9884414f78..5130358fc8 100644
--- a/pr/3254/docs/iroh/node_info/index.html
+++ b/pr/3254/docs/iroh/node_info/index.html
@@ -1,4 +1,4 @@
-iroh::node_info - Rust Expand description
Support for handling DNS resource records for dialing by NodeId.
+iroh::node_info - Rust Module node_info
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:
diff --git a/pr/3254/docs/iroh/node_info/struct.MaxLengthExceededError.html b/pr/3254/docs/iroh/node_info/struct.MaxLengthExceededError.html
index 2f1c9b7234..33cd3a33fc 100644
--- a/pr/3254/docs/iroh/node_info/struct.MaxLengthExceededError.html
+++ b/pr/3254/docs/iroh/node_info/struct.MaxLengthExceededError.html
@@ -1,5 +1,5 @@
-MaxLengthExceededError in iroh::node_info - Rust pub struct MaxLengthExceededError;
Expand description
Error returned when an input value is too long for UserData.
-Trait Implementations§
Source§impl Debug for MaxLengthExceededError
Source§impl Display for MaxLengthExceededError
Source§impl Error for MaxLengthExceededError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Auto Trait Implementations§
§impl Freeze for MaxLengthExceededError
§impl RefUnwindSafe for MaxLengthExceededError
§impl Send for MaxLengthExceededError
§impl Sync for MaxLengthExceededError
§impl Unpin for MaxLengthExceededError
§impl UnwindSafe for MaxLengthExceededError
Blanket Implementations§
Source§impl<T> Any for Twhere
+MaxLengthExceededError in iroh::node_info - Rust Struct MaxLengthExceededError
pub struct MaxLengthExceededError;
Expand description
Error returned when an input value is too long for UserData.
+Trait Implementations§
§impl Debug for MaxLengthExceededError
§impl Display for MaxLengthExceededError
§impl Error for MaxLengthExceededError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Auto Trait Implementations§
§impl Freeze for MaxLengthExceededError
§impl RefUnwindSafe for MaxLengthExceededError
§impl Send for MaxLengthExceededError
§impl Sync for MaxLengthExceededError
§impl Unpin for MaxLengthExceededError
§impl UnwindSafe for MaxLengthExceededError
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/3254/docs/iroh/node_info/struct.NodeData.html b/pr/3254/docs/iroh/node_info/struct.NodeData.html
index 8315fa3859..6a489b4160 100644
--- a/pr/3254/docs/iroh/node_info/struct.NodeData.html
+++ b/pr/3254/docs/iroh/node_info/struct.NodeData.html
@@ -1,31 +1,31 @@
-NodeData in iroh::node_info - Rust pub struct NodeData { /* private fields */ }
Expand description
Data about a node that may be published to and resolved from discovery services.
+NodeData in iroh::node_info - Rust Struct NodeData
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
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.
-Implementations§
Implementations§
§impl NodeData
pub fn new(
relay_url: Option<RelayUrl>,
direct_addresses: BTreeSet<SocketAddr>,
) -> NodeData
Creates a new NodeData with a relay URL and a set of direct addresses.
-Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> NodeData
Sets the relay URL and returns the updated node data.
-Sourcepub fn with_direct_addresses(
+
pub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> NodeData
Sets the relay URL and returns the updated node data.
+pub fn with_direct_addresses(
self,
direct_addresses: BTreeSet<SocketAddr>,
) -> NodeData
Sets the direct addresses and returns the updated node data.
-Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> NodeData
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.
-Sourcepub fn add_direct_addresses(
+
pub fn with_user_data(self, user_data: Option<UserData>) -> NodeData
Sets the user-defined data and returns the updated node data.
+pub fn direct_addresses(&self) -> &BTreeSet<SocketAddr>
Returns the direct addresses of the node.
+pub fn clear_direct_addresses(&mut self)
Removes all direct addresses from the node data.
+pub fn add_direct_addresses(
&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_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the node data.
-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§
pub fn set_relay_url(&mut self, relay_url: Option<RelayUrl>)
Sets the relay URL of the node data.
+pub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the node data.
+Trait Implementations§
§impl Eq for NodeData
§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
T: 'a,
§fn implicit(
diff --git a/pr/3254/docs/iroh/node_info/struct.NodeInfo.html b/pr/3254/docs/iroh/node_info/struct.NodeInfo.html
index d477ae0321..8adc2da63a 100644
--- a/pr/3254/docs/iroh/node_info/struct.NodeInfo.html
+++ b/pr/3254/docs/iroh/node_info/struct.NodeInfo.html
@@ -1,43 +1,43 @@
-NodeInfo in iroh::node_info - Rust pub struct NodeInfo {
+NodeInfo in iroh::node_info - Rust Struct NodeInfo
pub struct NodeInfo {
pub node_id: PublicKey,
pub data: NodeData,
}
Expand description
Fields§
§node_id: PublicKeyThe NodeId of the node this is about.
§data: NodeDataThe information published about the node.
-Implementations§
Source§impl NodeInfo
Sourcepub fn from_parts(node_id: PublicKey, data: NodeData) -> NodeInfo
Creates a new NodeInfo from its parts.
-Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> NodeInfo
Sets the relay URL and returns the updated node info.
-Sourcepub fn with_direct_addresses(
+
Implementations§
§impl NodeInfo
pub fn from_parts(node_id: PublicKey, data: NodeData) -> NodeInfo
Creates a new NodeInfo from its parts.
+pub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> NodeInfo
Sets the relay URL and returns the updated node info.
+pub fn with_direct_addresses(
self,
direct_addresses: BTreeSet<SocketAddr>,
) -> NodeInfo
Sets the direct addresses and returns the updated node info.
-Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> NodeInfo
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 from_txt_lookup(lookup: TxtLookup) -> Result<NodeInfo, Error>
Available on non-wasm_browser only.
Parses a NodeInfo from a TXT records lookup.
-Sourcepub fn from_pkarr_signed_packet(
+
pub fn with_user_data(self, user_data: Option<UserData>) -> NodeInfo
Sets the user-defined data and returns the updated node info.
+pub fn to_node_addr(&self) -> NodeAddr
Converts into a NodeAddr by cloning the needed fields.
+pub fn into_node_addr(self) -> NodeAddr
Converts into a NodeAddr without cloning.
+pub fn from_txt_lookup(lookup: TxtLookup) -> Result<NodeInfo, Error>
Available on non-wasm_browser only.
Parses a NodeInfo from a TXT records lookup.
+pub fn from_pkarr_signed_packet(
packet: &SignedPacket,
) -> Result<NodeInfo, Error>
Parses a NodeInfo from a [pkarr::SignedPacket].
-Sourcepub fn to_pkarr_signed_packet(
+
pub fn to_pkarr_signed_packet(
&self,
secret_key: &SecretKey,
ttl: u32,
) -> Result<SignedPacket, Error>
Creates a [pkarr::SignedPacket].
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.
-Sourcepub fn add_direct_addresses(
+
pub fn to_txt_strings(&self) -> Vec<String>
Converts into a list of {key}={value} strings.
+
Methods from Deref<Target = NodeData>§
pub fn direct_addresses(&self) -> &BTreeSet<SocketAddr>
Returns the direct addresses of the node.
+pub fn clear_direct_addresses(&mut self)
Removes all direct addresses from the node data.
+pub fn add_direct_addresses(
&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_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the node data.
-Trait Implementations§
Source§impl From<DiscoveryItem> for NodeInfo
Source§fn from(item: DiscoveryItem) -> Self
Converts to this type from the input type.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§
pub fn set_relay_url(&mut self, relay_url: Option<RelayUrl>)
Sets the relay URL of the node data.
+pub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the node data.
+Trait Implementations§
Source§impl From<DiscoveryItem> for NodeInfo
Source§fn from(item: DiscoveryItem) -> Self
Converts to this type from the input type.§impl Eq for NodeInfo
§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
T: 'a,
§fn implicit(
diff --git a/pr/3254/docs/iroh/node_info/struct.UserData.html b/pr/3254/docs/iroh/node_info/struct.UserData.html
index 4f76e55134..fb7ea9a345 100644
--- a/pr/3254/docs/iroh/node_info/struct.UserData.html
+++ b/pr/3254/docs/iroh/node_info/struct.UserData.html
@@ -1,24 +1,24 @@
-UserData in iroh::node_info - Rust pub struct UserData(/* private fields */);
Expand description
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
+UserData in iroh::node_info - Rust Struct UserData
pub struct UserData(/* private fields */);
Expand description
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
Iroh does not keep track of or examine the user-defined data.
UserData implements FromStr and TryFrom<String>, so you can
convert &str and String into UserData easily.
-Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
+Implementations§
§impl UserData
pub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
In DNS discovery services, the user-defined data is stored in a TXT record character string,
which has a max length of 255 bytes. We need to subtract the user-data= prefix,
which leaves 245 bytes for the actual user-defined data.
-Trait Implementations§
Trait Implementations§
§impl Ord for UserData
Source§impl PartialOrd for UserData
Source§impl Eq for UserData
Source§impl StructuralPartialEq for UserData
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
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/3254/docs/iroh/node_info/trait.NodeIdExt.html b/pr/3254/docs/iroh/node_info/trait.NodeIdExt.html
index 554c8c6e66..6d8273fb7e 100644
--- a/pr/3254/docs/iroh/node_info/trait.NodeIdExt.html
+++ b/pr/3254/docs/iroh/node_info/trait.NodeIdExt.html
@@ -1,9 +1,9 @@
-NodeIdExt in iroh::node_info - Rust pub trait NodeIdExt {
+NodeIdExt in iroh::node_info - Rust Trait NodeIdExt
pub trait NodeIdExt {
// Required methods
fn to_z32(&self) -> String;
fn from_z32(s: &str) -> Result<PublicKey, Error>;
}
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.
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.
Implementors§
\ No newline at end of file
diff --git a/pr/3254/docs/iroh/struct.NodeAddr.html b/pr/3254/docs/iroh/struct.NodeAddr.html
index cd39aabacf..b2e98874c3 100644
--- a/pr/3254/docs/iroh/struct.NodeAddr.html
+++ b/pr/3254/docs/iroh/struct.NodeAddr.html
@@ -44,7 +44,7 @@ whenever a connection to other nodes needs to be established.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for NodeAddr
Source§fn deserialize<__D>(
__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.
+ __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 Ord for NodeAddr
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more1.21.0 · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more1.50.0 · Source§fn clamp(self, min: Self, max: Self) -> Selfwhere
diff --git a/pr/3254/docs/iroh/struct.PublicKey.html b/pr/3254/docs/iroh/struct.PublicKey.html
index 140d5f9452..94f97f44d1 100644
--- a/pr/3254/docs/iroh/struct.PublicKey.html
+++ b/pr/3254/docs/iroh/struct.PublicKey.html
@@ -22,7 +22,7 @@ representation of the key.
Source§impl Ord for PublicKey
Source§impl PartialEq for PublicKey
Source§fn eq(&self, other: &PublicKey) -> 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/3254/docs/iroh/struct.RelayMap.html b/pr/3254/docs/iroh/struct.RelayMap.html
index d44542c103..c331ec3208 100644
--- a/pr/3254/docs/iroh/struct.RelayMap.html
+++ b/pr/3254/docs/iroh/struct.RelayMap.html
@@ -1,26 +1,26 @@
-RelayMap in iroh - Rust pub struct RelayMap { /* private fields */ }
Expand description
Configuration of all the relay servers that can be used.
-Implementations§
Source§impl RelayMap
Sourcepub fn nodes(&self) -> impl Iterator<Item = &Arc<RelayNode>>
Returns an Iterator over all known nodes.
-Sourcepub fn contains_node(&self, url: &RelayUrl) -> bool
Is this a known node?
-Sourcepub fn default_from_node(url: RelayUrl, stun_port: u16) -> RelayMap
Creates a new RelayMap with a single relay server configured.
+RelayMap in iroh - Rust Struct RelayMap
pub struct RelayMap { /* private fields */ }
Expand description
Configuration of all the relay servers that can be used.
+Implementations§
§impl RelayMap
pub fn nodes(&self) -> impl Iterator<Item = &Arc<RelayNode>>
Returns an Iterator over all known nodes.
+pub fn contains_node(&self, url: &RelayUrl) -> bool
Is this a known node?
+pub fn default_from_node(url: RelayUrl, stun_port: u16) -> RelayMap
Creates a new RelayMap with a single relay server configured.
Allows to set a custom STUN port and different IP addresses for IPv4 and IPv6.
If IP addresses are provided, no DNS lookup will be performed.
Sets the port to the default DEFAULT_RELAY_QUIC_PORT.
-Sourcepub fn from_nodes<I>(
+
pub fn from_nodes<I>(
value: impl IntoIterator<Item = I>,
) -> Result<RelayMap, Error>
Trait Implementations§
Source§impl Eq for RelayMap
Source§impl StructuralPartialEq for RelayMap
Auto Trait Implementations§
§impl Freeze for RelayMap
§impl RefUnwindSafe for RelayMap
§impl Send for RelayMap
§impl Sync for RelayMap
§impl Unpin for RelayMap
§impl UnwindSafe for RelayMap
Blanket Implementations§
Trait Implementations§
§impl Eq for RelayMap
§impl StructuralPartialEq for RelayMap
Auto Trait Implementations§
§impl Freeze for RelayMap
§impl RefUnwindSafe for RelayMap
§impl Send for RelayMap
§impl Sync for RelayMap
§impl Unpin for RelayMap
§impl UnwindSafe for RelayMap
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/3254/docs/iroh/struct.RelayNode.html b/pr/3254/docs/iroh/struct.RelayNode.html
index efbb608578..9ab2cddcc0 100644
--- a/pr/3254/docs/iroh/struct.RelayNode.html
+++ b/pr/3254/docs/iroh/struct.RelayNode.html
@@ -1,8 +1,8 @@
-RelayNode in iroh - Rust pub struct RelayNode {
+RelayNode in iroh - Rust Struct RelayNode
pub struct RelayNode {
pub url: RelayUrl,
pub stun_only: bool,
pub stun_port: u16,
- pub quic: Option<RelayQuicConfig>,
+ 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.
@@ -11,24 +11,24 @@
functionality is used.
§stun_port: u16The stun port of the relay server.
Setting this to 0 means the default STUN port is used.
-§quic: Option<RelayQuicConfig>Configuration to speak to the QUIC endpoint on the relay server.
+§quic: Option<RelayQuicConfig>Configuration to speak to the QUIC endpoint on the relay server.
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>(
+
Trait Implementations§
§impl<'de> Deserialize<'de> for RelayNode
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<RelayNode, <__D as Deserializer<'de>>::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more§impl Ord for RelayNode
Source§impl PartialOrd for RelayNode
§impl Serialize for RelayNode
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
- __S: Serializer,
Serialize this value into the given Serde serializer. Read moreSource§impl Eq for RelayNode
Source§impl StructuralPartialEq for RelayNode
Auto Trait Implementations§
§impl Freeze for RelayNode
§impl RefUnwindSafe for RelayNode
§impl Send for RelayNode
§impl Sync for RelayNode
§impl Unpin for RelayNode
§impl UnwindSafe for RelayNode
Blanket Implementations§
Source§impl<T> Any for Twhere
+ __S: Serializer,
Serialize this value into the given Serde serializer. Read more§impl Eq for RelayNode
§impl StructuralPartialEq for RelayNode
Auto Trait Implementations§
§impl Freeze for RelayNode
§impl RefUnwindSafe for RelayNode
§impl Send for RelayNode
§impl Sync for RelayNode
§impl Unpin for RelayNode
§impl UnwindSafe for RelayNode
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/3254/docs/iroh/test_utils/fn.run_relay_server.html b/pr/3254/docs/iroh/test_utils/fn.run_relay_server.html
index 4f41fd2d31..d738a1d8e1 100644
--- a/pr/3254/docs/iroh/test_utils/fn.run_relay_server.html
+++ b/pr/3254/docs/iroh/test_utils/fn.run_relay_server.html
@@ -1,4 +1,4 @@
-run_relay_server in iroh::test_utils - Rust pub async fn run_relay_server() -> Result<(RelayMap, RelayUrl, Server)>
Available on crate feature test-utils only.Expand description
Runs a relay server with STUN and QUIC enabled suitable for tests.
+run_relay_server in iroh::test_utils - Rust
\ No newline at end of file
diff --git a/pr/3254/docs/iroh/test_utils/fn.run_relay_server_with.html b/pr/3254/docs/iroh/test_utils/fn.run_relay_server_with.html
index c31b8b2572..5b179c2f1d 100644
--- a/pr/3254/docs/iroh/test_utils/fn.run_relay_server_with.html
+++ b/pr/3254/docs/iroh/test_utils/fn.run_relay_server_with.html
@@ -1,9 +1,9 @@
run_relay_server_with in iroh::test_utils - Rust pub async fn run_relay_server_with(
- stun: Option<StunConfig>,
+ stun: Option<StunConfig>,
quic: bool,
-) -> Result<(RelayMap, RelayUrl, Server)>
Available on crate feature test-utils only.Expand description
Runs a relay server.
+) -> Result<(RelayMap, RelayUrl, Server)>Available on crate feature test-utils only.Expand description
Runs a relay server.
stun can be set to None to disable stun, or set to Some StunConfig,
to enable stun on a specific socket.
-If quic is set to true, it will make the appropriate QuicConfig from the generated tls certificates and run the quic server at a random free port.
+If quic is set to true, it will make the appropriate [QuicConfig] from the generated tls certificates and run the quic server at a random free port.
The return value is similar to run_relay_server.
\ No newline at end of file
diff --git a/pr/3254/docs/iroh/test_utils/fn.run_relay_server_with_stun.html b/pr/3254/docs/iroh/test_utils/fn.run_relay_server_with_stun.html
index 436f9d1200..ce014daffa 100644
--- a/pr/3254/docs/iroh/test_utils/fn.run_relay_server_with_stun.html
+++ b/pr/3254/docs/iroh/test_utils/fn.run_relay_server_with_stun.html
@@ -1,4 +1,4 @@
-run_relay_server_with_stun in iroh::test_utils - Rust pub async fn run_relay_server_with_stun() -> Result<(RelayMap, RelayUrl, Server)>
Available on crate feature test-utils only.Expand description
Runs a relay server with STUN enabled suitable for tests.
+run_relay_server_with_stun in iroh::test_utils - Rust
\ No newline at end of file
diff --git a/pr/3254/docs/iroh_net_report/struct.Client.html b/pr/3254/docs/iroh_net_report/struct.Client.html
index f8932f43eb..774654c5d3 100644
--- a/pr/3254/docs/iroh_net_report/struct.Client.html
+++ b/pr/3254/docs/iroh_net_report/struct.Client.html
@@ -7,7 +7,7 @@ If all Addr::receive_stun_packet.
Implementations§
Source§impl Client
Sourcepub fn new(
port_mapper: Option<Client>,
- dns_resolver: DnsResolver,
+ dns_resolver: DnsResolver,
ip_mapped_addrs: Option<IpMappedAddresses>,
) -> Result<Self>
Creates a new net_report client.
This starts a connected actor in the background. Once the client is dropped it will
@@ -17,7 +17,7 @@ stop running.
allows sending messages to the actor.
Sourcepub async fn get_report(
&mut self,
- relay_map: RelayMap,
+ relay_map: RelayMap,
stun_sock_v4: Option<Arc<UdpSocket>>,
stun_sock_v6: Option<Arc<UdpSocket>>,
quic_config: Option<QuicConfig>,
@@ -39,14 +39,14 @@ using QUIC address discovery.
This will attempt to use all probe protocols.
Sourcepub async fn get_report_with_opts(
&mut self,
- relay_map: RelayMap,
+ relay_map: RelayMap,
opts: Options,
) -> Result<Arc<Report>>
Runs a net_report, returning the report.
It may not be called concurrently with itself, &mut self takes care of that.
Look at Options for the different configuration options.
Sourcepub async fn get_report_channel(
&mut self,
- relay_map: RelayMap,
+ relay_map: RelayMap,
opts: Options,
) -> Result<Receiver<Result<Arc<Report>>>>
Get report with channel
Look at Options for the different configuration options.
diff --git a/pr/3254/docs/iroh_net_report/struct.RelayLatencies.html b/pr/3254/docs/iroh_net_report/struct.RelayLatencies.html
index cab40bff24..bbbe92b500 100644
--- a/pr/3254/docs/iroh_net_report/struct.RelayLatencies.html
+++ b/pr/3254/docs/iroh_net_report/struct.RelayLatencies.html
@@ -1,5 +1,5 @@
RelayLatencies in iroh_net_report - Rust pub struct RelayLatencies(/* private fields */);
Expand description
Latencies per relay node.
-Implementations§
Source§impl RelayLatencies
Sourcepub fn iter(&self) -> impl Iterator<Item = (&RelayUrl, Duration)> + '_
Returns an iterator over all the relays and their latencies.
+Implementations§
Trait Implementations§
Source§impl Clone for RelayLatencies
Source§fn clone(&self) -> RelayLatencies
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 RelayLatencies
Source§impl Default for RelayLatencies
Source§fn default() -> RelayLatencies
Returns the “default value” for a type. Read moreSource§impl PartialEq for RelayLatencies
Source§impl Eq for RelayLatencies
Source§impl StructuralPartialEq for RelayLatencies
Auto Trait Implementations§
§impl Freeze for RelayLatencies
§impl RefUnwindSafe for RelayLatencies
§impl Send for RelayLatencies
§impl Sync for RelayLatencies
§impl Unpin for RelayLatencies
§impl UnwindSafe for RelayLatencies
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/3254/docs/iroh_net_report/struct.Report.html b/pr/3254/docs/iroh_net_report/struct.Report.html
index b6dda01fab..1cdf766458 100644
--- a/pr/3254/docs/iroh_net_report/struct.Report.html
+++ b/pr/3254/docs/iroh_net_report/struct.Report.html
@@ -11,7 +11,7 @@
pub mapping_varies_by_dest_ipv6: Option<bool>,
pub hair_pinning: Option<bool>,
pub portmap_probe: Option<ProbeOutput>,
- pub preferred_relay: Option<RelayUrl>,
+ pub preferred_relay: Option<RelayUrl>,
pub relay_latency: RelayLatencies,
pub relay_v4_latency: RelayLatencies,
pub relay_v6_latency: RelayLatencies,
@@ -35,7 +35,7 @@ detecting rather than using it. For now.
§hair_pinning: Option<bool>Whether the router supports communicating between two local devices through the NATted
public IP address (on IPv4).
§portmap_probe: Option<ProbeOutput>Probe indicating the presence of port mapping protocols on the LAN.
-§preferred_relay: Option<RelayUrl>None for unknown
+§preferred_relay: Option<RelayUrl>None for unknown
§relay_latency: RelayLatencieskeyed by relay Url
§relay_v4_latency: RelayLatencieskeyed by relay Url
§relay_v6_latency: RelayLatencieskeyed by relay Url
diff --git a/pr/3254/docs/src/iroh/magicsock/relay_actor.rs.html b/pr/3254/docs/src/iroh/magicsock/relay_actor.rs.html
index 8a3318169b..10265b471c 100644
--- a/pr/3254/docs/src/iroh/magicsock/relay_actor.rs.html
+++ b/pr/3254/docs/src/iroh/magicsock/relay_actor.rs.html
@@ -1582,13 +1582,7 @@
1581
1582
1583
-1584
-1585
-1586
-1587
-1588
-1589
-1590//! The relay actor.
+1584
//! The relay actor.
//!
//! The [`RelayActor`] handles all the relay connections. It is helped by the
//! [`ActiveRelayActor`] which handles a single relay connection.
@@ -1871,25 +1865,19 @@
let mut backoff = Self::build_backoff();
- loop {
- match self.run_once().await {
- Err(err) => {
- warn!("Relay connection failed: {err:#}");
- if self.pong_received {
- // If the relay connection remained established long enough so that we received a pong
- // from the relay server, we reset the backoff and attempt to reconnect immediately.
- self.pong_received = false;
- backoff = Self::build_backoff();
- continue;
- } else {
- // If dialing failed, or if the relay connection failed before we received a pong,
- // we wait an exponentially increasing time until we attempt to reconnect again.
- let sleep = backoff.next().context("Retries exceeded")?;
- debug!("Retry in {sleep:?}");
- time::sleep(sleep).await;
- }
- }
- Ok(()) => break,
+ while let Err(err) = self.run_once().await {
+ warn!("Relay connection failed: {err:#}");
+ if self.pong_received {
+ // If the relay connection remained established long enough so that we received a pong
+ // from the relay server, we reset the backoff and attempt to reconnect immediately.
+ self.pong_received = false;
+ backoff = Self::build_backoff();
+ } else {
+ // If dialing failed, or if the relay connection failed before we received a pong,
+ // we wait an exponentially increasing time until we attempt to reconnect again.
+ let sleep = backoff.next().context("Retries exceeded")?;
+ debug!("Retry in {sleep:?}");
+ time::sleep(sleep).await;
}
}
debug!("exiting");
diff --git a/pr/3254/docs/type.impl/iroh/struct.PublicKey.js b/pr/3254/docs/type.impl/iroh/struct.PublicKey.js
index d01f8c9287..9c9039082f 100644
--- a/pr/3254/docs/type.impl/iroh/struct.PublicKey.js
+++ b/pr/3254/docs/type.impl/iroh/struct.PublicKey.js
@@ -1,9 +1,9 @@
(function() {
- var type_impls = Object.fromEntries([["iroh",[["","AsRef<[u8]>","iroh::NodeId"],["","Borrow<[u8; 32]>","iroh::NodeId"],["","Clone","iroh::NodeId"],["","Debug","iroh::NodeId"],["Source§impl<'de> Deserialize<'de> for PublicKey
Source§fn deserialize<D>(\n deserializer: D,\n) -> Result<PublicKey, <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh::NodeId"],["","Display","iroh::NodeId"],["","From","iroh::NodeId"],["Source§impl FromStr for PublicKey
","FromStr","iroh::NodeId"],["","Hash","iroh::NodeId"],["","NodeIdExt","iroh::NodeId"],["Source§impl Ord for PublicKey
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh::NodeId"],["","PartialEq","iroh::NodeId"],["Source§impl PartialOrd for PublicKey
","PartialOrd","iroh::NodeId"],["Source§impl PublicKey
Sourcepub fn from_bytes(bytes: &[u8; 32]) -> Result<PublicKey, Error>
Construct a PublicKey from a slice of bytes.
\n§Warning
\nThis will return a [SignatureError] if the bytes passed into this method do not represent\na valid ed25519_dalek curve point. Will never fail for bytes return from Self::as_bytes.\nSee [VerifyingKey::from_bytes] for details.
\n",0,"iroh::NodeId"],["Source§impl Serialize for PublicKey
Source§fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
Serialize this value into the given Serde serializer. Read more","Serialize","iroh::NodeId"],["","TryFrom<&[u8]>","iroh::NodeId"],["","TryFrom<&[u8; 32]>","iroh::NodeId"],["Source§impl Copy for PublicKey
","Copy","iroh::NodeId"],["Source§impl Eq for PublicKey
","Eq","iroh::NodeId"],["Source§impl StructuralPartialEq for PublicKey
","StructuralPartialEq","iroh::NodeId"]]]]);
+ var type_impls = Object.fromEntries([["iroh",[["","AsRef<[u8]>","iroh::NodeId"],["","Borrow<[u8; 32]>","iroh::NodeId"],["","Clone","iroh::NodeId"],["","Debug","iroh::NodeId"],["Source§impl<'de> Deserialize<'de> for PublicKey
Source§fn deserialize<D>(\n deserializer: D,\n) -> Result<PublicKey, <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh::NodeId"],["","Display","iroh::NodeId"],["","From","iroh::NodeId"],["Source§impl FromStr for PublicKey
","FromStr","iroh::NodeId"],["","Hash","iroh::NodeId"],["","NodeIdExt","iroh::NodeId"],["Source§impl Ord for PublicKey
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh::NodeId"],["","PartialEq","iroh::NodeId"],["Source§impl PartialOrd for PublicKey
","PartialOrd","iroh::NodeId"],["Source§impl PublicKey
Sourcepub fn from_bytes(bytes: &[u8; 32]) -> Result<PublicKey, Error>
Construct a PublicKey from a slice of bytes.
\n§Warning
\nThis will return a [SignatureError] if the bytes passed into this method do not represent\na valid ed25519_dalek curve point. Will never fail for bytes return from Self::as_bytes.\nSee [VerifyingKey::from_bytes] for details.
\n",0,"iroh::NodeId"],["Source§impl Serialize for PublicKey
Source§fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
Serialize this value into the given Serde serializer. Read more","Serialize","iroh::NodeId"],["","TryFrom<&[u8]>","iroh::NodeId"],["","TryFrom<&[u8; 32]>","iroh::NodeId"],["Source§impl Copy for PublicKey
","Copy","iroh::NodeId"],["Source§impl Eq for PublicKey
","Eq","iroh::NodeId"],["Source§impl StructuralPartialEq for PublicKey
","StructuralPartialEq","iroh::NodeId"]]]]);
if (window.register_type_impls) {
window.register_type_impls(type_impls);
} else {
window.pending_type_impls = type_impls;
}
})()
-//{"start":55,"fragment_lengths":[47903]}
\ No newline at end of file
+//{"start":55,"fragment_lengths":[47657]}
\ No newline at end of file
pub struct RelayMetrics {Show 21 fields
+RelayMetrics in iroh::metrics - Rust Struct RelayMetrics
pub struct RelayMetrics {Show 21 fields
pub bytes_sent: Counter,
pub bytes_recv: Counter,
pub send_packets_sent: Counter,
@@ -42,7 +42,7 @@
§unique_client_keys: CounterNumber of unique client keys per day
§websocket_accepts: CounterNumber of accepted websocket connections
§relay_accepts: CounterNumber of accepted ‘iroh derp http’ connection upgrades
-Trait Implementations§
Source§impl Metric for Metrics
§fn new(registry: &mut Registry) -> Self
Available on crate feature metrics only.Initializes this metric group.§fn with_metric<T, F>(f: F)where
+Trait Implementations§
§impl Metric for Metrics
§fn new(registry: &mut Registry) -> Self
Available on crate feature metrics only.Initializes this metric group.§fn with_metric<T, F>(f: F)where
F: FnOnce(&Self) -> T,
Available on crate feature metrics only.Access to this metrics group to record a metric.
Only records if this metric is registered in the global registry.Auto Trait Implementations§
§impl Freeze for Metrics
§impl RefUnwindSafe for Metrics
§impl Send for Metrics
§impl Sync for Metrics
§impl Unpin for Metrics
§impl UnwindSafe for Metrics
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/3254/docs/iroh/node_info/constant.IROH_TXT_NAME.html b/pr/3254/docs/iroh/node_info/constant.IROH_TXT_NAME.html
index c78d056a1f..0c1e657fb3 100644
--- a/pr/3254/docs/iroh/node_info/constant.IROH_TXT_NAME.html
+++ b/pr/3254/docs/iroh/node_info/constant.IROH_TXT_NAME.html
@@ -1,2 +1,2 @@
-IROH_TXT_NAME in iroh::node_info - Rust pub const IROH_TXT_NAME: &'static str;
Expand description
The DNS name for the iroh TXT record.
+IROH_TXT_NAME in iroh::node_info - Rust Constant IROH_TXT_NAME
pub const IROH_TXT_NAME: &'static str;
Expand description
The DNS name for the iroh TXT record.
\ No newline at end of file
diff --git a/pr/3254/docs/iroh/node_info/index.html b/pr/3254/docs/iroh/node_info/index.html
index 9884414f78..5130358fc8 100644
--- a/pr/3254/docs/iroh/node_info/index.html
+++ b/pr/3254/docs/iroh/node_info/index.html
@@ -1,4 +1,4 @@
-iroh::node_info - Rust Expand description
Support for handling DNS resource records for dialing by NodeId.
+iroh::node_info - Rust Module node_info
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:
diff --git a/pr/3254/docs/iroh/node_info/struct.MaxLengthExceededError.html b/pr/3254/docs/iroh/node_info/struct.MaxLengthExceededError.html
index 2f1c9b7234..33cd3a33fc 100644
--- a/pr/3254/docs/iroh/node_info/struct.MaxLengthExceededError.html
+++ b/pr/3254/docs/iroh/node_info/struct.MaxLengthExceededError.html
@@ -1,5 +1,5 @@
-MaxLengthExceededError in iroh::node_info - Rust pub struct MaxLengthExceededError;
Expand description
Error returned when an input value is too long for UserData.
-Trait Implementations§
Source§impl Debug for MaxLengthExceededError
Source§impl Display for MaxLengthExceededError
Source§impl Error for MaxLengthExceededError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Auto Trait Implementations§
§impl Freeze for MaxLengthExceededError
§impl RefUnwindSafe for MaxLengthExceededError
§impl Send for MaxLengthExceededError
§impl Sync for MaxLengthExceededError
§impl Unpin for MaxLengthExceededError
§impl UnwindSafe for MaxLengthExceededError
Blanket Implementations§
Source§impl<T> Any for Twhere
+MaxLengthExceededError in iroh::node_info - Rust Struct MaxLengthExceededError
pub struct MaxLengthExceededError;
Expand description
Error returned when an input value is too long for UserData.
+Trait Implementations§
§impl Debug for MaxLengthExceededError
§impl Display for MaxLengthExceededError
§impl Error for MaxLengthExceededError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Auto Trait Implementations§
§impl Freeze for MaxLengthExceededError
§impl RefUnwindSafe for MaxLengthExceededError
§impl Send for MaxLengthExceededError
§impl Sync for MaxLengthExceededError
§impl Unpin for MaxLengthExceededError
§impl UnwindSafe for MaxLengthExceededError
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/3254/docs/iroh/node_info/struct.NodeData.html b/pr/3254/docs/iroh/node_info/struct.NodeData.html
index 8315fa3859..6a489b4160 100644
--- a/pr/3254/docs/iroh/node_info/struct.NodeData.html
+++ b/pr/3254/docs/iroh/node_info/struct.NodeData.html
@@ -1,31 +1,31 @@
-NodeData in iroh::node_info - Rust pub struct NodeData { /* private fields */ }
Expand description
Data about a node that may be published to and resolved from discovery services.
+NodeData in iroh::node_info - Rust Struct NodeData
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
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.
-Implementations§
Implementations§
§impl NodeData
pub fn new(
relay_url: Option<RelayUrl>,
direct_addresses: BTreeSet<SocketAddr>,
) -> NodeData
Creates a new NodeData with a relay URL and a set of direct addresses.
-Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> NodeData
Sets the relay URL and returns the updated node data.
-Sourcepub fn with_direct_addresses(
+
pub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> NodeData
Sets the relay URL and returns the updated node data.
+pub fn with_direct_addresses(
self,
direct_addresses: BTreeSet<SocketAddr>,
) -> NodeData
Sets the direct addresses and returns the updated node data.
-Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> NodeData
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.
-Sourcepub fn add_direct_addresses(
+
pub fn with_user_data(self, user_data: Option<UserData>) -> NodeData
Sets the user-defined data and returns the updated node data.
+pub fn direct_addresses(&self) -> &BTreeSet<SocketAddr>
Returns the direct addresses of the node.
+pub fn clear_direct_addresses(&mut self)
Removes all direct addresses from the node data.
+pub fn add_direct_addresses(
&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_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the node data.
-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§
pub fn set_relay_url(&mut self, relay_url: Option<RelayUrl>)
Sets the relay URL of the node data.
+pub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the node data.
+Trait Implementations§
§impl Eq for NodeData
§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
T: 'a,
§fn implicit(
diff --git a/pr/3254/docs/iroh/node_info/struct.NodeInfo.html b/pr/3254/docs/iroh/node_info/struct.NodeInfo.html
index d477ae0321..8adc2da63a 100644
--- a/pr/3254/docs/iroh/node_info/struct.NodeInfo.html
+++ b/pr/3254/docs/iroh/node_info/struct.NodeInfo.html
@@ -1,43 +1,43 @@
-NodeInfo in iroh::node_info - Rust pub struct NodeInfo {
+NodeInfo in iroh::node_info - Rust Struct NodeInfo
pub struct NodeInfo {
pub node_id: PublicKey,
pub data: NodeData,
}
Expand description
Fields§
§node_id: PublicKeyThe NodeId of the node this is about.
§data: NodeDataThe information published about the node.
-Implementations§
Source§impl NodeInfo
Sourcepub fn from_parts(node_id: PublicKey, data: NodeData) -> NodeInfo
Creates a new NodeInfo from its parts.
-Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> NodeInfo
Sets the relay URL and returns the updated node info.
-Sourcepub fn with_direct_addresses(
+
Implementations§
§impl NodeInfo
pub fn from_parts(node_id: PublicKey, data: NodeData) -> NodeInfo
Creates a new NodeInfo from its parts.
+pub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> NodeInfo
Sets the relay URL and returns the updated node info.
+pub fn with_direct_addresses(
self,
direct_addresses: BTreeSet<SocketAddr>,
) -> NodeInfo
Sets the direct addresses and returns the updated node info.
-Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> NodeInfo
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 from_txt_lookup(lookup: TxtLookup) -> Result<NodeInfo, Error>
Available on non-wasm_browser only.
Parses a NodeInfo from a TXT records lookup.
-Sourcepub fn from_pkarr_signed_packet(
+
pub fn with_user_data(self, user_data: Option<UserData>) -> NodeInfo
Sets the user-defined data and returns the updated node info.
+pub fn to_node_addr(&self) -> NodeAddr
Converts into a NodeAddr by cloning the needed fields.
+pub fn into_node_addr(self) -> NodeAddr
Converts into a NodeAddr without cloning.
+pub fn from_txt_lookup(lookup: TxtLookup) -> Result<NodeInfo, Error>
Available on non-wasm_browser only.
Parses a NodeInfo from a TXT records lookup.
+pub fn from_pkarr_signed_packet(
packet: &SignedPacket,
) -> Result<NodeInfo, Error>
Parses a NodeInfo from a [pkarr::SignedPacket].
-Sourcepub fn to_pkarr_signed_packet(
+
pub fn to_pkarr_signed_packet(
&self,
secret_key: &SecretKey,
ttl: u32,
) -> Result<SignedPacket, Error>
Creates a [pkarr::SignedPacket].
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.
-Sourcepub fn add_direct_addresses(
+
pub fn to_txt_strings(&self) -> Vec<String>
Converts into a list of {key}={value} strings.
+
Methods from Deref<Target = NodeData>§
pub fn direct_addresses(&self) -> &BTreeSet<SocketAddr>
Returns the direct addresses of the node.
+pub fn clear_direct_addresses(&mut self)
Removes all direct addresses from the node data.
+pub fn add_direct_addresses(
&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_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the node data.
-Trait Implementations§
Source§impl From<DiscoveryItem> for NodeInfo
Source§fn from(item: DiscoveryItem) -> Self
Converts to this type from the input type.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§
pub fn set_relay_url(&mut self, relay_url: Option<RelayUrl>)
Sets the relay URL of the node data.
+pub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the node data.
+Trait Implementations§
Source§impl From<DiscoveryItem> for NodeInfo
Source§fn from(item: DiscoveryItem) -> Self
Converts to this type from the input type.§impl Eq for NodeInfo
§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
T: 'a,
§fn implicit(
diff --git a/pr/3254/docs/iroh/node_info/struct.UserData.html b/pr/3254/docs/iroh/node_info/struct.UserData.html
index 4f76e55134..fb7ea9a345 100644
--- a/pr/3254/docs/iroh/node_info/struct.UserData.html
+++ b/pr/3254/docs/iroh/node_info/struct.UserData.html
@@ -1,24 +1,24 @@
-UserData in iroh::node_info - Rust pub struct UserData(/* private fields */);
Expand description
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
+UserData in iroh::node_info - Rust Struct UserData
pub struct UserData(/* private fields */);
Expand description
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
Iroh does not keep track of or examine the user-defined data.
UserData implements FromStr and TryFrom<String>, so you can
convert &str and String into UserData easily.
-Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
+Implementations§
§impl UserData
pub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
In DNS discovery services, the user-defined data is stored in a TXT record character string,
which has a max length of 255 bytes. We need to subtract the user-data= prefix,
which leaves 245 bytes for the actual user-defined data.
-Trait Implementations§
Trait Implementations§
§impl Ord for UserData
Source§impl PartialOrd for UserData
Source§impl Eq for UserData
Source§impl StructuralPartialEq for UserData
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
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/3254/docs/iroh/node_info/trait.NodeIdExt.html b/pr/3254/docs/iroh/node_info/trait.NodeIdExt.html
index 554c8c6e66..6d8273fb7e 100644
--- a/pr/3254/docs/iroh/node_info/trait.NodeIdExt.html
+++ b/pr/3254/docs/iroh/node_info/trait.NodeIdExt.html
@@ -1,9 +1,9 @@
-NodeIdExt in iroh::node_info - Rust pub trait NodeIdExt {
+NodeIdExt in iroh::node_info - Rust Trait NodeIdExt
pub trait NodeIdExt {
// Required methods
fn to_z32(&self) -> String;
fn from_z32(s: &str) -> Result<PublicKey, Error>;
}
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.
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.
Implementors§
\ No newline at end of file
diff --git a/pr/3254/docs/iroh/struct.NodeAddr.html b/pr/3254/docs/iroh/struct.NodeAddr.html
index cd39aabacf..b2e98874c3 100644
--- a/pr/3254/docs/iroh/struct.NodeAddr.html
+++ b/pr/3254/docs/iroh/struct.NodeAddr.html
@@ -44,7 +44,7 @@ whenever a connection to other nodes needs to be established.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for NodeAddr
Source§fn deserialize<__D>(
__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.
+ __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 Ord for NodeAddr
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more1.21.0 · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more1.50.0 · Source§fn clamp(self, min: Self, max: Self) -> Selfwhere
diff --git a/pr/3254/docs/iroh/struct.PublicKey.html b/pr/3254/docs/iroh/struct.PublicKey.html
index 140d5f9452..94f97f44d1 100644
--- a/pr/3254/docs/iroh/struct.PublicKey.html
+++ b/pr/3254/docs/iroh/struct.PublicKey.html
@@ -22,7 +22,7 @@ representation of the key.
Source§impl Ord for PublicKey
Source§impl PartialEq for PublicKey
Source§fn eq(&self, other: &PublicKey) -> 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/3254/docs/iroh/struct.RelayMap.html b/pr/3254/docs/iroh/struct.RelayMap.html
index d44542c103..c331ec3208 100644
--- a/pr/3254/docs/iroh/struct.RelayMap.html
+++ b/pr/3254/docs/iroh/struct.RelayMap.html
@@ -1,26 +1,26 @@
-RelayMap in iroh - Rust pub struct RelayMap { /* private fields */ }
Expand description
Configuration of all the relay servers that can be used.
-Implementations§
Source§impl RelayMap
Sourcepub fn nodes(&self) -> impl Iterator<Item = &Arc<RelayNode>>
Returns an Iterator over all known nodes.
-Sourcepub fn contains_node(&self, url: &RelayUrl) -> bool
Is this a known node?
-Sourcepub fn default_from_node(url: RelayUrl, stun_port: u16) -> RelayMap
Creates a new RelayMap with a single relay server configured.
+RelayMap in iroh - Rust Struct RelayMap
pub struct RelayMap { /* private fields */ }
Expand description
Configuration of all the relay servers that can be used.
+Implementations§
§impl RelayMap
pub fn nodes(&self) -> impl Iterator<Item = &Arc<RelayNode>>
Returns an Iterator over all known nodes.
+pub fn contains_node(&self, url: &RelayUrl) -> bool
Is this a known node?
+pub fn default_from_node(url: RelayUrl, stun_port: u16) -> RelayMap
Creates a new RelayMap with a single relay server configured.
Allows to set a custom STUN port and different IP addresses for IPv4 and IPv6.
If IP addresses are provided, no DNS lookup will be performed.
Sets the port to the default DEFAULT_RELAY_QUIC_PORT.
-Sourcepub fn from_nodes<I>(
+
pub fn from_nodes<I>(
value: impl IntoIterator<Item = I>,
) -> Result<RelayMap, Error>
Trait Implementations§
Source§impl Eq for RelayMap
Source§impl StructuralPartialEq for RelayMap
Auto Trait Implementations§
§impl Freeze for RelayMap
§impl RefUnwindSafe for RelayMap
§impl Send for RelayMap
§impl Sync for RelayMap
§impl Unpin for RelayMap
§impl UnwindSafe for RelayMap
Blanket Implementations§
Trait Implementations§
§impl Eq for RelayMap
§impl StructuralPartialEq for RelayMap
Auto Trait Implementations§
§impl Freeze for RelayMap
§impl RefUnwindSafe for RelayMap
§impl Send for RelayMap
§impl Sync for RelayMap
§impl Unpin for RelayMap
§impl UnwindSafe for RelayMap
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/3254/docs/iroh/struct.RelayNode.html b/pr/3254/docs/iroh/struct.RelayNode.html
index efbb608578..9ab2cddcc0 100644
--- a/pr/3254/docs/iroh/struct.RelayNode.html
+++ b/pr/3254/docs/iroh/struct.RelayNode.html
@@ -1,8 +1,8 @@
-RelayNode in iroh - Rust pub struct RelayNode {
+RelayNode in iroh - Rust Struct RelayNode
pub struct RelayNode {
pub url: RelayUrl,
pub stun_only: bool,
pub stun_port: u16,
- pub quic: Option<RelayQuicConfig>,
+ 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.
@@ -11,24 +11,24 @@
functionality is used.
§stun_port: u16The stun port of the relay server.
Setting this to 0 means the default STUN port is used.
-§quic: Option<RelayQuicConfig>Configuration to speak to the QUIC endpoint on the relay server.
+§quic: Option<RelayQuicConfig>Configuration to speak to the QUIC endpoint on the relay server.
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>(
+
Trait Implementations§
§impl<'de> Deserialize<'de> for RelayNode
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<RelayNode, <__D as Deserializer<'de>>::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more§impl Ord for RelayNode
Source§impl PartialOrd for RelayNode
§impl Serialize for RelayNode
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
- __S: Serializer,
Serialize this value into the given Serde serializer. Read moreSource§impl Eq for RelayNode
Source§impl StructuralPartialEq for RelayNode
Auto Trait Implementations§
§impl Freeze for RelayNode
§impl RefUnwindSafe for RelayNode
§impl Send for RelayNode
§impl Sync for RelayNode
§impl Unpin for RelayNode
§impl UnwindSafe for RelayNode
Blanket Implementations§
Source§impl<T> Any for Twhere
+ __S: Serializer,
Serialize this value into the given Serde serializer. Read more§impl Eq for RelayNode
§impl StructuralPartialEq for RelayNode
Auto Trait Implementations§
§impl Freeze for RelayNode
§impl RefUnwindSafe for RelayNode
§impl Send for RelayNode
§impl Sync for RelayNode
§impl Unpin for RelayNode
§impl UnwindSafe for RelayNode
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/3254/docs/iroh/test_utils/fn.run_relay_server.html b/pr/3254/docs/iroh/test_utils/fn.run_relay_server.html
index 4f41fd2d31..d738a1d8e1 100644
--- a/pr/3254/docs/iroh/test_utils/fn.run_relay_server.html
+++ b/pr/3254/docs/iroh/test_utils/fn.run_relay_server.html
@@ -1,4 +1,4 @@
-run_relay_server in iroh::test_utils - Rust pub async fn run_relay_server() -> Result<(RelayMap, RelayUrl, Server)>
Available on crate feature test-utils only.Expand description
Runs a relay server with STUN and QUIC enabled suitable for tests.
+run_relay_server in iroh::test_utils - Rust
\ No newline at end of file
diff --git a/pr/3254/docs/iroh/test_utils/fn.run_relay_server_with.html b/pr/3254/docs/iroh/test_utils/fn.run_relay_server_with.html
index c31b8b2572..5b179c2f1d 100644
--- a/pr/3254/docs/iroh/test_utils/fn.run_relay_server_with.html
+++ b/pr/3254/docs/iroh/test_utils/fn.run_relay_server_with.html
@@ -1,9 +1,9 @@
run_relay_server_with in iroh::test_utils - Rust pub async fn run_relay_server_with(
- stun: Option<StunConfig>,
+ stun: Option<StunConfig>,
quic: bool,
-) -> Result<(RelayMap, RelayUrl, Server)>
Available on crate feature test-utils only.Expand description
Runs a relay server.
+) -> Result<(RelayMap, RelayUrl, Server)>Available on crate feature test-utils only.Expand description
Runs a relay server.
stun can be set to None to disable stun, or set to Some StunConfig,
to enable stun on a specific socket.
-If quic is set to true, it will make the appropriate QuicConfig from the generated tls certificates and run the quic server at a random free port.
+If quic is set to true, it will make the appropriate [QuicConfig] from the generated tls certificates and run the quic server at a random free port.
The return value is similar to run_relay_server.
\ No newline at end of file
diff --git a/pr/3254/docs/iroh/test_utils/fn.run_relay_server_with_stun.html b/pr/3254/docs/iroh/test_utils/fn.run_relay_server_with_stun.html
index 436f9d1200..ce014daffa 100644
--- a/pr/3254/docs/iroh/test_utils/fn.run_relay_server_with_stun.html
+++ b/pr/3254/docs/iroh/test_utils/fn.run_relay_server_with_stun.html
@@ -1,4 +1,4 @@
-run_relay_server_with_stun in iroh::test_utils - Rust pub async fn run_relay_server_with_stun() -> Result<(RelayMap, RelayUrl, Server)>
Available on crate feature test-utils only.Expand description
Runs a relay server with STUN enabled suitable for tests.
+run_relay_server_with_stun in iroh::test_utils - Rust
\ No newline at end of file
diff --git a/pr/3254/docs/iroh_net_report/struct.Client.html b/pr/3254/docs/iroh_net_report/struct.Client.html
index f8932f43eb..774654c5d3 100644
--- a/pr/3254/docs/iroh_net_report/struct.Client.html
+++ b/pr/3254/docs/iroh_net_report/struct.Client.html
@@ -7,7 +7,7 @@ If all Addr::receive_stun_packet.
Implementations§
Source§impl Client
Sourcepub fn new(
port_mapper: Option<Client>,
- dns_resolver: DnsResolver,
+ dns_resolver: DnsResolver,
ip_mapped_addrs: Option<IpMappedAddresses>,
) -> Result<Self>
Creates a new net_report client.
This starts a connected actor in the background. Once the client is dropped it will
@@ -17,7 +17,7 @@ stop running.
allows sending messages to the actor.
Sourcepub async fn get_report(
&mut self,
- relay_map: RelayMap,
+ relay_map: RelayMap,
stun_sock_v4: Option<Arc<UdpSocket>>,
stun_sock_v6: Option<Arc<UdpSocket>>,
quic_config: Option<QuicConfig>,
@@ -39,14 +39,14 @@ using QUIC address discovery.
This will attempt to use all probe protocols.
Sourcepub async fn get_report_with_opts(
&mut self,
- relay_map: RelayMap,
+ relay_map: RelayMap,
opts: Options,
) -> Result<Arc<Report>>
Runs a net_report, returning the report.
It may not be called concurrently with itself, &mut self takes care of that.
Look at Options for the different configuration options.
Sourcepub async fn get_report_channel(
&mut self,
- relay_map: RelayMap,
+ relay_map: RelayMap,
opts: Options,
) -> Result<Receiver<Result<Arc<Report>>>>
Get report with channel
Look at Options for the different configuration options.
diff --git a/pr/3254/docs/iroh_net_report/struct.RelayLatencies.html b/pr/3254/docs/iroh_net_report/struct.RelayLatencies.html
index cab40bff24..bbbe92b500 100644
--- a/pr/3254/docs/iroh_net_report/struct.RelayLatencies.html
+++ b/pr/3254/docs/iroh_net_report/struct.RelayLatencies.html
@@ -1,5 +1,5 @@
RelayLatencies in iroh_net_report - Rust pub struct RelayLatencies(/* private fields */);
Expand description
Latencies per relay node.
-Implementations§
Source§impl RelayLatencies
Sourcepub fn iter(&self) -> impl Iterator<Item = (&RelayUrl, Duration)> + '_
Returns an iterator over all the relays and their latencies.
+Implementations§
Trait Implementations§
Source§impl Clone for RelayLatencies
Source§fn clone(&self) -> RelayLatencies
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 RelayLatencies
Source§impl Default for RelayLatencies
Source§fn default() -> RelayLatencies
Returns the “default value” for a type. Read moreSource§impl PartialEq for RelayLatencies
Source§impl Eq for RelayLatencies
Source§impl StructuralPartialEq for RelayLatencies
Auto Trait Implementations§
§impl Freeze for RelayLatencies
§impl RefUnwindSafe for RelayLatencies
§impl Send for RelayLatencies
§impl Sync for RelayLatencies
§impl Unpin for RelayLatencies
§impl UnwindSafe for RelayLatencies
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/3254/docs/iroh_net_report/struct.Report.html b/pr/3254/docs/iroh_net_report/struct.Report.html
index b6dda01fab..1cdf766458 100644
--- a/pr/3254/docs/iroh_net_report/struct.Report.html
+++ b/pr/3254/docs/iroh_net_report/struct.Report.html
@@ -11,7 +11,7 @@
pub mapping_varies_by_dest_ipv6: Option<bool>,
pub hair_pinning: Option<bool>,
pub portmap_probe: Option<ProbeOutput>,
- pub preferred_relay: Option<RelayUrl>,
+ pub preferred_relay: Option<RelayUrl>,
pub relay_latency: RelayLatencies,
pub relay_v4_latency: RelayLatencies,
pub relay_v6_latency: RelayLatencies,
@@ -35,7 +35,7 @@ detecting rather than using it. For now.
§hair_pinning: Option<bool>Whether the router supports communicating between two local devices through the NATted
public IP address (on IPv4).
§portmap_probe: Option<ProbeOutput>Probe indicating the presence of port mapping protocols on the LAN.
-§preferred_relay: Option<RelayUrl>None for unknown
+§preferred_relay: Option<RelayUrl>None for unknown
§relay_latency: RelayLatencieskeyed by relay Url
§relay_v4_latency: RelayLatencieskeyed by relay Url
§relay_v6_latency: RelayLatencieskeyed by relay Url
diff --git a/pr/3254/docs/src/iroh/magicsock/relay_actor.rs.html b/pr/3254/docs/src/iroh/magicsock/relay_actor.rs.html
index 8a3318169b..10265b471c 100644
--- a/pr/3254/docs/src/iroh/magicsock/relay_actor.rs.html
+++ b/pr/3254/docs/src/iroh/magicsock/relay_actor.rs.html
@@ -1582,13 +1582,7 @@
1581
1582
1583
-1584
-1585
-1586
-1587
-1588
-1589
-1590//! The relay actor.
+1584
//! The relay actor.
//!
//! The [`RelayActor`] handles all the relay connections. It is helped by the
//! [`ActiveRelayActor`] which handles a single relay connection.
@@ -1871,25 +1865,19 @@
let mut backoff = Self::build_backoff();
- loop {
- match self.run_once().await {
- Err(err) => {
- warn!("Relay connection failed: {err:#}");
- if self.pong_received {
- // If the relay connection remained established long enough so that we received a pong
- // from the relay server, we reset the backoff and attempt to reconnect immediately.
- self.pong_received = false;
- backoff = Self::build_backoff();
- continue;
- } else {
- // If dialing failed, or if the relay connection failed before we received a pong,
- // we wait an exponentially increasing time until we attempt to reconnect again.
- let sleep = backoff.next().context("Retries exceeded")?;
- debug!("Retry in {sleep:?}");
- time::sleep(sleep).await;
- }
- }
- Ok(()) => break,
+ while let Err(err) = self.run_once().await {
+ warn!("Relay connection failed: {err:#}");
+ if self.pong_received {
+ // If the relay connection remained established long enough so that we received a pong
+ // from the relay server, we reset the backoff and attempt to reconnect immediately.
+ self.pong_received = false;
+ backoff = Self::build_backoff();
+ } else {
+ // If dialing failed, or if the relay connection failed before we received a pong,
+ // we wait an exponentially increasing time until we attempt to reconnect again.
+ let sleep = backoff.next().context("Retries exceeded")?;
+ debug!("Retry in {sleep:?}");
+ time::sleep(sleep).await;
}
}
debug!("exiting");
diff --git a/pr/3254/docs/type.impl/iroh/struct.PublicKey.js b/pr/3254/docs/type.impl/iroh/struct.PublicKey.js
index d01f8c9287..9c9039082f 100644
--- a/pr/3254/docs/type.impl/iroh/struct.PublicKey.js
+++ b/pr/3254/docs/type.impl/iroh/struct.PublicKey.js
@@ -1,9 +1,9 @@
(function() {
- var type_impls = Object.fromEntries([["iroh",[["","AsRef<[u8]>","iroh::NodeId"],["","Borrow<[u8; 32]>","iroh::NodeId"],["","Clone","iroh::NodeId"],["","Debug","iroh::NodeId"],["Source§impl<'de> Deserialize<'de> for PublicKey
Source§fn deserialize<D>(\n deserializer: D,\n) -> Result<PublicKey, <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh::NodeId"],["","Display","iroh::NodeId"],["","From","iroh::NodeId"],["Source§impl FromStr for PublicKey
","FromStr","iroh::NodeId"],["","Hash","iroh::NodeId"],["","NodeIdExt","iroh::NodeId"],["Source§impl Ord for PublicKey
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh::NodeId"],["","PartialEq","iroh::NodeId"],["Source§impl PartialOrd for PublicKey
","PartialOrd","iroh::NodeId"],["Source§impl PublicKey
Sourcepub fn from_bytes(bytes: &[u8; 32]) -> Result<PublicKey, Error>
Construct a PublicKey from a slice of bytes.
\n§Warning
\nThis will return a [SignatureError] if the bytes passed into this method do not represent\na valid ed25519_dalek curve point. Will never fail for bytes return from Self::as_bytes.\nSee [VerifyingKey::from_bytes] for details.
\n",0,"iroh::NodeId"],["Source§impl Serialize for PublicKey
Source§fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
Serialize this value into the given Serde serializer. Read more","Serialize","iroh::NodeId"],["","TryFrom<&[u8]>","iroh::NodeId"],["","TryFrom<&[u8; 32]>","iroh::NodeId"],["Source§impl Copy for PublicKey
","Copy","iroh::NodeId"],["Source§impl Eq for PublicKey
","Eq","iroh::NodeId"],["Source§impl StructuralPartialEq for PublicKey
","StructuralPartialEq","iroh::NodeId"]]]]);
+ var type_impls = Object.fromEntries([["iroh",[["","AsRef<[u8]>","iroh::NodeId"],["","Borrow<[u8; 32]>","iroh::NodeId"],["","Clone","iroh::NodeId"],["","Debug","iroh::NodeId"],["Source§impl<'de> Deserialize<'de> for PublicKey
Source§fn deserialize<D>(\n deserializer: D,\n) -> Result<PublicKey, <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh::NodeId"],["","Display","iroh::NodeId"],["","From","iroh::NodeId"],["Source§impl FromStr for PublicKey
","FromStr","iroh::NodeId"],["","Hash","iroh::NodeId"],["","NodeIdExt","iroh::NodeId"],["Source§impl Ord for PublicKey
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh::NodeId"],["","PartialEq","iroh::NodeId"],["Source§impl PartialOrd for PublicKey
","PartialOrd","iroh::NodeId"],["Source§impl PublicKey
Sourcepub fn from_bytes(bytes: &[u8; 32]) -> Result<PublicKey, Error>
Construct a PublicKey from a slice of bytes.
\n§Warning
\nThis will return a [SignatureError] if the bytes passed into this method do not represent\na valid ed25519_dalek curve point. Will never fail for bytes return from Self::as_bytes.\nSee [VerifyingKey::from_bytes] for details.
\n",0,"iroh::NodeId"],["Source§impl Serialize for PublicKey
Source§fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
Serialize this value into the given Serde serializer. Read more","Serialize","iroh::NodeId"],["","TryFrom<&[u8]>","iroh::NodeId"],["","TryFrom<&[u8; 32]>","iroh::NodeId"],["Source§impl Copy for PublicKey
","Copy","iroh::NodeId"],["Source§impl Eq for PublicKey
","Eq","iroh::NodeId"],["Source§impl StructuralPartialEq for PublicKey
","StructuralPartialEq","iroh::NodeId"]]]]);
if (window.register_type_impls) {
window.register_type_impls(type_impls);
} else {
window.pending_type_impls = type_impls;
}
})()
-//{"start":55,"fragment_lengths":[47903]}
\ No newline at end of file
+//{"start":55,"fragment_lengths":[47657]}
\ No newline at end of file