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/3217/docs/iroh/defaults/constant.DEFAULT_STUN_PORT.html b/pr/3217/docs/iroh/defaults/constant.DEFAULT_STUN_PORT.html index bcaf8d2a33..7b929eeefd 100644 --- a/pr/3217/docs/iroh/defaults/constant.DEFAULT_STUN_PORT.html +++ b/pr/3217/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/3217/docs/iroh/discovery/dns/constant.N0_DNS_NODE_ORIGIN_PROD.html b/pr/3217/docs/iroh/discovery/dns/constant.N0_DNS_NODE_ORIGIN_PROD.html index 108ca21590..51b2f605eb 100644 --- a/pr/3217/docs/iroh/discovery/dns/constant.N0_DNS_NODE_ORIGIN_PROD.html +++ b/pr/3217/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/3217/docs/iroh/discovery/struct.NodeData.html b/pr/3217/docs/iroh/discovery/struct.NodeData.html
index 88d24bd42d..b3a9ec4402 100644
--- a/pr/3217/docs/iroh/discovery/struct.NodeData.html
+++ b/pr/3217/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/3217/docs/iroh/discovery/struct.NodeInfo.html b/pr/3217/docs/iroh/discovery/struct.NodeInfo.html
index 021976d4db..991766d098 100644
--- a/pr/3217/docs/iroh/discovery/struct.NodeInfo.html
+++ b/pr/3217/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/3217/docs/iroh/discovery/struct.UserData.html b/pr/3217/docs/iroh/discovery/struct.UserData.html
index 134f039717..74cd45e3c7 100644
--- a/pr/3217/docs/iroh/discovery/struct.UserData.html
+++ b/pr/3217/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/3217/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_PROD.html b/pr/3217/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_PROD.html
index dd2f30450f..1e378e6be9 100644
--- a/pr/3217/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_PROD.html
+++ b/pr/3217/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/3217/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_STAGING.html b/pr/3217/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_STAGING.html
index fa61f0f616..00c49c891d 100644
--- a/pr/3217/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_STAGING.html
+++ b/pr/3217/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/3217/docs/iroh/dns/struct.DnsResolver.html b/pr/3217/docs/iroh/dns/struct.DnsResolver.html
index bb72543896..53843cda16 100644
--- a/pr/3217/docs/iroh/dns/struct.DnsResolver.html
+++ b/pr/3217/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/3217/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html b/pr/3217/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html
index f03a92e8fc..ebd857988a 100644
--- a/pr/3217/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html
+++ b/pr/3217/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html
@@ -1,2 +1,2 @@
-ENV_FORCE_STAGING_RELAYS in iroh::endpoint - Rust pub const ENV_FORCE_STAGING_RELAYS: &str = "IROH_FORCE_STAGING_RELAYS";
Expand description
Environment variable to force the use of staging relays.
+ENV_FORCE_STAGING_RELAYS in iroh::endpoint - Rust
\ No newline at end of file
diff --git a/pr/3217/docs/iroh/endpoint/enum.DirectAddrType.html b/pr/3217/docs/iroh/endpoint/enum.DirectAddrType.html
index db8fd263b6..8d7040b73e 100644
--- a/pr/3217/docs/iroh/endpoint/enum.DirectAddrType.html
+++ b/pr/3217/docs/iroh/endpoint/enum.DirectAddrType.html
@@ -1,4 +1,4 @@
-DirectAddrType in iroh::endpoint - Rust pub enum DirectAddrType {
+DirectAddrType in iroh::endpoint - Rust pub enum DirectAddrType {
Unknown,
Local,
Stun,
@@ -20,16 +20,16 @@ get a publicly routable direct address.
It is possible to configure iroh to bound to a specific port and independently
configure the router to forward this port to the iroh node. This indicates a
situation like this, which still uses STUN to discover the public address.
-
Trait Implementations§
Source§impl Clone for DirectAddrType
Source§fn clone(&self) -> DirectAddrType
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 DirectAddrType
Source§impl Display for DirectAddrType
Source§impl Hash for DirectAddrType
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
+
Trait Implementations§
Source§impl Clone for DirectAddrType
Source§fn clone(&self) -> DirectAddrType
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 DirectAddrType
Source§impl Display for DirectAddrType
Source§impl Hash for DirectAddrType
Source§impl Ord for DirectAddrType
Source§impl Ord for DirectAddrType
Source§fn cmp(&self, other: &DirectAddrType) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read moreSource§impl PartialEq for DirectAddrType
Source§impl PartialOrd for DirectAddrType
Source§impl PartialEq for DirectAddrType
Source§impl PartialOrd for DirectAddrType
Source§impl Copy for DirectAddrType
Source§impl Eq for DirectAddrType
Source§impl StructuralPartialEq for DirectAddrType
Auto Trait Implementations§
§impl Freeze for DirectAddrType
§impl RefUnwindSafe for DirectAddrType
§impl Send for DirectAddrType
§impl Sync for DirectAddrType
§impl Unpin for DirectAddrType
§impl UnwindSafe for DirectAddrType
Blanket Implementations§
Source§impl Copy for DirectAddrType
Source§impl Eq for DirectAddrType
Source§impl StructuralPartialEq for DirectAddrType
Auto Trait Implementations§
§impl Freeze for DirectAddrType
§impl RefUnwindSafe for DirectAddrType
§impl Send for DirectAddrType
§impl Sync for DirectAddrType
§impl Unpin for DirectAddrType
§impl UnwindSafe for DirectAddrType
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/3217/docs/iroh/endpoint/enum.RelayMode.html b/pr/3217/docs/iroh/endpoint/enum.RelayMode.html
index b478f03249..ab87d54df6 100644
--- a/pr/3217/docs/iroh/endpoint/enum.RelayMode.html
+++ b/pr/3217/docs/iroh/endpoint/enum.RelayMode.html
@@ -1,4 +1,4 @@
-RelayMode in iroh::endpoint - Rust pub enum RelayMode {
+RelayMode in iroh::endpoint - Rust pub enum RelayMode {
Disabled,
Default,
Staging,
@@ -9,9 +9,9 @@
See crate::defaults::prod for the severs used.
§Staging
Use the staging relay servers from n0.
§Custom(RelayMap)
Use a custom relay map.
-
Implementations§
Trait Implementations§
Source§impl Eq for RelayMode
Source§impl StructuralPartialEq for RelayMode
Auto Trait Implementations§
§impl Freeze for RelayMode
§impl RefUnwindSafe for RelayMode
§impl Send for RelayMode
§impl Sync for RelayMode
§impl Unpin for RelayMode
§impl UnwindSafe for RelayMode
Blanket Implementations§
Implementations§
Trait Implementations§
Source§impl Eq for RelayMode
Source§impl StructuralPartialEq for RelayMode
Auto Trait Implementations§
§impl Freeze for RelayMode
§impl RefUnwindSafe for RelayMode
§impl Send for RelayMode
§impl Sync for RelayMode
§impl Unpin for RelayMode
§impl UnwindSafe for RelayMode
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/3217/docs/iroh/endpoint/fn.default_relay_mode.html b/pr/3217/docs/iroh/endpoint/fn.default_relay_mode.html
index 3206b983f7..bedd6fe18a 100644
--- a/pr/3217/docs/iroh/endpoint/fn.default_relay_mode.html
+++ b/pr/3217/docs/iroh/endpoint/fn.default_relay_mode.html
@@ -1,4 +1,4 @@
-default_relay_mode in iroh::endpoint - Rust pub fn default_relay_mode() -> RelayMode
Expand description
Returns the default relay mode.
+default_relay_mode in iroh::endpoint - Rust
\ No newline at end of file
diff --git a/pr/3217/docs/iroh/endpoint/fn.force_staging_infra.html b/pr/3217/docs/iroh/endpoint/fn.force_staging_infra.html
index 763aa33a74..eaaa3f19e2 100644
--- a/pr/3217/docs/iroh/endpoint/fn.force_staging_infra.html
+++ b/pr/3217/docs/iroh/endpoint/fn.force_staging_infra.html
@@ -1,2 +1,2 @@
-force_staging_infra in iroh::endpoint - Rust pub fn force_staging_infra() -> bool
Expand description
Returns true if the use of staging relays is forced.
+force_staging_infra in iroh::endpoint - Rust
\ No newline at end of file
diff --git a/pr/3217/docs/iroh/endpoint/index.html b/pr/3217/docs/iroh/endpoint/index.html
index 4deb68bd51..011ed71358 100644
--- a/pr/3217/docs/iroh/endpoint/index.html
+++ b/pr/3217/docs/iroh/endpoint/index.html
@@ -1,4 +1,4 @@
-iroh::endpoint - Rust Expand description
The Endpoint allows establishing connections to other iroh nodes.
+iroh::endpoint - Rust Expand description
The Endpoint allows establishing connections to other iroh nodes.
The Endpoint is the main API interface to manage a local iroh node. It allows
connecting to and accepting connections from other nodes. See the module docs for
more details on how iroh connections work.
diff --git a/pr/3217/docs/iroh/endpoint/struct.Accept.html b/pr/3217/docs/iroh/endpoint/struct.Accept.html
index 58bb4e71ea..74d685c091 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Accept.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Accept.html
@@ -1,6 +1,6 @@
-Accept in iroh::endpoint - Rust pub struct Accept<'a> { /* private fields */ }
Expand description
Future produced by Endpoint::accept.
-Trait Implementations§
Source§impl<'pin, 'a> Unpin for Accept<'a>where
+Accept in iroh::endpoint - Rust pub struct Accept<'a> { /* private fields */ }
Expand description
Future produced by Endpoint::accept.
+Trait Implementations§
Source§impl<'pin, 'a> Unpin for Accept<'a>where
PinnedFieldsOf<__Accept<'pin, 'a>>: Unpin,
Auto Trait Implementations§
§impl<'a> !Freeze for Accept<'a>
§impl<'a> !RefUnwindSafe for Accept<'a>
§impl<'a> Send for Accept<'a>
§impl<'a> Sync for Accept<'a>
§impl<'a> !UnwindSafe for Accept<'a>
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/endpoint/struct.Builder.html b/pr/3217/docs/iroh/endpoint/struct.Builder.html
index 6872da2482..46b31e019e 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Builder.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Builder.html
@@ -1,24 +1,24 @@
-Builder in iroh::endpoint - Rust pub struct Builder { /* private fields */ }
Expand description
Builder for Endpoint.
+Builder in iroh::endpoint - Rust pub struct Builder { /* private fields */ }
Expand description
Builder for Endpoint.
By default the endpoint will generate a new random SecretKey, which will result in a
new NodeId.
To create the Endpoint call Builder::bind.
-Implementations§
Source§impl Builder
Sourcepub fn bind_addr_v4(self, addr: SocketAddrV4) -> Self
Sets the IPv4 bind address.
+Implementations§
Source§impl Builder
Sourcepub fn bind_addr_v4(self, addr: SocketAddrV4) -> Self
Sets the IPv4 bind address.
Setting the port to 0 will use a random port.
If the port specified is already in use, it will fallback to choosing a random port.
By default will use 0.0.0.0:0 to bind to.
-Sourcepub fn bind_addr_v6(self, addr: SocketAddrV6) -> Self
Sets the IPv6 bind address.
+Sourcepub fn bind_addr_v6(self, addr: SocketAddrV6) -> Self
Sets the IPv6 bind address.
Setting the port to 0 will use a random port.
If the port specified is already in use, it will fallback to choosing a random port.
By default will use [::]:0 to bind to.
-Sourcepub fn secret_key(self, secret_key: SecretKey) -> Self
Sets a secret key to authenticate with other peers.
+Sourcepub fn secret_key(self, secret_key: SecretKey) -> Self
Sourcepub fn alpns(self, alpn_protocols: Vec<Vec<u8>>) -> Self
Sets the ALPN protocols that this endpoint will accept on incoming connections.
+Sourcepub fn relay_mode(self, relay_mode: RelayMode) -> Self
Sets the relay servers to assist in establishing connectivity.
+Sourcepub fn relay_mode(self, relay_mode: RelayMode) -> Self
Sets the relay servers to assist in establishing connectivity.
Relay servers are used to establish initial connection with another iroh node.
They also perform various functions related to hole punching, see the crate docs
for more details.
@@ -26,15 +26,22 @@ for more details.
When using RelayMode::Custom, the provided relay_map must contain at least one
configured relay node. If an invalid RelayMap is provided bind
will result in an error.
-Sourcepub fn clear_discovery(self) -> Self
Removes all discovery services from the builder.
-Sourcepub fn discovery(self, discovery: Box<dyn Discovery>) -> Self
Optionally sets a discovery mechanism for this endpoint.
+Sourcepub fn relay_conn_protocol(self, protocol: Protocol) -> Self
Sets the protocol to use for relay connections.
+Options are either Protocol::Websocket or Protocol::Relay.
+Websocket will work with relays version 0.19 and above, so likely with any relays
+deployed at the time of writing this option (websocket support was released 9 months ago).
+Relay will work for now, but will likely be removed with the 1.0 release.
+Default is set to Relay at the moment, until we’ve thoroughly tested and improved
+websocket performance.
+Sourcepub fn clear_discovery(self) -> Self
Removes all discovery services from the builder.
+Sourcepub fn discovery(self, discovery: Box<dyn Discovery>) -> Self
Optionally sets a discovery mechanism for this endpoint.
If you want to combine multiple discovery services, you can use
Builder::add_discovery instead. This will internally create a
crate::discovery::ConcurrentDiscovery.
If no discovery service is set, connecting to a node without providing its
direct addresses or relay URLs will fail.
See the documentation of the Discovery trait for details.
-Sourcepub fn add_discovery<F, D>(self, discovery: F) -> Selfwhere
+
Sourcepub fn add_discovery<F, D>(self, discovery: F) -> Self
Adds a discovery mechanism for this endpoint.
The function discovery
@@ -47,7 +54,7 @@ to use this secret key to sign the information.
direct addresses or relay URLs will fail.
To clear all discovery services, use Builder::clear_discovery.
See the documentation of the Discovery trait for details.
-Sourcepub fn discovery_n0(self) -> Self
Configures the endpoint to use the default n0 DNS discovery service.
+Sourcepub fn discovery_n0(self) -> Self
Configures the endpoint to use the default n0 DNS discovery service.
The default discovery service publishes to and resolves from the
n0.computer dns server iroh.link.
This is equivalent to adding both a crate::discovery::pkarr::PkarrPublisher
@@ -56,29 +63,29 @@ n0.computer dns server.
This will by default use N0_DNS_PKARR_RELAY_PROD.
When in tests, or when the test-utils feature is enabled, this will use the
N0_DNS_PKARR_RELAY_STAGING.
-Sourcepub fn tls_x509(self) -> Self
Use libp2p based self signed certificates for TLS.
For details see the libp2p spec at https://github.com/libp2p/specs/blob/master/tls/tls.md
This is the only mechanism available in iroh@0.33.0 and earlier.
-Sourcepub fn tls_raw_public_keys(self) -> Self
Use TLS Raw Public Keys
+Sourcepub fn tls_raw_public_keys(self) -> Self
Use TLS Raw Public Keys
This is the default, but is not compatible with older versions of iroh.
-Sourcepub fn discovery_dht(self) -> Self
Available on crate feature discovery-pkarr-dht only.
Configures the endpoint to also use the mainline DHT with default settings.
+Sourcepub fn discovery_dht(self) -> Self
Available on crate feature discovery-pkarr-dht only.
Configures the endpoint to also use the mainline DHT with default settings.
This is equivalent to adding a crate::discovery::pkarr::dht::DhtDiscovery
with default settings. Note that DhtDiscovery has various more advanced
configuration options. If you need any of those, you should manually
create a DhtDiscovery and add it with Builder::add_discovery.
-Sourcepub fn discovery_local_network(self) -> Self
Available on crate feature discovery-local-network only.
Configures the endpoint to also use local network discovery.
+Sourcepub fn discovery_local_network(self) -> Self
Available on crate feature discovery-local-network only.
Configures the endpoint to also use local network discovery.
This is equivalent to adding a crate::discovery::mdns::MdnsDiscovery
with default settings. Note that MdnsDiscovery has various more advanced
configuration options. If you need any of those, you should manually
create a MdnsDiscovery and add it with Builder::add_discovery.
-Sourcepub fn user_data_for_discovery(self, user_data: UserData) -> Self
Sets the initial user-defined data to be published in discovery services for this node.
+Sourcepub fn user_data_for_discovery(self, user_data: UserData) -> Self
Sets the initial user-defined data to be published in discovery services for this node.
When using discovery services, this string of UserData will be published together
with the node’s addresses and relay URL. When other nodes discover this node,
they retrieve the UserData in addition to the addressing info.
Iroh itself does not interpret the user-defined data in any way, it is purely left
for applications to parse and use.
-Sourcepub fn known_nodes(self, nodes: Vec<NodeAddr>) -> Self
Optionally set a list of known nodes.
-Sourcepub fn transport_config(self, transport_config: TransportConfig) -> Self
Sets a custom quinn::TransportConfig for this endpoint.
+Sourcepub fn known_nodes(self, nodes: Vec<NodeAddr>) -> Self
Optionally set a list of known nodes.
+Sourcepub fn transport_config(self, transport_config: TransportConfig) -> Self
Sets a custom quinn::TransportConfig for this endpoint.
The transport config contains parameters governing the QUIC state machine.
If unset, the default config is used. Default values should be suitable for most
internet applications. Applications protocols which forbid remotely-initiated
@@ -86,31 +93,31 @@ streams should set max_concurrent_bidi_streams and max_concur
zero.
Please be aware that changing some settings may have adverse effects on establishing
and maintaining direct connections.
-Sourcepub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self
Available on non-wasm_browser only.
Optionally sets a custom DNS resolver to use for this endpoint.
+Sourcepub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self
Available on non-wasm_browser only.
Optionally sets a custom DNS resolver to use for this endpoint.
The DNS resolver is used to resolve relay hostnames, and node addresses if
crate::discovery::dns::DnsDiscovery is configured.
By default, a new DNS resolver is created which is configured to use the
host system’s DNS configuration. You can pass a custom instance of DnsResolver
here to use a differently configured DNS resolver for this endpoint, or to share
a DnsResolver between multiple endpoints.
-Sourcepub fn proxy_url(self, url: Url) -> Self
Sets an explicit proxy url to proxy all HTTP(S) traffic through.
-Sourcepub fn proxy_from_env(self) -> Self
Sets the proxy url from the environment, in this order:
+Sourcepub fn proxy_url(self, url: Url) -> Self
Sets an explicit proxy url to proxy all HTTP(S) traffic through.
+Sourcepub fn proxy_from_env(self) -> Self
Sets the proxy url from the environment, in this order:
HTTP_PROXY
http_proxy
HTTPS_PROXY
https_proxy
-Sourcepub fn keylog(self, keylog: bool) -> Self
Enables saving the TLS pre-master key for connections.
+Sourcepub fn keylog(self, keylog: bool) -> Self
Enables saving the TLS pre-master key for connections.
This key should normally remain secret but can be useful to debug networking issues
by decrypting captured traffic.
If keylog is true then setting the SSLKEYLOGFILE environment variable to a
filename will result in this file being used to log the TLS pre-master keys.
-Sourcepub fn insecure_skip_relay_cert_verify(self, skip_verify: bool) -> Self
Available on crate feature test-utils only.
Skip verification of SSL certificates from relay servers
+Sourcepub fn insecure_skip_relay_cert_verify(self, skip_verify: bool) -> Self
Available on crate feature test-utils only.
Skip verification of SSL certificates from relay servers
May only be used in tests.
-Sourcepub fn path_selection(self, path_selection: PathSelection) -> Self
Available on crate feature test-utils only.
This implies we only use the relay to communicate
+
Sourcepub fn path_selection(self, path_selection: PathSelection) -> Self
Available on crate feature test-utils only.
This implies we only use the relay to communicate
and do not attempt to do any hole punching.
-Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Builder
§impl !RefUnwindSafe for Builder
§impl Send for Builder
§impl Sync for Builder
§impl Unpin for Builder
§impl !UnwindSafe for Builder
Blanket Implementations§
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Builder
§impl !RefUnwindSafe for Builder
§impl Send for Builder
§impl Sync for Builder
§impl Unpin for Builder
§impl !UnwindSafe for Builder
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/3217/docs/iroh/endpoint/struct.ConnectOptions.html b/pr/3217/docs/iroh/endpoint/struct.ConnectOptions.html
index d82c67e528..4b2b9fa2d5 100644
--- a/pr/3217/docs/iroh/endpoint/struct.ConnectOptions.html
+++ b/pr/3217/docs/iroh/endpoint/struct.ConnectOptions.html
@@ -1,12 +1,12 @@
-ConnectOptions in iroh::endpoint - Rust pub struct ConnectOptions { /* private fields */ }
Expand description
Options for the Endpoint::connect_with_opts function.
-Implementations§
Source§impl ConnectOptions
Sourcepub fn new() -> Self
Initializes new connection options.
+ConnectOptions in iroh::endpoint - Rust pub struct ConnectOptions { /* private fields */ }
Expand description
Options for the Endpoint::connect_with_opts function.
+Implementations§
Source§impl ConnectOptions
Sourcepub fn new() -> Self
Initializes new connection options.
By default, the connection will use the same options
as Endpoint::connect, e.g. a default TransportConfig.
-Sourcepub fn with_transport_config(
+
Sourcepub fn with_transport_config(
self,
transport_config: Arc<TransportConfig>,
) -> Self
Sets the QUIC transport config options for this connection.
-Trait Implementations§
Source§impl Clone for ConnectOptions
Source§fn clone(&self) -> ConnectOptions
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 ConnectOptions
Source§impl Default for ConnectOptions
Source§fn default() -> ConnectOptions
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for ConnectOptions
§impl !RefUnwindSafe for ConnectOptions
§impl Send for ConnectOptions
§impl Sync for ConnectOptions
§impl Unpin for ConnectOptions
§impl !UnwindSafe for ConnectOptions
Blanket Implementations§
Trait Implementations§
Source§impl Clone for ConnectOptions
Source§fn clone(&self) -> ConnectOptions
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 ConnectOptions
Source§impl Default for ConnectOptions
Source§fn default() -> ConnectOptions
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for ConnectOptions
§impl !RefUnwindSafe for ConnectOptions
§impl Send for ConnectOptions
§impl Sync for ConnectOptions
§impl Unpin for ConnectOptions
§impl !UnwindSafe for ConnectOptions
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/3217/docs/iroh/endpoint/struct.Connecting.html b/pr/3217/docs/iroh/endpoint/struct.Connecting.html
index 41a03946a4..e190a84876 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Connecting.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Connecting.html
@@ -1,5 +1,5 @@
-Connecting in iroh::endpoint - Rust pub struct Connecting { /* private fields */ }
Expand description
In-progress connection attempt future
-Implementations§
Source§impl Connecting
Sourcepub fn into_0rtt(self) -> Result<(Connection, ZeroRttAccepted), Self>
Converts this Connecting into a 0-RTT or 0.5-RTT connection at the cost of weakened
+
Connecting in iroh::endpoint - Rust pub struct Connecting { /* private fields */ }
Expand description
In-progress connection attempt future
+Implementations§
Source§impl Connecting
Sourcepub fn into_0rtt(self) -> Result<(Connection, ZeroRttAccepted), Self>
Converts this Connecting into a 0-RTT or 0.5-RTT connection at the cost of weakened
security.
Returns Ok immediately if the local endpoint is able to attempt sending 0/0.5-RTT data.
If so, the returned Connection can be used to send application data without waiting for
@@ -33,10 +33,10 @@ before TLS client authentication has occurred, and should therefore not be used
data for which client authentication is being used.
You can use RecvStream::is_0rtt to check whether a stream has been opened in 0-RTT
and thus whether parts of the stream are operating under this reduced security level.
-Sourcepub async fn handshake_data(&mut self) -> Result<Box<dyn Any>, ConnectionError>
Parameters negotiated during the handshake
-Trait Implementations§
Source§impl Debug for Connecting
Source§impl Future for Connecting
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for Connectingwhere
+Sourcepub async fn handshake_data(&mut self) -> Result<Box<dyn Any>, ConnectionError>
Parameters negotiated during the handshake
+
Trait Implementations§
Source§impl Debug for Connecting
Source§impl Future for Connecting
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for Connectingwhere
PinnedFieldsOf<__Connecting<'pin>>: Unpin,
Auto Trait Implementations§
§impl Freeze for Connecting
§impl !RefUnwindSafe for Connecting
§impl Send for Connecting
§impl Sync for Connecting
§impl !UnwindSafe for Connecting
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/endpoint/struct.Connection.html b/pr/3217/docs/iroh/endpoint/struct.Connection.html
index 8e81609487..928cdb9918 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Connection.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Connection.html
@@ -1,4 +1,4 @@
-Connection in iroh::endpoint - Rust pub struct Connection { /* private fields */ }
Expand description
A QUIC connection.
+Connection in iroh::endpoint - Rust pub struct Connection { /* private fields */ }
Expand description
A QUIC connection.
If all references to a connection (including every clone of the Connection handle,
streams of incoming streams, and the various stream types) have been dropped, then the
connection will be automatically closed with an error_code of 0 and an empty reason. You
@@ -8,29 +8,29 @@ receiving CONNECTION_CLOSE the peer may drop any stream data not yet delivered t
application. Connection::close describes in more detail how to gracefully close a
connection without losing application data.
May be cloned to obtain another handle to the same connection.
-Implementations§
Source§impl Connection
Implementations§
Source§impl Connection
Sourcepub fn open_uni(&self) -> OpenUni<'_> ⓘ
Initiates a new outgoing unidirectional stream.
Streams are cheap and instantaneous to open unless blocked by flow control. As a
consequence, the peer won’t be notified that a stream has been opened until the
stream is actually used.
-Sourcepub fn open_bi(&self) -> OpenBi<'_> ⓘ
Initiates a new outgoing bidirectional stream.
Streams are cheap and instantaneous to open unless blocked by flow control. As a
consequence, the peer won’t be notified that a stream has been opened until the
stream is actually used. Calling open_bi then waiting on the RecvStream
without writing anything to SendStream will never succeed.
-Sourcepub fn accept_uni(&self) -> AcceptUni<'_> ⓘ
Accepts the next incoming uni-directional stream.
-Sourcepub fn accept_uni(&self) -> AcceptUni<'_> ⓘ
Accepts the next incoming uni-directional stream.
+Sourcepub fn accept_bi(&self) -> AcceptBi<'_> ⓘ
Accept the next incoming bidirectional stream.
Important Note: The peer that calls open_bi must write to its SendStream
before the peer Connection is able to accept the stream using
accept_bi(). Calling open_bi then waiting on the RecvStream without
writing anything to the connected SendStream will never succeed.
-Sourcepub fn read_datagram(&self) -> ReadDatagram<'_> ⓘ
Receives an application datagram.
-Sourcepub async fn closed(&self) -> ConnectionError
Wait for the connection to be closed for any reason.
+Sourcepub fn read_datagram(&self) -> ReadDatagram<'_> ⓘ
Receives an application datagram.
+Sourcepub async fn closed(&self) -> ConnectionError
Wait for the connection to be closed for any reason.
Despite the return type’s name, closed connections are often not an error condition
at the application layer. Cases that might be routine include
ConnectionError::LocallyClosed and ConnectionError::ApplicationClosed.
-Sourcepub fn close_reason(&self) -> Option<ConnectionError>
If the connection is closed, the reason why.
+Sourcepub fn close_reason(&self) -> Option<ConnectionError>
If the connection is closed, the reason why.
Returns None if the connection is still open.
-Sourcepub fn close(&self, error_code: VarInt, reason: &[u8])
Closes the connection immediately.
Pending operations will fail immediately with ConnectionError::LocallyClosed. No
more data is sent to the peer and the peer may drop buffered data upon receiving the
CONNECTION_CLOSE frame.
@@ -51,41 +51,41 @@ endpoint. Once the local side sends a CONNECTION_CLOSE frame in response to call
close the remote endpoint may drop any data it received but is as yet
undelivered to the application, including data that was acknowledged as received to
the local endpoint.
-Sourcepub fn send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError>
Transmits data as an unreliable, unordered application datagram.
+Sourcepub fn send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError>
Transmits data as an unreliable, unordered application datagram.
Application datagrams are a low-level primitive. They may be lost or delivered out
of order, and data must both fit inside a single QUIC packet and be smaller than
the maximum dictated by the peer.
-Sourcepub fn max_datagram_size(&self) -> Option<usize>
Computes the maximum size of datagrams that may be passed to send_datagram.
+Sourcepub fn max_datagram_size(&self) -> Option<usize>
Computes the maximum size of datagrams that may be passed to send_datagram.
Returns None if datagrams are unsupported by the peer or disabled locally.
This may change over the lifetime of a connection according to variation in the path
MTU estimate. The peer can also enforce an arbitrarily small fixed limit, but if the
peer’s limit is large this is guaranteed to be a little over a kilobyte at minimum.
Not necessarily the maximum size of received datagrams.
-Sourcepub fn datagram_send_buffer_space(&self) -> usize
Bytes available in the outgoing datagram buffer.
+Sourcepub fn datagram_send_buffer_space(&self) -> usize
Bytes available in the outgoing datagram buffer.
When greater than zero, calling send_datagram with a
datagram of at most this size is guaranteed not to cause older datagrams to be
dropped.
-Sourcepub fn rtt(&self) -> Duration
Current best estimate of this connection’s latency (round-trip-time).
-Sourcepub fn stats(&self) -> ConnectionStats
Returns connection statistics.
-Sourcepub fn congestion_state(&self) -> Box<dyn Controller>
Current state of the congestion control algorithm, for debugging purposes.
-Sourcepub fn handshake_data(&self) -> Option<Box<dyn Any>>
Parameters negotiated during the handshake.
+Sourcepub fn rtt(&self) -> Duration
Current best estimate of this connection’s latency (round-trip-time).
+Sourcepub fn stats(&self) -> ConnectionStats
Returns connection statistics.
+Sourcepub fn congestion_state(&self) -> Box<dyn Controller>
Current state of the congestion control algorithm, for debugging purposes.
+Sourcepub fn handshake_data(&self) -> Option<Box<dyn Any>>
Parameters negotiated during the handshake.
Guaranteed to return Some on fully established connections or after
Connecting::handshake_data() succeeds. See that method’s documentations for
details on the returned value.
-Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
-Sourcepub fn peer_identity(&self) -> Option<Box<dyn Any>>
Cryptographic identity of the peer.
+Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
+Sourcepub fn peer_identity(&self) -> Option<Box<dyn Any>>
Sourcepub fn remote_node_id(&self) -> Result<NodeId>
Returns the NodeId from the peer’s TLS certificate.
+Sourcepub fn remote_node_id(&self) -> Result<NodeId>
Sourcepub fn stable_id(&self) -> usize
A stable identifier for this connection.
Peer addresses and connection IDs can change, but this value will remain fixed for
the lifetime of the connection.
-Sourcepub fn export_keying_material(
+
Sourcepub fn export_keying_material(
&self,
output: &mut [u8],
label: &[u8],
@@ -96,14 +96,14 @@ arguments and output buffers of equal length, they will get the
same sequence of bytes in output. These bytes are cryptographically
strong and pseudorandom, and are suitable for use as keying material.
See RFC5705 for more information.
-
Sourcepub fn set_max_concurrent_uni_streams(&self, count: VarInt)
Modifies the number of unidirectional streams that may be concurrently opened.
+Sourcepub fn set_max_concurrent_uni_streams(&self, count: VarInt)
Modifies the number of unidirectional streams that may be concurrently opened.
No streams may be opened by the peer unless fewer than count are already
open. Large counts increase both minimum and worst-case memory consumption.
-Sourcepub fn set_receive_window(&self, receive_window: VarInt)
Sourcepub fn set_max_concurrent_bi_streams(&self, count: VarInt)
Modifies the number of bidirectional streams that may be concurrently opened.
+Sourcepub fn set_receive_window(&self, receive_window: VarInt)
Sourcepub fn set_max_concurrent_bi_streams(&self, count: VarInt)
Modifies the number of bidirectional streams that may be concurrently opened.
No streams may be opened by the peer unless fewer than count are already
open. Large counts increase both minimum and worst-case memory consumption.
-Trait Implementations§
Source§impl Clone for Connection
Source§fn clone(&self) -> Connection
Returns a copy of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreAuto Trait Implementations§
§impl Freeze for Connection
§impl RefUnwindSafe for Connection
§impl Send for Connection
§impl Sync for Connection
§impl Unpin for Connection
§impl UnwindSafe for Connection
Blanket Implementations§
Trait Implementations§
Source§impl Clone for Connection
Source§fn clone(&self) -> Connection
Returns a copy of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreAuto Trait Implementations§
§impl Freeze for Connection
§impl RefUnwindSafe for Connection
§impl Send for Connection
§impl Sync for Connection
§impl Unpin for Connection
§impl UnwindSafe for Connection
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/3217/docs/iroh/endpoint/struct.DirectAddr.html b/pr/3217/docs/iroh/endpoint/struct.DirectAddr.html
index 61a667e47d..04760c9021 100644
--- a/pr/3217/docs/iroh/endpoint/struct.DirectAddr.html
+++ b/pr/3217/docs/iroh/endpoint/struct.DirectAddr.html
@@ -1,4 +1,4 @@
-DirectAddr in iroh::endpoint - Rust pub struct DirectAddr {
+DirectAddr in iroh::endpoint - Rust pub struct DirectAddr {
pub addr: SocketAddr,
pub typ: DirectAddrType,
}
Expand description
A direct address on which an iroh-node might be contactable.
@@ -7,16 +7,16 @@ contacted. These can come from various sources depending on the network topolog
iroh node, see DirectAddrType for the several kinds of sources.
Fields§
§addr: SocketAddrThe address.
§typ: DirectAddrTypeThe origin of this direct address.
-Trait Implementations§
Source§impl Clone for DirectAddr
Source§fn clone(&self) -> DirectAddr
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 DirectAddr
Source§impl Hash for DirectAddr
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
+Trait Implementations§
Source§impl Clone for DirectAddr
Source§fn clone(&self) -> DirectAddr
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 DirectAddr
Source§impl Hash for DirectAddr
Source§impl Ord for DirectAddr
Source§impl Ord for DirectAddr
Source§fn cmp(&self, other: &DirectAddr) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read moreSource§impl PartialEq for DirectAddr
Source§impl PartialOrd for DirectAddr
Source§impl PartialEq for DirectAddr
Source§impl PartialOrd for DirectAddr
Source§impl Eq for DirectAddr
Source§impl StructuralPartialEq for DirectAddr
Auto Trait Implementations§
§impl Freeze for DirectAddr
§impl RefUnwindSafe for DirectAddr
§impl Send for DirectAddr
§impl Sync for DirectAddr
§impl Unpin for DirectAddr
§impl UnwindSafe for DirectAddr
Blanket Implementations§
Source§impl Eq for DirectAddr
Source§impl StructuralPartialEq for DirectAddr
Auto Trait Implementations§
§impl Freeze for DirectAddr
§impl RefUnwindSafe for DirectAddr
§impl Send for DirectAddr
§impl Sync for DirectAddr
§impl Unpin for DirectAddr
§impl UnwindSafe for DirectAddr
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/3217/docs/iroh/endpoint/struct.Endpoint.html b/pr/3217/docs/iroh/endpoint/struct.Endpoint.html
index e25e697700..0b8c9af7b3 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Endpoint.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Endpoint.html
@@ -1,4 +1,4 @@
-Endpoint in iroh::endpoint - Rust pub struct Endpoint { /* private fields */ }
Expand description
Controls an iroh node, establishing connections with other nodes.
+Endpoint in iroh::endpoint - Rust pub struct Endpoint { /* private fields */ }
Expand description
Controls an iroh node, establishing connections with other nodes.
This is the main API interface to create connections to, and accept connections from
other iroh nodes. The connections are peer-to-peer and encrypted, a Relay server is
used to make the connections reliable. See the [crate docs] for a more detailed
@@ -16,17 +16,17 @@ the peer are created using the Connection::open_uni and Connection::open_bi functions.
Note that due to the light-weight properties of streams a stream will only be accepted
once the initiating peer has sent some data on it.
-Implementations§
Source§impl Endpoint
Sourcepub fn builder() -> Builder
Returns the builder for an Endpoint, with a production configuration.
-Sourcepub fn set_alpns(&self, alpns: Vec<Vec<u8>>) -> Result<()>
Sets the list of accepted ALPN protocols.
+Implementations§
Source§impl Endpoint
Sourcepub fn builder() -> Builder
Returns the builder for an Endpoint, with a production configuration.
+Sourcepub async fn connect(
&self,
node_addr: impl Into<NodeAddr>,
alpn: &[u8],
) -> Result<Connection>
Connects to a remote Endpoint.
A value that can be converted into a NodeAddr is required. This can be either a
-NodeAddr, a NodeId or a iroh_base::ticket::NodeTicket.
+NodeAddr, a NodeId or a [iroh_base::ticket::NodeTicket].
The NodeAddr must contain the NodeId to dial and may also contain a RelayUrl
and direct addresses. If direct addresses are provided, they will be used to try and
establish a direct connection without involving a relay server.
@@ -41,7 +41,7 @@ connection attempt will fail with an error.
The alpn, or application-level protocol identifier, is also required. The remote
endpoint must support this alpn, otherwise the connection attempt will fail with
an error.
-Sourcepub async fn connect_with_opts(
+
Sourcepub async fn connect_with_opts(
&self,
node_addr: impl Into<NodeAddr>,
alpn: &[u8],
@@ -61,13 +61,13 @@ security concerns.
establishing and maintaining direct connections. Carefully test settings you use and
consider this currently as still rather experimental.
-
Sourcepub fn accept(&self) -> Accept<'_> ⓘ
Accepts an incoming connection on the endpoint.
Only connections with the ALPNs configured in Builder::alpns will be accepted.
If multiple ALPNs have been configured the ALPN can be inspected before accepting
the connection using Connecting::alpn.
The returned future will yield None if the endpoint is closed by calling
Endpoint::close.
-Sourcepub fn add_node_addr(&self, node_addr: NodeAddr) -> Result<()>
Informs this Endpoint about addresses of the iroh node.
+Sourcepub fn add_node_addr(&self, node_addr: NodeAddr) -> Result<()>
Informs this Endpoint about addresses of the iroh node.
This updates the local state for the remote node. If the provided NodeAddr
contains a RelayUrl this will be used as the new relay server for this node. If
it contains any new IP endpoints they will also be stored and tried when next
@@ -80,7 +80,7 @@ This provides more flexibility and future proofing.
§Errors
Will return an error if we attempt to add our own NodeId to the node map or
if the direct addresses are a subset of ours.
-Sourcepub fn add_node_addr_with_source(
+
Sourcepub fn secret_key(&self) -> &SecretKey
Returns the secret_key of this endpoint.
-Sourcepub fn secret_key(&self) -> &SecretKey
Returns the secret_key of this endpoint.
+Sourcepub fn node_id(&self) -> NodeId
Returns the node id of this endpoint.
This ID is the unique addressing information of this node and other peers must know
it to be able to connect to this node.
-Sourcepub async fn node_addr(&self) -> Result<NodeAddr>
Returns the current NodeAddr for this endpoint.
+Sourcepub async fn node_addr(&self) -> Result<NodeAddr>
Returns the current NodeAddr for this endpoint.
The returned NodeAddr will have the current RelayUrl and direct addresses
as they would be returned by Endpoint::home_relay and
Endpoint::direct_addresses.
In browsers, because direct addresses are unavailable, this will only wait for
the home relay to be available before returning.
-Sourcepub fn home_relay(&self) -> Watcher<Option<RelayUrl>>
Sourcepub fn home_relay(&self) -> Watcher<Option<RelayUrl>>
Returns a Watcher for the RelayUrl of the Relay server used as home relay.
Every endpoint has a home Relay server which it chooses as the server with the
lowest latency out of the configured servers provided by Builder::relay_mode.
This is the server other iroh nodes can use to reliably establish a connection
@@ -122,7 +122,7 @@ some time to connect to find and connect to the home relay server.
let mep = Endpoint::builder().bind().await.unwrap();
let _relay_url = mep.home_relay().initialized().await.unwrap();
-Sourcepub fn direct_addresses(&self) -> Watcher<Option<BTreeSet<DirectAddr>>>
Sourcepub fn direct_addresses(&self) -> Watcher<Option<BTreeSet<DirectAddr>>>
Returns a Watcher for the direct addresses of this Endpoint.
The direct addresses of the Endpoint are those that could be used by other
iroh nodes to establish direct connectivity, depending on the network
situation. The yielded lists of direct addresses contain both the locally-bound
@@ -145,10 +145,10 @@ recently discovered direct addresses.
let mep = Endpoint::builder().bind().await.unwrap();
let _addrs = mep.direct_addresses().initialized().await.unwrap();
-Sourcepub fn bound_sockets(&self) -> (SocketAddr, Option<SocketAddr>)
Available on non-wasm_browser only.
Returns the local socket addresses on which the underlying sockets are bound.
+Sourcepub fn bound_sockets(&self) -> (SocketAddr, Option<SocketAddr>)
Available on non-wasm_browser only.
Returns the local socket addresses on which the underlying sockets are bound.
The Endpoint always binds on an IPv4 address and also tries to bind on an IPv6
address if available.
-Sourcepub fn remote_info(&self, node_id: NodeId) -> Option<RemoteInfo>
Returns information about the remote node identified by a NodeId.
+Sourcepub fn remote_info(&self, node_id: NodeId) -> Option<RemoteInfo>
Returns information about the remote node identified by a NodeId.
The Endpoint keeps some information about remote iroh nodes, which it uses to find
the best path to a node. Having information on a remote node, however, does not mean we have
ever connected to it to or even whether a connection is even possible. The information about a
@@ -157,14 +157,14 @@ calls may return different information. Furthermore, node information may even b
completely evicted as it becomes stale.
See also Endpoint::remote_info_iter which returns information on all nodes known
by this Endpoint.
-Sourcepub fn remote_info_iter(&self) -> impl Iterator<Item = RemoteInfo>
Returns information about all the remote nodes this Endpoint knows about.
+Sourcepub fn remote_info_iter(&self) -> impl Iterator<Item = RemoteInfo>
Returns information about all the remote nodes this Endpoint knows about.
This returns the same information as Endpoint::remote_info for each node known to this
Endpoint.
The Endpoint keeps some information about remote iroh nodes, which it uses to find
the best path to a node. This returns all the nodes it knows about, regardless of whether a
connection was ever made or is even possible.
See also Endpoint::remote_info to only retrieve information about a single node.
-Sourcepub fn discovery_stream(
+
Sourcepub fn discovery_stream(
&self,
) -> impl Stream<Item = Result<DiscoveryItem, Lagged>>
Returns a stream of all remote nodes discovered through the endpoint’s discovery services.
Whenever a node is discovered via the endpoint’s discovery service, the corresponding
@@ -183,7 +183,7 @@ at the time of adding it to the static provider.
Lagged may be yielded, indicating that items were missed.
See also Endpoint::remote_info_iter, which returns an iterator over all remotes
the endpoint knows about at a specific point in time.
-Sourcepub fn conn_type(&self, node_id: NodeId) -> Result<Watcher<ConnectionType>>
Returns a Watcher that reports the current connection type and any changes for
+
Sourcepub fn conn_type(&self, node_id: NodeId) -> Result<Watcher<ConnectionType>>
Returns a Watcher that reports the current connection type and any changes for
given remote node.
This watcher allows observing a stream of ConnectionType items by calling
Watcher::stream(). If the underlying connection to a remote node changes, it will
@@ -202,11 +202,11 @@ recently connected to this node id but previous methods of reaching the node hav
become inaccessible.
§Errors
Will error if we do not have any address information for the given node_id.
-Sourcepub fn dns_resolver(&self) -> &DnsResolver
Available on non-wasm_browser only.
Returns the DNS resolver used in this Endpoint.
+Sourcepub fn dns_resolver(&self) -> &DnsResolver
Available on non-wasm_browser only.
Returns the DNS resolver used in this Endpoint.
-Sourcepub fn discovery(&self) -> Option<&dyn Discovery>
Returns the discovery mechanism, if configured.
+Sourcepub fn discovery(&self) -> Option<&dyn Discovery>
Returns the discovery mechanism, if configured.
See Builder::discovery.
-Sourcepub async fn network_change(&self)
Notifies the system of potential network changes.
+Sourcepub async fn network_change(&self)
Notifies the system of potential network changes.
On many systems iroh is able to detect network changes by itself, however
some systems like android do not expose this functionality to native code.
Android does however provide this functionality to Java code. This
@@ -214,12 +214,12 @@ function allows for notifying iroh of any potential network changes like
this.
Even when the network did not change, or iroh was already able to detect
the network change itself, there is no harm in calling this function.
-Sourcepub fn set_user_data_for_discovery(&self, user_data: Option<UserData>)
Sets the initial user-defined data to be published in discovery services for this node.
+Sourcepub fn set_user_data_for_discovery(&self, user_data: Option<UserData>)
Sets the initial user-defined data to be published in discovery services for this node.
If the user-defined data passed to this function is different to the previous one,
the endpoint will republish its node info to the configured discovery services.
See also Builder::user_data_for_discovery for setting an initial value when
building the endpoint.
-Sourcepub async fn close(&self)
Closes the QUIC endpoint and the magic socket.
This will close any remaining open Connections with an error code
of 0 and an empty reason. Though it is best practice to close those
explicitly before with a custom error code and reason.
@@ -245,8 +245,8 @@ while TCP sockets usually get closed and drained by the operating system in the
kernel during the “Time-Wait” period of the TCP socket.
Be aware however that the underlying UDP sockets are only closed once all clones of
the the respective Endpoint are dropped.
-Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Endpoint
§impl !RefUnwindSafe for Endpoint
§impl Send for Endpoint
§impl Sync for Endpoint
§impl Unpin for Endpoint
§impl !UnwindSafe for Endpoint
Blanket Implementations§
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Endpoint
§impl !RefUnwindSafe for Endpoint
§impl Send for Endpoint
§impl Sync for Endpoint
§impl Unpin for Endpoint
§impl !UnwindSafe for Endpoint
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/3217/docs/iroh/endpoint/struct.Incoming.html b/pr/3217/docs/iroh/endpoint/struct.Incoming.html
index 61f28360fa..6b71064a82 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Incoming.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Incoming.html
@@ -1,29 +1,29 @@
-Incoming in iroh::endpoint - Rust pub struct Incoming { /* private fields */ }
Expand description
An incoming connection for which the server has not yet begun its parts of the
+
Incoming in iroh::endpoint - Rust pub struct Incoming { /* private fields */ }
Expand description
An incoming connection for which the server has not yet begun its parts of the
handshake.
-Implementations§
Source§impl Incoming
Sourcepub fn accept(self) -> Result<Connecting, ConnectionError>
Attempts to accept this incoming connection (an error may still occur).
+Implementations§
Source§impl Incoming
Sourcepub fn accept(self) -> Result<Connecting, ConnectionError>
Attempts to accept this incoming connection (an error may still occur).
Errors occurring here are likely not caused by the application or remote. The QUIC
connection listens on a normal UDP socket and any reachable network endpoint can
send datagrams to it, solicited or not. Even if the first few bytes look like a
QUIC packet, it might not even be a QUIC packet that is being received.
Thus it is common to simply log the errors here and accept them as something which
can happen.
-Sourcepub fn accept_with(
+
Sourcepub fn accept_with(
self,
server_config: Arc<ServerConfig>,
) -> Result<Connecting, ConnectionError>
Accepts this incoming connection using a custom configuration.
See accept() for more details.
-Sourcepub fn retry(self) -> Result<(), RetryError>
Responds with a retry packet.
+Sourcepub fn retry(self) -> Result<(), RetryError>
Responds with a retry packet.
This requires the client to retry with address validation.
Errors if remote_address_validated() is true.
-Sourcepub fn ignore(self)
Ignores this incoming connection attempt, not sending any packet in response.
-Sourcepub fn local_ip(&self) -> Option<IpAddr>
Returns the local IP address which was used when the peer established the
+
Sourcepub fn ignore(self)
Ignores this incoming connection attempt, not sending any packet in response.
+Sourcepub fn local_ip(&self) -> Option<IpAddr>
Returns the local IP address which was used when the peer established the
connection.
-Sourcepub fn remote_address(&self) -> SocketAddr
Returns the peer’s UDP address.
-Sourcepub fn remote_address_validated(&self) -> bool
Whether the socket address that is initiating this connection has been validated.
+Sourcepub fn remote_address(&self) -> SocketAddr
Returns the peer’s UDP address.
+Sourcepub fn remote_address_validated(&self) -> bool
Whether the socket address that is initiating this connection has been validated.
This means that the sender of the initial packet has proved that they can receive
traffic sent to self.remote_address().
-Trait Implementations§
Source§impl IntoFuture for Incoming
Source§type Output = Result<Connection, ConnectionError>
The output that the future will produce on completion.Source§type IntoFuture = IncomingFuture
Which kind of future are we turning this into?Source§fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read moreAuto Trait Implementations§
§impl !Freeze for Incoming
§impl !RefUnwindSafe for Incoming
§impl Send for Incoming
§impl Sync for Incoming
§impl Unpin for Incoming
§impl !UnwindSafe for Incoming
Blanket Implementations§
Trait Implementations§
Source§impl IntoFuture for Incoming
Source§type Output = Result<Connection, ConnectionError>
The output that the future will produce on completion.Source§type IntoFuture = IncomingFuture
Which kind of future are we turning this into?Source§fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read moreAuto Trait Implementations§
§impl !Freeze for Incoming
§impl !RefUnwindSafe for Incoming
§impl Send for Incoming
§impl Sync for Incoming
§impl Unpin for Incoming
§impl !UnwindSafe for Incoming
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/3217/docs/iroh/endpoint/struct.IncomingFuture.html b/pr/3217/docs/iroh/endpoint/struct.IncomingFuture.html
index 504c012c78..3934a53120 100644
--- a/pr/3217/docs/iroh/endpoint/struct.IncomingFuture.html
+++ b/pr/3217/docs/iroh/endpoint/struct.IncomingFuture.html
@@ -1,6 +1,6 @@
-IncomingFuture in iroh::endpoint - Rust pub struct IncomingFuture { /* private fields */ }
Expand description
Adaptor to let Incoming be awaited like a Connecting.
-Trait Implementations§
Source§impl Debug for IncomingFuture
Source§impl Future for IncomingFuture
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for IncomingFuturewhere
+IncomingFuture in iroh::endpoint - Rust pub struct IncomingFuture { /* private fields */ }
Expand description
Adaptor to let Incoming be awaited like a Connecting.
+Trait Implementations§
Source§impl Debug for IncomingFuture
Source§impl Future for IncomingFuture
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for IncomingFuturewhere
PinnedFieldsOf<__IncomingFuture<'pin>>: Unpin,
Auto Trait Implementations§
§impl !Freeze for IncomingFuture
§impl !RefUnwindSafe for IncomingFuture
§impl Send for IncomingFuture
§impl Sync for IncomingFuture
§impl !UnwindSafe for IncomingFuture
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html b/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html
index 792290d8f5..d03f08d892 100644
--- a/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html
+++ b/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html
@@ -1,7 +1,7 @@
-ZeroRttAccepted in iroh::endpoint - Rust pub struct ZeroRttAccepted { /* private fields */ }
Expand description
Future that completes when a connection is fully established.
+ZeroRttAccepted in iroh::endpoint - Rust pub struct ZeroRttAccepted { /* private fields */ }
Expand description
Future that completes when a connection is fully established.
For clients, the resulting value indicates if 0-RTT was accepted. For servers, the resulting
value is meaningless.
-Trait Implementations§
Source§impl Debug for ZeroRttAccepted
Source§impl Future for ZeroRttAccepted
Source§fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>
Attempts to resolve the future to a final value, registering
+Trait Implementations§
Source§impl Debug for ZeroRttAccepted
Source§impl Future for ZeroRttAccepted
Auto Trait Implementations§
§impl Freeze for ZeroRttAccepted
§impl !RefUnwindSafe for ZeroRttAccepted
§impl Send for ZeroRttAccepted
§impl Sync for ZeroRttAccepted
§impl Unpin for ZeroRttAccepted
§impl !UnwindSafe for ZeroRttAccepted
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/enum.KeyParsingError.html b/pr/3217/docs/iroh/enum.KeyParsingError.html
index 55941cda04..c7925e588b 100644
--- a/pr/3217/docs/iroh/enum.KeyParsingError.html
+++ b/pr/3217/docs/iroh/enum.KeyParsingError.html
@@ -1,4 +1,4 @@
-KeyParsingError in iroh - Rust pub enum KeyParsingError {
+KeyParsingError in iroh - Rust Enum KeyParsingError
pub enum KeyParsingError {
Decode(DecodeError),
Key(Error),
DecodeInvalidLength,
@@ -6,7 +6,7 @@
Variants§
§Decode(DecodeError)
Error when decoding.
§Key(Error)
Error when decoding the public key.
§DecodeInvalidLength
The encoded information had the wrong length.
-Trait Implementations§
Source§impl Debug for KeyParsingError
Source§impl Display for KeyParsingError
Source§impl Error for KeyParsingError
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()Source§impl From<DecodeError> for KeyParsingError
Source§fn from(source: DecodeError) -> KeyParsingError
Converts to this type from the input type.Source§impl From<Error> for KeyParsingError
Source§fn from(source: Error) -> KeyParsingError
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for KeyParsingError
§impl !RefUnwindSafe for KeyParsingError
§impl Send for KeyParsingError
§impl Sync for KeyParsingError
§impl Unpin for KeyParsingError
§impl !UnwindSafe for KeyParsingError
Blanket Implementations§
Trait Implementations§
§impl Debug for KeyParsingError
§impl Display for KeyParsingError
§impl Error for KeyParsingError
§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()§impl From<DecodeError> for KeyParsingError
§fn from(source: DecodeError) -> KeyParsingError
Converts to this type from the input type.§impl From<Error> for KeyParsingError
§fn from(source: Error) -> KeyParsingError
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for KeyParsingError
§impl !RefUnwindSafe for KeyParsingError
§impl Send for KeyParsingError
§impl Sync for KeyParsingError
§impl Unpin for KeyParsingError
§impl !UnwindSafe for KeyParsingError
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/3217/docs/iroh/metrics/struct.RelayMetrics.html b/pr/3217/docs/iroh/metrics/struct.RelayMetrics.html
index 83ae1acdcc..6f22d04f93 100644
--- a/pr/3217/docs/iroh/metrics/struct.RelayMetrics.html
+++ b/pr/3217/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/3217/docs/iroh/node_info/constant.IROH_TXT_NAME.html b/pr/3217/docs/iroh/node_info/constant.IROH_TXT_NAME.html
index c78d056a1f..0c1e657fb3 100644
--- a/pr/3217/docs/iroh/node_info/constant.IROH_TXT_NAME.html
+++ b/pr/3217/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/3217/docs/iroh/node_info/index.html b/pr/3217/docs/iroh/node_info/index.html
index 9884414f78..5130358fc8 100644
--- a/pr/3217/docs/iroh/node_info/index.html
+++ b/pr/3217/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/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html b/pr/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html
index 2f1c9b7234..33cd3a33fc 100644
--- a/pr/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html
+++ b/pr/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html
@@ -1,5 +1,5 @@
-MaxLengthExceededError in iroh::node_info - Rust
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/discovery/struct.NodeData.html b/pr/3217/docs/iroh/discovery/struct.NodeData.html
index 88d24bd42d..b3a9ec4402 100644
--- a/pr/3217/docs/iroh/discovery/struct.NodeData.html
+++ b/pr/3217/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/3217/docs/iroh/discovery/struct.NodeInfo.html b/pr/3217/docs/iroh/discovery/struct.NodeInfo.html
index 021976d4db..991766d098 100644
--- a/pr/3217/docs/iroh/discovery/struct.NodeInfo.html
+++ b/pr/3217/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/3217/docs/iroh/discovery/struct.UserData.html b/pr/3217/docs/iroh/discovery/struct.UserData.html
index 134f039717..74cd45e3c7 100644
--- a/pr/3217/docs/iroh/discovery/struct.UserData.html
+++ b/pr/3217/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/3217/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_PROD.html b/pr/3217/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_PROD.html
index dd2f30450f..1e378e6be9 100644
--- a/pr/3217/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_PROD.html
+++ b/pr/3217/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/3217/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_STAGING.html b/pr/3217/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_STAGING.html
index fa61f0f616..00c49c891d 100644
--- a/pr/3217/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_STAGING.html
+++ b/pr/3217/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/3217/docs/iroh/dns/struct.DnsResolver.html b/pr/3217/docs/iroh/dns/struct.DnsResolver.html
index bb72543896..53843cda16 100644
--- a/pr/3217/docs/iroh/dns/struct.DnsResolver.html
+++ b/pr/3217/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/3217/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html b/pr/3217/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html
index f03a92e8fc..ebd857988a 100644
--- a/pr/3217/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html
+++ b/pr/3217/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html
@@ -1,2 +1,2 @@
-ENV_FORCE_STAGING_RELAYS in iroh::endpoint - Rust pub const ENV_FORCE_STAGING_RELAYS: &str = "IROH_FORCE_STAGING_RELAYS";
Expand description
Environment variable to force the use of staging relays.
+ENV_FORCE_STAGING_RELAYS in iroh::endpoint - Rust
\ No newline at end of file
diff --git a/pr/3217/docs/iroh/endpoint/enum.DirectAddrType.html b/pr/3217/docs/iroh/endpoint/enum.DirectAddrType.html
index db8fd263b6..8d7040b73e 100644
--- a/pr/3217/docs/iroh/endpoint/enum.DirectAddrType.html
+++ b/pr/3217/docs/iroh/endpoint/enum.DirectAddrType.html
@@ -1,4 +1,4 @@
-DirectAddrType in iroh::endpoint - Rust pub enum DirectAddrType {
+DirectAddrType in iroh::endpoint - Rust pub enum DirectAddrType {
Unknown,
Local,
Stun,
@@ -20,16 +20,16 @@ get a publicly routable direct address.
It is possible to configure iroh to bound to a specific port and independently
configure the router to forward this port to the iroh node. This indicates a
situation like this, which still uses STUN to discover the public address.
-
Trait Implementations§
Source§impl Clone for DirectAddrType
Source§fn clone(&self) -> DirectAddrType
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 DirectAddrType
Source§impl Display for DirectAddrType
Source§impl Hash for DirectAddrType
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
+
Trait Implementations§
Source§impl Clone for DirectAddrType
Source§fn clone(&self) -> DirectAddrType
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 DirectAddrType
Source§impl Display for DirectAddrType
Source§impl Hash for DirectAddrType
Source§impl Ord for DirectAddrType
Source§impl Ord for DirectAddrType
Source§fn cmp(&self, other: &DirectAddrType) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read moreSource§impl PartialEq for DirectAddrType
Source§impl PartialOrd for DirectAddrType
Source§impl PartialEq for DirectAddrType
Source§impl PartialOrd for DirectAddrType
Source§impl Copy for DirectAddrType
Source§impl Eq for DirectAddrType
Source§impl StructuralPartialEq for DirectAddrType
Auto Trait Implementations§
§impl Freeze for DirectAddrType
§impl RefUnwindSafe for DirectAddrType
§impl Send for DirectAddrType
§impl Sync for DirectAddrType
§impl Unpin for DirectAddrType
§impl UnwindSafe for DirectAddrType
Blanket Implementations§
Source§impl Copy for DirectAddrType
Source§impl Eq for DirectAddrType
Source§impl StructuralPartialEq for DirectAddrType
Auto Trait Implementations§
§impl Freeze for DirectAddrType
§impl RefUnwindSafe for DirectAddrType
§impl Send for DirectAddrType
§impl Sync for DirectAddrType
§impl Unpin for DirectAddrType
§impl UnwindSafe for DirectAddrType
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/3217/docs/iroh/endpoint/enum.RelayMode.html b/pr/3217/docs/iroh/endpoint/enum.RelayMode.html
index b478f03249..ab87d54df6 100644
--- a/pr/3217/docs/iroh/endpoint/enum.RelayMode.html
+++ b/pr/3217/docs/iroh/endpoint/enum.RelayMode.html
@@ -1,4 +1,4 @@
-RelayMode in iroh::endpoint - Rust pub enum RelayMode {
+RelayMode in iroh::endpoint - Rust pub enum RelayMode {
Disabled,
Default,
Staging,
@@ -9,9 +9,9 @@
See crate::defaults::prod for the severs used.
§Staging
Use the staging relay servers from n0.
§Custom(RelayMap)
Use a custom relay map.
-
Implementations§
Trait Implementations§
Source§impl Eq for RelayMode
Source§impl StructuralPartialEq for RelayMode
Auto Trait Implementations§
§impl Freeze for RelayMode
§impl RefUnwindSafe for RelayMode
§impl Send for RelayMode
§impl Sync for RelayMode
§impl Unpin for RelayMode
§impl UnwindSafe for RelayMode
Blanket Implementations§
Implementations§
Trait Implementations§
Source§impl Eq for RelayMode
Source§impl StructuralPartialEq for RelayMode
Auto Trait Implementations§
§impl Freeze for RelayMode
§impl RefUnwindSafe for RelayMode
§impl Send for RelayMode
§impl Sync for RelayMode
§impl Unpin for RelayMode
§impl UnwindSafe for RelayMode
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/3217/docs/iroh/endpoint/fn.default_relay_mode.html b/pr/3217/docs/iroh/endpoint/fn.default_relay_mode.html
index 3206b983f7..bedd6fe18a 100644
--- a/pr/3217/docs/iroh/endpoint/fn.default_relay_mode.html
+++ b/pr/3217/docs/iroh/endpoint/fn.default_relay_mode.html
@@ -1,4 +1,4 @@
-default_relay_mode in iroh::endpoint - Rust pub fn default_relay_mode() -> RelayMode
Expand description
Returns the default relay mode.
+default_relay_mode in iroh::endpoint - Rust
\ No newline at end of file
diff --git a/pr/3217/docs/iroh/endpoint/fn.force_staging_infra.html b/pr/3217/docs/iroh/endpoint/fn.force_staging_infra.html
index 763aa33a74..eaaa3f19e2 100644
--- a/pr/3217/docs/iroh/endpoint/fn.force_staging_infra.html
+++ b/pr/3217/docs/iroh/endpoint/fn.force_staging_infra.html
@@ -1,2 +1,2 @@
-force_staging_infra in iroh::endpoint - Rust pub fn force_staging_infra() -> bool
Expand description
Returns true if the use of staging relays is forced.
+force_staging_infra in iroh::endpoint - Rust
\ No newline at end of file
diff --git a/pr/3217/docs/iroh/endpoint/index.html b/pr/3217/docs/iroh/endpoint/index.html
index 4deb68bd51..011ed71358 100644
--- a/pr/3217/docs/iroh/endpoint/index.html
+++ b/pr/3217/docs/iroh/endpoint/index.html
@@ -1,4 +1,4 @@
-iroh::endpoint - Rust Expand description
The Endpoint allows establishing connections to other iroh nodes.
+iroh::endpoint - Rust Expand description
The Endpoint allows establishing connections to other iroh nodes.
The Endpoint is the main API interface to manage a local iroh node. It allows
connecting to and accepting connections from other nodes. See the module docs for
more details on how iroh connections work.
diff --git a/pr/3217/docs/iroh/endpoint/struct.Accept.html b/pr/3217/docs/iroh/endpoint/struct.Accept.html
index 58bb4e71ea..74d685c091 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Accept.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Accept.html
@@ -1,6 +1,6 @@
-Accept in iroh::endpoint - Rust pub struct Accept<'a> { /* private fields */ }
Expand description
Future produced by Endpoint::accept.
-Trait Implementations§
Source§impl<'pin, 'a> Unpin for Accept<'a>where
+Accept in iroh::endpoint - Rust pub struct Accept<'a> { /* private fields */ }
Expand description
Future produced by Endpoint::accept.
+Trait Implementations§
Source§impl<'pin, 'a> Unpin for Accept<'a>where
PinnedFieldsOf<__Accept<'pin, 'a>>: Unpin,
Auto Trait Implementations§
§impl<'a> !Freeze for Accept<'a>
§impl<'a> !RefUnwindSafe for Accept<'a>
§impl<'a> Send for Accept<'a>
§impl<'a> Sync for Accept<'a>
§impl<'a> !UnwindSafe for Accept<'a>
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/endpoint/struct.Builder.html b/pr/3217/docs/iroh/endpoint/struct.Builder.html
index 6872da2482..46b31e019e 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Builder.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Builder.html
@@ -1,24 +1,24 @@
-Builder in iroh::endpoint - Rust pub struct Builder { /* private fields */ }
Expand description
Builder for Endpoint.
+Builder in iroh::endpoint - Rust pub struct Builder { /* private fields */ }
Expand description
Builder for Endpoint.
By default the endpoint will generate a new random SecretKey, which will result in a
new NodeId.
To create the Endpoint call Builder::bind.
-Implementations§
Source§impl Builder
Sourcepub fn bind_addr_v4(self, addr: SocketAddrV4) -> Self
Sets the IPv4 bind address.
+Implementations§
Source§impl Builder
Sourcepub fn bind_addr_v4(self, addr: SocketAddrV4) -> Self
Sets the IPv4 bind address.
Setting the port to 0 will use a random port.
If the port specified is already in use, it will fallback to choosing a random port.
By default will use 0.0.0.0:0 to bind to.
-Sourcepub fn bind_addr_v6(self, addr: SocketAddrV6) -> Self
Sets the IPv6 bind address.
+Sourcepub fn bind_addr_v6(self, addr: SocketAddrV6) -> Self
Sets the IPv6 bind address.
Setting the port to 0 will use a random port.
If the port specified is already in use, it will fallback to choosing a random port.
By default will use [::]:0 to bind to.
-Sourcepub fn secret_key(self, secret_key: SecretKey) -> Self
Sets a secret key to authenticate with other peers.
+Sourcepub fn secret_key(self, secret_key: SecretKey) -> Self
Sourcepub fn alpns(self, alpn_protocols: Vec<Vec<u8>>) -> Self
Sets the ALPN protocols that this endpoint will accept on incoming connections.
+Sourcepub fn relay_mode(self, relay_mode: RelayMode) -> Self
Sets the relay servers to assist in establishing connectivity.
+Sourcepub fn relay_mode(self, relay_mode: RelayMode) -> Self
Sets the relay servers to assist in establishing connectivity.
Relay servers are used to establish initial connection with another iroh node.
They also perform various functions related to hole punching, see the crate docs
for more details.
@@ -26,15 +26,22 @@ for more details.
When using RelayMode::Custom, the provided relay_map must contain at least one
configured relay node. If an invalid RelayMap is provided bind
will result in an error.
-Sourcepub fn clear_discovery(self) -> Self
Removes all discovery services from the builder.
-Sourcepub fn discovery(self, discovery: Box<dyn Discovery>) -> Self
Optionally sets a discovery mechanism for this endpoint.
+Sourcepub fn relay_conn_protocol(self, protocol: Protocol) -> Self
Sets the protocol to use for relay connections.
+Options are either Protocol::Websocket or Protocol::Relay.
+Websocket will work with relays version 0.19 and above, so likely with any relays
+deployed at the time of writing this option (websocket support was released 9 months ago).
+Relay will work for now, but will likely be removed with the 1.0 release.
+Default is set to Relay at the moment, until we’ve thoroughly tested and improved
+websocket performance.
+Sourcepub fn clear_discovery(self) -> Self
Removes all discovery services from the builder.
+Sourcepub fn discovery(self, discovery: Box<dyn Discovery>) -> Self
Optionally sets a discovery mechanism for this endpoint.
If you want to combine multiple discovery services, you can use
Builder::add_discovery instead. This will internally create a
crate::discovery::ConcurrentDiscovery.
If no discovery service is set, connecting to a node without providing its
direct addresses or relay URLs will fail.
See the documentation of the Discovery trait for details.
-Sourcepub fn add_discovery<F, D>(self, discovery: F) -> Selfwhere
+
Sourcepub fn add_discovery<F, D>(self, discovery: F) -> Self
Adds a discovery mechanism for this endpoint.
The function discovery
@@ -47,7 +54,7 @@ to use this secret key to sign the information.
direct addresses or relay URLs will fail.
To clear all discovery services, use Builder::clear_discovery.
See the documentation of the Discovery trait for details.
-Sourcepub fn discovery_n0(self) -> Self
Configures the endpoint to use the default n0 DNS discovery service.
+Sourcepub fn discovery_n0(self) -> Self
Configures the endpoint to use the default n0 DNS discovery service.
The default discovery service publishes to and resolves from the
n0.computer dns server iroh.link.
This is equivalent to adding both a crate::discovery::pkarr::PkarrPublisher
@@ -56,29 +63,29 @@ n0.computer dns server.
This will by default use N0_DNS_PKARR_RELAY_PROD.
When in tests, or when the test-utils feature is enabled, this will use the
N0_DNS_PKARR_RELAY_STAGING.
-Sourcepub fn tls_x509(self) -> Self
Use libp2p based self signed certificates for TLS.
For details see the libp2p spec at https://github.com/libp2p/specs/blob/master/tls/tls.md
This is the only mechanism available in iroh@0.33.0 and earlier.
-Sourcepub fn tls_raw_public_keys(self) -> Self
Use TLS Raw Public Keys
+Sourcepub fn tls_raw_public_keys(self) -> Self
Use TLS Raw Public Keys
This is the default, but is not compatible with older versions of iroh.
-Sourcepub fn discovery_dht(self) -> Self
Available on crate feature discovery-pkarr-dht only.
Configures the endpoint to also use the mainline DHT with default settings.
+Sourcepub fn discovery_dht(self) -> Self
Available on crate feature discovery-pkarr-dht only.
Configures the endpoint to also use the mainline DHT with default settings.
This is equivalent to adding a crate::discovery::pkarr::dht::DhtDiscovery
with default settings. Note that DhtDiscovery has various more advanced
configuration options. If you need any of those, you should manually
create a DhtDiscovery and add it with Builder::add_discovery.
-Sourcepub fn discovery_local_network(self) -> Self
Available on crate feature discovery-local-network only.
Configures the endpoint to also use local network discovery.
+Sourcepub fn discovery_local_network(self) -> Self
Available on crate feature discovery-local-network only.
Configures the endpoint to also use local network discovery.
This is equivalent to adding a crate::discovery::mdns::MdnsDiscovery
with default settings. Note that MdnsDiscovery has various more advanced
configuration options. If you need any of those, you should manually
create a MdnsDiscovery and add it with Builder::add_discovery.
-Sourcepub fn user_data_for_discovery(self, user_data: UserData) -> Self
Sets the initial user-defined data to be published in discovery services for this node.
+Sourcepub fn user_data_for_discovery(self, user_data: UserData) -> Self
Sets the initial user-defined data to be published in discovery services for this node.
When using discovery services, this string of UserData will be published together
with the node’s addresses and relay URL. When other nodes discover this node,
they retrieve the UserData in addition to the addressing info.
Iroh itself does not interpret the user-defined data in any way, it is purely left
for applications to parse and use.
-Sourcepub fn known_nodes(self, nodes: Vec<NodeAddr>) -> Self
Optionally set a list of known nodes.
-Sourcepub fn transport_config(self, transport_config: TransportConfig) -> Self
Sets a custom quinn::TransportConfig for this endpoint.
+Sourcepub fn known_nodes(self, nodes: Vec<NodeAddr>) -> Self
Optionally set a list of known nodes.
+Sourcepub fn transport_config(self, transport_config: TransportConfig) -> Self
Sets a custom quinn::TransportConfig for this endpoint.
The transport config contains parameters governing the QUIC state machine.
If unset, the default config is used. Default values should be suitable for most
internet applications. Applications protocols which forbid remotely-initiated
@@ -86,31 +93,31 @@ streams should set max_concurrent_bidi_streams and max_concur
zero.
Please be aware that changing some settings may have adverse effects on establishing
and maintaining direct connections.
-Sourcepub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self
Available on non-wasm_browser only.
Optionally sets a custom DNS resolver to use for this endpoint.
+Sourcepub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self
Available on non-wasm_browser only.
Optionally sets a custom DNS resolver to use for this endpoint.
The DNS resolver is used to resolve relay hostnames, and node addresses if
crate::discovery::dns::DnsDiscovery is configured.
By default, a new DNS resolver is created which is configured to use the
host system’s DNS configuration. You can pass a custom instance of DnsResolver
here to use a differently configured DNS resolver for this endpoint, or to share
a DnsResolver between multiple endpoints.
-Sourcepub fn proxy_url(self, url: Url) -> Self
Sets an explicit proxy url to proxy all HTTP(S) traffic through.
-Sourcepub fn proxy_from_env(self) -> Self
Sets the proxy url from the environment, in this order:
+Sourcepub fn proxy_url(self, url: Url) -> Self
Sets an explicit proxy url to proxy all HTTP(S) traffic through.
+Sourcepub fn proxy_from_env(self) -> Self
Sets the proxy url from the environment, in this order:
HTTP_PROXY
http_proxy
HTTPS_PROXY
https_proxy
-Sourcepub fn keylog(self, keylog: bool) -> Self
Enables saving the TLS pre-master key for connections.
+Sourcepub fn keylog(self, keylog: bool) -> Self
Enables saving the TLS pre-master key for connections.
This key should normally remain secret but can be useful to debug networking issues
by decrypting captured traffic.
If keylog is true then setting the SSLKEYLOGFILE environment variable to a
filename will result in this file being used to log the TLS pre-master keys.
-Sourcepub fn insecure_skip_relay_cert_verify(self, skip_verify: bool) -> Self
Available on crate feature test-utils only.
Skip verification of SSL certificates from relay servers
+Sourcepub fn insecure_skip_relay_cert_verify(self, skip_verify: bool) -> Self
Available on crate feature test-utils only.
Skip verification of SSL certificates from relay servers
May only be used in tests.
-Sourcepub fn path_selection(self, path_selection: PathSelection) -> Self
Available on crate feature test-utils only.
This implies we only use the relay to communicate
+
Sourcepub fn path_selection(self, path_selection: PathSelection) -> Self
Available on crate feature test-utils only.
This implies we only use the relay to communicate
and do not attempt to do any hole punching.
-Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Builder
§impl !RefUnwindSafe for Builder
§impl Send for Builder
§impl Sync for Builder
§impl Unpin for Builder
§impl !UnwindSafe for Builder
Blanket Implementations§
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Builder
§impl !RefUnwindSafe for Builder
§impl Send for Builder
§impl Sync for Builder
§impl Unpin for Builder
§impl !UnwindSafe for Builder
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/3217/docs/iroh/endpoint/struct.ConnectOptions.html b/pr/3217/docs/iroh/endpoint/struct.ConnectOptions.html
index d82c67e528..4b2b9fa2d5 100644
--- a/pr/3217/docs/iroh/endpoint/struct.ConnectOptions.html
+++ b/pr/3217/docs/iroh/endpoint/struct.ConnectOptions.html
@@ -1,12 +1,12 @@
-ConnectOptions in iroh::endpoint - Rust pub struct ConnectOptions { /* private fields */ }
Expand description
Options for the Endpoint::connect_with_opts function.
-Implementations§
Source§impl ConnectOptions
Sourcepub fn new() -> Self
Initializes new connection options.
+ConnectOptions in iroh::endpoint - Rust pub struct ConnectOptions { /* private fields */ }
Expand description
Options for the Endpoint::connect_with_opts function.
+Implementations§
Source§impl ConnectOptions
Sourcepub fn new() -> Self
Initializes new connection options.
By default, the connection will use the same options
as Endpoint::connect, e.g. a default TransportConfig.
-Sourcepub fn with_transport_config(
+
Sourcepub fn with_transport_config(
self,
transport_config: Arc<TransportConfig>,
) -> Self
Sets the QUIC transport config options for this connection.
-Trait Implementations§
Source§impl Clone for ConnectOptions
Source§fn clone(&self) -> ConnectOptions
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 ConnectOptions
Source§impl Default for ConnectOptions
Source§fn default() -> ConnectOptions
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for ConnectOptions
§impl !RefUnwindSafe for ConnectOptions
§impl Send for ConnectOptions
§impl Sync for ConnectOptions
§impl Unpin for ConnectOptions
§impl !UnwindSafe for ConnectOptions
Blanket Implementations§
Trait Implementations§
Source§impl Clone for ConnectOptions
Source§fn clone(&self) -> ConnectOptions
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 ConnectOptions
Source§impl Default for ConnectOptions
Source§fn default() -> ConnectOptions
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for ConnectOptions
§impl !RefUnwindSafe for ConnectOptions
§impl Send for ConnectOptions
§impl Sync for ConnectOptions
§impl Unpin for ConnectOptions
§impl !UnwindSafe for ConnectOptions
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/3217/docs/iroh/endpoint/struct.Connecting.html b/pr/3217/docs/iroh/endpoint/struct.Connecting.html
index 41a03946a4..e190a84876 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Connecting.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Connecting.html
@@ -1,5 +1,5 @@
-Connecting in iroh::endpoint - Rust pub struct Connecting { /* private fields */ }
Expand description
In-progress connection attempt future
-Implementations§
Source§impl Connecting
Sourcepub fn into_0rtt(self) -> Result<(Connection, ZeroRttAccepted), Self>
Converts this Connecting into a 0-RTT or 0.5-RTT connection at the cost of weakened
+
Connecting in iroh::endpoint - Rust pub struct Connecting { /* private fields */ }
Expand description
In-progress connection attempt future
+Implementations§
Source§impl Connecting
Sourcepub fn into_0rtt(self) -> Result<(Connection, ZeroRttAccepted), Self>
Converts this Connecting into a 0-RTT or 0.5-RTT connection at the cost of weakened
security.
Returns Ok immediately if the local endpoint is able to attempt sending 0/0.5-RTT data.
If so, the returned Connection can be used to send application data without waiting for
@@ -33,10 +33,10 @@ before TLS client authentication has occurred, and should therefore not be used
data for which client authentication is being used.
You can use RecvStream::is_0rtt to check whether a stream has been opened in 0-RTT
and thus whether parts of the stream are operating under this reduced security level.
-Sourcepub async fn handshake_data(&mut self) -> Result<Box<dyn Any>, ConnectionError>
Parameters negotiated during the handshake
-Trait Implementations§
Source§impl Debug for Connecting
Source§impl Future for Connecting
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for Connectingwhere
+Sourcepub async fn handshake_data(&mut self) -> Result<Box<dyn Any>, ConnectionError>
Parameters negotiated during the handshake
+
Trait Implementations§
Source§impl Debug for Connecting
Source§impl Future for Connecting
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for Connectingwhere
PinnedFieldsOf<__Connecting<'pin>>: Unpin,
Auto Trait Implementations§
§impl Freeze for Connecting
§impl !RefUnwindSafe for Connecting
§impl Send for Connecting
§impl Sync for Connecting
§impl !UnwindSafe for Connecting
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/endpoint/struct.Connection.html b/pr/3217/docs/iroh/endpoint/struct.Connection.html
index 8e81609487..928cdb9918 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Connection.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Connection.html
@@ -1,4 +1,4 @@
-Connection in iroh::endpoint - Rust pub struct Connection { /* private fields */ }
Expand description
A QUIC connection.
+Connection in iroh::endpoint - Rust pub struct Connection { /* private fields */ }
Expand description
A QUIC connection.
If all references to a connection (including every clone of the Connection handle,
streams of incoming streams, and the various stream types) have been dropped, then the
connection will be automatically closed with an error_code of 0 and an empty reason. You
@@ -8,29 +8,29 @@ receiving CONNECTION_CLOSE the peer may drop any stream data not yet delivered t
application. Connection::close describes in more detail how to gracefully close a
connection without losing application data.
May be cloned to obtain another handle to the same connection.
-Implementations§
Source§impl Connection
Implementations§
Source§impl Connection
Sourcepub fn open_uni(&self) -> OpenUni<'_> ⓘ
Initiates a new outgoing unidirectional stream.
Streams are cheap and instantaneous to open unless blocked by flow control. As a
consequence, the peer won’t be notified that a stream has been opened until the
stream is actually used.
-Sourcepub fn open_bi(&self) -> OpenBi<'_> ⓘ
Initiates a new outgoing bidirectional stream.
Streams are cheap and instantaneous to open unless blocked by flow control. As a
consequence, the peer won’t be notified that a stream has been opened until the
stream is actually used. Calling open_bi then waiting on the RecvStream
without writing anything to SendStream will never succeed.
-Sourcepub fn accept_uni(&self) -> AcceptUni<'_> ⓘ
Accepts the next incoming uni-directional stream.
-Sourcepub fn accept_uni(&self) -> AcceptUni<'_> ⓘ
Accepts the next incoming uni-directional stream.
+Sourcepub fn accept_bi(&self) -> AcceptBi<'_> ⓘ
Accept the next incoming bidirectional stream.
Important Note: The peer that calls open_bi must write to its SendStream
before the peer Connection is able to accept the stream using
accept_bi(). Calling open_bi then waiting on the RecvStream without
writing anything to the connected SendStream will never succeed.
-Sourcepub fn read_datagram(&self) -> ReadDatagram<'_> ⓘ
Receives an application datagram.
-Sourcepub async fn closed(&self) -> ConnectionError
Wait for the connection to be closed for any reason.
+Sourcepub fn read_datagram(&self) -> ReadDatagram<'_> ⓘ
Receives an application datagram.
+Sourcepub async fn closed(&self) -> ConnectionError
Wait for the connection to be closed for any reason.
Despite the return type’s name, closed connections are often not an error condition
at the application layer. Cases that might be routine include
ConnectionError::LocallyClosed and ConnectionError::ApplicationClosed.
-Sourcepub fn close_reason(&self) -> Option<ConnectionError>
If the connection is closed, the reason why.
+Sourcepub fn close_reason(&self) -> Option<ConnectionError>
If the connection is closed, the reason why.
Returns None if the connection is still open.
-Sourcepub fn close(&self, error_code: VarInt, reason: &[u8])
Closes the connection immediately.
Pending operations will fail immediately with ConnectionError::LocallyClosed. No
more data is sent to the peer and the peer may drop buffered data upon receiving the
CONNECTION_CLOSE frame.
@@ -51,41 +51,41 @@ endpoint. Once the local side sends a CONNECTION_CLOSE frame in response to call
close the remote endpoint may drop any data it received but is as yet
undelivered to the application, including data that was acknowledged as received to
the local endpoint.
-Sourcepub fn send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError>
Transmits data as an unreliable, unordered application datagram.
+Sourcepub fn send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError>
Transmits data as an unreliable, unordered application datagram.
Application datagrams are a low-level primitive. They may be lost or delivered out
of order, and data must both fit inside a single QUIC packet and be smaller than
the maximum dictated by the peer.
-Sourcepub fn max_datagram_size(&self) -> Option<usize>
Computes the maximum size of datagrams that may be passed to send_datagram.
+Sourcepub fn max_datagram_size(&self) -> Option<usize>
Computes the maximum size of datagrams that may be passed to send_datagram.
Returns None if datagrams are unsupported by the peer or disabled locally.
This may change over the lifetime of a connection according to variation in the path
MTU estimate. The peer can also enforce an arbitrarily small fixed limit, but if the
peer’s limit is large this is guaranteed to be a little over a kilobyte at minimum.
Not necessarily the maximum size of received datagrams.
-Sourcepub fn datagram_send_buffer_space(&self) -> usize
Bytes available in the outgoing datagram buffer.
+Sourcepub fn datagram_send_buffer_space(&self) -> usize
Bytes available in the outgoing datagram buffer.
When greater than zero, calling send_datagram with a
datagram of at most this size is guaranteed not to cause older datagrams to be
dropped.
-Sourcepub fn rtt(&self) -> Duration
Current best estimate of this connection’s latency (round-trip-time).
-Sourcepub fn stats(&self) -> ConnectionStats
Returns connection statistics.
-Sourcepub fn congestion_state(&self) -> Box<dyn Controller>
Current state of the congestion control algorithm, for debugging purposes.
-Sourcepub fn handshake_data(&self) -> Option<Box<dyn Any>>
Parameters negotiated during the handshake.
+Sourcepub fn rtt(&self) -> Duration
Current best estimate of this connection’s latency (round-trip-time).
+Sourcepub fn stats(&self) -> ConnectionStats
Returns connection statistics.
+Sourcepub fn congestion_state(&self) -> Box<dyn Controller>
Current state of the congestion control algorithm, for debugging purposes.
+Sourcepub fn handshake_data(&self) -> Option<Box<dyn Any>>
Parameters negotiated during the handshake.
Guaranteed to return Some on fully established connections or after
Connecting::handshake_data() succeeds. See that method’s documentations for
details on the returned value.
-Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
-Sourcepub fn peer_identity(&self) -> Option<Box<dyn Any>>
Cryptographic identity of the peer.
+Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
+Sourcepub fn peer_identity(&self) -> Option<Box<dyn Any>>
Sourcepub fn remote_node_id(&self) -> Result<NodeId>
Returns the NodeId from the peer’s TLS certificate.
+Sourcepub fn remote_node_id(&self) -> Result<NodeId>
Sourcepub fn stable_id(&self) -> usize
A stable identifier for this connection.
Peer addresses and connection IDs can change, but this value will remain fixed for
the lifetime of the connection.
-Sourcepub fn export_keying_material(
+
Sourcepub fn export_keying_material(
&self,
output: &mut [u8],
label: &[u8],
@@ -96,14 +96,14 @@ arguments and output buffers of equal length, they will get the
same sequence of bytes in output. These bytes are cryptographically
strong and pseudorandom, and are suitable for use as keying material.
See RFC5705 for more information.
-
Sourcepub fn set_max_concurrent_uni_streams(&self, count: VarInt)
Modifies the number of unidirectional streams that may be concurrently opened.
+Sourcepub fn set_max_concurrent_uni_streams(&self, count: VarInt)
Modifies the number of unidirectional streams that may be concurrently opened.
No streams may be opened by the peer unless fewer than count are already
open. Large counts increase both minimum and worst-case memory consumption.
-Sourcepub fn set_receive_window(&self, receive_window: VarInt)
Sourcepub fn set_max_concurrent_bi_streams(&self, count: VarInt)
Modifies the number of bidirectional streams that may be concurrently opened.
+Sourcepub fn set_receive_window(&self, receive_window: VarInt)
Sourcepub fn set_max_concurrent_bi_streams(&self, count: VarInt)
Modifies the number of bidirectional streams that may be concurrently opened.
No streams may be opened by the peer unless fewer than count are already
open. Large counts increase both minimum and worst-case memory consumption.
-Trait Implementations§
Source§impl Clone for Connection
Source§fn clone(&self) -> Connection
Returns a copy of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreAuto Trait Implementations§
§impl Freeze for Connection
§impl RefUnwindSafe for Connection
§impl Send for Connection
§impl Sync for Connection
§impl Unpin for Connection
§impl UnwindSafe for Connection
Blanket Implementations§
Trait Implementations§
Source§impl Clone for Connection
Source§fn clone(&self) -> Connection
Returns a copy of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreAuto Trait Implementations§
§impl Freeze for Connection
§impl RefUnwindSafe for Connection
§impl Send for Connection
§impl Sync for Connection
§impl Unpin for Connection
§impl UnwindSafe for Connection
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/3217/docs/iroh/endpoint/struct.DirectAddr.html b/pr/3217/docs/iroh/endpoint/struct.DirectAddr.html
index 61a667e47d..04760c9021 100644
--- a/pr/3217/docs/iroh/endpoint/struct.DirectAddr.html
+++ b/pr/3217/docs/iroh/endpoint/struct.DirectAddr.html
@@ -1,4 +1,4 @@
-DirectAddr in iroh::endpoint - Rust pub struct DirectAddr {
+DirectAddr in iroh::endpoint - Rust pub struct DirectAddr {
pub addr: SocketAddr,
pub typ: DirectAddrType,
}
Expand description
A direct address on which an iroh-node might be contactable.
@@ -7,16 +7,16 @@ contacted. These can come from various sources depending on the network topolog
iroh node, see DirectAddrType for the several kinds of sources.
Fields§
§addr: SocketAddrThe address.
§typ: DirectAddrTypeThe origin of this direct address.
-Trait Implementations§
Source§impl Clone for DirectAddr
Source§fn clone(&self) -> DirectAddr
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 DirectAddr
Source§impl Hash for DirectAddr
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
+Trait Implementations§
Source§impl Clone for DirectAddr
Source§fn clone(&self) -> DirectAddr
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 DirectAddr
Source§impl Hash for DirectAddr
Source§impl Ord for DirectAddr
Source§impl Ord for DirectAddr
Source§fn cmp(&self, other: &DirectAddr) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read moreSource§impl PartialEq for DirectAddr
Source§impl PartialOrd for DirectAddr
Source§impl PartialEq for DirectAddr
Source§impl PartialOrd for DirectAddr
Source§impl Eq for DirectAddr
Source§impl StructuralPartialEq for DirectAddr
Auto Trait Implementations§
§impl Freeze for DirectAddr
§impl RefUnwindSafe for DirectAddr
§impl Send for DirectAddr
§impl Sync for DirectAddr
§impl Unpin for DirectAddr
§impl UnwindSafe for DirectAddr
Blanket Implementations§
Source§impl Eq for DirectAddr
Source§impl StructuralPartialEq for DirectAddr
Auto Trait Implementations§
§impl Freeze for DirectAddr
§impl RefUnwindSafe for DirectAddr
§impl Send for DirectAddr
§impl Sync for DirectAddr
§impl Unpin for DirectAddr
§impl UnwindSafe for DirectAddr
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/3217/docs/iroh/endpoint/struct.Endpoint.html b/pr/3217/docs/iroh/endpoint/struct.Endpoint.html
index e25e697700..0b8c9af7b3 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Endpoint.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Endpoint.html
@@ -1,4 +1,4 @@
-Endpoint in iroh::endpoint - Rust pub struct Endpoint { /* private fields */ }
Expand description
Controls an iroh node, establishing connections with other nodes.
+Endpoint in iroh::endpoint - Rust pub struct Endpoint { /* private fields */ }
Expand description
Controls an iroh node, establishing connections with other nodes.
This is the main API interface to create connections to, and accept connections from
other iroh nodes. The connections are peer-to-peer and encrypted, a Relay server is
used to make the connections reliable. See the [crate docs] for a more detailed
@@ -16,17 +16,17 @@ the peer are created using the Connection::open_uni and Connection::open_bi functions.
Note that due to the light-weight properties of streams a stream will only be accepted
once the initiating peer has sent some data on it.
-Implementations§
Source§impl Endpoint
Sourcepub fn builder() -> Builder
Returns the builder for an Endpoint, with a production configuration.
-Sourcepub fn set_alpns(&self, alpns: Vec<Vec<u8>>) -> Result<()>
Sets the list of accepted ALPN protocols.
+Implementations§
Source§impl Endpoint
Sourcepub fn builder() -> Builder
Returns the builder for an Endpoint, with a production configuration.
+Sourcepub async fn connect(
&self,
node_addr: impl Into<NodeAddr>,
alpn: &[u8],
) -> Result<Connection>
Connects to a remote Endpoint.
A value that can be converted into a NodeAddr is required. This can be either a
-NodeAddr, a NodeId or a iroh_base::ticket::NodeTicket.
+NodeAddr, a NodeId or a [iroh_base::ticket::NodeTicket].
The NodeAddr must contain the NodeId to dial and may also contain a RelayUrl
and direct addresses. If direct addresses are provided, they will be used to try and
establish a direct connection without involving a relay server.
@@ -41,7 +41,7 @@ connection attempt will fail with an error.
The alpn, or application-level protocol identifier, is also required. The remote
endpoint must support this alpn, otherwise the connection attempt will fail with
an error.
-Sourcepub async fn connect_with_opts(
+
Sourcepub async fn connect_with_opts(
&self,
node_addr: impl Into<NodeAddr>,
alpn: &[u8],
@@ -61,13 +61,13 @@ security concerns.
establishing and maintaining direct connections. Carefully test settings you use and
consider this currently as still rather experimental.
-
Sourcepub fn accept(&self) -> Accept<'_> ⓘ
Accepts an incoming connection on the endpoint.
Only connections with the ALPNs configured in Builder::alpns will be accepted.
If multiple ALPNs have been configured the ALPN can be inspected before accepting
the connection using Connecting::alpn.
The returned future will yield None if the endpoint is closed by calling
Endpoint::close.
-Sourcepub fn add_node_addr(&self, node_addr: NodeAddr) -> Result<()>
Informs this Endpoint about addresses of the iroh node.
+Sourcepub fn add_node_addr(&self, node_addr: NodeAddr) -> Result<()>
Informs this Endpoint about addresses of the iroh node.
This updates the local state for the remote node. If the provided NodeAddr
contains a RelayUrl this will be used as the new relay server for this node. If
it contains any new IP endpoints they will also be stored and tried when next
@@ -80,7 +80,7 @@ This provides more flexibility and future proofing.
§Errors
Will return an error if we attempt to add our own NodeId to the node map or
if the direct addresses are a subset of ours.
-Sourcepub fn add_node_addr_with_source(
+
Sourcepub fn secret_key(&self) -> &SecretKey
Returns the secret_key of this endpoint.
-Sourcepub fn secret_key(&self) -> &SecretKey
Returns the secret_key of this endpoint.
+Sourcepub fn node_id(&self) -> NodeId
Returns the node id of this endpoint.
This ID is the unique addressing information of this node and other peers must know
it to be able to connect to this node.
-Sourcepub async fn node_addr(&self) -> Result<NodeAddr>
Returns the current NodeAddr for this endpoint.
+Sourcepub async fn node_addr(&self) -> Result<NodeAddr>
Returns the current NodeAddr for this endpoint.
The returned NodeAddr will have the current RelayUrl and direct addresses
as they would be returned by Endpoint::home_relay and
Endpoint::direct_addresses.
In browsers, because direct addresses are unavailable, this will only wait for
the home relay to be available before returning.
-Sourcepub fn home_relay(&self) -> Watcher<Option<RelayUrl>>
Sourcepub fn home_relay(&self) -> Watcher<Option<RelayUrl>>
Returns a Watcher for the RelayUrl of the Relay server used as home relay.
Every endpoint has a home Relay server which it chooses as the server with the
lowest latency out of the configured servers provided by Builder::relay_mode.
This is the server other iroh nodes can use to reliably establish a connection
@@ -122,7 +122,7 @@ some time to connect to find and connect to the home relay server.
let mep = Endpoint::builder().bind().await.unwrap();
let _relay_url = mep.home_relay().initialized().await.unwrap();
-Sourcepub fn direct_addresses(&self) -> Watcher<Option<BTreeSet<DirectAddr>>>
Sourcepub fn direct_addresses(&self) -> Watcher<Option<BTreeSet<DirectAddr>>>
Returns a Watcher for the direct addresses of this Endpoint.
The direct addresses of the Endpoint are those that could be used by other
iroh nodes to establish direct connectivity, depending on the network
situation. The yielded lists of direct addresses contain both the locally-bound
@@ -145,10 +145,10 @@ recently discovered direct addresses.
let mep = Endpoint::builder().bind().await.unwrap();
let _addrs = mep.direct_addresses().initialized().await.unwrap();
-Sourcepub fn bound_sockets(&self) -> (SocketAddr, Option<SocketAddr>)
Available on non-wasm_browser only.
Returns the local socket addresses on which the underlying sockets are bound.
+Sourcepub fn bound_sockets(&self) -> (SocketAddr, Option<SocketAddr>)
Available on non-wasm_browser only.
Returns the local socket addresses on which the underlying sockets are bound.
The Endpoint always binds on an IPv4 address and also tries to bind on an IPv6
address if available.
-Sourcepub fn remote_info(&self, node_id: NodeId) -> Option<RemoteInfo>
Returns information about the remote node identified by a NodeId.
+Sourcepub fn remote_info(&self, node_id: NodeId) -> Option<RemoteInfo>
Returns information about the remote node identified by a NodeId.
The Endpoint keeps some information about remote iroh nodes, which it uses to find
the best path to a node. Having information on a remote node, however, does not mean we have
ever connected to it to or even whether a connection is even possible. The information about a
@@ -157,14 +157,14 @@ calls may return different information. Furthermore, node information may even b
completely evicted as it becomes stale.
See also Endpoint::remote_info_iter which returns information on all nodes known
by this Endpoint.
-Sourcepub fn remote_info_iter(&self) -> impl Iterator<Item = RemoteInfo>
Returns information about all the remote nodes this Endpoint knows about.
+Sourcepub fn remote_info_iter(&self) -> impl Iterator<Item = RemoteInfo>
Returns information about all the remote nodes this Endpoint knows about.
This returns the same information as Endpoint::remote_info for each node known to this
Endpoint.
The Endpoint keeps some information about remote iroh nodes, which it uses to find
the best path to a node. This returns all the nodes it knows about, regardless of whether a
connection was ever made or is even possible.
See also Endpoint::remote_info to only retrieve information about a single node.
-Sourcepub fn discovery_stream(
+
Sourcepub fn discovery_stream(
&self,
) -> impl Stream<Item = Result<DiscoveryItem, Lagged>>
Returns a stream of all remote nodes discovered through the endpoint’s discovery services.
Whenever a node is discovered via the endpoint’s discovery service, the corresponding
@@ -183,7 +183,7 @@ at the time of adding it to the static provider.
Lagged may be yielded, indicating that items were missed.
See also Endpoint::remote_info_iter, which returns an iterator over all remotes
the endpoint knows about at a specific point in time.
-Sourcepub fn conn_type(&self, node_id: NodeId) -> Result<Watcher<ConnectionType>>
Returns a Watcher that reports the current connection type and any changes for
+
Sourcepub fn conn_type(&self, node_id: NodeId) -> Result<Watcher<ConnectionType>>
Returns a Watcher that reports the current connection type and any changes for
given remote node.
This watcher allows observing a stream of ConnectionType items by calling
Watcher::stream(). If the underlying connection to a remote node changes, it will
@@ -202,11 +202,11 @@ recently connected to this node id but previous methods of reaching the node hav
become inaccessible.
§Errors
Will error if we do not have any address information for the given node_id.
-Sourcepub fn dns_resolver(&self) -> &DnsResolver
Available on non-wasm_browser only.
Returns the DNS resolver used in this Endpoint.
+Sourcepub fn dns_resolver(&self) -> &DnsResolver
Available on non-wasm_browser only.
Returns the DNS resolver used in this Endpoint.
-Sourcepub fn discovery(&self) -> Option<&dyn Discovery>
Returns the discovery mechanism, if configured.
+Sourcepub fn discovery(&self) -> Option<&dyn Discovery>
Returns the discovery mechanism, if configured.
See Builder::discovery.
-Sourcepub async fn network_change(&self)
Notifies the system of potential network changes.
+Sourcepub async fn network_change(&self)
Notifies the system of potential network changes.
On many systems iroh is able to detect network changes by itself, however
some systems like android do not expose this functionality to native code.
Android does however provide this functionality to Java code. This
@@ -214,12 +214,12 @@ function allows for notifying iroh of any potential network changes like
this.
Even when the network did not change, or iroh was already able to detect
the network change itself, there is no harm in calling this function.
-Sourcepub fn set_user_data_for_discovery(&self, user_data: Option<UserData>)
Sets the initial user-defined data to be published in discovery services for this node.
+Sourcepub fn set_user_data_for_discovery(&self, user_data: Option<UserData>)
Sets the initial user-defined data to be published in discovery services for this node.
If the user-defined data passed to this function is different to the previous one,
the endpoint will republish its node info to the configured discovery services.
See also Builder::user_data_for_discovery for setting an initial value when
building the endpoint.
-Sourcepub async fn close(&self)
Closes the QUIC endpoint and the magic socket.
This will close any remaining open Connections with an error code
of 0 and an empty reason. Though it is best practice to close those
explicitly before with a custom error code and reason.
@@ -245,8 +245,8 @@ while TCP sockets usually get closed and drained by the operating system in the
kernel during the “Time-Wait” period of the TCP socket.
Be aware however that the underlying UDP sockets are only closed once all clones of
the the respective Endpoint are dropped.
-Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Endpoint
§impl !RefUnwindSafe for Endpoint
§impl Send for Endpoint
§impl Sync for Endpoint
§impl Unpin for Endpoint
§impl !UnwindSafe for Endpoint
Blanket Implementations§
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Endpoint
§impl !RefUnwindSafe for Endpoint
§impl Send for Endpoint
§impl Sync for Endpoint
§impl Unpin for Endpoint
§impl !UnwindSafe for Endpoint
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/3217/docs/iroh/endpoint/struct.Incoming.html b/pr/3217/docs/iroh/endpoint/struct.Incoming.html
index 61f28360fa..6b71064a82 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Incoming.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Incoming.html
@@ -1,29 +1,29 @@
-Incoming in iroh::endpoint - Rust pub struct Incoming { /* private fields */ }
Expand description
An incoming connection for which the server has not yet begun its parts of the
+
Incoming in iroh::endpoint - Rust pub struct Incoming { /* private fields */ }
Expand description
An incoming connection for which the server has not yet begun its parts of the
handshake.
-Implementations§
Source§impl Incoming
Sourcepub fn accept(self) -> Result<Connecting, ConnectionError>
Attempts to accept this incoming connection (an error may still occur).
+Implementations§
Source§impl Incoming
Sourcepub fn accept(self) -> Result<Connecting, ConnectionError>
Attempts to accept this incoming connection (an error may still occur).
Errors occurring here are likely not caused by the application or remote. The QUIC
connection listens on a normal UDP socket and any reachable network endpoint can
send datagrams to it, solicited or not. Even if the first few bytes look like a
QUIC packet, it might not even be a QUIC packet that is being received.
Thus it is common to simply log the errors here and accept them as something which
can happen.
-Sourcepub fn accept_with(
+
Sourcepub fn accept_with(
self,
server_config: Arc<ServerConfig>,
) -> Result<Connecting, ConnectionError>
Accepts this incoming connection using a custom configuration.
See accept() for more details.
-Sourcepub fn retry(self) -> Result<(), RetryError>
Responds with a retry packet.
+Sourcepub fn retry(self) -> Result<(), RetryError>
Responds with a retry packet.
This requires the client to retry with address validation.
Errors if remote_address_validated() is true.
-Sourcepub fn ignore(self)
Ignores this incoming connection attempt, not sending any packet in response.
-Sourcepub fn local_ip(&self) -> Option<IpAddr>
Returns the local IP address which was used when the peer established the
+
Sourcepub fn ignore(self)
Ignores this incoming connection attempt, not sending any packet in response.
+Sourcepub fn local_ip(&self) -> Option<IpAddr>
Returns the local IP address which was used when the peer established the
connection.
-Sourcepub fn remote_address(&self) -> SocketAddr
Returns the peer’s UDP address.
-Sourcepub fn remote_address_validated(&self) -> bool
Whether the socket address that is initiating this connection has been validated.
+Sourcepub fn remote_address(&self) -> SocketAddr
Returns the peer’s UDP address.
+Sourcepub fn remote_address_validated(&self) -> bool
Whether the socket address that is initiating this connection has been validated.
This means that the sender of the initial packet has proved that they can receive
traffic sent to self.remote_address().
-Trait Implementations§
Source§impl IntoFuture for Incoming
Source§type Output = Result<Connection, ConnectionError>
The output that the future will produce on completion.Source§type IntoFuture = IncomingFuture
Which kind of future are we turning this into?Source§fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read moreAuto Trait Implementations§
§impl !Freeze for Incoming
§impl !RefUnwindSafe for Incoming
§impl Send for Incoming
§impl Sync for Incoming
§impl Unpin for Incoming
§impl !UnwindSafe for Incoming
Blanket Implementations§
Trait Implementations§
Source§impl IntoFuture for Incoming
Source§type Output = Result<Connection, ConnectionError>
The output that the future will produce on completion.Source§type IntoFuture = IncomingFuture
Which kind of future are we turning this into?Source§fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read moreAuto Trait Implementations§
§impl !Freeze for Incoming
§impl !RefUnwindSafe for Incoming
§impl Send for Incoming
§impl Sync for Incoming
§impl Unpin for Incoming
§impl !UnwindSafe for Incoming
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/3217/docs/iroh/endpoint/struct.IncomingFuture.html b/pr/3217/docs/iroh/endpoint/struct.IncomingFuture.html
index 504c012c78..3934a53120 100644
--- a/pr/3217/docs/iroh/endpoint/struct.IncomingFuture.html
+++ b/pr/3217/docs/iroh/endpoint/struct.IncomingFuture.html
@@ -1,6 +1,6 @@
-IncomingFuture in iroh::endpoint - Rust pub struct IncomingFuture { /* private fields */ }
Expand description
Adaptor to let Incoming be awaited like a Connecting.
-Trait Implementations§
Source§impl Debug for IncomingFuture
Source§impl Future for IncomingFuture
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for IncomingFuturewhere
+IncomingFuture in iroh::endpoint - Rust pub struct IncomingFuture { /* private fields */ }
Expand description
Adaptor to let Incoming be awaited like a Connecting.
+Trait Implementations§
Source§impl Debug for IncomingFuture
Source§impl Future for IncomingFuture
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for IncomingFuturewhere
PinnedFieldsOf<__IncomingFuture<'pin>>: Unpin,
Auto Trait Implementations§
§impl !Freeze for IncomingFuture
§impl !RefUnwindSafe for IncomingFuture
§impl Send for IncomingFuture
§impl Sync for IncomingFuture
§impl !UnwindSafe for IncomingFuture
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html b/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html
index 792290d8f5..d03f08d892 100644
--- a/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html
+++ b/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html
@@ -1,7 +1,7 @@
-ZeroRttAccepted in iroh::endpoint - Rust pub struct ZeroRttAccepted { /* private fields */ }
Expand description
Future that completes when a connection is fully established.
+ZeroRttAccepted in iroh::endpoint - Rust pub struct ZeroRttAccepted { /* private fields */ }
Expand description
Future that completes when a connection is fully established.
For clients, the resulting value indicates if 0-RTT was accepted. For servers, the resulting
value is meaningless.
-Trait Implementations§
Source§impl Debug for ZeroRttAccepted
Source§impl Future for ZeroRttAccepted
Source§fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>
Attempts to resolve the future to a final value, registering
+Trait Implementations§
Source§impl Debug for ZeroRttAccepted
Source§impl Future for ZeroRttAccepted
Auto Trait Implementations§
§impl Freeze for ZeroRttAccepted
§impl !RefUnwindSafe for ZeroRttAccepted
§impl Send for ZeroRttAccepted
§impl Sync for ZeroRttAccepted
§impl Unpin for ZeroRttAccepted
§impl !UnwindSafe for ZeroRttAccepted
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/enum.KeyParsingError.html b/pr/3217/docs/iroh/enum.KeyParsingError.html
index 55941cda04..c7925e588b 100644
--- a/pr/3217/docs/iroh/enum.KeyParsingError.html
+++ b/pr/3217/docs/iroh/enum.KeyParsingError.html
@@ -1,4 +1,4 @@
-KeyParsingError in iroh - Rust pub enum KeyParsingError {
+KeyParsingError in iroh - Rust Enum KeyParsingError
pub enum KeyParsingError {
Decode(DecodeError),
Key(Error),
DecodeInvalidLength,
@@ -6,7 +6,7 @@
Variants§
§Decode(DecodeError)
Error when decoding.
§Key(Error)
Error when decoding the public key.
§DecodeInvalidLength
The encoded information had the wrong length.
-Trait Implementations§
Source§impl Debug for KeyParsingError
Source§impl Display for KeyParsingError
Source§impl Error for KeyParsingError
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()Source§impl From<DecodeError> for KeyParsingError
Source§fn from(source: DecodeError) -> KeyParsingError
Converts to this type from the input type.Source§impl From<Error> for KeyParsingError
Source§fn from(source: Error) -> KeyParsingError
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for KeyParsingError
§impl !RefUnwindSafe for KeyParsingError
§impl Send for KeyParsingError
§impl Sync for KeyParsingError
§impl Unpin for KeyParsingError
§impl !UnwindSafe for KeyParsingError
Blanket Implementations§
Trait Implementations§
§impl Debug for KeyParsingError
§impl Display for KeyParsingError
§impl Error for KeyParsingError
§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()§impl From<DecodeError> for KeyParsingError
§fn from(source: DecodeError) -> KeyParsingError
Converts to this type from the input type.§impl From<Error> for KeyParsingError
§fn from(source: Error) -> KeyParsingError
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for KeyParsingError
§impl !RefUnwindSafe for KeyParsingError
§impl Send for KeyParsingError
§impl Sync for KeyParsingError
§impl Unpin for KeyParsingError
§impl !UnwindSafe for KeyParsingError
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/3217/docs/iroh/metrics/struct.RelayMetrics.html b/pr/3217/docs/iroh/metrics/struct.RelayMetrics.html
index 83ae1acdcc..6f22d04f93 100644
--- a/pr/3217/docs/iroh/metrics/struct.RelayMetrics.html
+++ b/pr/3217/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/3217/docs/iroh/node_info/constant.IROH_TXT_NAME.html b/pr/3217/docs/iroh/node_info/constant.IROH_TXT_NAME.html
index c78d056a1f..0c1e657fb3 100644
--- a/pr/3217/docs/iroh/node_info/constant.IROH_TXT_NAME.html
+++ b/pr/3217/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/3217/docs/iroh/node_info/index.html b/pr/3217/docs/iroh/node_info/index.html
index 9884414f78..5130358fc8 100644
--- a/pr/3217/docs/iroh/node_info/index.html
+++ b/pr/3217/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/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html b/pr/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html
index 2f1c9b7234..33cd3a33fc 100644
--- a/pr/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html
+++ b/pr/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html
@@ -1,5 +1,5 @@
-MaxLengthExceededError 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.
+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/3217/docs/iroh/discovery/struct.NodeInfo.html b/pr/3217/docs/iroh/discovery/struct.NodeInfo.html
index 021976d4db..991766d098 100644
--- a/pr/3217/docs/iroh/discovery/struct.NodeInfo.html
+++ b/pr/3217/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/3217/docs/iroh/discovery/struct.UserData.html b/pr/3217/docs/iroh/discovery/struct.UserData.html
index 134f039717..74cd45e3c7 100644
--- a/pr/3217/docs/iroh/discovery/struct.UserData.html
+++ b/pr/3217/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/3217/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_PROD.html b/pr/3217/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_PROD.html
index dd2f30450f..1e378e6be9 100644
--- a/pr/3217/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_PROD.html
+++ b/pr/3217/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/3217/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_STAGING.html b/pr/3217/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_STAGING.html
index fa61f0f616..00c49c891d 100644
--- a/pr/3217/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_STAGING.html
+++ b/pr/3217/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/3217/docs/iroh/dns/struct.DnsResolver.html b/pr/3217/docs/iroh/dns/struct.DnsResolver.html
index bb72543896..53843cda16 100644
--- a/pr/3217/docs/iroh/dns/struct.DnsResolver.html
+++ b/pr/3217/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/3217/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_PROD.html b/pr/3217/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_PROD.html
index dd2f30450f..1e378e6be9 100644
--- a/pr/3217/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_PROD.html
+++ b/pr/3217/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/3217/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_STAGING.html b/pr/3217/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_STAGING.html
index fa61f0f616..00c49c891d 100644
--- a/pr/3217/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_STAGING.html
+++ b/pr/3217/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/3217/docs/iroh/dns/struct.DnsResolver.html b/pr/3217/docs/iroh/dns/struct.DnsResolver.html
index bb72543896..53843cda16 100644
--- a/pr/3217/docs/iroh/dns/struct.DnsResolver.html
+++ b/pr/3217/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/3217/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html b/pr/3217/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html
index f03a92e8fc..ebd857988a 100644
--- a/pr/3217/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html
+++ b/pr/3217/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html
@@ -1,2 +1,2 @@
-ENV_FORCE_STAGING_RELAYS in iroh::endpoint - Rust pub const ENV_FORCE_STAGING_RELAYS: &str = "IROH_FORCE_STAGING_RELAYS";
Expand description
Environment variable to force the use of staging relays.
+ENV_FORCE_STAGING_RELAYS in iroh::endpoint - Rust
\ No newline at end of file
diff --git a/pr/3217/docs/iroh/endpoint/enum.DirectAddrType.html b/pr/3217/docs/iroh/endpoint/enum.DirectAddrType.html
index db8fd263b6..8d7040b73e 100644
--- a/pr/3217/docs/iroh/endpoint/enum.DirectAddrType.html
+++ b/pr/3217/docs/iroh/endpoint/enum.DirectAddrType.html
@@ -1,4 +1,4 @@
-DirectAddrType in iroh::endpoint - Rust pub enum DirectAddrType {
+DirectAddrType in iroh::endpoint - Rust pub enum DirectAddrType {
Unknown,
Local,
Stun,
@@ -20,16 +20,16 @@ get a publicly routable direct address.
It is possible to configure iroh to bound to a specific port and independently
configure the router to forward this port to the iroh node. This indicates a
situation like this, which still uses STUN to discover the public address.
-
Trait Implementations§
Source§impl Clone for DirectAddrType
Source§fn clone(&self) -> DirectAddrType
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 DirectAddrType
Source§impl Display for DirectAddrType
Source§impl Hash for DirectAddrType
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
+
Trait Implementations§
Source§impl Clone for DirectAddrType
Source§fn clone(&self) -> DirectAddrType
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 DirectAddrType
Source§impl Display for DirectAddrType
Source§impl Hash for DirectAddrType
Source§impl Ord for DirectAddrType
Source§impl Ord for DirectAddrType
Source§fn cmp(&self, other: &DirectAddrType) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read moreSource§impl PartialEq for DirectAddrType
Source§impl PartialOrd for DirectAddrType
Source§impl PartialEq for DirectAddrType
Source§impl PartialOrd for DirectAddrType
Source§impl Copy for DirectAddrType
Source§impl Eq for DirectAddrType
Source§impl StructuralPartialEq for DirectAddrType
Auto Trait Implementations§
§impl Freeze for DirectAddrType
§impl RefUnwindSafe for DirectAddrType
§impl Send for DirectAddrType
§impl Sync for DirectAddrType
§impl Unpin for DirectAddrType
§impl UnwindSafe for DirectAddrType
Blanket Implementations§
Source§impl Copy for DirectAddrType
Source§impl Eq for DirectAddrType
Source§impl StructuralPartialEq for DirectAddrType
Auto Trait Implementations§
§impl Freeze for DirectAddrType
§impl RefUnwindSafe for DirectAddrType
§impl Send for DirectAddrType
§impl Sync for DirectAddrType
§impl Unpin for DirectAddrType
§impl UnwindSafe for DirectAddrType
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/3217/docs/iroh/endpoint/enum.RelayMode.html b/pr/3217/docs/iroh/endpoint/enum.RelayMode.html
index b478f03249..ab87d54df6 100644
--- a/pr/3217/docs/iroh/endpoint/enum.RelayMode.html
+++ b/pr/3217/docs/iroh/endpoint/enum.RelayMode.html
@@ -1,4 +1,4 @@
-RelayMode in iroh::endpoint - Rust pub enum RelayMode {
+RelayMode in iroh::endpoint - Rust pub enum RelayMode {
Disabled,
Default,
Staging,
@@ -9,9 +9,9 @@
See crate::defaults::prod for the severs used.
§Staging
Use the staging relay servers from n0.
§Custom(RelayMap)
Use a custom relay map.
-
Implementations§
Trait Implementations§
Source§impl Eq for RelayMode
Source§impl StructuralPartialEq for RelayMode
Auto Trait Implementations§
§impl Freeze for RelayMode
§impl RefUnwindSafe for RelayMode
§impl Send for RelayMode
§impl Sync for RelayMode
§impl Unpin for RelayMode
§impl UnwindSafe for RelayMode
Blanket Implementations§
Implementations§
Trait Implementations§
Source§impl Eq for RelayMode
Source§impl StructuralPartialEq for RelayMode
Auto Trait Implementations§
§impl Freeze for RelayMode
§impl RefUnwindSafe for RelayMode
§impl Send for RelayMode
§impl Sync for RelayMode
§impl Unpin for RelayMode
§impl UnwindSafe for RelayMode
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/3217/docs/iroh/endpoint/fn.default_relay_mode.html b/pr/3217/docs/iroh/endpoint/fn.default_relay_mode.html
index 3206b983f7..bedd6fe18a 100644
--- a/pr/3217/docs/iroh/endpoint/fn.default_relay_mode.html
+++ b/pr/3217/docs/iroh/endpoint/fn.default_relay_mode.html
@@ -1,4 +1,4 @@
-default_relay_mode in iroh::endpoint - Rust pub fn default_relay_mode() -> RelayMode
Expand description
Returns the default relay mode.
+default_relay_mode in iroh::endpoint - Rust
\ No newline at end of file
diff --git a/pr/3217/docs/iroh/endpoint/fn.force_staging_infra.html b/pr/3217/docs/iroh/endpoint/fn.force_staging_infra.html
index 763aa33a74..eaaa3f19e2 100644
--- a/pr/3217/docs/iroh/endpoint/fn.force_staging_infra.html
+++ b/pr/3217/docs/iroh/endpoint/fn.force_staging_infra.html
@@ -1,2 +1,2 @@
-force_staging_infra in iroh::endpoint - Rust pub fn force_staging_infra() -> bool
Expand description
Returns true if the use of staging relays is forced.
+force_staging_infra in iroh::endpoint - Rust
\ No newline at end of file
diff --git a/pr/3217/docs/iroh/endpoint/index.html b/pr/3217/docs/iroh/endpoint/index.html
index 4deb68bd51..011ed71358 100644
--- a/pr/3217/docs/iroh/endpoint/index.html
+++ b/pr/3217/docs/iroh/endpoint/index.html
@@ -1,4 +1,4 @@
-iroh::endpoint - Rust Expand description
The Endpoint allows establishing connections to other iroh nodes.
+iroh::endpoint - Rust Expand description
The Endpoint allows establishing connections to other iroh nodes.
The Endpoint is the main API interface to manage a local iroh node. It allows
connecting to and accepting connections from other nodes. See the module docs for
more details on how iroh connections work.
diff --git a/pr/3217/docs/iroh/endpoint/struct.Accept.html b/pr/3217/docs/iroh/endpoint/struct.Accept.html
index 58bb4e71ea..74d685c091 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Accept.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Accept.html
@@ -1,6 +1,6 @@
-Accept in iroh::endpoint - Rust pub struct Accept<'a> { /* private fields */ }
Expand description
Future produced by Endpoint::accept.
-Trait Implementations§
Source§impl<'pin, 'a> Unpin for Accept<'a>where
+Accept in iroh::endpoint - Rust pub struct Accept<'a> { /* private fields */ }
Expand description
Future produced by Endpoint::accept.
+Trait Implementations§
Source§impl<'pin, 'a> Unpin for Accept<'a>where
PinnedFieldsOf<__Accept<'pin, 'a>>: Unpin,
Auto Trait Implementations§
§impl<'a> !Freeze for Accept<'a>
§impl<'a> !RefUnwindSafe for Accept<'a>
§impl<'a> Send for Accept<'a>
§impl<'a> Sync for Accept<'a>
§impl<'a> !UnwindSafe for Accept<'a>
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/endpoint/struct.Builder.html b/pr/3217/docs/iroh/endpoint/struct.Builder.html
index 6872da2482..46b31e019e 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Builder.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Builder.html
@@ -1,24 +1,24 @@
-Builder in iroh::endpoint - Rust pub struct Builder { /* private fields */ }
Expand description
Builder for Endpoint.
+Builder in iroh::endpoint - Rust pub struct Builder { /* private fields */ }
Expand description
Builder for Endpoint.
By default the endpoint will generate a new random SecretKey, which will result in a
new NodeId.
To create the Endpoint call Builder::bind.
-Implementations§
Source§impl Builder
Sourcepub fn bind_addr_v4(self, addr: SocketAddrV4) -> Self
Sets the IPv4 bind address.
+Implementations§
Source§impl Builder
Sourcepub fn bind_addr_v4(self, addr: SocketAddrV4) -> Self
Sets the IPv4 bind address.
Setting the port to 0 will use a random port.
If the port specified is already in use, it will fallback to choosing a random port.
By default will use 0.0.0.0:0 to bind to.
-Sourcepub fn bind_addr_v6(self, addr: SocketAddrV6) -> Self
Sets the IPv6 bind address.
+Sourcepub fn bind_addr_v6(self, addr: SocketAddrV6) -> Self
Sets the IPv6 bind address.
Setting the port to 0 will use a random port.
If the port specified is already in use, it will fallback to choosing a random port.
By default will use [::]:0 to bind to.
-Sourcepub fn secret_key(self, secret_key: SecretKey) -> Self
Sets a secret key to authenticate with other peers.
+Sourcepub fn secret_key(self, secret_key: SecretKey) -> Self
Sourcepub fn alpns(self, alpn_protocols: Vec<Vec<u8>>) -> Self
Sets the ALPN protocols that this endpoint will accept on incoming connections.
+Sourcepub fn relay_mode(self, relay_mode: RelayMode) -> Self
Sets the relay servers to assist in establishing connectivity.
+Sourcepub fn relay_mode(self, relay_mode: RelayMode) -> Self
Sets the relay servers to assist in establishing connectivity.
Relay servers are used to establish initial connection with another iroh node.
They also perform various functions related to hole punching, see the crate docs
for more details.
@@ -26,15 +26,22 @@ for more details.
When using RelayMode::Custom, the provided relay_map must contain at least one
configured relay node. If an invalid RelayMap is provided bind
will result in an error.
-Sourcepub fn clear_discovery(self) -> Self
Removes all discovery services from the builder.
-Sourcepub fn discovery(self, discovery: Box<dyn Discovery>) -> Self
Optionally sets a discovery mechanism for this endpoint.
+Sourcepub fn relay_conn_protocol(self, protocol: Protocol) -> Self
Sets the protocol to use for relay connections.
+Options are either Protocol::Websocket or Protocol::Relay.
+Websocket will work with relays version 0.19 and above, so likely with any relays
+deployed at the time of writing this option (websocket support was released 9 months ago).
+Relay will work for now, but will likely be removed with the 1.0 release.
+Default is set to Relay at the moment, until we’ve thoroughly tested and improved
+websocket performance.
+Sourcepub fn clear_discovery(self) -> Self
Removes all discovery services from the builder.
+Sourcepub fn discovery(self, discovery: Box<dyn Discovery>) -> Self
Optionally sets a discovery mechanism for this endpoint.
If you want to combine multiple discovery services, you can use
Builder::add_discovery instead. This will internally create a
crate::discovery::ConcurrentDiscovery.
If no discovery service is set, connecting to a node without providing its
direct addresses or relay URLs will fail.
See the documentation of the Discovery trait for details.
-Sourcepub fn add_discovery<F, D>(self, discovery: F) -> Selfwhere
+
Sourcepub fn add_discovery<F, D>(self, discovery: F) -> Self
Adds a discovery mechanism for this endpoint.
The function discovery
@@ -47,7 +54,7 @@ to use this secret key to sign the information.
direct addresses or relay URLs will fail.
To clear all discovery services, use Builder::clear_discovery.
See the documentation of the Discovery trait for details.
-Sourcepub fn discovery_n0(self) -> Self
Configures the endpoint to use the default n0 DNS discovery service.
+Sourcepub fn discovery_n0(self) -> Self
Configures the endpoint to use the default n0 DNS discovery service.
The default discovery service publishes to and resolves from the
n0.computer dns server iroh.link.
This is equivalent to adding both a crate::discovery::pkarr::PkarrPublisher
@@ -56,29 +63,29 @@ n0.computer dns server.
This will by default use N0_DNS_PKARR_RELAY_PROD.
When in tests, or when the test-utils feature is enabled, this will use the
N0_DNS_PKARR_RELAY_STAGING.
-Sourcepub fn tls_x509(self) -> Self
Use libp2p based self signed certificates for TLS.
For details see the libp2p spec at https://github.com/libp2p/specs/blob/master/tls/tls.md
This is the only mechanism available in iroh@0.33.0 and earlier.
-Sourcepub fn tls_raw_public_keys(self) -> Self
Use TLS Raw Public Keys
+Sourcepub fn tls_raw_public_keys(self) -> Self
Use TLS Raw Public Keys
This is the default, but is not compatible with older versions of iroh.
-Sourcepub fn discovery_dht(self) -> Self
Available on crate feature discovery-pkarr-dht only.
Configures the endpoint to also use the mainline DHT with default settings.
+Sourcepub fn discovery_dht(self) -> Self
Available on crate feature discovery-pkarr-dht only.
Configures the endpoint to also use the mainline DHT with default settings.
This is equivalent to adding a crate::discovery::pkarr::dht::DhtDiscovery
with default settings. Note that DhtDiscovery has various more advanced
configuration options. If you need any of those, you should manually
create a DhtDiscovery and add it with Builder::add_discovery.
-Sourcepub fn discovery_local_network(self) -> Self
Available on crate feature discovery-local-network only.
Configures the endpoint to also use local network discovery.
+Sourcepub fn discovery_local_network(self) -> Self
Available on crate feature discovery-local-network only.
Configures the endpoint to also use local network discovery.
This is equivalent to adding a crate::discovery::mdns::MdnsDiscovery
with default settings. Note that MdnsDiscovery has various more advanced
configuration options. If you need any of those, you should manually
create a MdnsDiscovery and add it with Builder::add_discovery.
-Sourcepub fn user_data_for_discovery(self, user_data: UserData) -> Self
Sets the initial user-defined data to be published in discovery services for this node.
+Sourcepub fn user_data_for_discovery(self, user_data: UserData) -> Self
Sets the initial user-defined data to be published in discovery services for this node.
When using discovery services, this string of UserData will be published together
with the node’s addresses and relay URL. When other nodes discover this node,
they retrieve the UserData in addition to the addressing info.
Iroh itself does not interpret the user-defined data in any way, it is purely left
for applications to parse and use.
-Sourcepub fn known_nodes(self, nodes: Vec<NodeAddr>) -> Self
Optionally set a list of known nodes.
-Sourcepub fn transport_config(self, transport_config: TransportConfig) -> Self
Sets a custom quinn::TransportConfig for this endpoint.
+Sourcepub fn known_nodes(self, nodes: Vec<NodeAddr>) -> Self
Optionally set a list of known nodes.
+Sourcepub fn transport_config(self, transport_config: TransportConfig) -> Self
Sets a custom quinn::TransportConfig for this endpoint.
The transport config contains parameters governing the QUIC state machine.
If unset, the default config is used. Default values should be suitable for most
internet applications. Applications protocols which forbid remotely-initiated
@@ -86,31 +93,31 @@ streams should set max_concurrent_bidi_streams and max_concur
zero.
Please be aware that changing some settings may have adverse effects on establishing
and maintaining direct connections.
-Sourcepub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self
Available on non-wasm_browser only.
Optionally sets a custom DNS resolver to use for this endpoint.
+Sourcepub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self
Available on non-wasm_browser only.
Optionally sets a custom DNS resolver to use for this endpoint.
The DNS resolver is used to resolve relay hostnames, and node addresses if
crate::discovery::dns::DnsDiscovery is configured.
By default, a new DNS resolver is created which is configured to use the
host system’s DNS configuration. You can pass a custom instance of DnsResolver
here to use a differently configured DNS resolver for this endpoint, or to share
a DnsResolver between multiple endpoints.
-Sourcepub fn proxy_url(self, url: Url) -> Self
Sets an explicit proxy url to proxy all HTTP(S) traffic through.
-Sourcepub fn proxy_from_env(self) -> Self
Sets the proxy url from the environment, in this order:
+Sourcepub fn proxy_url(self, url: Url) -> Self
Sets an explicit proxy url to proxy all HTTP(S) traffic through.
+Sourcepub fn proxy_from_env(self) -> Self
Sets the proxy url from the environment, in this order:
HTTP_PROXY
http_proxy
HTTPS_PROXY
https_proxy
-Sourcepub fn keylog(self, keylog: bool) -> Self
Enables saving the TLS pre-master key for connections.
+Sourcepub fn keylog(self, keylog: bool) -> Self
Enables saving the TLS pre-master key for connections.
This key should normally remain secret but can be useful to debug networking issues
by decrypting captured traffic.
If keylog is true then setting the SSLKEYLOGFILE environment variable to a
filename will result in this file being used to log the TLS pre-master keys.
-Sourcepub fn insecure_skip_relay_cert_verify(self, skip_verify: bool) -> Self
Available on crate feature test-utils only.
Skip verification of SSL certificates from relay servers
+Sourcepub fn insecure_skip_relay_cert_verify(self, skip_verify: bool) -> Self
Available on crate feature test-utils only.
Skip verification of SSL certificates from relay servers
May only be used in tests.
-Sourcepub fn path_selection(self, path_selection: PathSelection) -> Self
Available on crate feature test-utils only.
This implies we only use the relay to communicate
+
Sourcepub fn path_selection(self, path_selection: PathSelection) -> Self
Available on crate feature test-utils only.
This implies we only use the relay to communicate
and do not attempt to do any hole punching.
-Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Builder
§impl !RefUnwindSafe for Builder
§impl Send for Builder
§impl Sync for Builder
§impl Unpin for Builder
§impl !UnwindSafe for Builder
Blanket Implementations§
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Builder
§impl !RefUnwindSafe for Builder
§impl Send for Builder
§impl Sync for Builder
§impl Unpin for Builder
§impl !UnwindSafe for Builder
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/3217/docs/iroh/endpoint/struct.ConnectOptions.html b/pr/3217/docs/iroh/endpoint/struct.ConnectOptions.html
index d82c67e528..4b2b9fa2d5 100644
--- a/pr/3217/docs/iroh/endpoint/struct.ConnectOptions.html
+++ b/pr/3217/docs/iroh/endpoint/struct.ConnectOptions.html
@@ -1,12 +1,12 @@
-ConnectOptions in iroh::endpoint - Rust pub struct ConnectOptions { /* private fields */ }
Expand description
Options for the Endpoint::connect_with_opts function.
-Implementations§
Source§impl ConnectOptions
Sourcepub fn new() -> Self
Initializes new connection options.
+ConnectOptions in iroh::endpoint - Rust pub struct ConnectOptions { /* private fields */ }
Expand description
Options for the Endpoint::connect_with_opts function.
+Implementations§
Source§impl ConnectOptions
Sourcepub fn new() -> Self
Initializes new connection options.
By default, the connection will use the same options
as Endpoint::connect, e.g. a default TransportConfig.
-Sourcepub fn with_transport_config(
+
Sourcepub fn with_transport_config(
self,
transport_config: Arc<TransportConfig>,
) -> Self
Sets the QUIC transport config options for this connection.
-Trait Implementations§
Source§impl Clone for ConnectOptions
Source§fn clone(&self) -> ConnectOptions
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 ConnectOptions
Source§impl Default for ConnectOptions
Source§fn default() -> ConnectOptions
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for ConnectOptions
§impl !RefUnwindSafe for ConnectOptions
§impl Send for ConnectOptions
§impl Sync for ConnectOptions
§impl Unpin for ConnectOptions
§impl !UnwindSafe for ConnectOptions
Blanket Implementations§
Trait Implementations§
Source§impl Clone for ConnectOptions
Source§fn clone(&self) -> ConnectOptions
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 ConnectOptions
Source§impl Default for ConnectOptions
Source§fn default() -> ConnectOptions
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for ConnectOptions
§impl !RefUnwindSafe for ConnectOptions
§impl Send for ConnectOptions
§impl Sync for ConnectOptions
§impl Unpin for ConnectOptions
§impl !UnwindSafe for ConnectOptions
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/3217/docs/iroh/endpoint/struct.Connecting.html b/pr/3217/docs/iroh/endpoint/struct.Connecting.html
index 41a03946a4..e190a84876 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Connecting.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Connecting.html
@@ -1,5 +1,5 @@
-Connecting in iroh::endpoint - Rust pub struct Connecting { /* private fields */ }
Expand description
In-progress connection attempt future
-Implementations§
Source§impl Connecting
Sourcepub fn into_0rtt(self) -> Result<(Connection, ZeroRttAccepted), Self>
Converts this Connecting into a 0-RTT or 0.5-RTT connection at the cost of weakened
+
Connecting in iroh::endpoint - Rust pub struct Connecting { /* private fields */ }
Expand description
In-progress connection attempt future
+Implementations§
Source§impl Connecting
Sourcepub fn into_0rtt(self) -> Result<(Connection, ZeroRttAccepted), Self>
Converts this Connecting into a 0-RTT or 0.5-RTT connection at the cost of weakened
security.
Returns Ok immediately if the local endpoint is able to attempt sending 0/0.5-RTT data.
If so, the returned Connection can be used to send application data without waiting for
@@ -33,10 +33,10 @@ before TLS client authentication has occurred, and should therefore not be used
data for which client authentication is being used.
You can use RecvStream::is_0rtt to check whether a stream has been opened in 0-RTT
and thus whether parts of the stream are operating under this reduced security level.
-Sourcepub async fn handshake_data(&mut self) -> Result<Box<dyn Any>, ConnectionError>
Parameters negotiated during the handshake
-Trait Implementations§
Source§impl Debug for Connecting
Source§impl Future for Connecting
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for Connectingwhere
+Sourcepub async fn handshake_data(&mut self) -> Result<Box<dyn Any>, ConnectionError>
Parameters negotiated during the handshake
+
Trait Implementations§
Source§impl Debug for Connecting
Source§impl Future for Connecting
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for Connectingwhere
PinnedFieldsOf<__Connecting<'pin>>: Unpin,
Auto Trait Implementations§
§impl Freeze for Connecting
§impl !RefUnwindSafe for Connecting
§impl Send for Connecting
§impl Sync for Connecting
§impl !UnwindSafe for Connecting
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/endpoint/struct.Connection.html b/pr/3217/docs/iroh/endpoint/struct.Connection.html
index 8e81609487..928cdb9918 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Connection.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Connection.html
@@ -1,4 +1,4 @@
-Connection in iroh::endpoint - Rust pub struct Connection { /* private fields */ }
Expand description
A QUIC connection.
+Connection in iroh::endpoint - Rust pub struct Connection { /* private fields */ }
Expand description
A QUIC connection.
If all references to a connection (including every clone of the Connection handle,
streams of incoming streams, and the various stream types) have been dropped, then the
connection will be automatically closed with an error_code of 0 and an empty reason. You
@@ -8,29 +8,29 @@ receiving CONNECTION_CLOSE the peer may drop any stream data not yet delivered t
application. Connection::close describes in more detail how to gracefully close a
connection without losing application data.
May be cloned to obtain another handle to the same connection.
-Implementations§
Source§impl Connection
Implementations§
Source§impl Connection
Sourcepub fn open_uni(&self) -> OpenUni<'_> ⓘ
Initiates a new outgoing unidirectional stream.
Streams are cheap and instantaneous to open unless blocked by flow control. As a
consequence, the peer won’t be notified that a stream has been opened until the
stream is actually used.
-Sourcepub fn open_bi(&self) -> OpenBi<'_> ⓘ
Initiates a new outgoing bidirectional stream.
Streams are cheap and instantaneous to open unless blocked by flow control. As a
consequence, the peer won’t be notified that a stream has been opened until the
stream is actually used. Calling open_bi then waiting on the RecvStream
without writing anything to SendStream will never succeed.
-Sourcepub fn accept_uni(&self) -> AcceptUni<'_> ⓘ
Accepts the next incoming uni-directional stream.
-Sourcepub fn accept_uni(&self) -> AcceptUni<'_> ⓘ
Accepts the next incoming uni-directional stream.
+Sourcepub fn accept_bi(&self) -> AcceptBi<'_> ⓘ
Accept the next incoming bidirectional stream.
Important Note: The peer that calls open_bi must write to its SendStream
before the peer Connection is able to accept the stream using
accept_bi(). Calling open_bi then waiting on the RecvStream without
writing anything to the connected SendStream will never succeed.
-Sourcepub fn read_datagram(&self) -> ReadDatagram<'_> ⓘ
Receives an application datagram.
-Sourcepub async fn closed(&self) -> ConnectionError
Wait for the connection to be closed for any reason.
+Sourcepub fn read_datagram(&self) -> ReadDatagram<'_> ⓘ
Receives an application datagram.
+Sourcepub async fn closed(&self) -> ConnectionError
Wait for the connection to be closed for any reason.
Despite the return type’s name, closed connections are often not an error condition
at the application layer. Cases that might be routine include
ConnectionError::LocallyClosed and ConnectionError::ApplicationClosed.
-Sourcepub fn close_reason(&self) -> Option<ConnectionError>
If the connection is closed, the reason why.
+Sourcepub fn close_reason(&self) -> Option<ConnectionError>
If the connection is closed, the reason why.
Returns None if the connection is still open.
-Sourcepub fn close(&self, error_code: VarInt, reason: &[u8])
Closes the connection immediately.
Pending operations will fail immediately with ConnectionError::LocallyClosed. No
more data is sent to the peer and the peer may drop buffered data upon receiving the
CONNECTION_CLOSE frame.
@@ -51,41 +51,41 @@ endpoint. Once the local side sends a CONNECTION_CLOSE frame in response to call
close the remote endpoint may drop any data it received but is as yet
undelivered to the application, including data that was acknowledged as received to
the local endpoint.
-Sourcepub fn send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError>
Transmits data as an unreliable, unordered application datagram.
+Sourcepub fn send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError>
Transmits data as an unreliable, unordered application datagram.
Application datagrams are a low-level primitive. They may be lost or delivered out
of order, and data must both fit inside a single QUIC packet and be smaller than
the maximum dictated by the peer.
-Sourcepub fn max_datagram_size(&self) -> Option<usize>
Computes the maximum size of datagrams that may be passed to send_datagram.
+Sourcepub fn max_datagram_size(&self) -> Option<usize>
Computes the maximum size of datagrams that may be passed to send_datagram.
Returns None if datagrams are unsupported by the peer or disabled locally.
This may change over the lifetime of a connection according to variation in the path
MTU estimate. The peer can also enforce an arbitrarily small fixed limit, but if the
peer’s limit is large this is guaranteed to be a little over a kilobyte at minimum.
Not necessarily the maximum size of received datagrams.
-Sourcepub fn datagram_send_buffer_space(&self) -> usize
Bytes available in the outgoing datagram buffer.
+Sourcepub fn datagram_send_buffer_space(&self) -> usize
Bytes available in the outgoing datagram buffer.
When greater than zero, calling send_datagram with a
datagram of at most this size is guaranteed not to cause older datagrams to be
dropped.
-Sourcepub fn rtt(&self) -> Duration
Current best estimate of this connection’s latency (round-trip-time).
-Sourcepub fn stats(&self) -> ConnectionStats
Returns connection statistics.
-Sourcepub fn congestion_state(&self) -> Box<dyn Controller>
Current state of the congestion control algorithm, for debugging purposes.
-Sourcepub fn handshake_data(&self) -> Option<Box<dyn Any>>
Parameters negotiated during the handshake.
+Sourcepub fn rtt(&self) -> Duration
Current best estimate of this connection’s latency (round-trip-time).
+Sourcepub fn stats(&self) -> ConnectionStats
Returns connection statistics.
+Sourcepub fn congestion_state(&self) -> Box<dyn Controller>
Current state of the congestion control algorithm, for debugging purposes.
+Sourcepub fn handshake_data(&self) -> Option<Box<dyn Any>>
Parameters negotiated during the handshake.
Guaranteed to return Some on fully established connections or after
Connecting::handshake_data() succeeds. See that method’s documentations for
details on the returned value.
-Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
-Sourcepub fn peer_identity(&self) -> Option<Box<dyn Any>>
Cryptographic identity of the peer.
+Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
+Sourcepub fn peer_identity(&self) -> Option<Box<dyn Any>>
Sourcepub fn remote_node_id(&self) -> Result<NodeId>
Returns the NodeId from the peer’s TLS certificate.
+Sourcepub fn remote_node_id(&self) -> Result<NodeId>
Sourcepub fn stable_id(&self) -> usize
A stable identifier for this connection.
Peer addresses and connection IDs can change, but this value will remain fixed for
the lifetime of the connection.
-Sourcepub fn export_keying_material(
+
Sourcepub fn export_keying_material(
&self,
output: &mut [u8],
label: &[u8],
@@ -96,14 +96,14 @@ arguments and output buffers of equal length, they will get the
same sequence of bytes in output. These bytes are cryptographically
strong and pseudorandom, and are suitable for use as keying material.
See RFC5705 for more information.
-
Sourcepub fn set_max_concurrent_uni_streams(&self, count: VarInt)
Modifies the number of unidirectional streams that may be concurrently opened.
+Sourcepub fn set_max_concurrent_uni_streams(&self, count: VarInt)
Modifies the number of unidirectional streams that may be concurrently opened.
No streams may be opened by the peer unless fewer than count are already
open. Large counts increase both minimum and worst-case memory consumption.
-Sourcepub fn set_receive_window(&self, receive_window: VarInt)
Sourcepub fn set_max_concurrent_bi_streams(&self, count: VarInt)
Modifies the number of bidirectional streams that may be concurrently opened.
+Sourcepub fn set_receive_window(&self, receive_window: VarInt)
Sourcepub fn set_max_concurrent_bi_streams(&self, count: VarInt)
Modifies the number of bidirectional streams that may be concurrently opened.
No streams may be opened by the peer unless fewer than count are already
open. Large counts increase both minimum and worst-case memory consumption.
-Trait Implementations§
Source§impl Clone for Connection
Source§fn clone(&self) -> Connection
Returns a copy of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreAuto Trait Implementations§
§impl Freeze for Connection
§impl RefUnwindSafe for Connection
§impl Send for Connection
§impl Sync for Connection
§impl Unpin for Connection
§impl UnwindSafe for Connection
Blanket Implementations§
Trait Implementations§
Source§impl Clone for Connection
Source§fn clone(&self) -> Connection
Returns a copy of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreAuto Trait Implementations§
§impl Freeze for Connection
§impl RefUnwindSafe for Connection
§impl Send for Connection
§impl Sync for Connection
§impl Unpin for Connection
§impl UnwindSafe for Connection
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/3217/docs/iroh/endpoint/struct.DirectAddr.html b/pr/3217/docs/iroh/endpoint/struct.DirectAddr.html
index 61a667e47d..04760c9021 100644
--- a/pr/3217/docs/iroh/endpoint/struct.DirectAddr.html
+++ b/pr/3217/docs/iroh/endpoint/struct.DirectAddr.html
@@ -1,4 +1,4 @@
-DirectAddr in iroh::endpoint - Rust pub struct DirectAddr {
+DirectAddr in iroh::endpoint - Rust pub struct DirectAddr {
pub addr: SocketAddr,
pub typ: DirectAddrType,
}
Expand description
A direct address on which an iroh-node might be contactable.
@@ -7,16 +7,16 @@ contacted. These can come from various sources depending on the network topolog
iroh node, see DirectAddrType for the several kinds of sources.
Fields§
§addr: SocketAddrThe address.
§typ: DirectAddrTypeThe origin of this direct address.
-Trait Implementations§
Source§impl Clone for DirectAddr
Source§fn clone(&self) -> DirectAddr
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 DirectAddr
Source§impl Hash for DirectAddr
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
+Trait Implementations§
Source§impl Clone for DirectAddr
Source§fn clone(&self) -> DirectAddr
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 DirectAddr
Source§impl Hash for DirectAddr
Source§impl Ord for DirectAddr
Source§impl Ord for DirectAddr
Source§fn cmp(&self, other: &DirectAddr) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read moreSource§impl PartialEq for DirectAddr
Source§impl PartialOrd for DirectAddr
Source§impl PartialEq for DirectAddr
Source§impl PartialOrd for DirectAddr
Source§impl Eq for DirectAddr
Source§impl StructuralPartialEq for DirectAddr
Auto Trait Implementations§
§impl Freeze for DirectAddr
§impl RefUnwindSafe for DirectAddr
§impl Send for DirectAddr
§impl Sync for DirectAddr
§impl Unpin for DirectAddr
§impl UnwindSafe for DirectAddr
Blanket Implementations§
Source§impl Eq for DirectAddr
Source§impl StructuralPartialEq for DirectAddr
Auto Trait Implementations§
§impl Freeze for DirectAddr
§impl RefUnwindSafe for DirectAddr
§impl Send for DirectAddr
§impl Sync for DirectAddr
§impl Unpin for DirectAddr
§impl UnwindSafe for DirectAddr
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/3217/docs/iroh/endpoint/struct.Endpoint.html b/pr/3217/docs/iroh/endpoint/struct.Endpoint.html
index e25e697700..0b8c9af7b3 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Endpoint.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Endpoint.html
@@ -1,4 +1,4 @@
-Endpoint in iroh::endpoint - Rust pub struct Endpoint { /* private fields */ }
Expand description
Controls an iroh node, establishing connections with other nodes.
+Endpoint in iroh::endpoint - Rust pub struct Endpoint { /* private fields */ }
Expand description
Controls an iroh node, establishing connections with other nodes.
This is the main API interface to create connections to, and accept connections from
other iroh nodes. The connections are peer-to-peer and encrypted, a Relay server is
used to make the connections reliable. See the [crate docs] for a more detailed
@@ -16,17 +16,17 @@ the peer are created using the Connection::open_uni and Connection::open_bi functions.
Note that due to the light-weight properties of streams a stream will only be accepted
once the initiating peer has sent some data on it.
-Implementations§
Source§impl Endpoint
Sourcepub fn builder() -> Builder
Returns the builder for an Endpoint, with a production configuration.
-Sourcepub fn set_alpns(&self, alpns: Vec<Vec<u8>>) -> Result<()>
Sets the list of accepted ALPN protocols.
+Implementations§
Source§impl Endpoint
Sourcepub fn builder() -> Builder
Returns the builder for an Endpoint, with a production configuration.
+Sourcepub async fn connect(
&self,
node_addr: impl Into<NodeAddr>,
alpn: &[u8],
) -> Result<Connection>
Connects to a remote Endpoint.
A value that can be converted into a NodeAddr is required. This can be either a
-NodeAddr, a NodeId or a iroh_base::ticket::NodeTicket.
+NodeAddr, a NodeId or a [iroh_base::ticket::NodeTicket].
The NodeAddr must contain the NodeId to dial and may also contain a RelayUrl
and direct addresses. If direct addresses are provided, they will be used to try and
establish a direct connection without involving a relay server.
@@ -41,7 +41,7 @@ connection attempt will fail with an error.
The alpn, or application-level protocol identifier, is also required. The remote
endpoint must support this alpn, otherwise the connection attempt will fail with
an error.
-Sourcepub async fn connect_with_opts(
+
Sourcepub async fn connect_with_opts(
&self,
node_addr: impl Into<NodeAddr>,
alpn: &[u8],
@@ -61,13 +61,13 @@ security concerns.
establishing and maintaining direct connections. Carefully test settings you use and
consider this currently as still rather experimental.
-
Sourcepub fn accept(&self) -> Accept<'_> ⓘ
Accepts an incoming connection on the endpoint.
Only connections with the ALPNs configured in Builder::alpns will be accepted.
If multiple ALPNs have been configured the ALPN can be inspected before accepting
the connection using Connecting::alpn.
The returned future will yield None if the endpoint is closed by calling
Endpoint::close.
-Sourcepub fn add_node_addr(&self, node_addr: NodeAddr) -> Result<()>
Informs this Endpoint about addresses of the iroh node.
+Sourcepub fn add_node_addr(&self, node_addr: NodeAddr) -> Result<()>
Informs this Endpoint about addresses of the iroh node.
This updates the local state for the remote node. If the provided NodeAddr
contains a RelayUrl this will be used as the new relay server for this node. If
it contains any new IP endpoints they will also be stored and tried when next
@@ -80,7 +80,7 @@ This provides more flexibility and future proofing.
§Errors
Will return an error if we attempt to add our own NodeId to the node map or
if the direct addresses are a subset of ours.
-Sourcepub fn add_node_addr_with_source(
+
Sourcepub fn secret_key(&self) -> &SecretKey
Returns the secret_key of this endpoint.
-Sourcepub fn secret_key(&self) -> &SecretKey
Returns the secret_key of this endpoint.
+Sourcepub fn node_id(&self) -> NodeId
Returns the node id of this endpoint.
This ID is the unique addressing information of this node and other peers must know
it to be able to connect to this node.
-Sourcepub async fn node_addr(&self) -> Result<NodeAddr>
Returns the current NodeAddr for this endpoint.
+Sourcepub async fn node_addr(&self) -> Result<NodeAddr>
Returns the current NodeAddr for this endpoint.
The returned NodeAddr will have the current RelayUrl and direct addresses
as they would be returned by Endpoint::home_relay and
Endpoint::direct_addresses.
In browsers, because direct addresses are unavailable, this will only wait for
the home relay to be available before returning.
-Sourcepub fn home_relay(&self) -> Watcher<Option<RelayUrl>>
Sourcepub fn home_relay(&self) -> Watcher<Option<RelayUrl>>
Returns a Watcher for the RelayUrl of the Relay server used as home relay.
Every endpoint has a home Relay server which it chooses as the server with the
lowest latency out of the configured servers provided by Builder::relay_mode.
This is the server other iroh nodes can use to reliably establish a connection
@@ -122,7 +122,7 @@ some time to connect to find and connect to the home relay server.
let mep = Endpoint::builder().bind().await.unwrap();
let _relay_url = mep.home_relay().initialized().await.unwrap();
-Sourcepub fn direct_addresses(&self) -> Watcher<Option<BTreeSet<DirectAddr>>>
Sourcepub fn direct_addresses(&self) -> Watcher<Option<BTreeSet<DirectAddr>>>
Returns a Watcher for the direct addresses of this Endpoint.
The direct addresses of the Endpoint are those that could be used by other
iroh nodes to establish direct connectivity, depending on the network
situation. The yielded lists of direct addresses contain both the locally-bound
@@ -145,10 +145,10 @@ recently discovered direct addresses.
let mep = Endpoint::builder().bind().await.unwrap();
let _addrs = mep.direct_addresses().initialized().await.unwrap();
-Sourcepub fn bound_sockets(&self) -> (SocketAddr, Option<SocketAddr>)
Available on non-wasm_browser only.
Returns the local socket addresses on which the underlying sockets are bound.
+Sourcepub fn bound_sockets(&self) -> (SocketAddr, Option<SocketAddr>)
Available on non-wasm_browser only.
Returns the local socket addresses on which the underlying sockets are bound.
The Endpoint always binds on an IPv4 address and also tries to bind on an IPv6
address if available.
-Sourcepub fn remote_info(&self, node_id: NodeId) -> Option<RemoteInfo>
Returns information about the remote node identified by a NodeId.
+Sourcepub fn remote_info(&self, node_id: NodeId) -> Option<RemoteInfo>
Returns information about the remote node identified by a NodeId.
The Endpoint keeps some information about remote iroh nodes, which it uses to find
the best path to a node. Having information on a remote node, however, does not mean we have
ever connected to it to or even whether a connection is even possible. The information about a
@@ -157,14 +157,14 @@ calls may return different information. Furthermore, node information may even b
completely evicted as it becomes stale.
See also Endpoint::remote_info_iter which returns information on all nodes known
by this Endpoint.
-Sourcepub fn remote_info_iter(&self) -> impl Iterator<Item = RemoteInfo>
Returns information about all the remote nodes this Endpoint knows about.
+Sourcepub fn remote_info_iter(&self) -> impl Iterator<Item = RemoteInfo>
Returns information about all the remote nodes this Endpoint knows about.
This returns the same information as Endpoint::remote_info for each node known to this
Endpoint.
The Endpoint keeps some information about remote iroh nodes, which it uses to find
the best path to a node. This returns all the nodes it knows about, regardless of whether a
connection was ever made or is even possible.
See also Endpoint::remote_info to only retrieve information about a single node.
-Sourcepub fn discovery_stream(
+
Sourcepub fn discovery_stream(
&self,
) -> impl Stream<Item = Result<DiscoveryItem, Lagged>>
Returns a stream of all remote nodes discovered through the endpoint’s discovery services.
Whenever a node is discovered via the endpoint’s discovery service, the corresponding
@@ -183,7 +183,7 @@ at the time of adding it to the static provider.
Lagged may be yielded, indicating that items were missed.
See also Endpoint::remote_info_iter, which returns an iterator over all remotes
the endpoint knows about at a specific point in time.
-Sourcepub fn conn_type(&self, node_id: NodeId) -> Result<Watcher<ConnectionType>>
Returns a Watcher that reports the current connection type and any changes for
+
Sourcepub fn conn_type(&self, node_id: NodeId) -> Result<Watcher<ConnectionType>>
Returns a Watcher that reports the current connection type and any changes for
given remote node.
This watcher allows observing a stream of ConnectionType items by calling
Watcher::stream(). If the underlying connection to a remote node changes, it will
@@ -202,11 +202,11 @@ recently connected to this node id but previous methods of reaching the node hav
become inaccessible.
§Errors
Will error if we do not have any address information for the given node_id.
-Sourcepub fn dns_resolver(&self) -> &DnsResolver
Available on non-wasm_browser only.
Returns the DNS resolver used in this Endpoint.
+Sourcepub fn dns_resolver(&self) -> &DnsResolver
Available on non-wasm_browser only.
Returns the DNS resolver used in this Endpoint.
-Sourcepub fn discovery(&self) -> Option<&dyn Discovery>
Returns the discovery mechanism, if configured.
+Sourcepub fn discovery(&self) -> Option<&dyn Discovery>
Returns the discovery mechanism, if configured.
See Builder::discovery.
-Sourcepub async fn network_change(&self)
Notifies the system of potential network changes.
+Sourcepub async fn network_change(&self)
Notifies the system of potential network changes.
On many systems iroh is able to detect network changes by itself, however
some systems like android do not expose this functionality to native code.
Android does however provide this functionality to Java code. This
@@ -214,12 +214,12 @@ function allows for notifying iroh of any potential network changes like
this.
Even when the network did not change, or iroh was already able to detect
the network change itself, there is no harm in calling this function.
-Sourcepub fn set_user_data_for_discovery(&self, user_data: Option<UserData>)
Sets the initial user-defined data to be published in discovery services for this node.
+Sourcepub fn set_user_data_for_discovery(&self, user_data: Option<UserData>)
Sets the initial user-defined data to be published in discovery services for this node.
If the user-defined data passed to this function is different to the previous one,
the endpoint will republish its node info to the configured discovery services.
See also Builder::user_data_for_discovery for setting an initial value when
building the endpoint.
-Sourcepub async fn close(&self)
Closes the QUIC endpoint and the magic socket.
This will close any remaining open Connections with an error code
of 0 and an empty reason. Though it is best practice to close those
explicitly before with a custom error code and reason.
@@ -245,8 +245,8 @@ while TCP sockets usually get closed and drained by the operating system in the
kernel during the “Time-Wait” period of the TCP socket.
Be aware however that the underlying UDP sockets are only closed once all clones of
the the respective Endpoint are dropped.
-Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Endpoint
§impl !RefUnwindSafe for Endpoint
§impl Send for Endpoint
§impl Sync for Endpoint
§impl Unpin for Endpoint
§impl !UnwindSafe for Endpoint
Blanket Implementations§
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Endpoint
§impl !RefUnwindSafe for Endpoint
§impl Send for Endpoint
§impl Sync for Endpoint
§impl Unpin for Endpoint
§impl !UnwindSafe for Endpoint
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/3217/docs/iroh/endpoint/struct.Incoming.html b/pr/3217/docs/iroh/endpoint/struct.Incoming.html
index 61f28360fa..6b71064a82 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Incoming.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Incoming.html
@@ -1,29 +1,29 @@
-Incoming in iroh::endpoint - Rust pub struct Incoming { /* private fields */ }
Expand description
An incoming connection for which the server has not yet begun its parts of the
+
Incoming in iroh::endpoint - Rust pub struct Incoming { /* private fields */ }
Expand description
An incoming connection for which the server has not yet begun its parts of the
handshake.
-Implementations§
Source§impl Incoming
Sourcepub fn accept(self) -> Result<Connecting, ConnectionError>
Attempts to accept this incoming connection (an error may still occur).
+Implementations§
Source§impl Incoming
Sourcepub fn accept(self) -> Result<Connecting, ConnectionError>
Attempts to accept this incoming connection (an error may still occur).
Errors occurring here are likely not caused by the application or remote. The QUIC
connection listens on a normal UDP socket and any reachable network endpoint can
send datagrams to it, solicited or not. Even if the first few bytes look like a
QUIC packet, it might not even be a QUIC packet that is being received.
Thus it is common to simply log the errors here and accept them as something which
can happen.
-Sourcepub fn accept_with(
+
Sourcepub fn accept_with(
self,
server_config: Arc<ServerConfig>,
) -> Result<Connecting, ConnectionError>
Accepts this incoming connection using a custom configuration.
See accept() for more details.
-Sourcepub fn retry(self) -> Result<(), RetryError>
Responds with a retry packet.
+Sourcepub fn retry(self) -> Result<(), RetryError>
Responds with a retry packet.
This requires the client to retry with address validation.
Errors if remote_address_validated() is true.
-Sourcepub fn ignore(self)
Ignores this incoming connection attempt, not sending any packet in response.
-Sourcepub fn local_ip(&self) -> Option<IpAddr>
Returns the local IP address which was used when the peer established the
+
Sourcepub fn ignore(self)
Ignores this incoming connection attempt, not sending any packet in response.
+Sourcepub fn local_ip(&self) -> Option<IpAddr>
Returns the local IP address which was used when the peer established the
connection.
-Sourcepub fn remote_address(&self) -> SocketAddr
Returns the peer’s UDP address.
-Sourcepub fn remote_address_validated(&self) -> bool
Whether the socket address that is initiating this connection has been validated.
+Sourcepub fn remote_address(&self) -> SocketAddr
Returns the peer’s UDP address.
+Sourcepub fn remote_address_validated(&self) -> bool
Whether the socket address that is initiating this connection has been validated.
This means that the sender of the initial packet has proved that they can receive
traffic sent to self.remote_address().
-Trait Implementations§
Source§impl IntoFuture for Incoming
Source§type Output = Result<Connection, ConnectionError>
The output that the future will produce on completion.Source§type IntoFuture = IncomingFuture
Which kind of future are we turning this into?Source§fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read moreAuto Trait Implementations§
§impl !Freeze for Incoming
§impl !RefUnwindSafe for Incoming
§impl Send for Incoming
§impl Sync for Incoming
§impl Unpin for Incoming
§impl !UnwindSafe for Incoming
Blanket Implementations§
Trait Implementations§
Source§impl IntoFuture for Incoming
Source§type Output = Result<Connection, ConnectionError>
The output that the future will produce on completion.Source§type IntoFuture = IncomingFuture
Which kind of future are we turning this into?Source§fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read moreAuto Trait Implementations§
§impl !Freeze for Incoming
§impl !RefUnwindSafe for Incoming
§impl Send for Incoming
§impl Sync for Incoming
§impl Unpin for Incoming
§impl !UnwindSafe for Incoming
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/3217/docs/iroh/endpoint/struct.IncomingFuture.html b/pr/3217/docs/iroh/endpoint/struct.IncomingFuture.html
index 504c012c78..3934a53120 100644
--- a/pr/3217/docs/iroh/endpoint/struct.IncomingFuture.html
+++ b/pr/3217/docs/iroh/endpoint/struct.IncomingFuture.html
@@ -1,6 +1,6 @@
-IncomingFuture in iroh::endpoint - Rust pub struct IncomingFuture { /* private fields */ }
Expand description
Adaptor to let Incoming be awaited like a Connecting.
-Trait Implementations§
Source§impl Debug for IncomingFuture
Source§impl Future for IncomingFuture
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for IncomingFuturewhere
+IncomingFuture in iroh::endpoint - Rust pub struct IncomingFuture { /* private fields */ }
Expand description
Adaptor to let Incoming be awaited like a Connecting.
+Trait Implementations§
Source§impl Debug for IncomingFuture
Source§impl Future for IncomingFuture
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for IncomingFuturewhere
PinnedFieldsOf<__IncomingFuture<'pin>>: Unpin,
Auto Trait Implementations§
§impl !Freeze for IncomingFuture
§impl !RefUnwindSafe for IncomingFuture
§impl Send for IncomingFuture
§impl Sync for IncomingFuture
§impl !UnwindSafe for IncomingFuture
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html b/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html
index 792290d8f5..d03f08d892 100644
--- a/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html
+++ b/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html
@@ -1,7 +1,7 @@
-ZeroRttAccepted in iroh::endpoint - Rust pub struct ZeroRttAccepted { /* private fields */ }
Expand description
Future that completes when a connection is fully established.
+ZeroRttAccepted in iroh::endpoint - Rust pub struct ZeroRttAccepted { /* private fields */ }
Expand description
Future that completes when a connection is fully established.
For clients, the resulting value indicates if 0-RTT was accepted. For servers, the resulting
value is meaningless.
-Trait Implementations§
Source§impl Debug for ZeroRttAccepted
Source§impl Future for ZeroRttAccepted
Source§fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>
Attempts to resolve the future to a final value, registering
+Trait Implementations§
Source§impl Debug for ZeroRttAccepted
Source§impl Future for ZeroRttAccepted
Auto Trait Implementations§
§impl Freeze for ZeroRttAccepted
§impl !RefUnwindSafe for ZeroRttAccepted
§impl Send for ZeroRttAccepted
§impl Sync for ZeroRttAccepted
§impl Unpin for ZeroRttAccepted
§impl !UnwindSafe for ZeroRttAccepted
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/enum.KeyParsingError.html b/pr/3217/docs/iroh/enum.KeyParsingError.html
index 55941cda04..c7925e588b 100644
--- a/pr/3217/docs/iroh/enum.KeyParsingError.html
+++ b/pr/3217/docs/iroh/enum.KeyParsingError.html
@@ -1,4 +1,4 @@
-KeyParsingError in iroh - Rust pub enum KeyParsingError {
+KeyParsingError in iroh - Rust Enum KeyParsingError
pub enum KeyParsingError {
Decode(DecodeError),
Key(Error),
DecodeInvalidLength,
@@ -6,7 +6,7 @@
Variants§
§Decode(DecodeError)
Error when decoding.
§Key(Error)
Error when decoding the public key.
§DecodeInvalidLength
The encoded information had the wrong length.
-Trait Implementations§
Source§impl Debug for KeyParsingError
Source§impl Display for KeyParsingError
Source§impl Error for KeyParsingError
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()Source§impl From<DecodeError> for KeyParsingError
Source§fn from(source: DecodeError) -> KeyParsingError
Converts to this type from the input type.Source§impl From<Error> for KeyParsingError
Source§fn from(source: Error) -> KeyParsingError
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for KeyParsingError
§impl !RefUnwindSafe for KeyParsingError
§impl Send for KeyParsingError
§impl Sync for KeyParsingError
§impl Unpin for KeyParsingError
§impl !UnwindSafe for KeyParsingError
Blanket Implementations§
Trait Implementations§
§impl Debug for KeyParsingError
§impl Display for KeyParsingError
§impl Error for KeyParsingError
§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()§impl From<DecodeError> for KeyParsingError
§fn from(source: DecodeError) -> KeyParsingError
Converts to this type from the input type.§impl From<Error> for KeyParsingError
§fn from(source: Error) -> KeyParsingError
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for KeyParsingError
§impl !RefUnwindSafe for KeyParsingError
§impl Send for KeyParsingError
§impl Sync for KeyParsingError
§impl Unpin for KeyParsingError
§impl !UnwindSafe for KeyParsingError
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/3217/docs/iroh/metrics/struct.RelayMetrics.html b/pr/3217/docs/iroh/metrics/struct.RelayMetrics.html
index 83ae1acdcc..6f22d04f93 100644
--- a/pr/3217/docs/iroh/metrics/struct.RelayMetrics.html
+++ b/pr/3217/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/3217/docs/iroh/node_info/constant.IROH_TXT_NAME.html b/pr/3217/docs/iroh/node_info/constant.IROH_TXT_NAME.html
index c78d056a1f..0c1e657fb3 100644
--- a/pr/3217/docs/iroh/node_info/constant.IROH_TXT_NAME.html
+++ b/pr/3217/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/3217/docs/iroh/node_info/index.html b/pr/3217/docs/iroh/node_info/index.html
index 9884414f78..5130358fc8 100644
--- a/pr/3217/docs/iroh/node_info/index.html
+++ b/pr/3217/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/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html b/pr/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html
index 2f1c9b7234..33cd3a33fc 100644
--- a/pr/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html
+++ b/pr/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html
@@ -1,5 +1,5 @@
-MaxLengthExceededError in iroh::node_info - Rust
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html b/pr/3217/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html
index f03a92e8fc..ebd857988a 100644
--- a/pr/3217/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html
+++ b/pr/3217/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html
@@ -1,2 +1,2 @@
-ENV_FORCE_STAGING_RELAYS in iroh::endpoint - Rust pub const ENV_FORCE_STAGING_RELAYS: &str = "IROH_FORCE_STAGING_RELAYS";
Expand description
Environment variable to force the use of staging relays.
+ENV_FORCE_STAGING_RELAYS in iroh::endpoint - Rust
\ No newline at end of file
diff --git a/pr/3217/docs/iroh/endpoint/enum.DirectAddrType.html b/pr/3217/docs/iroh/endpoint/enum.DirectAddrType.html
index db8fd263b6..8d7040b73e 100644
--- a/pr/3217/docs/iroh/endpoint/enum.DirectAddrType.html
+++ b/pr/3217/docs/iroh/endpoint/enum.DirectAddrType.html
@@ -1,4 +1,4 @@
-DirectAddrType in iroh::endpoint - Rust pub enum DirectAddrType {
+DirectAddrType in iroh::endpoint - Rust pub enum DirectAddrType {
Unknown,
Local,
Stun,
@@ -20,16 +20,16 @@ get a publicly routable direct address.
It is possible to configure iroh to bound to a specific port and independently
configure the router to forward this port to the iroh node. This indicates a
situation like this, which still uses STUN to discover the public address.
-
Trait Implementations§
Source§impl Clone for DirectAddrType
Source§fn clone(&self) -> DirectAddrType
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 DirectAddrType
Source§impl Display for DirectAddrType
Source§impl Hash for DirectAddrType
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
+
Trait Implementations§
Source§impl Clone for DirectAddrType
Source§fn clone(&self) -> DirectAddrType
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 DirectAddrType
Source§impl Display for DirectAddrType
Source§impl Hash for DirectAddrType
Source§impl Ord for DirectAddrType
Source§impl Ord for DirectAddrType
Source§fn cmp(&self, other: &DirectAddrType) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read moreSource§impl PartialEq for DirectAddrType
Source§impl PartialOrd for DirectAddrType
Source§impl PartialEq for DirectAddrType
Source§impl PartialOrd for DirectAddrType
Source§impl Copy for DirectAddrType
Source§impl Eq for DirectAddrType
Source§impl StructuralPartialEq for DirectAddrType
Auto Trait Implementations§
§impl Freeze for DirectAddrType
§impl RefUnwindSafe for DirectAddrType
§impl Send for DirectAddrType
§impl Sync for DirectAddrType
§impl Unpin for DirectAddrType
§impl UnwindSafe for DirectAddrType
Blanket Implementations§
Source§impl Copy for DirectAddrType
Source§impl Eq for DirectAddrType
Source§impl StructuralPartialEq for DirectAddrType
Auto Trait Implementations§
§impl Freeze for DirectAddrType
§impl RefUnwindSafe for DirectAddrType
§impl Send for DirectAddrType
§impl Sync for DirectAddrType
§impl Unpin for DirectAddrType
§impl UnwindSafe for DirectAddrType
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/3217/docs/iroh/endpoint/enum.RelayMode.html b/pr/3217/docs/iroh/endpoint/enum.RelayMode.html
index b478f03249..ab87d54df6 100644
--- a/pr/3217/docs/iroh/endpoint/enum.RelayMode.html
+++ b/pr/3217/docs/iroh/endpoint/enum.RelayMode.html
@@ -1,4 +1,4 @@
-RelayMode in iroh::endpoint - Rust pub enum RelayMode {
+RelayMode in iroh::endpoint - Rust pub enum RelayMode {
Disabled,
Default,
Staging,
@@ -9,9 +9,9 @@
See crate::defaults::prod for the severs used.
§Staging
Use the staging relay servers from n0.
§Custom(RelayMap)
Use a custom relay map.
-
Implementations§
Trait Implementations§
Source§impl Eq for RelayMode
Source§impl StructuralPartialEq for RelayMode
Auto Trait Implementations§
§impl Freeze for RelayMode
§impl RefUnwindSafe for RelayMode
§impl Send for RelayMode
§impl Sync for RelayMode
§impl Unpin for RelayMode
§impl UnwindSafe for RelayMode
Blanket Implementations§
Implementations§
Trait Implementations§
Source§impl Eq for RelayMode
Source§impl StructuralPartialEq for RelayMode
Auto Trait Implementations§
§impl Freeze for RelayMode
§impl RefUnwindSafe for RelayMode
§impl Send for RelayMode
§impl Sync for RelayMode
§impl Unpin for RelayMode
§impl UnwindSafe for RelayMode
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/3217/docs/iroh/endpoint/fn.default_relay_mode.html b/pr/3217/docs/iroh/endpoint/fn.default_relay_mode.html
index 3206b983f7..bedd6fe18a 100644
--- a/pr/3217/docs/iroh/endpoint/fn.default_relay_mode.html
+++ b/pr/3217/docs/iroh/endpoint/fn.default_relay_mode.html
@@ -1,4 +1,4 @@
-default_relay_mode in iroh::endpoint - Rust pub fn default_relay_mode() -> RelayMode
Expand description
Returns the default relay mode.
+default_relay_mode in iroh::endpoint - Rust
\ No newline at end of file
diff --git a/pr/3217/docs/iroh/endpoint/fn.force_staging_infra.html b/pr/3217/docs/iroh/endpoint/fn.force_staging_infra.html
index 763aa33a74..eaaa3f19e2 100644
--- a/pr/3217/docs/iroh/endpoint/fn.force_staging_infra.html
+++ b/pr/3217/docs/iroh/endpoint/fn.force_staging_infra.html
@@ -1,2 +1,2 @@
-force_staging_infra in iroh::endpoint - Rust pub fn force_staging_infra() -> bool
Expand description
Returns true if the use of staging relays is forced.
+force_staging_infra in iroh::endpoint - Rust
\ No newline at end of file
diff --git a/pr/3217/docs/iroh/endpoint/index.html b/pr/3217/docs/iroh/endpoint/index.html
index 4deb68bd51..011ed71358 100644
--- a/pr/3217/docs/iroh/endpoint/index.html
+++ b/pr/3217/docs/iroh/endpoint/index.html
@@ -1,4 +1,4 @@
-iroh::endpoint - Rust Expand description
The Endpoint allows establishing connections to other iroh nodes.
+iroh::endpoint - Rust Expand description
The Endpoint allows establishing connections to other iroh nodes.
The Endpoint is the main API interface to manage a local iroh node. It allows
connecting to and accepting connections from other nodes. See the module docs for
more details on how iroh connections work.
diff --git a/pr/3217/docs/iroh/endpoint/struct.Accept.html b/pr/3217/docs/iroh/endpoint/struct.Accept.html
index 58bb4e71ea..74d685c091 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Accept.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Accept.html
@@ -1,6 +1,6 @@
-Accept in iroh::endpoint - Rust pub struct Accept<'a> { /* private fields */ }
Expand description
Future produced by Endpoint::accept.
-Trait Implementations§
Source§impl<'pin, 'a> Unpin for Accept<'a>where
+Accept in iroh::endpoint - Rust pub struct Accept<'a> { /* private fields */ }
Expand description
Future produced by Endpoint::accept.
+Trait Implementations§
Source§impl<'pin, 'a> Unpin for Accept<'a>where
PinnedFieldsOf<__Accept<'pin, 'a>>: Unpin,
Auto Trait Implementations§
§impl<'a> !Freeze for Accept<'a>
§impl<'a> !RefUnwindSafe for Accept<'a>
§impl<'a> Send for Accept<'a>
§impl<'a> Sync for Accept<'a>
§impl<'a> !UnwindSafe for Accept<'a>
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/endpoint/struct.Builder.html b/pr/3217/docs/iroh/endpoint/struct.Builder.html
index 6872da2482..46b31e019e 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Builder.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Builder.html
@@ -1,24 +1,24 @@
-Builder in iroh::endpoint - Rust pub struct Builder { /* private fields */ }
Expand description
Builder for Endpoint.
+Builder in iroh::endpoint - Rust pub struct Builder { /* private fields */ }
Expand description
Builder for Endpoint.
By default the endpoint will generate a new random SecretKey, which will result in a
new NodeId.
To create the Endpoint call Builder::bind.
-Implementations§
Source§impl Builder
Sourcepub fn bind_addr_v4(self, addr: SocketAddrV4) -> Self
Sets the IPv4 bind address.
+Implementations§
Source§impl Builder
Sourcepub fn bind_addr_v4(self, addr: SocketAddrV4) -> Self
Sets the IPv4 bind address.
Setting the port to 0 will use a random port.
If the port specified is already in use, it will fallback to choosing a random port.
By default will use 0.0.0.0:0 to bind to.
-Sourcepub fn bind_addr_v6(self, addr: SocketAddrV6) -> Self
Sets the IPv6 bind address.
+Sourcepub fn bind_addr_v6(self, addr: SocketAddrV6) -> Self
Sets the IPv6 bind address.
Setting the port to 0 will use a random port.
If the port specified is already in use, it will fallback to choosing a random port.
By default will use [::]:0 to bind to.
-Sourcepub fn secret_key(self, secret_key: SecretKey) -> Self
Sets a secret key to authenticate with other peers.
+Sourcepub fn secret_key(self, secret_key: SecretKey) -> Self
Sourcepub fn alpns(self, alpn_protocols: Vec<Vec<u8>>) -> Self
Sets the ALPN protocols that this endpoint will accept on incoming connections.
+Sourcepub fn relay_mode(self, relay_mode: RelayMode) -> Self
Sets the relay servers to assist in establishing connectivity.
+Sourcepub fn relay_mode(self, relay_mode: RelayMode) -> Self
Sets the relay servers to assist in establishing connectivity.
Relay servers are used to establish initial connection with another iroh node.
They also perform various functions related to hole punching, see the crate docs
for more details.
@@ -26,15 +26,22 @@ for more details.
When using RelayMode::Custom, the provided relay_map must contain at least one
configured relay node. If an invalid RelayMap is provided bind
will result in an error.
-Sourcepub fn clear_discovery(self) -> Self
Removes all discovery services from the builder.
-Sourcepub fn discovery(self, discovery: Box<dyn Discovery>) -> Self
Optionally sets a discovery mechanism for this endpoint.
+Sourcepub fn relay_conn_protocol(self, protocol: Protocol) -> Self
Sets the protocol to use for relay connections.
+Options are either Protocol::Websocket or Protocol::Relay.
+Websocket will work with relays version 0.19 and above, so likely with any relays
+deployed at the time of writing this option (websocket support was released 9 months ago).
+Relay will work for now, but will likely be removed with the 1.0 release.
+Default is set to Relay at the moment, until we’ve thoroughly tested and improved
+websocket performance.
+Sourcepub fn clear_discovery(self) -> Self
Removes all discovery services from the builder.
+Sourcepub fn discovery(self, discovery: Box<dyn Discovery>) -> Self
Optionally sets a discovery mechanism for this endpoint.
If you want to combine multiple discovery services, you can use
Builder::add_discovery instead. This will internally create a
crate::discovery::ConcurrentDiscovery.
If no discovery service is set, connecting to a node without providing its
direct addresses or relay URLs will fail.
See the documentation of the Discovery trait for details.
-Sourcepub fn add_discovery<F, D>(self, discovery: F) -> Selfwhere
+
Sourcepub fn add_discovery<F, D>(self, discovery: F) -> Self
Adds a discovery mechanism for this endpoint.
The function discovery
@@ -47,7 +54,7 @@ to use this secret key to sign the information.
direct addresses or relay URLs will fail.
To clear all discovery services, use Builder::clear_discovery.
See the documentation of the Discovery trait for details.
-Sourcepub fn discovery_n0(self) -> Self
Configures the endpoint to use the default n0 DNS discovery service.
+Sourcepub fn discovery_n0(self) -> Self
Configures the endpoint to use the default n0 DNS discovery service.
The default discovery service publishes to and resolves from the
n0.computer dns server iroh.link.
This is equivalent to adding both a crate::discovery::pkarr::PkarrPublisher
@@ -56,29 +63,29 @@ n0.computer dns server.
This will by default use N0_DNS_PKARR_RELAY_PROD.
When in tests, or when the test-utils feature is enabled, this will use the
N0_DNS_PKARR_RELAY_STAGING.
-Sourcepub fn tls_x509(self) -> Self
Use libp2p based self signed certificates for TLS.
For details see the libp2p spec at https://github.com/libp2p/specs/blob/master/tls/tls.md
This is the only mechanism available in iroh@0.33.0 and earlier.
-Sourcepub fn tls_raw_public_keys(self) -> Self
Use TLS Raw Public Keys
+Sourcepub fn tls_raw_public_keys(self) -> Self
Use TLS Raw Public Keys
This is the default, but is not compatible with older versions of iroh.
-Sourcepub fn discovery_dht(self) -> Self
Available on crate feature discovery-pkarr-dht only.
Configures the endpoint to also use the mainline DHT with default settings.
+Sourcepub fn discovery_dht(self) -> Self
Available on crate feature discovery-pkarr-dht only.
Configures the endpoint to also use the mainline DHT with default settings.
This is equivalent to adding a crate::discovery::pkarr::dht::DhtDiscovery
with default settings. Note that DhtDiscovery has various more advanced
configuration options. If you need any of those, you should manually
create a DhtDiscovery and add it with Builder::add_discovery.
-Sourcepub fn discovery_local_network(self) -> Self
Available on crate feature discovery-local-network only.
Configures the endpoint to also use local network discovery.
+Sourcepub fn discovery_local_network(self) -> Self
Available on crate feature discovery-local-network only.
Configures the endpoint to also use local network discovery.
This is equivalent to adding a crate::discovery::mdns::MdnsDiscovery
with default settings. Note that MdnsDiscovery has various more advanced
configuration options. If you need any of those, you should manually
create a MdnsDiscovery and add it with Builder::add_discovery.
-Sourcepub fn user_data_for_discovery(self, user_data: UserData) -> Self
Sets the initial user-defined data to be published in discovery services for this node.
+Sourcepub fn user_data_for_discovery(self, user_data: UserData) -> Self
Sets the initial user-defined data to be published in discovery services for this node.
When using discovery services, this string of UserData will be published together
with the node’s addresses and relay URL. When other nodes discover this node,
they retrieve the UserData in addition to the addressing info.
Iroh itself does not interpret the user-defined data in any way, it is purely left
for applications to parse and use.
-Sourcepub fn known_nodes(self, nodes: Vec<NodeAddr>) -> Self
Optionally set a list of known nodes.
-Sourcepub fn transport_config(self, transport_config: TransportConfig) -> Self
Sets a custom quinn::TransportConfig for this endpoint.
+Sourcepub fn known_nodes(self, nodes: Vec<NodeAddr>) -> Self
Optionally set a list of known nodes.
+Sourcepub fn transport_config(self, transport_config: TransportConfig) -> Self
Sets a custom quinn::TransportConfig for this endpoint.
The transport config contains parameters governing the QUIC state machine.
If unset, the default config is used. Default values should be suitable for most
internet applications. Applications protocols which forbid remotely-initiated
@@ -86,31 +93,31 @@ streams should set max_concurrent_bidi_streams and max_concur
zero.
Please be aware that changing some settings may have adverse effects on establishing
and maintaining direct connections.
-Sourcepub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self
Available on non-wasm_browser only.
Optionally sets a custom DNS resolver to use for this endpoint.
+Sourcepub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self
Available on non-wasm_browser only.
Optionally sets a custom DNS resolver to use for this endpoint.
The DNS resolver is used to resolve relay hostnames, and node addresses if
crate::discovery::dns::DnsDiscovery is configured.
By default, a new DNS resolver is created which is configured to use the
host system’s DNS configuration. You can pass a custom instance of DnsResolver
here to use a differently configured DNS resolver for this endpoint, or to share
a DnsResolver between multiple endpoints.
-Sourcepub fn proxy_url(self, url: Url) -> Self
Sets an explicit proxy url to proxy all HTTP(S) traffic through.
-Sourcepub fn proxy_from_env(self) -> Self
Sets the proxy url from the environment, in this order:
+Sourcepub fn proxy_url(self, url: Url) -> Self
Sets an explicit proxy url to proxy all HTTP(S) traffic through.
+Sourcepub fn proxy_from_env(self) -> Self
Sets the proxy url from the environment, in this order:
HTTP_PROXY
http_proxy
HTTPS_PROXY
https_proxy
-Sourcepub fn keylog(self, keylog: bool) -> Self
Enables saving the TLS pre-master key for connections.
+Sourcepub fn keylog(self, keylog: bool) -> Self
Enables saving the TLS pre-master key for connections.
This key should normally remain secret but can be useful to debug networking issues
by decrypting captured traffic.
If keylog is true then setting the SSLKEYLOGFILE environment variable to a
filename will result in this file being used to log the TLS pre-master keys.
-Sourcepub fn insecure_skip_relay_cert_verify(self, skip_verify: bool) -> Self
Available on crate feature test-utils only.
Skip verification of SSL certificates from relay servers
+Sourcepub fn insecure_skip_relay_cert_verify(self, skip_verify: bool) -> Self
Available on crate feature test-utils only.
Skip verification of SSL certificates from relay servers
May only be used in tests.
-Sourcepub fn path_selection(self, path_selection: PathSelection) -> Self
Available on crate feature test-utils only.
This implies we only use the relay to communicate
+
Sourcepub fn path_selection(self, path_selection: PathSelection) -> Self
Available on crate feature test-utils only.
This implies we only use the relay to communicate
and do not attempt to do any hole punching.
-Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Builder
§impl !RefUnwindSafe for Builder
§impl Send for Builder
§impl Sync for Builder
§impl Unpin for Builder
§impl !UnwindSafe for Builder
Blanket Implementations§
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Builder
§impl !RefUnwindSafe for Builder
§impl Send for Builder
§impl Sync for Builder
§impl Unpin for Builder
§impl !UnwindSafe for Builder
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/3217/docs/iroh/endpoint/struct.ConnectOptions.html b/pr/3217/docs/iroh/endpoint/struct.ConnectOptions.html
index d82c67e528..4b2b9fa2d5 100644
--- a/pr/3217/docs/iroh/endpoint/struct.ConnectOptions.html
+++ b/pr/3217/docs/iroh/endpoint/struct.ConnectOptions.html
@@ -1,12 +1,12 @@
-ConnectOptions in iroh::endpoint - Rust pub struct ConnectOptions { /* private fields */ }
Expand description
Options for the Endpoint::connect_with_opts function.
-Implementations§
Source§impl ConnectOptions
Sourcepub fn new() -> Self
Initializes new connection options.
+ConnectOptions in iroh::endpoint - Rust pub struct ConnectOptions { /* private fields */ }
Expand description
Options for the Endpoint::connect_with_opts function.
+Implementations§
Source§impl ConnectOptions
Sourcepub fn new() -> Self
Initializes new connection options.
By default, the connection will use the same options
as Endpoint::connect, e.g. a default TransportConfig.
-Sourcepub fn with_transport_config(
+
Sourcepub fn with_transport_config(
self,
transport_config: Arc<TransportConfig>,
) -> Self
Sets the QUIC transport config options for this connection.
-Trait Implementations§
Source§impl Clone for ConnectOptions
Source§fn clone(&self) -> ConnectOptions
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 ConnectOptions
Source§impl Default for ConnectOptions
Source§fn default() -> ConnectOptions
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for ConnectOptions
§impl !RefUnwindSafe for ConnectOptions
§impl Send for ConnectOptions
§impl Sync for ConnectOptions
§impl Unpin for ConnectOptions
§impl !UnwindSafe for ConnectOptions
Blanket Implementations§
Trait Implementations§
Source§impl Clone for ConnectOptions
Source§fn clone(&self) -> ConnectOptions
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 ConnectOptions
Source§impl Default for ConnectOptions
Source§fn default() -> ConnectOptions
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for ConnectOptions
§impl !RefUnwindSafe for ConnectOptions
§impl Send for ConnectOptions
§impl Sync for ConnectOptions
§impl Unpin for ConnectOptions
§impl !UnwindSafe for ConnectOptions
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/3217/docs/iroh/endpoint/struct.Connecting.html b/pr/3217/docs/iroh/endpoint/struct.Connecting.html
index 41a03946a4..e190a84876 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Connecting.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Connecting.html
@@ -1,5 +1,5 @@
-Connecting in iroh::endpoint - Rust pub struct Connecting { /* private fields */ }
Expand description
In-progress connection attempt future
-Implementations§
Source§impl Connecting
Sourcepub fn into_0rtt(self) -> Result<(Connection, ZeroRttAccepted), Self>
Converts this Connecting into a 0-RTT or 0.5-RTT connection at the cost of weakened
+
Connecting in iroh::endpoint - Rust pub struct Connecting { /* private fields */ }
Expand description
In-progress connection attempt future
+Implementations§
Source§impl Connecting
Sourcepub fn into_0rtt(self) -> Result<(Connection, ZeroRttAccepted), Self>
Converts this Connecting into a 0-RTT or 0.5-RTT connection at the cost of weakened
security.
Returns Ok immediately if the local endpoint is able to attempt sending 0/0.5-RTT data.
If so, the returned Connection can be used to send application data without waiting for
@@ -33,10 +33,10 @@ before TLS client authentication has occurred, and should therefore not be used
data for which client authentication is being used.
You can use RecvStream::is_0rtt to check whether a stream has been opened in 0-RTT
and thus whether parts of the stream are operating under this reduced security level.
-Sourcepub async fn handshake_data(&mut self) -> Result<Box<dyn Any>, ConnectionError>
Parameters negotiated during the handshake
-Trait Implementations§
Source§impl Debug for Connecting
Source§impl Future for Connecting
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for Connectingwhere
+Sourcepub async fn handshake_data(&mut self) -> Result<Box<dyn Any>, ConnectionError>
Parameters negotiated during the handshake
+
Trait Implementations§
Source§impl Debug for Connecting
Source§impl Future for Connecting
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for Connectingwhere
PinnedFieldsOf<__Connecting<'pin>>: Unpin,
Auto Trait Implementations§
§impl Freeze for Connecting
§impl !RefUnwindSafe for Connecting
§impl Send for Connecting
§impl Sync for Connecting
§impl !UnwindSafe for Connecting
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/endpoint/struct.Connection.html b/pr/3217/docs/iroh/endpoint/struct.Connection.html
index 8e81609487..928cdb9918 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Connection.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Connection.html
@@ -1,4 +1,4 @@
-Connection in iroh::endpoint - Rust pub struct Connection { /* private fields */ }
Expand description
A QUIC connection.
+Connection in iroh::endpoint - Rust pub struct Connection { /* private fields */ }
Expand description
A QUIC connection.
If all references to a connection (including every clone of the Connection handle,
streams of incoming streams, and the various stream types) have been dropped, then the
connection will be automatically closed with an error_code of 0 and an empty reason. You
@@ -8,29 +8,29 @@ receiving CONNECTION_CLOSE the peer may drop any stream data not yet delivered t
application. Connection::close describes in more detail how to gracefully close a
connection without losing application data.
May be cloned to obtain another handle to the same connection.
-Implementations§
Source§impl Connection
Implementations§
Source§impl Connection
Sourcepub fn open_uni(&self) -> OpenUni<'_> ⓘ
Initiates a new outgoing unidirectional stream.
Streams are cheap and instantaneous to open unless blocked by flow control. As a
consequence, the peer won’t be notified that a stream has been opened until the
stream is actually used.
-Sourcepub fn open_bi(&self) -> OpenBi<'_> ⓘ
Initiates a new outgoing bidirectional stream.
Streams are cheap and instantaneous to open unless blocked by flow control. As a
consequence, the peer won’t be notified that a stream has been opened until the
stream is actually used. Calling open_bi then waiting on the RecvStream
without writing anything to SendStream will never succeed.
-Sourcepub fn accept_uni(&self) -> AcceptUni<'_> ⓘ
Accepts the next incoming uni-directional stream.
-Sourcepub fn accept_uni(&self) -> AcceptUni<'_> ⓘ
Accepts the next incoming uni-directional stream.
+Sourcepub fn accept_bi(&self) -> AcceptBi<'_> ⓘ
Accept the next incoming bidirectional stream.
Important Note: The peer that calls open_bi must write to its SendStream
before the peer Connection is able to accept the stream using
accept_bi(). Calling open_bi then waiting on the RecvStream without
writing anything to the connected SendStream will never succeed.
-Sourcepub fn read_datagram(&self) -> ReadDatagram<'_> ⓘ
Receives an application datagram.
-Sourcepub async fn closed(&self) -> ConnectionError
Wait for the connection to be closed for any reason.
+Sourcepub fn read_datagram(&self) -> ReadDatagram<'_> ⓘ
Receives an application datagram.
+Sourcepub async fn closed(&self) -> ConnectionError
Wait for the connection to be closed for any reason.
Despite the return type’s name, closed connections are often not an error condition
at the application layer. Cases that might be routine include
ConnectionError::LocallyClosed and ConnectionError::ApplicationClosed.
-Sourcepub fn close_reason(&self) -> Option<ConnectionError>
If the connection is closed, the reason why.
+Sourcepub fn close_reason(&self) -> Option<ConnectionError>
If the connection is closed, the reason why.
Returns None if the connection is still open.
-Sourcepub fn close(&self, error_code: VarInt, reason: &[u8])
Closes the connection immediately.
Pending operations will fail immediately with ConnectionError::LocallyClosed. No
more data is sent to the peer and the peer may drop buffered data upon receiving the
CONNECTION_CLOSE frame.
@@ -51,41 +51,41 @@ endpoint. Once the local side sends a CONNECTION_CLOSE frame in response to call
close the remote endpoint may drop any data it received but is as yet
undelivered to the application, including data that was acknowledged as received to
the local endpoint.
-Sourcepub fn send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError>
Transmits data as an unreliable, unordered application datagram.
+Sourcepub fn send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError>
Transmits data as an unreliable, unordered application datagram.
Application datagrams are a low-level primitive. They may be lost or delivered out
of order, and data must both fit inside a single QUIC packet and be smaller than
the maximum dictated by the peer.
-Sourcepub fn max_datagram_size(&self) -> Option<usize>
Computes the maximum size of datagrams that may be passed to send_datagram.
+Sourcepub fn max_datagram_size(&self) -> Option<usize>
Computes the maximum size of datagrams that may be passed to send_datagram.
Returns None if datagrams are unsupported by the peer or disabled locally.
This may change over the lifetime of a connection according to variation in the path
MTU estimate. The peer can also enforce an arbitrarily small fixed limit, but if the
peer’s limit is large this is guaranteed to be a little over a kilobyte at minimum.
Not necessarily the maximum size of received datagrams.
-Sourcepub fn datagram_send_buffer_space(&self) -> usize
Bytes available in the outgoing datagram buffer.
+Sourcepub fn datagram_send_buffer_space(&self) -> usize
Bytes available in the outgoing datagram buffer.
When greater than zero, calling send_datagram with a
datagram of at most this size is guaranteed not to cause older datagrams to be
dropped.
-Sourcepub fn rtt(&self) -> Duration
Current best estimate of this connection’s latency (round-trip-time).
-Sourcepub fn stats(&self) -> ConnectionStats
Returns connection statistics.
-Sourcepub fn congestion_state(&self) -> Box<dyn Controller>
Current state of the congestion control algorithm, for debugging purposes.
-Sourcepub fn handshake_data(&self) -> Option<Box<dyn Any>>
Parameters negotiated during the handshake.
+Sourcepub fn rtt(&self) -> Duration
Current best estimate of this connection’s latency (round-trip-time).
+Sourcepub fn stats(&self) -> ConnectionStats
Returns connection statistics.
+Sourcepub fn congestion_state(&self) -> Box<dyn Controller>
Current state of the congestion control algorithm, for debugging purposes.
+Sourcepub fn handshake_data(&self) -> Option<Box<dyn Any>>
Parameters negotiated during the handshake.
Guaranteed to return Some on fully established connections or after
Connecting::handshake_data() succeeds. See that method’s documentations for
details on the returned value.
-Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
-Sourcepub fn peer_identity(&self) -> Option<Box<dyn Any>>
Cryptographic identity of the peer.
+Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
+Sourcepub fn peer_identity(&self) -> Option<Box<dyn Any>>
Sourcepub fn remote_node_id(&self) -> Result<NodeId>
Returns the NodeId from the peer’s TLS certificate.
+Sourcepub fn remote_node_id(&self) -> Result<NodeId>
Sourcepub fn stable_id(&self) -> usize
A stable identifier for this connection.
Peer addresses and connection IDs can change, but this value will remain fixed for
the lifetime of the connection.
-Sourcepub fn export_keying_material(
+
Sourcepub fn export_keying_material(
&self,
output: &mut [u8],
label: &[u8],
@@ -96,14 +96,14 @@ arguments and output buffers of equal length, they will get the
same sequence of bytes in output. These bytes are cryptographically
strong and pseudorandom, and are suitable for use as keying material.
See RFC5705 for more information.
-
Sourcepub fn set_max_concurrent_uni_streams(&self, count: VarInt)
Modifies the number of unidirectional streams that may be concurrently opened.
+Sourcepub fn set_max_concurrent_uni_streams(&self, count: VarInt)
Modifies the number of unidirectional streams that may be concurrently opened.
No streams may be opened by the peer unless fewer than count are already
open. Large counts increase both minimum and worst-case memory consumption.
-Sourcepub fn set_receive_window(&self, receive_window: VarInt)
Sourcepub fn set_max_concurrent_bi_streams(&self, count: VarInt)
Modifies the number of bidirectional streams that may be concurrently opened.
+Sourcepub fn set_receive_window(&self, receive_window: VarInt)
Sourcepub fn set_max_concurrent_bi_streams(&self, count: VarInt)
Modifies the number of bidirectional streams that may be concurrently opened.
No streams may be opened by the peer unless fewer than count are already
open. Large counts increase both minimum and worst-case memory consumption.
-Trait Implementations§
Source§impl Clone for Connection
Source§fn clone(&self) -> Connection
Returns a copy of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreAuto Trait Implementations§
§impl Freeze for Connection
§impl RefUnwindSafe for Connection
§impl Send for Connection
§impl Sync for Connection
§impl Unpin for Connection
§impl UnwindSafe for Connection
Blanket Implementations§
Trait Implementations§
Source§impl Clone for Connection
Source§fn clone(&self) -> Connection
Returns a copy of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreAuto Trait Implementations§
§impl Freeze for Connection
§impl RefUnwindSafe for Connection
§impl Send for Connection
§impl Sync for Connection
§impl Unpin for Connection
§impl UnwindSafe for Connection
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/3217/docs/iroh/endpoint/struct.DirectAddr.html b/pr/3217/docs/iroh/endpoint/struct.DirectAddr.html
index 61a667e47d..04760c9021 100644
--- a/pr/3217/docs/iroh/endpoint/struct.DirectAddr.html
+++ b/pr/3217/docs/iroh/endpoint/struct.DirectAddr.html
@@ -1,4 +1,4 @@
-DirectAddr in iroh::endpoint - Rust pub struct DirectAddr {
+DirectAddr in iroh::endpoint - Rust pub struct DirectAddr {
pub addr: SocketAddr,
pub typ: DirectAddrType,
}
Expand description
A direct address on which an iroh-node might be contactable.
@@ -7,16 +7,16 @@ contacted. These can come from various sources depending on the network topolog
iroh node, see DirectAddrType for the several kinds of sources.
Fields§
§addr: SocketAddrThe address.
§typ: DirectAddrTypeThe origin of this direct address.
-Trait Implementations§
Source§impl Clone for DirectAddr
Source§fn clone(&self) -> DirectAddr
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 DirectAddr
Source§impl Hash for DirectAddr
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
+Trait Implementations§
Source§impl Clone for DirectAddr
Source§fn clone(&self) -> DirectAddr
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 DirectAddr
Source§impl Hash for DirectAddr
Source§impl Ord for DirectAddr
Source§impl Ord for DirectAddr
Source§fn cmp(&self, other: &DirectAddr) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read moreSource§impl PartialEq for DirectAddr
Source§impl PartialOrd for DirectAddr
Source§impl PartialEq for DirectAddr
Source§impl PartialOrd for DirectAddr
Source§impl Eq for DirectAddr
Source§impl StructuralPartialEq for DirectAddr
Auto Trait Implementations§
§impl Freeze for DirectAddr
§impl RefUnwindSafe for DirectAddr
§impl Send for DirectAddr
§impl Sync for DirectAddr
§impl Unpin for DirectAddr
§impl UnwindSafe for DirectAddr
Blanket Implementations§
Source§impl Eq for DirectAddr
Source§impl StructuralPartialEq for DirectAddr
Auto Trait Implementations§
§impl Freeze for DirectAddr
§impl RefUnwindSafe for DirectAddr
§impl Send for DirectAddr
§impl Sync for DirectAddr
§impl Unpin for DirectAddr
§impl UnwindSafe for DirectAddr
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/3217/docs/iroh/endpoint/struct.Endpoint.html b/pr/3217/docs/iroh/endpoint/struct.Endpoint.html
index e25e697700..0b8c9af7b3 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Endpoint.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Endpoint.html
@@ -1,4 +1,4 @@
-Endpoint in iroh::endpoint - Rust pub struct Endpoint { /* private fields */ }
Expand description
Controls an iroh node, establishing connections with other nodes.
+Endpoint in iroh::endpoint - Rust pub struct Endpoint { /* private fields */ }
Expand description
Controls an iroh node, establishing connections with other nodes.
This is the main API interface to create connections to, and accept connections from
other iroh nodes. The connections are peer-to-peer and encrypted, a Relay server is
used to make the connections reliable. See the [crate docs] for a more detailed
@@ -16,17 +16,17 @@ the peer are created using the Connection::open_uni and Connection::open_bi functions.
Note that due to the light-weight properties of streams a stream will only be accepted
once the initiating peer has sent some data on it.
-Implementations§
Source§impl Endpoint
Sourcepub fn builder() -> Builder
Returns the builder for an Endpoint, with a production configuration.
-Sourcepub fn set_alpns(&self, alpns: Vec<Vec<u8>>) -> Result<()>
Sets the list of accepted ALPN protocols.
+Implementations§
Source§impl Endpoint
Sourcepub fn builder() -> Builder
Returns the builder for an Endpoint, with a production configuration.
+Sourcepub async fn connect(
&self,
node_addr: impl Into<NodeAddr>,
alpn: &[u8],
) -> Result<Connection>
Connects to a remote Endpoint.
A value that can be converted into a NodeAddr is required. This can be either a
-NodeAddr, a NodeId or a iroh_base::ticket::NodeTicket.
+NodeAddr, a NodeId or a [iroh_base::ticket::NodeTicket].
The NodeAddr must contain the NodeId to dial and may also contain a RelayUrl
and direct addresses. If direct addresses are provided, they will be used to try and
establish a direct connection without involving a relay server.
@@ -41,7 +41,7 @@ connection attempt will fail with an error.
The alpn, or application-level protocol identifier, is also required. The remote
endpoint must support this alpn, otherwise the connection attempt will fail with
an error.
-Sourcepub async fn connect_with_opts(
+
Sourcepub async fn connect_with_opts(
&self,
node_addr: impl Into<NodeAddr>,
alpn: &[u8],
@@ -61,13 +61,13 @@ security concerns.
establishing and maintaining direct connections. Carefully test settings you use and
consider this currently as still rather experimental.
-
Sourcepub fn accept(&self) -> Accept<'_> ⓘ
Accepts an incoming connection on the endpoint.
Only connections with the ALPNs configured in Builder::alpns will be accepted.
If multiple ALPNs have been configured the ALPN can be inspected before accepting
the connection using Connecting::alpn.
The returned future will yield None if the endpoint is closed by calling
Endpoint::close.
-Sourcepub fn add_node_addr(&self, node_addr: NodeAddr) -> Result<()>
Informs this Endpoint about addresses of the iroh node.
+Sourcepub fn add_node_addr(&self, node_addr: NodeAddr) -> Result<()>
Informs this Endpoint about addresses of the iroh node.
This updates the local state for the remote node. If the provided NodeAddr
contains a RelayUrl this will be used as the new relay server for this node. If
it contains any new IP endpoints they will also be stored and tried when next
@@ -80,7 +80,7 @@ This provides more flexibility and future proofing.
§Errors
Will return an error if we attempt to add our own NodeId to the node map or
if the direct addresses are a subset of ours.
-Sourcepub fn add_node_addr_with_source(
+
Sourcepub fn secret_key(&self) -> &SecretKey
Returns the secret_key of this endpoint.
-Sourcepub fn secret_key(&self) -> &SecretKey
Returns the secret_key of this endpoint.
+Sourcepub fn node_id(&self) -> NodeId
Returns the node id of this endpoint.
This ID is the unique addressing information of this node and other peers must know
it to be able to connect to this node.
-Sourcepub async fn node_addr(&self) -> Result<NodeAddr>
Returns the current NodeAddr for this endpoint.
+Sourcepub async fn node_addr(&self) -> Result<NodeAddr>
Returns the current NodeAddr for this endpoint.
The returned NodeAddr will have the current RelayUrl and direct addresses
as they would be returned by Endpoint::home_relay and
Endpoint::direct_addresses.
In browsers, because direct addresses are unavailable, this will only wait for
the home relay to be available before returning.
-Sourcepub fn home_relay(&self) -> Watcher<Option<RelayUrl>>
Sourcepub fn home_relay(&self) -> Watcher<Option<RelayUrl>>
Returns a Watcher for the RelayUrl of the Relay server used as home relay.
Every endpoint has a home Relay server which it chooses as the server with the
lowest latency out of the configured servers provided by Builder::relay_mode.
This is the server other iroh nodes can use to reliably establish a connection
@@ -122,7 +122,7 @@ some time to connect to find and connect to the home relay server.
let mep = Endpoint::builder().bind().await.unwrap();
let _relay_url = mep.home_relay().initialized().await.unwrap();
-Sourcepub fn direct_addresses(&self) -> Watcher<Option<BTreeSet<DirectAddr>>>
Sourcepub fn direct_addresses(&self) -> Watcher<Option<BTreeSet<DirectAddr>>>
Returns a Watcher for the direct addresses of this Endpoint.
The direct addresses of the Endpoint are those that could be used by other
iroh nodes to establish direct connectivity, depending on the network
situation. The yielded lists of direct addresses contain both the locally-bound
@@ -145,10 +145,10 @@ recently discovered direct addresses.
let mep = Endpoint::builder().bind().await.unwrap();
let _addrs = mep.direct_addresses().initialized().await.unwrap();
-Sourcepub fn bound_sockets(&self) -> (SocketAddr, Option<SocketAddr>)
Available on non-wasm_browser only.
Returns the local socket addresses on which the underlying sockets are bound.
+Sourcepub fn bound_sockets(&self) -> (SocketAddr, Option<SocketAddr>)
Available on non-wasm_browser only.
Returns the local socket addresses on which the underlying sockets are bound.
The Endpoint always binds on an IPv4 address and also tries to bind on an IPv6
address if available.
-Sourcepub fn remote_info(&self, node_id: NodeId) -> Option<RemoteInfo>
Returns information about the remote node identified by a NodeId.
+Sourcepub fn remote_info(&self, node_id: NodeId) -> Option<RemoteInfo>
Returns information about the remote node identified by a NodeId.
The Endpoint keeps some information about remote iroh nodes, which it uses to find
the best path to a node. Having information on a remote node, however, does not mean we have
ever connected to it to or even whether a connection is even possible. The information about a
@@ -157,14 +157,14 @@ calls may return different information. Furthermore, node information may even b
completely evicted as it becomes stale.
See also Endpoint::remote_info_iter which returns information on all nodes known
by this Endpoint.
-Sourcepub fn remote_info_iter(&self) -> impl Iterator<Item = RemoteInfo>
Returns information about all the remote nodes this Endpoint knows about.
+Sourcepub fn remote_info_iter(&self) -> impl Iterator<Item = RemoteInfo>
Returns information about all the remote nodes this Endpoint knows about.
This returns the same information as Endpoint::remote_info for each node known to this
Endpoint.
The Endpoint keeps some information about remote iroh nodes, which it uses to find
the best path to a node. This returns all the nodes it knows about, regardless of whether a
connection was ever made or is even possible.
See also Endpoint::remote_info to only retrieve information about a single node.
-Sourcepub fn discovery_stream(
+
Sourcepub fn discovery_stream(
&self,
) -> impl Stream<Item = Result<DiscoveryItem, Lagged>>
Returns a stream of all remote nodes discovered through the endpoint’s discovery services.
Whenever a node is discovered via the endpoint’s discovery service, the corresponding
@@ -183,7 +183,7 @@ at the time of adding it to the static provider.
Lagged may be yielded, indicating that items were missed.
See also Endpoint::remote_info_iter, which returns an iterator over all remotes
the endpoint knows about at a specific point in time.
-Sourcepub fn conn_type(&self, node_id: NodeId) -> Result<Watcher<ConnectionType>>
Returns a Watcher that reports the current connection type and any changes for
+
Sourcepub fn conn_type(&self, node_id: NodeId) -> Result<Watcher<ConnectionType>>
Returns a Watcher that reports the current connection type and any changes for
given remote node.
This watcher allows observing a stream of ConnectionType items by calling
Watcher::stream(). If the underlying connection to a remote node changes, it will
@@ -202,11 +202,11 @@ recently connected to this node id but previous methods of reaching the node hav
become inaccessible.
§Errors
Will error if we do not have any address information for the given node_id.
-Sourcepub fn dns_resolver(&self) -> &DnsResolver
Available on non-wasm_browser only.
Returns the DNS resolver used in this Endpoint.
+Sourcepub fn dns_resolver(&self) -> &DnsResolver
Available on non-wasm_browser only.
Returns the DNS resolver used in this Endpoint.
-Sourcepub fn discovery(&self) -> Option<&dyn Discovery>
Returns the discovery mechanism, if configured.
+Sourcepub fn discovery(&self) -> Option<&dyn Discovery>
Returns the discovery mechanism, if configured.
See Builder::discovery.
-Sourcepub async fn network_change(&self)
Notifies the system of potential network changes.
+Sourcepub async fn network_change(&self)
Notifies the system of potential network changes.
On many systems iroh is able to detect network changes by itself, however
some systems like android do not expose this functionality to native code.
Android does however provide this functionality to Java code. This
@@ -214,12 +214,12 @@ function allows for notifying iroh of any potential network changes like
this.
Even when the network did not change, or iroh was already able to detect
the network change itself, there is no harm in calling this function.
-Sourcepub fn set_user_data_for_discovery(&self, user_data: Option<UserData>)
Sets the initial user-defined data to be published in discovery services for this node.
+Sourcepub fn set_user_data_for_discovery(&self, user_data: Option<UserData>)
Sets the initial user-defined data to be published in discovery services for this node.
If the user-defined data passed to this function is different to the previous one,
the endpoint will republish its node info to the configured discovery services.
See also Builder::user_data_for_discovery for setting an initial value when
building the endpoint.
-Sourcepub async fn close(&self)
Closes the QUIC endpoint and the magic socket.
This will close any remaining open Connections with an error code
of 0 and an empty reason. Though it is best practice to close those
explicitly before with a custom error code and reason.
@@ -245,8 +245,8 @@ while TCP sockets usually get closed and drained by the operating system in the
kernel during the “Time-Wait” period of the TCP socket.
Be aware however that the underlying UDP sockets are only closed once all clones of
the the respective Endpoint are dropped.
-Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Endpoint
§impl !RefUnwindSafe for Endpoint
§impl Send for Endpoint
§impl Sync for Endpoint
§impl Unpin for Endpoint
§impl !UnwindSafe for Endpoint
Blanket Implementations§
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Endpoint
§impl !RefUnwindSafe for Endpoint
§impl Send for Endpoint
§impl Sync for Endpoint
§impl Unpin for Endpoint
§impl !UnwindSafe for Endpoint
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/3217/docs/iroh/endpoint/struct.Incoming.html b/pr/3217/docs/iroh/endpoint/struct.Incoming.html
index 61f28360fa..6b71064a82 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Incoming.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Incoming.html
@@ -1,29 +1,29 @@
-Incoming in iroh::endpoint - Rust pub struct Incoming { /* private fields */ }
Expand description
An incoming connection for which the server has not yet begun its parts of the
+
Incoming in iroh::endpoint - Rust pub struct Incoming { /* private fields */ }
Expand description
An incoming connection for which the server has not yet begun its parts of the
handshake.
-Implementations§
Source§impl Incoming
Sourcepub fn accept(self) -> Result<Connecting, ConnectionError>
Attempts to accept this incoming connection (an error may still occur).
+Implementations§
Source§impl Incoming
Sourcepub fn accept(self) -> Result<Connecting, ConnectionError>
Attempts to accept this incoming connection (an error may still occur).
Errors occurring here are likely not caused by the application or remote. The QUIC
connection listens on a normal UDP socket and any reachable network endpoint can
send datagrams to it, solicited or not. Even if the first few bytes look like a
QUIC packet, it might not even be a QUIC packet that is being received.
Thus it is common to simply log the errors here and accept them as something which
can happen.
-Sourcepub fn accept_with(
+
Sourcepub fn accept_with(
self,
server_config: Arc<ServerConfig>,
) -> Result<Connecting, ConnectionError>
Accepts this incoming connection using a custom configuration.
See accept() for more details.
-Sourcepub fn retry(self) -> Result<(), RetryError>
Responds with a retry packet.
+Sourcepub fn retry(self) -> Result<(), RetryError>
Responds with a retry packet.
This requires the client to retry with address validation.
Errors if remote_address_validated() is true.
-Sourcepub fn ignore(self)
Ignores this incoming connection attempt, not sending any packet in response.
-Sourcepub fn local_ip(&self) -> Option<IpAddr>
Returns the local IP address which was used when the peer established the
+
Sourcepub fn ignore(self)
Ignores this incoming connection attempt, not sending any packet in response.
+Sourcepub fn local_ip(&self) -> Option<IpAddr>
Returns the local IP address which was used when the peer established the
connection.
-Sourcepub fn remote_address(&self) -> SocketAddr
Returns the peer’s UDP address.
-Sourcepub fn remote_address_validated(&self) -> bool
Whether the socket address that is initiating this connection has been validated.
+Sourcepub fn remote_address(&self) -> SocketAddr
Returns the peer’s UDP address.
+Sourcepub fn remote_address_validated(&self) -> bool
Whether the socket address that is initiating this connection has been validated.
This means that the sender of the initial packet has proved that they can receive
traffic sent to self.remote_address().
-Trait Implementations§
Source§impl IntoFuture for Incoming
Source§type Output = Result<Connection, ConnectionError>
The output that the future will produce on completion.Source§type IntoFuture = IncomingFuture
Which kind of future are we turning this into?Source§fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read moreAuto Trait Implementations§
§impl !Freeze for Incoming
§impl !RefUnwindSafe for Incoming
§impl Send for Incoming
§impl Sync for Incoming
§impl Unpin for Incoming
§impl !UnwindSafe for Incoming
Blanket Implementations§
Trait Implementations§
Source§impl IntoFuture for Incoming
Source§type Output = Result<Connection, ConnectionError>
The output that the future will produce on completion.Source§type IntoFuture = IncomingFuture
Which kind of future are we turning this into?Source§fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read moreAuto Trait Implementations§
§impl !Freeze for Incoming
§impl !RefUnwindSafe for Incoming
§impl Send for Incoming
§impl Sync for Incoming
§impl Unpin for Incoming
§impl !UnwindSafe for Incoming
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/3217/docs/iroh/endpoint/struct.IncomingFuture.html b/pr/3217/docs/iroh/endpoint/struct.IncomingFuture.html
index 504c012c78..3934a53120 100644
--- a/pr/3217/docs/iroh/endpoint/struct.IncomingFuture.html
+++ b/pr/3217/docs/iroh/endpoint/struct.IncomingFuture.html
@@ -1,6 +1,6 @@
-IncomingFuture in iroh::endpoint - Rust pub struct IncomingFuture { /* private fields */ }
Expand description
Adaptor to let Incoming be awaited like a Connecting.
-Trait Implementations§
Source§impl Debug for IncomingFuture
Source§impl Future for IncomingFuture
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for IncomingFuturewhere
+IncomingFuture in iroh::endpoint - Rust pub struct IncomingFuture { /* private fields */ }
Expand description
Adaptor to let Incoming be awaited like a Connecting.
+Trait Implementations§
Source§impl Debug for IncomingFuture
Source§impl Future for IncomingFuture
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for IncomingFuturewhere
PinnedFieldsOf<__IncomingFuture<'pin>>: Unpin,
Auto Trait Implementations§
§impl !Freeze for IncomingFuture
§impl !RefUnwindSafe for IncomingFuture
§impl Send for IncomingFuture
§impl Sync for IncomingFuture
§impl !UnwindSafe for IncomingFuture
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html b/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html
index 792290d8f5..d03f08d892 100644
--- a/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html
+++ b/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html
@@ -1,7 +1,7 @@
-ZeroRttAccepted in iroh::endpoint - Rust pub struct ZeroRttAccepted { /* private fields */ }
Expand description
Future that completes when a connection is fully established.
+ZeroRttAccepted in iroh::endpoint - Rust pub struct ZeroRttAccepted { /* private fields */ }
Expand description
Future that completes when a connection is fully established.
For clients, the resulting value indicates if 0-RTT was accepted. For servers, the resulting
value is meaningless.
-Trait Implementations§
Source§impl Debug for ZeroRttAccepted
Source§impl Future for ZeroRttAccepted
Source§fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>
Attempts to resolve the future to a final value, registering
+Trait Implementations§
Source§impl Debug for ZeroRttAccepted
Source§impl Future for ZeroRttAccepted
Auto Trait Implementations§
§impl Freeze for ZeroRttAccepted
§impl !RefUnwindSafe for ZeroRttAccepted
§impl Send for ZeroRttAccepted
§impl Sync for ZeroRttAccepted
§impl Unpin for ZeroRttAccepted
§impl !UnwindSafe for ZeroRttAccepted
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/enum.KeyParsingError.html b/pr/3217/docs/iroh/enum.KeyParsingError.html
index 55941cda04..c7925e588b 100644
--- a/pr/3217/docs/iroh/enum.KeyParsingError.html
+++ b/pr/3217/docs/iroh/enum.KeyParsingError.html
@@ -1,4 +1,4 @@
-KeyParsingError in iroh - Rust pub enum KeyParsingError {
+KeyParsingError in iroh - Rust Enum KeyParsingError
pub enum KeyParsingError {
Decode(DecodeError),
Key(Error),
DecodeInvalidLength,
@@ -6,7 +6,7 @@
Variants§
§Decode(DecodeError)
Error when decoding.
§Key(Error)
Error when decoding the public key.
§DecodeInvalidLength
The encoded information had the wrong length.
-Trait Implementations§
Source§impl Debug for KeyParsingError
Source§impl Display for KeyParsingError
Source§impl Error for KeyParsingError
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()Source§impl From<DecodeError> for KeyParsingError
Source§fn from(source: DecodeError) -> KeyParsingError
Converts to this type from the input type.Source§impl From<Error> for KeyParsingError
Source§fn from(source: Error) -> KeyParsingError
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for KeyParsingError
§impl !RefUnwindSafe for KeyParsingError
§impl Send for KeyParsingError
§impl Sync for KeyParsingError
§impl Unpin for KeyParsingError
§impl !UnwindSafe for KeyParsingError
Blanket Implementations§
Trait Implementations§
§impl Debug for KeyParsingError
§impl Display for KeyParsingError
§impl Error for KeyParsingError
§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()§impl From<DecodeError> for KeyParsingError
§fn from(source: DecodeError) -> KeyParsingError
Converts to this type from the input type.§impl From<Error> for KeyParsingError
§fn from(source: Error) -> KeyParsingError
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for KeyParsingError
§impl !RefUnwindSafe for KeyParsingError
§impl Send for KeyParsingError
§impl Sync for KeyParsingError
§impl Unpin for KeyParsingError
§impl !UnwindSafe for KeyParsingError
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/3217/docs/iroh/metrics/struct.RelayMetrics.html b/pr/3217/docs/iroh/metrics/struct.RelayMetrics.html
index 83ae1acdcc..6f22d04f93 100644
--- a/pr/3217/docs/iroh/metrics/struct.RelayMetrics.html
+++ b/pr/3217/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/3217/docs/iroh/node_info/constant.IROH_TXT_NAME.html b/pr/3217/docs/iroh/node_info/constant.IROH_TXT_NAME.html
index c78d056a1f..0c1e657fb3 100644
--- a/pr/3217/docs/iroh/node_info/constant.IROH_TXT_NAME.html
+++ b/pr/3217/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/3217/docs/iroh/node_info/index.html b/pr/3217/docs/iroh/node_info/index.html
index 9884414f78..5130358fc8 100644
--- a/pr/3217/docs/iroh/node_info/index.html
+++ b/pr/3217/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/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html b/pr/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html
index 2f1c9b7234..33cd3a33fc 100644
--- a/pr/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html
+++ b/pr/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html
@@ -1,5 +1,5 @@
-MaxLengthExceededError in iroh::node_info - Rust
pub const ENV_FORCE_STAGING_RELAYS: &str = "IROH_FORCE_STAGING_RELAYS";Expand description
Environment variable to force the use of staging relays.
+pub enum DirectAddrType {
+DirectAddrType in iroh::endpoint - Rust pub enum DirectAddrType {
Unknown,
Local,
Stun,
@@ -20,16 +20,16 @@ get a publicly routable direct address.
It is possible to configure iroh to bound to a specific port and independently
configure the router to forward this port to the iroh node. This indicates a
situation like this, which still uses STUN to discover the public address.
-
Trait Implementations§
Source§impl Clone for DirectAddrType
impl Clone for DirectAddrType
Source§fn clone(&self) -> DirectAddrType
fn clone(&self) -> DirectAddrType
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DirectAddrType
impl Debug for DirectAddrType
Source§impl Display for DirectAddrType
impl Display for DirectAddrType
Source§impl Hash for DirectAddrType
impl Hash for DirectAddrType
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
+
fn hash_slice<H>(data: &[Self], state: &mut H)where
+
Trait Implementations§
Source§impl Clone for DirectAddrType
impl Clone for DirectAddrType
Source§fn clone(&self) -> DirectAddrType
fn clone(&self) -> DirectAddrType
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DirectAddrType
impl Debug for DirectAddrType
Source§impl Display for DirectAddrType
impl Display for DirectAddrType
Source§impl Hash for DirectAddrType
impl Hash for DirectAddrType
Source§impl Ord for DirectAddrType
impl Ord for DirectAddrType
Source§impl Ord for DirectAddrType
impl Ord for DirectAddrType
Source§fn cmp(&self, other: &DirectAddrType) -> Ordering
fn cmp(&self, other: &DirectAddrType) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for DirectAddrType
impl PartialEq for DirectAddrType
Source§impl PartialOrd for DirectAddrType
impl PartialOrd for DirectAddrType
Source§impl PartialEq for DirectAddrType
impl PartialEq for DirectAddrType
Source§impl PartialOrd for DirectAddrType
impl PartialOrd for DirectAddrType
impl Copy for DirectAddrType
impl Eq for DirectAddrType
impl StructuralPartialEq for DirectAddrType
Auto Trait Implementations§
impl Freeze for DirectAddrType
impl RefUnwindSafe for DirectAddrType
impl Send for DirectAddrType
impl Sync for DirectAddrType
impl Unpin for DirectAddrType
impl UnwindSafe for DirectAddrType
Blanket Implementations§
impl Copy for DirectAddrType
impl Eq for DirectAddrType
impl StructuralPartialEq for DirectAddrType
Auto Trait Implementations§
impl Freeze for DirectAddrType
impl RefUnwindSafe for DirectAddrType
impl Send for DirectAddrType
impl Sync for DirectAddrType
impl Unpin for DirectAddrType
impl UnwindSafe for DirectAddrType
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/3217/docs/iroh/endpoint/enum.RelayMode.html b/pr/3217/docs/iroh/endpoint/enum.RelayMode.html
index b478f03249..ab87d54df6 100644
--- a/pr/3217/docs/iroh/endpoint/enum.RelayMode.html
+++ b/pr/3217/docs/iroh/endpoint/enum.RelayMode.html
@@ -1,4 +1,4 @@
-RelayMode in iroh::endpoint - Rust pub enum RelayMode {
+RelayMode in iroh::endpoint - Rust pub enum RelayMode {
Disabled,
Default,
Staging,
@@ -9,9 +9,9 @@
See crate::defaults::prod for the severs used.
§Staging
Use the staging relay servers from n0.
§Custom(RelayMap)
Use a custom relay map.
-
Implementations§
Trait Implementations§
Source§impl Eq for RelayMode
Source§impl StructuralPartialEq for RelayMode
Auto Trait Implementations§
§impl Freeze for RelayMode
§impl RefUnwindSafe for RelayMode
§impl Send for RelayMode
§impl Sync for RelayMode
§impl Unpin for RelayMode
§impl UnwindSafe for RelayMode
Blanket Implementations§
Implementations§
Trait Implementations§
Source§impl Eq for RelayMode
Source§impl StructuralPartialEq for RelayMode
Auto Trait Implementations§
§impl Freeze for RelayMode
§impl RefUnwindSafe for RelayMode
§impl Send for RelayMode
§impl Sync for RelayMode
§impl Unpin for RelayMode
§impl UnwindSafe for RelayMode
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/3217/docs/iroh/endpoint/fn.default_relay_mode.html b/pr/3217/docs/iroh/endpoint/fn.default_relay_mode.html
index 3206b983f7..bedd6fe18a 100644
--- a/pr/3217/docs/iroh/endpoint/fn.default_relay_mode.html
+++ b/pr/3217/docs/iroh/endpoint/fn.default_relay_mode.html
@@ -1,4 +1,4 @@
-default_relay_mode in iroh::endpoint - Rust pub fn default_relay_mode() -> RelayMode
Expand description
Returns the default relay mode.
+default_relay_mode in iroh::endpoint - Rust
\ No newline at end of file
diff --git a/pr/3217/docs/iroh/endpoint/fn.force_staging_infra.html b/pr/3217/docs/iroh/endpoint/fn.force_staging_infra.html
index 763aa33a74..eaaa3f19e2 100644
--- a/pr/3217/docs/iroh/endpoint/fn.force_staging_infra.html
+++ b/pr/3217/docs/iroh/endpoint/fn.force_staging_infra.html
@@ -1,2 +1,2 @@
-force_staging_infra in iroh::endpoint - Rust pub fn force_staging_infra() -> bool
Expand description
Returns true if the use of staging relays is forced.
+force_staging_infra in iroh::endpoint - Rust
\ No newline at end of file
diff --git a/pr/3217/docs/iroh/endpoint/index.html b/pr/3217/docs/iroh/endpoint/index.html
index 4deb68bd51..011ed71358 100644
--- a/pr/3217/docs/iroh/endpoint/index.html
+++ b/pr/3217/docs/iroh/endpoint/index.html
@@ -1,4 +1,4 @@
-iroh::endpoint - Rust Expand description
The Endpoint allows establishing connections to other iroh nodes.
+iroh::endpoint - Rust Expand description
The Endpoint allows establishing connections to other iroh nodes.
The Endpoint is the main API interface to manage a local iroh node. It allows
connecting to and accepting connections from other nodes. See the module docs for
more details on how iroh connections work.
diff --git a/pr/3217/docs/iroh/endpoint/struct.Accept.html b/pr/3217/docs/iroh/endpoint/struct.Accept.html
index 58bb4e71ea..74d685c091 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Accept.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Accept.html
@@ -1,6 +1,6 @@
-Accept in iroh::endpoint - Rust pub struct Accept<'a> { /* private fields */ }
Expand description
Future produced by Endpoint::accept.
-Trait Implementations§
Source§impl<'pin, 'a> Unpin for Accept<'a>where
+Accept in iroh::endpoint - Rust pub struct Accept<'a> { /* private fields */ }
Expand description
Future produced by Endpoint::accept.
+Trait Implementations§
Source§impl<'pin, 'a> Unpin for Accept<'a>where
PinnedFieldsOf<__Accept<'pin, 'a>>: Unpin,
Auto Trait Implementations§
§impl<'a> !Freeze for Accept<'a>
§impl<'a> !RefUnwindSafe for Accept<'a>
§impl<'a> Send for Accept<'a>
§impl<'a> Sync for Accept<'a>
§impl<'a> !UnwindSafe for Accept<'a>
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/endpoint/struct.Builder.html b/pr/3217/docs/iroh/endpoint/struct.Builder.html
index 6872da2482..46b31e019e 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Builder.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Builder.html
@@ -1,24 +1,24 @@
-Builder in iroh::endpoint - Rust pub struct Builder { /* private fields */ }
Expand description
Builder for Endpoint.
+Builder in iroh::endpoint - Rust pub struct Builder { /* private fields */ }
Expand description
Builder for Endpoint.
By default the endpoint will generate a new random SecretKey, which will result in a
new NodeId.
To create the Endpoint call Builder::bind.
-Implementations§
Source§impl Builder
Sourcepub fn bind_addr_v4(self, addr: SocketAddrV4) -> Self
Sets the IPv4 bind address.
+Implementations§
Source§impl Builder
Sourcepub fn bind_addr_v4(self, addr: SocketAddrV4) -> Self
Sets the IPv4 bind address.
Setting the port to 0 will use a random port.
If the port specified is already in use, it will fallback to choosing a random port.
By default will use 0.0.0.0:0 to bind to.
-Sourcepub fn bind_addr_v6(self, addr: SocketAddrV6) -> Self
Sets the IPv6 bind address.
+Sourcepub fn bind_addr_v6(self, addr: SocketAddrV6) -> Self
Sets the IPv6 bind address.
Setting the port to 0 will use a random port.
If the port specified is already in use, it will fallback to choosing a random port.
By default will use [::]:0 to bind to.
-Sourcepub fn secret_key(self, secret_key: SecretKey) -> Self
Sets a secret key to authenticate with other peers.
+Sourcepub fn secret_key(self, secret_key: SecretKey) -> Self
Sourcepub fn alpns(self, alpn_protocols: Vec<Vec<u8>>) -> Self
Sets the ALPN protocols that this endpoint will accept on incoming connections.
+Sourcepub fn relay_mode(self, relay_mode: RelayMode) -> Self
Sets the relay servers to assist in establishing connectivity.
+Sourcepub fn relay_mode(self, relay_mode: RelayMode) -> Self
Sets the relay servers to assist in establishing connectivity.
Relay servers are used to establish initial connection with another iroh node.
They also perform various functions related to hole punching, see the crate docs
for more details.
@@ -26,15 +26,22 @@ for more details.
When using RelayMode::Custom, the provided relay_map must contain at least one
configured relay node. If an invalid RelayMap is provided bind
will result in an error.
-Sourcepub fn clear_discovery(self) -> Self
Removes all discovery services from the builder.
-Sourcepub fn discovery(self, discovery: Box<dyn Discovery>) -> Self
Optionally sets a discovery mechanism for this endpoint.
+Sourcepub fn relay_conn_protocol(self, protocol: Protocol) -> Self
Sets the protocol to use for relay connections.
+Options are either Protocol::Websocket or Protocol::Relay.
+Websocket will work with relays version 0.19 and above, so likely with any relays
+deployed at the time of writing this option (websocket support was released 9 months ago).
+Relay will work for now, but will likely be removed with the 1.0 release.
+Default is set to Relay at the moment, until we’ve thoroughly tested and improved
+websocket performance.
+Sourcepub fn clear_discovery(self) -> Self
Removes all discovery services from the builder.
+Sourcepub fn discovery(self, discovery: Box<dyn Discovery>) -> Self
Optionally sets a discovery mechanism for this endpoint.
If you want to combine multiple discovery services, you can use
Builder::add_discovery instead. This will internally create a
crate::discovery::ConcurrentDiscovery.
If no discovery service is set, connecting to a node without providing its
direct addresses or relay URLs will fail.
See the documentation of the Discovery trait for details.
-Sourcepub fn add_discovery<F, D>(self, discovery: F) -> Selfwhere
+
Sourcepub fn add_discovery<F, D>(self, discovery: F) -> Self
Adds a discovery mechanism for this endpoint.
The function discovery
@@ -47,7 +54,7 @@ to use this secret key to sign the information.
direct addresses or relay URLs will fail.
To clear all discovery services, use Builder::clear_discovery.
See the documentation of the Discovery trait for details.
-Sourcepub fn discovery_n0(self) -> Self
Configures the endpoint to use the default n0 DNS discovery service.
+Sourcepub fn discovery_n0(self) -> Self
Configures the endpoint to use the default n0 DNS discovery service.
The default discovery service publishes to and resolves from the
n0.computer dns server iroh.link.
This is equivalent to adding both a crate::discovery::pkarr::PkarrPublisher
@@ -56,29 +63,29 @@ n0.computer dns server.
This will by default use N0_DNS_PKARR_RELAY_PROD.
When in tests, or when the test-utils feature is enabled, this will use the
N0_DNS_PKARR_RELAY_STAGING.
-Sourcepub fn tls_x509(self) -> Self
Use libp2p based self signed certificates for TLS.
For details see the libp2p spec at https://github.com/libp2p/specs/blob/master/tls/tls.md
This is the only mechanism available in iroh@0.33.0 and earlier.
-Sourcepub fn tls_raw_public_keys(self) -> Self
Use TLS Raw Public Keys
+Sourcepub fn tls_raw_public_keys(self) -> Self
Use TLS Raw Public Keys
This is the default, but is not compatible with older versions of iroh.
-Sourcepub fn discovery_dht(self) -> Self
Available on crate feature discovery-pkarr-dht only.
Configures the endpoint to also use the mainline DHT with default settings.
+Sourcepub fn discovery_dht(self) -> Self
Available on crate feature discovery-pkarr-dht only.
Configures the endpoint to also use the mainline DHT with default settings.
This is equivalent to adding a crate::discovery::pkarr::dht::DhtDiscovery
with default settings. Note that DhtDiscovery has various more advanced
configuration options. If you need any of those, you should manually
create a DhtDiscovery and add it with Builder::add_discovery.
-Sourcepub fn discovery_local_network(self) -> Self
Available on crate feature discovery-local-network only.
Configures the endpoint to also use local network discovery.
+Sourcepub fn discovery_local_network(self) -> Self
Available on crate feature discovery-local-network only.
Configures the endpoint to also use local network discovery.
This is equivalent to adding a crate::discovery::mdns::MdnsDiscovery
with default settings. Note that MdnsDiscovery has various more advanced
configuration options. If you need any of those, you should manually
create a MdnsDiscovery and add it with Builder::add_discovery.
-Sourcepub fn user_data_for_discovery(self, user_data: UserData) -> Self
Sets the initial user-defined data to be published in discovery services for this node.
+Sourcepub fn user_data_for_discovery(self, user_data: UserData) -> Self
Sets the initial user-defined data to be published in discovery services for this node.
When using discovery services, this string of UserData will be published together
with the node’s addresses and relay URL. When other nodes discover this node,
they retrieve the UserData in addition to the addressing info.
Iroh itself does not interpret the user-defined data in any way, it is purely left
for applications to parse and use.
-Sourcepub fn known_nodes(self, nodes: Vec<NodeAddr>) -> Self
Optionally set a list of known nodes.
-Sourcepub fn transport_config(self, transport_config: TransportConfig) -> Self
Sets a custom quinn::TransportConfig for this endpoint.
+Sourcepub fn known_nodes(self, nodes: Vec<NodeAddr>) -> Self
Optionally set a list of known nodes.
+Sourcepub fn transport_config(self, transport_config: TransportConfig) -> Self
Sets a custom quinn::TransportConfig for this endpoint.
The transport config contains parameters governing the QUIC state machine.
If unset, the default config is used. Default values should be suitable for most
internet applications. Applications protocols which forbid remotely-initiated
@@ -86,31 +93,31 @@ streams should set max_concurrent_bidi_streams and max_concur
zero.
Please be aware that changing some settings may have adverse effects on establishing
and maintaining direct connections.
-Sourcepub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self
Available on non-wasm_browser only.
Optionally sets a custom DNS resolver to use for this endpoint.
+Sourcepub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self
Available on non-wasm_browser only.
Optionally sets a custom DNS resolver to use for this endpoint.
The DNS resolver is used to resolve relay hostnames, and node addresses if
crate::discovery::dns::DnsDiscovery is configured.
By default, a new DNS resolver is created which is configured to use the
host system’s DNS configuration. You can pass a custom instance of DnsResolver
here to use a differently configured DNS resolver for this endpoint, or to share
a DnsResolver between multiple endpoints.
-Sourcepub fn proxy_url(self, url: Url) -> Self
Sets an explicit proxy url to proxy all HTTP(S) traffic through.
-Sourcepub fn proxy_from_env(self) -> Self
Sets the proxy url from the environment, in this order:
+Sourcepub fn proxy_url(self, url: Url) -> Self
Sets an explicit proxy url to proxy all HTTP(S) traffic through.
+Sourcepub fn proxy_from_env(self) -> Self
Sets the proxy url from the environment, in this order:
HTTP_PROXY
http_proxy
HTTPS_PROXY
https_proxy
-Sourcepub fn keylog(self, keylog: bool) -> Self
Enables saving the TLS pre-master key for connections.
+Sourcepub fn keylog(self, keylog: bool) -> Self
Enables saving the TLS pre-master key for connections.
This key should normally remain secret but can be useful to debug networking issues
by decrypting captured traffic.
If keylog is true then setting the SSLKEYLOGFILE environment variable to a
filename will result in this file being used to log the TLS pre-master keys.
-Sourcepub fn insecure_skip_relay_cert_verify(self, skip_verify: bool) -> Self
Available on crate feature test-utils only.
Skip verification of SSL certificates from relay servers
+Sourcepub fn insecure_skip_relay_cert_verify(self, skip_verify: bool) -> Self
Available on crate feature test-utils only.
Skip verification of SSL certificates from relay servers
May only be used in tests.
-Sourcepub fn path_selection(self, path_selection: PathSelection) -> Self
Available on crate feature test-utils only.
This implies we only use the relay to communicate
+
Sourcepub fn path_selection(self, path_selection: PathSelection) -> Self
Available on crate feature test-utils only.
This implies we only use the relay to communicate
and do not attempt to do any hole punching.
-Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Builder
§impl !RefUnwindSafe for Builder
§impl Send for Builder
§impl Sync for Builder
§impl Unpin for Builder
§impl !UnwindSafe for Builder
Blanket Implementations§
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Builder
§impl !RefUnwindSafe for Builder
§impl Send for Builder
§impl Sync for Builder
§impl Unpin for Builder
§impl !UnwindSafe for Builder
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/3217/docs/iroh/endpoint/struct.ConnectOptions.html b/pr/3217/docs/iroh/endpoint/struct.ConnectOptions.html
index d82c67e528..4b2b9fa2d5 100644
--- a/pr/3217/docs/iroh/endpoint/struct.ConnectOptions.html
+++ b/pr/3217/docs/iroh/endpoint/struct.ConnectOptions.html
@@ -1,12 +1,12 @@
-ConnectOptions in iroh::endpoint - Rust pub struct ConnectOptions { /* private fields */ }
Expand description
Options for the Endpoint::connect_with_opts function.
-Implementations§
Source§impl ConnectOptions
Sourcepub fn new() -> Self
Initializes new connection options.
+ConnectOptions in iroh::endpoint - Rust pub struct ConnectOptions { /* private fields */ }
Expand description
Options for the Endpoint::connect_with_opts function.
+Implementations§
Source§impl ConnectOptions
Sourcepub fn new() -> Self
Initializes new connection options.
By default, the connection will use the same options
as Endpoint::connect, e.g. a default TransportConfig.
-Sourcepub fn with_transport_config(
+
Sourcepub fn with_transport_config(
self,
transport_config: Arc<TransportConfig>,
) -> Self
Sets the QUIC transport config options for this connection.
-Trait Implementations§
Source§impl Clone for ConnectOptions
Source§fn clone(&self) -> ConnectOptions
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 ConnectOptions
Source§impl Default for ConnectOptions
Source§fn default() -> ConnectOptions
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for ConnectOptions
§impl !RefUnwindSafe for ConnectOptions
§impl Send for ConnectOptions
§impl Sync for ConnectOptions
§impl Unpin for ConnectOptions
§impl !UnwindSafe for ConnectOptions
Blanket Implementations§
Trait Implementations§
Source§impl Clone for ConnectOptions
Source§fn clone(&self) -> ConnectOptions
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 ConnectOptions
Source§impl Default for ConnectOptions
Source§fn default() -> ConnectOptions
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for ConnectOptions
§impl !RefUnwindSafe for ConnectOptions
§impl Send for ConnectOptions
§impl Sync for ConnectOptions
§impl Unpin for ConnectOptions
§impl !UnwindSafe for ConnectOptions
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/3217/docs/iroh/endpoint/struct.Connecting.html b/pr/3217/docs/iroh/endpoint/struct.Connecting.html
index 41a03946a4..e190a84876 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Connecting.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Connecting.html
@@ -1,5 +1,5 @@
-Connecting in iroh::endpoint - Rust pub struct Connecting { /* private fields */ }
Expand description
In-progress connection attempt future
-Implementations§
Source§impl Connecting
Sourcepub fn into_0rtt(self) -> Result<(Connection, ZeroRttAccepted), Self>
Converts this Connecting into a 0-RTT or 0.5-RTT connection at the cost of weakened
+
Connecting in iroh::endpoint - Rust pub struct Connecting { /* private fields */ }
Expand description
In-progress connection attempt future
+Implementations§
Source§impl Connecting
Sourcepub fn into_0rtt(self) -> Result<(Connection, ZeroRttAccepted), Self>
Converts this Connecting into a 0-RTT or 0.5-RTT connection at the cost of weakened
security.
Returns Ok immediately if the local endpoint is able to attempt sending 0/0.5-RTT data.
If so, the returned Connection can be used to send application data without waiting for
@@ -33,10 +33,10 @@ before TLS client authentication has occurred, and should therefore not be used
data for which client authentication is being used.
You can use RecvStream::is_0rtt to check whether a stream has been opened in 0-RTT
and thus whether parts of the stream are operating under this reduced security level.
-Sourcepub async fn handshake_data(&mut self) -> Result<Box<dyn Any>, ConnectionError>
Parameters negotiated during the handshake
-Trait Implementations§
Source§impl Debug for Connecting
Source§impl Future for Connecting
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for Connectingwhere
+Sourcepub async fn handshake_data(&mut self) -> Result<Box<dyn Any>, ConnectionError>
Parameters negotiated during the handshake
+
Trait Implementations§
Source§impl Debug for Connecting
Source§impl Future for Connecting
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for Connectingwhere
PinnedFieldsOf<__Connecting<'pin>>: Unpin,
Auto Trait Implementations§
§impl Freeze for Connecting
§impl !RefUnwindSafe for Connecting
§impl Send for Connecting
§impl Sync for Connecting
§impl !UnwindSafe for Connecting
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/endpoint/struct.Connection.html b/pr/3217/docs/iroh/endpoint/struct.Connection.html
index 8e81609487..928cdb9918 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Connection.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Connection.html
@@ -1,4 +1,4 @@
-Connection in iroh::endpoint - Rust pub struct Connection { /* private fields */ }
Expand description
A QUIC connection.
+Connection in iroh::endpoint - Rust pub struct Connection { /* private fields */ }
Expand description
A QUIC connection.
If all references to a connection (including every clone of the Connection handle,
streams of incoming streams, and the various stream types) have been dropped, then the
connection will be automatically closed with an error_code of 0 and an empty reason. You
@@ -8,29 +8,29 @@ receiving CONNECTION_CLOSE the peer may drop any stream data not yet delivered t
application. Connection::close describes in more detail how to gracefully close a
connection without losing application data.
May be cloned to obtain another handle to the same connection.
-Implementations§
Source§impl Connection
Implementations§
Source§impl Connection
Sourcepub fn open_uni(&self) -> OpenUni<'_> ⓘ
Initiates a new outgoing unidirectional stream.
Streams are cheap and instantaneous to open unless blocked by flow control. As a
consequence, the peer won’t be notified that a stream has been opened until the
stream is actually used.
-Sourcepub fn open_bi(&self) -> OpenBi<'_> ⓘ
Initiates a new outgoing bidirectional stream.
Streams are cheap and instantaneous to open unless blocked by flow control. As a
consequence, the peer won’t be notified that a stream has been opened until the
stream is actually used. Calling open_bi then waiting on the RecvStream
without writing anything to SendStream will never succeed.
-Sourcepub fn accept_uni(&self) -> AcceptUni<'_> ⓘ
Accepts the next incoming uni-directional stream.
-Sourcepub fn accept_uni(&self) -> AcceptUni<'_> ⓘ
Accepts the next incoming uni-directional stream.
+Sourcepub fn accept_bi(&self) -> AcceptBi<'_> ⓘ
Accept the next incoming bidirectional stream.
Important Note: The peer that calls open_bi must write to its SendStream
before the peer Connection is able to accept the stream using
accept_bi(). Calling open_bi then waiting on the RecvStream without
writing anything to the connected SendStream will never succeed.
-Sourcepub fn read_datagram(&self) -> ReadDatagram<'_> ⓘ
Receives an application datagram.
-Sourcepub async fn closed(&self) -> ConnectionError
Wait for the connection to be closed for any reason.
+Sourcepub fn read_datagram(&self) -> ReadDatagram<'_> ⓘ
Receives an application datagram.
+Sourcepub async fn closed(&self) -> ConnectionError
Wait for the connection to be closed for any reason.
Despite the return type’s name, closed connections are often not an error condition
at the application layer. Cases that might be routine include
ConnectionError::LocallyClosed and ConnectionError::ApplicationClosed.
-Sourcepub fn close_reason(&self) -> Option<ConnectionError>
If the connection is closed, the reason why.
+Sourcepub fn close_reason(&self) -> Option<ConnectionError>
If the connection is closed, the reason why.
Returns None if the connection is still open.
-Sourcepub fn close(&self, error_code: VarInt, reason: &[u8])
Closes the connection immediately.
Pending operations will fail immediately with ConnectionError::LocallyClosed. No
more data is sent to the peer and the peer may drop buffered data upon receiving the
CONNECTION_CLOSE frame.
@@ -51,41 +51,41 @@ endpoint. Once the local side sends a CONNECTION_CLOSE frame in response to call
close the remote endpoint may drop any data it received but is as yet
undelivered to the application, including data that was acknowledged as received to
the local endpoint.
-Sourcepub fn send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError>
Transmits data as an unreliable, unordered application datagram.
+Sourcepub fn send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError>
Transmits data as an unreliable, unordered application datagram.
Application datagrams are a low-level primitive. They may be lost or delivered out
of order, and data must both fit inside a single QUIC packet and be smaller than
the maximum dictated by the peer.
-Sourcepub fn max_datagram_size(&self) -> Option<usize>
Computes the maximum size of datagrams that may be passed to send_datagram.
+Sourcepub fn max_datagram_size(&self) -> Option<usize>
Computes the maximum size of datagrams that may be passed to send_datagram.
Returns None if datagrams are unsupported by the peer or disabled locally.
This may change over the lifetime of a connection according to variation in the path
MTU estimate. The peer can also enforce an arbitrarily small fixed limit, but if the
peer’s limit is large this is guaranteed to be a little over a kilobyte at minimum.
Not necessarily the maximum size of received datagrams.
-Sourcepub fn datagram_send_buffer_space(&self) -> usize
Bytes available in the outgoing datagram buffer.
+Sourcepub fn datagram_send_buffer_space(&self) -> usize
Bytes available in the outgoing datagram buffer.
When greater than zero, calling send_datagram with a
datagram of at most this size is guaranteed not to cause older datagrams to be
dropped.
-Sourcepub fn rtt(&self) -> Duration
Current best estimate of this connection’s latency (round-trip-time).
-Sourcepub fn stats(&self) -> ConnectionStats
Returns connection statistics.
-Sourcepub fn congestion_state(&self) -> Box<dyn Controller>
Current state of the congestion control algorithm, for debugging purposes.
-Sourcepub fn handshake_data(&self) -> Option<Box<dyn Any>>
Parameters negotiated during the handshake.
+Sourcepub fn rtt(&self) -> Duration
Current best estimate of this connection’s latency (round-trip-time).
+Sourcepub fn stats(&self) -> ConnectionStats
Returns connection statistics.
+Sourcepub fn congestion_state(&self) -> Box<dyn Controller>
Current state of the congestion control algorithm, for debugging purposes.
+Sourcepub fn handshake_data(&self) -> Option<Box<dyn Any>>
Parameters negotiated during the handshake.
Guaranteed to return Some on fully established connections or after
Connecting::handshake_data() succeeds. See that method’s documentations for
details on the returned value.
-Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
-Sourcepub fn peer_identity(&self) -> Option<Box<dyn Any>>
Cryptographic identity of the peer.
+Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
+Sourcepub fn peer_identity(&self) -> Option<Box<dyn Any>>
Sourcepub fn remote_node_id(&self) -> Result<NodeId>
Returns the NodeId from the peer’s TLS certificate.
+Sourcepub fn remote_node_id(&self) -> Result<NodeId>
Sourcepub fn stable_id(&self) -> usize
A stable identifier for this connection.
Peer addresses and connection IDs can change, but this value will remain fixed for
the lifetime of the connection.
-Sourcepub fn export_keying_material(
+
Sourcepub fn export_keying_material(
&self,
output: &mut [u8],
label: &[u8],
@@ -96,14 +96,14 @@ arguments and output buffers of equal length, they will get the
same sequence of bytes in output. These bytes are cryptographically
strong and pseudorandom, and are suitable for use as keying material.
See RFC5705 for more information.
-
Sourcepub fn set_max_concurrent_uni_streams(&self, count: VarInt)
Modifies the number of unidirectional streams that may be concurrently opened.
+Sourcepub fn set_max_concurrent_uni_streams(&self, count: VarInt)
Modifies the number of unidirectional streams that may be concurrently opened.
No streams may be opened by the peer unless fewer than count are already
open. Large counts increase both minimum and worst-case memory consumption.
-Sourcepub fn set_receive_window(&self, receive_window: VarInt)
Sourcepub fn set_max_concurrent_bi_streams(&self, count: VarInt)
Modifies the number of bidirectional streams that may be concurrently opened.
+Sourcepub fn set_receive_window(&self, receive_window: VarInt)
Sourcepub fn set_max_concurrent_bi_streams(&self, count: VarInt)
Modifies the number of bidirectional streams that may be concurrently opened.
No streams may be opened by the peer unless fewer than count are already
open. Large counts increase both minimum and worst-case memory consumption.
-Trait Implementations§
Source§impl Clone for Connection
Source§fn clone(&self) -> Connection
Returns a copy of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreAuto Trait Implementations§
§impl Freeze for Connection
§impl RefUnwindSafe for Connection
§impl Send for Connection
§impl Sync for Connection
§impl Unpin for Connection
§impl UnwindSafe for Connection
Blanket Implementations§
Trait Implementations§
Source§impl Clone for Connection
Source§fn clone(&self) -> Connection
Returns a copy of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreAuto Trait Implementations§
§impl Freeze for Connection
§impl RefUnwindSafe for Connection
§impl Send for Connection
§impl Sync for Connection
§impl Unpin for Connection
§impl UnwindSafe for Connection
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/3217/docs/iroh/endpoint/struct.DirectAddr.html b/pr/3217/docs/iroh/endpoint/struct.DirectAddr.html
index 61a667e47d..04760c9021 100644
--- a/pr/3217/docs/iroh/endpoint/struct.DirectAddr.html
+++ b/pr/3217/docs/iroh/endpoint/struct.DirectAddr.html
@@ -1,4 +1,4 @@
-DirectAddr in iroh::endpoint - Rust pub struct DirectAddr {
+DirectAddr in iroh::endpoint - Rust pub struct DirectAddr {
pub addr: SocketAddr,
pub typ: DirectAddrType,
}
Expand description
A direct address on which an iroh-node might be contactable.
@@ -7,16 +7,16 @@ contacted. These can come from various sources depending on the network topolog
iroh node, see DirectAddrType for the several kinds of sources.
Fields§
§addr: SocketAddrThe address.
§typ: DirectAddrTypeThe origin of this direct address.
-Trait Implementations§
Source§impl Clone for DirectAddr
Source§fn clone(&self) -> DirectAddr
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 DirectAddr
Source§impl Hash for DirectAddr
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
+Trait Implementations§
Source§impl Clone for DirectAddr
Source§fn clone(&self) -> DirectAddr
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 DirectAddr
Source§impl Hash for DirectAddr
Source§impl Ord for DirectAddr
Source§impl Ord for DirectAddr
Source§fn cmp(&self, other: &DirectAddr) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read moreSource§impl PartialEq for DirectAddr
Source§impl PartialOrd for DirectAddr
Source§impl PartialEq for DirectAddr
Source§impl PartialOrd for DirectAddr
Source§impl Eq for DirectAddr
Source§impl StructuralPartialEq for DirectAddr
Auto Trait Implementations§
§impl Freeze for DirectAddr
§impl RefUnwindSafe for DirectAddr
§impl Send for DirectAddr
§impl Sync for DirectAddr
§impl Unpin for DirectAddr
§impl UnwindSafe for DirectAddr
Blanket Implementations§
Source§impl Eq for DirectAddr
Source§impl StructuralPartialEq for DirectAddr
Auto Trait Implementations§
§impl Freeze for DirectAddr
§impl RefUnwindSafe for DirectAddr
§impl Send for DirectAddr
§impl Sync for DirectAddr
§impl Unpin for DirectAddr
§impl UnwindSafe for DirectAddr
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/3217/docs/iroh/endpoint/struct.Endpoint.html b/pr/3217/docs/iroh/endpoint/struct.Endpoint.html
index e25e697700..0b8c9af7b3 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Endpoint.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Endpoint.html
@@ -1,4 +1,4 @@
-Endpoint in iroh::endpoint - Rust pub struct Endpoint { /* private fields */ }
Expand description
Controls an iroh node, establishing connections with other nodes.
+Endpoint in iroh::endpoint - Rust pub struct Endpoint { /* private fields */ }
Expand description
Controls an iroh node, establishing connections with other nodes.
This is the main API interface to create connections to, and accept connections from
other iroh nodes. The connections are peer-to-peer and encrypted, a Relay server is
used to make the connections reliable. See the [crate docs] for a more detailed
@@ -16,17 +16,17 @@ the peer are created using the Connection::open_uni and Connection::open_bi functions.
Note that due to the light-weight properties of streams a stream will only be accepted
once the initiating peer has sent some data on it.
-Implementations§
Source§impl Endpoint
Sourcepub fn builder() -> Builder
Returns the builder for an Endpoint, with a production configuration.
-Sourcepub fn set_alpns(&self, alpns: Vec<Vec<u8>>) -> Result<()>
Sets the list of accepted ALPN protocols.
+Implementations§
Source§impl Endpoint
Sourcepub fn builder() -> Builder
Returns the builder for an Endpoint, with a production configuration.
+Sourcepub async fn connect(
&self,
node_addr: impl Into<NodeAddr>,
alpn: &[u8],
) -> Result<Connection>
Connects to a remote Endpoint.
A value that can be converted into a NodeAddr is required. This can be either a
-NodeAddr, a NodeId or a iroh_base::ticket::NodeTicket.
+NodeAddr, a NodeId or a [iroh_base::ticket::NodeTicket].
The NodeAddr must contain the NodeId to dial and may also contain a RelayUrl
and direct addresses. If direct addresses are provided, they will be used to try and
establish a direct connection without involving a relay server.
@@ -41,7 +41,7 @@ connection attempt will fail with an error.
The alpn, or application-level protocol identifier, is also required. The remote
endpoint must support this alpn, otherwise the connection attempt will fail with
an error.
-Sourcepub async fn connect_with_opts(
+
Sourcepub async fn connect_with_opts(
&self,
node_addr: impl Into<NodeAddr>,
alpn: &[u8],
@@ -61,13 +61,13 @@ security concerns.
establishing and maintaining direct connections. Carefully test settings you use and
consider this currently as still rather experimental.
-
Sourcepub fn accept(&self) -> Accept<'_> ⓘ
Accepts an incoming connection on the endpoint.
Only connections with the ALPNs configured in Builder::alpns will be accepted.
If multiple ALPNs have been configured the ALPN can be inspected before accepting
the connection using Connecting::alpn.
The returned future will yield None if the endpoint is closed by calling
Endpoint::close.
-Sourcepub fn add_node_addr(&self, node_addr: NodeAddr) -> Result<()>
Informs this Endpoint about addresses of the iroh node.
+Sourcepub fn add_node_addr(&self, node_addr: NodeAddr) -> Result<()>
Informs this Endpoint about addresses of the iroh node.
This updates the local state for the remote node. If the provided NodeAddr
contains a RelayUrl this will be used as the new relay server for this node. If
it contains any new IP endpoints they will also be stored and tried when next
@@ -80,7 +80,7 @@ This provides more flexibility and future proofing.
§Errors
Will return an error if we attempt to add our own NodeId to the node map or
if the direct addresses are a subset of ours.
-Sourcepub fn add_node_addr_with_source(
+
Sourcepub fn secret_key(&self) -> &SecretKey
Returns the secret_key of this endpoint.
-Sourcepub fn secret_key(&self) -> &SecretKey
Returns the secret_key of this endpoint.
+Sourcepub fn node_id(&self) -> NodeId
Returns the node id of this endpoint.
This ID is the unique addressing information of this node and other peers must know
it to be able to connect to this node.
-Sourcepub async fn node_addr(&self) -> Result<NodeAddr>
Returns the current NodeAddr for this endpoint.
+Sourcepub async fn node_addr(&self) -> Result<NodeAddr>
Returns the current NodeAddr for this endpoint.
The returned NodeAddr will have the current RelayUrl and direct addresses
as they would be returned by Endpoint::home_relay and
Endpoint::direct_addresses.
In browsers, because direct addresses are unavailable, this will only wait for
the home relay to be available before returning.
-Sourcepub fn home_relay(&self) -> Watcher<Option<RelayUrl>>
Sourcepub fn home_relay(&self) -> Watcher<Option<RelayUrl>>
Returns a Watcher for the RelayUrl of the Relay server used as home relay.
Every endpoint has a home Relay server which it chooses as the server with the
lowest latency out of the configured servers provided by Builder::relay_mode.
This is the server other iroh nodes can use to reliably establish a connection
@@ -122,7 +122,7 @@ some time to connect to find and connect to the home relay server.
let mep = Endpoint::builder().bind().await.unwrap();
let _relay_url = mep.home_relay().initialized().await.unwrap();
-Sourcepub fn direct_addresses(&self) -> Watcher<Option<BTreeSet<DirectAddr>>>
Sourcepub fn direct_addresses(&self) -> Watcher<Option<BTreeSet<DirectAddr>>>
Returns a Watcher for the direct addresses of this Endpoint.
The direct addresses of the Endpoint are those that could be used by other
iroh nodes to establish direct connectivity, depending on the network
situation. The yielded lists of direct addresses contain both the locally-bound
@@ -145,10 +145,10 @@ recently discovered direct addresses.
let mep = Endpoint::builder().bind().await.unwrap();
let _addrs = mep.direct_addresses().initialized().await.unwrap();
-Sourcepub fn bound_sockets(&self) -> (SocketAddr, Option<SocketAddr>)
Available on non-wasm_browser only.
Returns the local socket addresses on which the underlying sockets are bound.
+Sourcepub fn bound_sockets(&self) -> (SocketAddr, Option<SocketAddr>)
Available on non-wasm_browser only.
Returns the local socket addresses on which the underlying sockets are bound.
The Endpoint always binds on an IPv4 address and also tries to bind on an IPv6
address if available.
-Sourcepub fn remote_info(&self, node_id: NodeId) -> Option<RemoteInfo>
Returns information about the remote node identified by a NodeId.
+Sourcepub fn remote_info(&self, node_id: NodeId) -> Option<RemoteInfo>
Returns information about the remote node identified by a NodeId.
The Endpoint keeps some information about remote iroh nodes, which it uses to find
the best path to a node. Having information on a remote node, however, does not mean we have
ever connected to it to or even whether a connection is even possible. The information about a
@@ -157,14 +157,14 @@ calls may return different information. Furthermore, node information may even b
completely evicted as it becomes stale.
See also Endpoint::remote_info_iter which returns information on all nodes known
by this Endpoint.
-Sourcepub fn remote_info_iter(&self) -> impl Iterator<Item = RemoteInfo>
Returns information about all the remote nodes this Endpoint knows about.
+Sourcepub fn remote_info_iter(&self) -> impl Iterator<Item = RemoteInfo>
Returns information about all the remote nodes this Endpoint knows about.
This returns the same information as Endpoint::remote_info for each node known to this
Endpoint.
The Endpoint keeps some information about remote iroh nodes, which it uses to find
the best path to a node. This returns all the nodes it knows about, regardless of whether a
connection was ever made or is even possible.
See also Endpoint::remote_info to only retrieve information about a single node.
-Sourcepub fn discovery_stream(
+
Sourcepub fn discovery_stream(
&self,
) -> impl Stream<Item = Result<DiscoveryItem, Lagged>>
Returns a stream of all remote nodes discovered through the endpoint’s discovery services.
Whenever a node is discovered via the endpoint’s discovery service, the corresponding
@@ -183,7 +183,7 @@ at the time of adding it to the static provider.
Lagged may be yielded, indicating that items were missed.
See also Endpoint::remote_info_iter, which returns an iterator over all remotes
the endpoint knows about at a specific point in time.
-Sourcepub fn conn_type(&self, node_id: NodeId) -> Result<Watcher<ConnectionType>>
Returns a Watcher that reports the current connection type and any changes for
+
Sourcepub fn conn_type(&self, node_id: NodeId) -> Result<Watcher<ConnectionType>>
Returns a Watcher that reports the current connection type and any changes for
given remote node.
This watcher allows observing a stream of ConnectionType items by calling
Watcher::stream(). If the underlying connection to a remote node changes, it will
@@ -202,11 +202,11 @@ recently connected to this node id but previous methods of reaching the node hav
become inaccessible.
§Errors
Will error if we do not have any address information for the given node_id.
-Sourcepub fn dns_resolver(&self) -> &DnsResolver
Available on non-wasm_browser only.
Returns the DNS resolver used in this Endpoint.
+Sourcepub fn dns_resolver(&self) -> &DnsResolver
Available on non-wasm_browser only.
Returns the DNS resolver used in this Endpoint.
-Sourcepub fn discovery(&self) -> Option<&dyn Discovery>
Returns the discovery mechanism, if configured.
+Sourcepub fn discovery(&self) -> Option<&dyn Discovery>
Returns the discovery mechanism, if configured.
See Builder::discovery.
-Sourcepub async fn network_change(&self)
Notifies the system of potential network changes.
+Sourcepub async fn network_change(&self)
Notifies the system of potential network changes.
On many systems iroh is able to detect network changes by itself, however
some systems like android do not expose this functionality to native code.
Android does however provide this functionality to Java code. This
@@ -214,12 +214,12 @@ function allows for notifying iroh of any potential network changes like
this.
Even when the network did not change, or iroh was already able to detect
the network change itself, there is no harm in calling this function.
-Sourcepub fn set_user_data_for_discovery(&self, user_data: Option<UserData>)
Sets the initial user-defined data to be published in discovery services for this node.
+Sourcepub fn set_user_data_for_discovery(&self, user_data: Option<UserData>)
Sets the initial user-defined data to be published in discovery services for this node.
If the user-defined data passed to this function is different to the previous one,
the endpoint will republish its node info to the configured discovery services.
See also Builder::user_data_for_discovery for setting an initial value when
building the endpoint.
-Sourcepub async fn close(&self)
Closes the QUIC endpoint and the magic socket.
This will close any remaining open Connections with an error code
of 0 and an empty reason. Though it is best practice to close those
explicitly before with a custom error code and reason.
@@ -245,8 +245,8 @@ while TCP sockets usually get closed and drained by the operating system in the
kernel during the “Time-Wait” period of the TCP socket.
Be aware however that the underlying UDP sockets are only closed once all clones of
the the respective Endpoint are dropped.
-Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Endpoint
§impl !RefUnwindSafe for Endpoint
§impl Send for Endpoint
§impl Sync for Endpoint
§impl Unpin for Endpoint
§impl !UnwindSafe for Endpoint
Blanket Implementations§
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Endpoint
§impl !RefUnwindSafe for Endpoint
§impl Send for Endpoint
§impl Sync for Endpoint
§impl Unpin for Endpoint
§impl !UnwindSafe for Endpoint
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/3217/docs/iroh/endpoint/struct.Incoming.html b/pr/3217/docs/iroh/endpoint/struct.Incoming.html
index 61f28360fa..6b71064a82 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Incoming.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Incoming.html
@@ -1,29 +1,29 @@
-Incoming in iroh::endpoint - Rust pub struct Incoming { /* private fields */ }
Expand description
An incoming connection for which the server has not yet begun its parts of the
+
Incoming in iroh::endpoint - Rust pub struct Incoming { /* private fields */ }
Expand description
An incoming connection for which the server has not yet begun its parts of the
handshake.
-Implementations§
Source§impl Incoming
Sourcepub fn accept(self) -> Result<Connecting, ConnectionError>
Attempts to accept this incoming connection (an error may still occur).
+Implementations§
Source§impl Incoming
Sourcepub fn accept(self) -> Result<Connecting, ConnectionError>
Attempts to accept this incoming connection (an error may still occur).
Errors occurring here are likely not caused by the application or remote. The QUIC
connection listens on a normal UDP socket and any reachable network endpoint can
send datagrams to it, solicited or not. Even if the first few bytes look like a
QUIC packet, it might not even be a QUIC packet that is being received.
Thus it is common to simply log the errors here and accept them as something which
can happen.
-Sourcepub fn accept_with(
+
Sourcepub fn accept_with(
self,
server_config: Arc<ServerConfig>,
) -> Result<Connecting, ConnectionError>
Accepts this incoming connection using a custom configuration.
See accept() for more details.
-Sourcepub fn retry(self) -> Result<(), RetryError>
Responds with a retry packet.
+Sourcepub fn retry(self) -> Result<(), RetryError>
Responds with a retry packet.
This requires the client to retry with address validation.
Errors if remote_address_validated() is true.
-Sourcepub fn ignore(self)
Ignores this incoming connection attempt, not sending any packet in response.
-Sourcepub fn local_ip(&self) -> Option<IpAddr>
Returns the local IP address which was used when the peer established the
+
Sourcepub fn ignore(self)
Ignores this incoming connection attempt, not sending any packet in response.
+Sourcepub fn local_ip(&self) -> Option<IpAddr>
Returns the local IP address which was used when the peer established the
connection.
-Sourcepub fn remote_address(&self) -> SocketAddr
Returns the peer’s UDP address.
-Sourcepub fn remote_address_validated(&self) -> bool
Whether the socket address that is initiating this connection has been validated.
+Sourcepub fn remote_address(&self) -> SocketAddr
Returns the peer’s UDP address.
+Sourcepub fn remote_address_validated(&self) -> bool
Whether the socket address that is initiating this connection has been validated.
This means that the sender of the initial packet has proved that they can receive
traffic sent to self.remote_address().
-Trait Implementations§
Source§impl IntoFuture for Incoming
Source§type Output = Result<Connection, ConnectionError>
The output that the future will produce on completion.Source§type IntoFuture = IncomingFuture
Which kind of future are we turning this into?Source§fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read moreAuto Trait Implementations§
§impl !Freeze for Incoming
§impl !RefUnwindSafe for Incoming
§impl Send for Incoming
§impl Sync for Incoming
§impl Unpin for Incoming
§impl !UnwindSafe for Incoming
Blanket Implementations§
Trait Implementations§
Source§impl IntoFuture for Incoming
Source§type Output = Result<Connection, ConnectionError>
The output that the future will produce on completion.Source§type IntoFuture = IncomingFuture
Which kind of future are we turning this into?Source§fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read moreAuto Trait Implementations§
§impl !Freeze for Incoming
§impl !RefUnwindSafe for Incoming
§impl Send for Incoming
§impl Sync for Incoming
§impl Unpin for Incoming
§impl !UnwindSafe for Incoming
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/3217/docs/iroh/endpoint/struct.IncomingFuture.html b/pr/3217/docs/iroh/endpoint/struct.IncomingFuture.html
index 504c012c78..3934a53120 100644
--- a/pr/3217/docs/iroh/endpoint/struct.IncomingFuture.html
+++ b/pr/3217/docs/iroh/endpoint/struct.IncomingFuture.html
@@ -1,6 +1,6 @@
-IncomingFuture in iroh::endpoint - Rust pub struct IncomingFuture { /* private fields */ }
Expand description
Adaptor to let Incoming be awaited like a Connecting.
-Trait Implementations§
Source§impl Debug for IncomingFuture
Source§impl Future for IncomingFuture
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for IncomingFuturewhere
+IncomingFuture in iroh::endpoint - Rust pub struct IncomingFuture { /* private fields */ }
Expand description
Adaptor to let Incoming be awaited like a Connecting.
+Trait Implementations§
Source§impl Debug for IncomingFuture
Source§impl Future for IncomingFuture
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for IncomingFuturewhere
PinnedFieldsOf<__IncomingFuture<'pin>>: Unpin,
Auto Trait Implementations§
§impl !Freeze for IncomingFuture
§impl !RefUnwindSafe for IncomingFuture
§impl Send for IncomingFuture
§impl Sync for IncomingFuture
§impl !UnwindSafe for IncomingFuture
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html b/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html
index 792290d8f5..d03f08d892 100644
--- a/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html
+++ b/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html
@@ -1,7 +1,7 @@
-ZeroRttAccepted in iroh::endpoint - Rust pub struct ZeroRttAccepted { /* private fields */ }
Expand description
Future that completes when a connection is fully established.
+ZeroRttAccepted in iroh::endpoint - Rust pub struct ZeroRttAccepted { /* private fields */ }
Expand description
Future that completes when a connection is fully established.
For clients, the resulting value indicates if 0-RTT was accepted. For servers, the resulting
value is meaningless.
-Trait Implementations§
Source§impl Debug for ZeroRttAccepted
Source§impl Future for ZeroRttAccepted
Source§fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>
Attempts to resolve the future to a final value, registering
+Trait Implementations§
Source§impl Debug for ZeroRttAccepted
Source§impl Future for ZeroRttAccepted
Auto Trait Implementations§
§impl Freeze for ZeroRttAccepted
§impl !RefUnwindSafe for ZeroRttAccepted
§impl Send for ZeroRttAccepted
§impl Sync for ZeroRttAccepted
§impl Unpin for ZeroRttAccepted
§impl !UnwindSafe for ZeroRttAccepted
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/enum.KeyParsingError.html b/pr/3217/docs/iroh/enum.KeyParsingError.html
index 55941cda04..c7925e588b 100644
--- a/pr/3217/docs/iroh/enum.KeyParsingError.html
+++ b/pr/3217/docs/iroh/enum.KeyParsingError.html
@@ -1,4 +1,4 @@
-KeyParsingError in iroh - Rust pub enum KeyParsingError {
+KeyParsingError in iroh - Rust Enum KeyParsingError
pub enum KeyParsingError {
Decode(DecodeError),
Key(Error),
DecodeInvalidLength,
@@ -6,7 +6,7 @@
Variants§
§Decode(DecodeError)
Error when decoding.
§Key(Error)
Error when decoding the public key.
§DecodeInvalidLength
The encoded information had the wrong length.
-Trait Implementations§
Source§impl Debug for KeyParsingError
Source§impl Display for KeyParsingError
Source§impl Error for KeyParsingError
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()Source§impl From<DecodeError> for KeyParsingError
Source§fn from(source: DecodeError) -> KeyParsingError
Converts to this type from the input type.Source§impl From<Error> for KeyParsingError
Source§fn from(source: Error) -> KeyParsingError
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for KeyParsingError
§impl !RefUnwindSafe for KeyParsingError
§impl Send for KeyParsingError
§impl Sync for KeyParsingError
§impl Unpin for KeyParsingError
§impl !UnwindSafe for KeyParsingError
Blanket Implementations§
Trait Implementations§
§impl Debug for KeyParsingError
§impl Display for KeyParsingError
§impl Error for KeyParsingError
§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()§impl From<DecodeError> for KeyParsingError
§fn from(source: DecodeError) -> KeyParsingError
Converts to this type from the input type.§impl From<Error> for KeyParsingError
§fn from(source: Error) -> KeyParsingError
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for KeyParsingError
§impl !RefUnwindSafe for KeyParsingError
§impl Send for KeyParsingError
§impl Sync for KeyParsingError
§impl Unpin for KeyParsingError
§impl !UnwindSafe for KeyParsingError
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/3217/docs/iroh/metrics/struct.RelayMetrics.html b/pr/3217/docs/iroh/metrics/struct.RelayMetrics.html
index 83ae1acdcc..6f22d04f93 100644
--- a/pr/3217/docs/iroh/metrics/struct.RelayMetrics.html
+++ b/pr/3217/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/3217/docs/iroh/node_info/constant.IROH_TXT_NAME.html b/pr/3217/docs/iroh/node_info/constant.IROH_TXT_NAME.html
index c78d056a1f..0c1e657fb3 100644
--- a/pr/3217/docs/iroh/node_info/constant.IROH_TXT_NAME.html
+++ b/pr/3217/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/3217/docs/iroh/node_info/index.html b/pr/3217/docs/iroh/node_info/index.html
index 9884414f78..5130358fc8 100644
--- a/pr/3217/docs/iroh/node_info/index.html
+++ b/pr/3217/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/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html b/pr/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html
index 2f1c9b7234..33cd3a33fc 100644
--- a/pr/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html
+++ b/pr/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html
@@ -1,5 +1,5 @@
-MaxLengthExceededError in iroh::node_info - Rust
pub enum RelayMode {
+RelayMode in iroh::endpoint - Rust pub enum RelayMode {
Disabled,
Default,
Staging,
@@ -9,9 +9,9 @@
See crate::defaults::prod for the severs used.
§Staging
Use the staging relay servers from n0.
§Custom(RelayMap)
Use a custom relay map.
-Implementations§
Trait Implementations§
impl Eq for RelayMode
impl StructuralPartialEq for RelayMode
Auto Trait Implementations§
impl Freeze for RelayMode
impl RefUnwindSafe for RelayMode
impl Send for RelayMode
impl Sync for RelayMode
impl Unpin for RelayMode
impl UnwindSafe for RelayMode
Blanket Implementations§
Implementations§
Trait Implementations§
impl Eq for RelayMode
impl StructuralPartialEq for RelayMode
Auto Trait Implementations§
impl Freeze for RelayMode
impl RefUnwindSafe for RelayMode
impl Send for RelayMode
impl Sync for RelayMode
impl Unpin for RelayMode
impl UnwindSafe for RelayMode
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/3217/docs/iroh/endpoint/fn.default_relay_mode.html b/pr/3217/docs/iroh/endpoint/fn.default_relay_mode.html
index 3206b983f7..bedd6fe18a 100644
--- a/pr/3217/docs/iroh/endpoint/fn.default_relay_mode.html
+++ b/pr/3217/docs/iroh/endpoint/fn.default_relay_mode.html
@@ -1,4 +1,4 @@
-default_relay_mode in iroh::endpoint - Rust pub fn default_relay_mode() -> RelayMode
Expand description
Returns the default relay mode.
+default_relay_mode in iroh::endpoint - Rust
\ No newline at end of file
diff --git a/pr/3217/docs/iroh/endpoint/fn.force_staging_infra.html b/pr/3217/docs/iroh/endpoint/fn.force_staging_infra.html
index 763aa33a74..eaaa3f19e2 100644
--- a/pr/3217/docs/iroh/endpoint/fn.force_staging_infra.html
+++ b/pr/3217/docs/iroh/endpoint/fn.force_staging_infra.html
@@ -1,2 +1,2 @@
-force_staging_infra in iroh::endpoint - Rust pub fn force_staging_infra() -> bool
Expand description
Returns true if the use of staging relays is forced.
+force_staging_infra in iroh::endpoint - Rust
\ No newline at end of file
diff --git a/pr/3217/docs/iroh/endpoint/index.html b/pr/3217/docs/iroh/endpoint/index.html
index 4deb68bd51..011ed71358 100644
--- a/pr/3217/docs/iroh/endpoint/index.html
+++ b/pr/3217/docs/iroh/endpoint/index.html
@@ -1,4 +1,4 @@
-iroh::endpoint - Rust Expand description
The Endpoint allows establishing connections to other iroh nodes.
+iroh::endpoint - Rust Expand description
The Endpoint allows establishing connections to other iroh nodes.
The Endpoint is the main API interface to manage a local iroh node. It allows
connecting to and accepting connections from other nodes. See the module docs for
more details on how iroh connections work.
diff --git a/pr/3217/docs/iroh/endpoint/struct.Accept.html b/pr/3217/docs/iroh/endpoint/struct.Accept.html
index 58bb4e71ea..74d685c091 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Accept.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Accept.html
@@ -1,6 +1,6 @@
-Accept in iroh::endpoint - Rust pub struct Accept<'a> { /* private fields */ }
Expand description
Future produced by Endpoint::accept.
-Trait Implementations§
Source§impl<'pin, 'a> Unpin for Accept<'a>where
+Accept in iroh::endpoint - Rust pub struct Accept<'a> { /* private fields */ }
Expand description
Future produced by Endpoint::accept.
+Trait Implementations§
Source§impl<'pin, 'a> Unpin for Accept<'a>where
PinnedFieldsOf<__Accept<'pin, 'a>>: Unpin,
Auto Trait Implementations§
§impl<'a> !Freeze for Accept<'a>
§impl<'a> !RefUnwindSafe for Accept<'a>
§impl<'a> Send for Accept<'a>
§impl<'a> Sync for Accept<'a>
§impl<'a> !UnwindSafe for Accept<'a>
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/endpoint/struct.Builder.html b/pr/3217/docs/iroh/endpoint/struct.Builder.html
index 6872da2482..46b31e019e 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Builder.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Builder.html
@@ -1,24 +1,24 @@
-Builder in iroh::endpoint - Rust pub struct Builder { /* private fields */ }
Expand description
Builder for Endpoint.
+Builder in iroh::endpoint - Rust pub struct Builder { /* private fields */ }
Expand description
Builder for Endpoint.
By default the endpoint will generate a new random SecretKey, which will result in a
new NodeId.
To create the Endpoint call Builder::bind.
-Implementations§
Source§impl Builder
Sourcepub fn bind_addr_v4(self, addr: SocketAddrV4) -> Self
Sets the IPv4 bind address.
+Implementations§
Source§impl Builder
Sourcepub fn bind_addr_v4(self, addr: SocketAddrV4) -> Self
Sets the IPv4 bind address.
Setting the port to 0 will use a random port.
If the port specified is already in use, it will fallback to choosing a random port.
By default will use 0.0.0.0:0 to bind to.
-Sourcepub fn bind_addr_v6(self, addr: SocketAddrV6) -> Self
Sets the IPv6 bind address.
+Sourcepub fn bind_addr_v6(self, addr: SocketAddrV6) -> Self
Sets the IPv6 bind address.
Setting the port to 0 will use a random port.
If the port specified is already in use, it will fallback to choosing a random port.
By default will use [::]:0 to bind to.
-Sourcepub fn secret_key(self, secret_key: SecretKey) -> Self
Sets a secret key to authenticate with other peers.
+Sourcepub fn secret_key(self, secret_key: SecretKey) -> Self
Sourcepub fn alpns(self, alpn_protocols: Vec<Vec<u8>>) -> Self
Sets the ALPN protocols that this endpoint will accept on incoming connections.
+Sourcepub fn relay_mode(self, relay_mode: RelayMode) -> Self
Sets the relay servers to assist in establishing connectivity.
+Sourcepub fn relay_mode(self, relay_mode: RelayMode) -> Self
Sets the relay servers to assist in establishing connectivity.
Relay servers are used to establish initial connection with another iroh node.
They also perform various functions related to hole punching, see the crate docs
for more details.
@@ -26,15 +26,22 @@ for more details.
When using RelayMode::Custom, the provided relay_map must contain at least one
configured relay node. If an invalid RelayMap is provided bind
will result in an error.
-Sourcepub fn clear_discovery(self) -> Self
Removes all discovery services from the builder.
-Sourcepub fn discovery(self, discovery: Box<dyn Discovery>) -> Self
Optionally sets a discovery mechanism for this endpoint.
+Sourcepub fn relay_conn_protocol(self, protocol: Protocol) -> Self
Sets the protocol to use for relay connections.
+Options are either Protocol::Websocket or Protocol::Relay.
+Websocket will work with relays version 0.19 and above, so likely with any relays
+deployed at the time of writing this option (websocket support was released 9 months ago).
+Relay will work for now, but will likely be removed with the 1.0 release.
+Default is set to Relay at the moment, until we’ve thoroughly tested and improved
+websocket performance.
+Sourcepub fn clear_discovery(self) -> Self
Removes all discovery services from the builder.
+Sourcepub fn discovery(self, discovery: Box<dyn Discovery>) -> Self
Optionally sets a discovery mechanism for this endpoint.
If you want to combine multiple discovery services, you can use
Builder::add_discovery instead. This will internally create a
crate::discovery::ConcurrentDiscovery.
If no discovery service is set, connecting to a node without providing its
direct addresses or relay URLs will fail.
See the documentation of the Discovery trait for details.
-Sourcepub fn add_discovery<F, D>(self, discovery: F) -> Selfwhere
+
Sourcepub fn add_discovery<F, D>(self, discovery: F) -> Self
Adds a discovery mechanism for this endpoint.
The function discovery
@@ -47,7 +54,7 @@ to use this secret key to sign the information.
direct addresses or relay URLs will fail.
To clear all discovery services, use Builder::clear_discovery.
See the documentation of the Discovery trait for details.
-Sourcepub fn discovery_n0(self) -> Self
Configures the endpoint to use the default n0 DNS discovery service.
+Sourcepub fn discovery_n0(self) -> Self
Configures the endpoint to use the default n0 DNS discovery service.
The default discovery service publishes to and resolves from the
n0.computer dns server iroh.link.
This is equivalent to adding both a crate::discovery::pkarr::PkarrPublisher
@@ -56,29 +63,29 @@ n0.computer dns server.
This will by default use N0_DNS_PKARR_RELAY_PROD.
When in tests, or when the test-utils feature is enabled, this will use the
N0_DNS_PKARR_RELAY_STAGING.
-Sourcepub fn tls_x509(self) -> Self
Use libp2p based self signed certificates for TLS.
For details see the libp2p spec at https://github.com/libp2p/specs/blob/master/tls/tls.md
This is the only mechanism available in iroh@0.33.0 and earlier.
-Sourcepub fn tls_raw_public_keys(self) -> Self
Use TLS Raw Public Keys
+Sourcepub fn tls_raw_public_keys(self) -> Self
Use TLS Raw Public Keys
This is the default, but is not compatible with older versions of iroh.
-Sourcepub fn discovery_dht(self) -> Self
Available on crate feature discovery-pkarr-dht only.
Configures the endpoint to also use the mainline DHT with default settings.
+Sourcepub fn discovery_dht(self) -> Self
Available on crate feature discovery-pkarr-dht only.
Configures the endpoint to also use the mainline DHT with default settings.
This is equivalent to adding a crate::discovery::pkarr::dht::DhtDiscovery
with default settings. Note that DhtDiscovery has various more advanced
configuration options. If you need any of those, you should manually
create a DhtDiscovery and add it with Builder::add_discovery.
-Sourcepub fn discovery_local_network(self) -> Self
Available on crate feature discovery-local-network only.
Configures the endpoint to also use local network discovery.
+Sourcepub fn discovery_local_network(self) -> Self
Available on crate feature discovery-local-network only.
Configures the endpoint to also use local network discovery.
This is equivalent to adding a crate::discovery::mdns::MdnsDiscovery
with default settings. Note that MdnsDiscovery has various more advanced
configuration options. If you need any of those, you should manually
create a MdnsDiscovery and add it with Builder::add_discovery.
-Sourcepub fn user_data_for_discovery(self, user_data: UserData) -> Self
Sets the initial user-defined data to be published in discovery services for this node.
+Sourcepub fn user_data_for_discovery(self, user_data: UserData) -> Self
Sets the initial user-defined data to be published in discovery services for this node.
When using discovery services, this string of UserData will be published together
with the node’s addresses and relay URL. When other nodes discover this node,
they retrieve the UserData in addition to the addressing info.
Iroh itself does not interpret the user-defined data in any way, it is purely left
for applications to parse and use.
-Sourcepub fn known_nodes(self, nodes: Vec<NodeAddr>) -> Self
Optionally set a list of known nodes.
-Sourcepub fn transport_config(self, transport_config: TransportConfig) -> Self
Sets a custom quinn::TransportConfig for this endpoint.
+Sourcepub fn known_nodes(self, nodes: Vec<NodeAddr>) -> Self
Optionally set a list of known nodes.
+Sourcepub fn transport_config(self, transport_config: TransportConfig) -> Self
Sets a custom quinn::TransportConfig for this endpoint.
The transport config contains parameters governing the QUIC state machine.
If unset, the default config is used. Default values should be suitable for most
internet applications. Applications protocols which forbid remotely-initiated
@@ -86,31 +93,31 @@ streams should set max_concurrent_bidi_streams and max_concur
zero.
Please be aware that changing some settings may have adverse effects on establishing
and maintaining direct connections.
-Sourcepub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self
Available on non-wasm_browser only.
Optionally sets a custom DNS resolver to use for this endpoint.
+Sourcepub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self
Available on non-wasm_browser only.
Optionally sets a custom DNS resolver to use for this endpoint.
The DNS resolver is used to resolve relay hostnames, and node addresses if
crate::discovery::dns::DnsDiscovery is configured.
By default, a new DNS resolver is created which is configured to use the
host system’s DNS configuration. You can pass a custom instance of DnsResolver
here to use a differently configured DNS resolver for this endpoint, or to share
a DnsResolver between multiple endpoints.
-Sourcepub fn proxy_url(self, url: Url) -> Self
Sets an explicit proxy url to proxy all HTTP(S) traffic through.
-Sourcepub fn proxy_from_env(self) -> Self
Sets the proxy url from the environment, in this order:
+Sourcepub fn proxy_url(self, url: Url) -> Self
Sets an explicit proxy url to proxy all HTTP(S) traffic through.
+Sourcepub fn proxy_from_env(self) -> Self
Sets the proxy url from the environment, in this order:
HTTP_PROXY
http_proxy
HTTPS_PROXY
https_proxy
-Sourcepub fn keylog(self, keylog: bool) -> Self
Enables saving the TLS pre-master key for connections.
+Sourcepub fn keylog(self, keylog: bool) -> Self
Enables saving the TLS pre-master key for connections.
This key should normally remain secret but can be useful to debug networking issues
by decrypting captured traffic.
If keylog is true then setting the SSLKEYLOGFILE environment variable to a
filename will result in this file being used to log the TLS pre-master keys.
-Sourcepub fn insecure_skip_relay_cert_verify(self, skip_verify: bool) -> Self
Available on crate feature test-utils only.
Skip verification of SSL certificates from relay servers
+Sourcepub fn insecure_skip_relay_cert_verify(self, skip_verify: bool) -> Self
Available on crate feature test-utils only.
Skip verification of SSL certificates from relay servers
May only be used in tests.
-Sourcepub fn path_selection(self, path_selection: PathSelection) -> Self
Available on crate feature test-utils only.
This implies we only use the relay to communicate
+
Sourcepub fn path_selection(self, path_selection: PathSelection) -> Self
Available on crate feature test-utils only.
This implies we only use the relay to communicate
and do not attempt to do any hole punching.
-Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Builder
§impl !RefUnwindSafe for Builder
§impl Send for Builder
§impl Sync for Builder
§impl Unpin for Builder
§impl !UnwindSafe for Builder
Blanket Implementations§
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Builder
§impl !RefUnwindSafe for Builder
§impl Send for Builder
§impl Sync for Builder
§impl Unpin for Builder
§impl !UnwindSafe for Builder
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/3217/docs/iroh/endpoint/struct.ConnectOptions.html b/pr/3217/docs/iroh/endpoint/struct.ConnectOptions.html
index d82c67e528..4b2b9fa2d5 100644
--- a/pr/3217/docs/iroh/endpoint/struct.ConnectOptions.html
+++ b/pr/3217/docs/iroh/endpoint/struct.ConnectOptions.html
@@ -1,12 +1,12 @@
-ConnectOptions in iroh::endpoint - Rust pub struct ConnectOptions { /* private fields */ }
Expand description
Options for the Endpoint::connect_with_opts function.
-Implementations§
Source§impl ConnectOptions
Sourcepub fn new() -> Self
Initializes new connection options.
+ConnectOptions in iroh::endpoint - Rust pub struct ConnectOptions { /* private fields */ }
Expand description
Options for the Endpoint::connect_with_opts function.
+Implementations§
Source§impl ConnectOptions
Sourcepub fn new() -> Self
Initializes new connection options.
By default, the connection will use the same options
as Endpoint::connect, e.g. a default TransportConfig.
-Sourcepub fn with_transport_config(
+
Sourcepub fn with_transport_config(
self,
transport_config: Arc<TransportConfig>,
) -> Self
Sets the QUIC transport config options for this connection.
-Trait Implementations§
Source§impl Clone for ConnectOptions
Source§fn clone(&self) -> ConnectOptions
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 ConnectOptions
Source§impl Default for ConnectOptions
Source§fn default() -> ConnectOptions
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for ConnectOptions
§impl !RefUnwindSafe for ConnectOptions
§impl Send for ConnectOptions
§impl Sync for ConnectOptions
§impl Unpin for ConnectOptions
§impl !UnwindSafe for ConnectOptions
Blanket Implementations§
Trait Implementations§
Source§impl Clone for ConnectOptions
Source§fn clone(&self) -> ConnectOptions
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 ConnectOptions
Source§impl Default for ConnectOptions
Source§fn default() -> ConnectOptions
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for ConnectOptions
§impl !RefUnwindSafe for ConnectOptions
§impl Send for ConnectOptions
§impl Sync for ConnectOptions
§impl Unpin for ConnectOptions
§impl !UnwindSafe for ConnectOptions
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/3217/docs/iroh/endpoint/struct.Connecting.html b/pr/3217/docs/iroh/endpoint/struct.Connecting.html
index 41a03946a4..e190a84876 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Connecting.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Connecting.html
@@ -1,5 +1,5 @@
-Connecting in iroh::endpoint - Rust pub struct Connecting { /* private fields */ }
Expand description
In-progress connection attempt future
-Implementations§
Source§impl Connecting
Sourcepub fn into_0rtt(self) -> Result<(Connection, ZeroRttAccepted), Self>
Converts this Connecting into a 0-RTT or 0.5-RTT connection at the cost of weakened
+
Connecting in iroh::endpoint - Rust pub struct Connecting { /* private fields */ }
Expand description
In-progress connection attempt future
+Implementations§
Source§impl Connecting
Sourcepub fn into_0rtt(self) -> Result<(Connection, ZeroRttAccepted), Self>
Converts this Connecting into a 0-RTT or 0.5-RTT connection at the cost of weakened
security.
Returns Ok immediately if the local endpoint is able to attempt sending 0/0.5-RTT data.
If so, the returned Connection can be used to send application data without waiting for
@@ -33,10 +33,10 @@ before TLS client authentication has occurred, and should therefore not be used
data for which client authentication is being used.
You can use RecvStream::is_0rtt to check whether a stream has been opened in 0-RTT
and thus whether parts of the stream are operating under this reduced security level.
-Sourcepub async fn handshake_data(&mut self) -> Result<Box<dyn Any>, ConnectionError>
Parameters negotiated during the handshake
-Trait Implementations§
Source§impl Debug for Connecting
Source§impl Future for Connecting
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for Connectingwhere
+Sourcepub async fn handshake_data(&mut self) -> Result<Box<dyn Any>, ConnectionError>
Parameters negotiated during the handshake
+
Trait Implementations§
Source§impl Debug for Connecting
Source§impl Future for Connecting
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for Connectingwhere
PinnedFieldsOf<__Connecting<'pin>>: Unpin,
Auto Trait Implementations§
§impl Freeze for Connecting
§impl !RefUnwindSafe for Connecting
§impl Send for Connecting
§impl Sync for Connecting
§impl !UnwindSafe for Connecting
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/endpoint/struct.Connection.html b/pr/3217/docs/iroh/endpoint/struct.Connection.html
index 8e81609487..928cdb9918 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Connection.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Connection.html
@@ -1,4 +1,4 @@
-Connection in iroh::endpoint - Rust pub struct Connection { /* private fields */ }
Expand description
A QUIC connection.
+Connection in iroh::endpoint - Rust pub struct Connection { /* private fields */ }
Expand description
A QUIC connection.
If all references to a connection (including every clone of the Connection handle,
streams of incoming streams, and the various stream types) have been dropped, then the
connection will be automatically closed with an error_code of 0 and an empty reason. You
@@ -8,29 +8,29 @@ receiving CONNECTION_CLOSE the peer may drop any stream data not yet delivered t
application. Connection::close describes in more detail how to gracefully close a
connection without losing application data.
May be cloned to obtain another handle to the same connection.
-Implementations§
Source§impl Connection
Implementations§
Source§impl Connection
Sourcepub fn open_uni(&self) -> OpenUni<'_> ⓘ
Initiates a new outgoing unidirectional stream.
Streams are cheap and instantaneous to open unless blocked by flow control. As a
consequence, the peer won’t be notified that a stream has been opened until the
stream is actually used.
-Sourcepub fn open_bi(&self) -> OpenBi<'_> ⓘ
Initiates a new outgoing bidirectional stream.
Streams are cheap and instantaneous to open unless blocked by flow control. As a
consequence, the peer won’t be notified that a stream has been opened until the
stream is actually used. Calling open_bi then waiting on the RecvStream
without writing anything to SendStream will never succeed.
-Sourcepub fn accept_uni(&self) -> AcceptUni<'_> ⓘ
Accepts the next incoming uni-directional stream.
-Sourcepub fn accept_uni(&self) -> AcceptUni<'_> ⓘ
Accepts the next incoming uni-directional stream.
+Sourcepub fn accept_bi(&self) -> AcceptBi<'_> ⓘ
Accept the next incoming bidirectional stream.
Important Note: The peer that calls open_bi must write to its SendStream
before the peer Connection is able to accept the stream using
accept_bi(). Calling open_bi then waiting on the RecvStream without
writing anything to the connected SendStream will never succeed.
-Sourcepub fn read_datagram(&self) -> ReadDatagram<'_> ⓘ
Receives an application datagram.
-Sourcepub async fn closed(&self) -> ConnectionError
Wait for the connection to be closed for any reason.
+Sourcepub fn read_datagram(&self) -> ReadDatagram<'_> ⓘ
Receives an application datagram.
+Sourcepub async fn closed(&self) -> ConnectionError
Wait for the connection to be closed for any reason.
Despite the return type’s name, closed connections are often not an error condition
at the application layer. Cases that might be routine include
ConnectionError::LocallyClosed and ConnectionError::ApplicationClosed.
-Sourcepub fn close_reason(&self) -> Option<ConnectionError>
If the connection is closed, the reason why.
+Sourcepub fn close_reason(&self) -> Option<ConnectionError>
If the connection is closed, the reason why.
Returns None if the connection is still open.
-Sourcepub fn close(&self, error_code: VarInt, reason: &[u8])
Closes the connection immediately.
Pending operations will fail immediately with ConnectionError::LocallyClosed. No
more data is sent to the peer and the peer may drop buffered data upon receiving the
CONNECTION_CLOSE frame.
@@ -51,41 +51,41 @@ endpoint. Once the local side sends a CONNECTION_CLOSE frame in response to call
close the remote endpoint may drop any data it received but is as yet
undelivered to the application, including data that was acknowledged as received to
the local endpoint.
-Sourcepub fn send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError>
Transmits data as an unreliable, unordered application datagram.
+Sourcepub fn send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError>
Transmits data as an unreliable, unordered application datagram.
Application datagrams are a low-level primitive. They may be lost or delivered out
of order, and data must both fit inside a single QUIC packet and be smaller than
the maximum dictated by the peer.
-Sourcepub fn max_datagram_size(&self) -> Option<usize>
Computes the maximum size of datagrams that may be passed to send_datagram.
+Sourcepub fn max_datagram_size(&self) -> Option<usize>
Computes the maximum size of datagrams that may be passed to send_datagram.
Returns None if datagrams are unsupported by the peer or disabled locally.
This may change over the lifetime of a connection according to variation in the path
MTU estimate. The peer can also enforce an arbitrarily small fixed limit, but if the
peer’s limit is large this is guaranteed to be a little over a kilobyte at minimum.
Not necessarily the maximum size of received datagrams.
-Sourcepub fn datagram_send_buffer_space(&self) -> usize
Bytes available in the outgoing datagram buffer.
+Sourcepub fn datagram_send_buffer_space(&self) -> usize
Bytes available in the outgoing datagram buffer.
When greater than zero, calling send_datagram with a
datagram of at most this size is guaranteed not to cause older datagrams to be
dropped.
-Sourcepub fn rtt(&self) -> Duration
Current best estimate of this connection’s latency (round-trip-time).
-Sourcepub fn stats(&self) -> ConnectionStats
Returns connection statistics.
-Sourcepub fn congestion_state(&self) -> Box<dyn Controller>
Current state of the congestion control algorithm, for debugging purposes.
-Sourcepub fn handshake_data(&self) -> Option<Box<dyn Any>>
Parameters negotiated during the handshake.
+Sourcepub fn rtt(&self) -> Duration
Current best estimate of this connection’s latency (round-trip-time).
+Sourcepub fn stats(&self) -> ConnectionStats
Returns connection statistics.
+Sourcepub fn congestion_state(&self) -> Box<dyn Controller>
Current state of the congestion control algorithm, for debugging purposes.
+Sourcepub fn handshake_data(&self) -> Option<Box<dyn Any>>
Parameters negotiated during the handshake.
Guaranteed to return Some on fully established connections or after
Connecting::handshake_data() succeeds. See that method’s documentations for
details on the returned value.
-Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
-Sourcepub fn peer_identity(&self) -> Option<Box<dyn Any>>
Cryptographic identity of the peer.
+Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
+Sourcepub fn peer_identity(&self) -> Option<Box<dyn Any>>
Sourcepub fn remote_node_id(&self) -> Result<NodeId>
Returns the NodeId from the peer’s TLS certificate.
+Sourcepub fn remote_node_id(&self) -> Result<NodeId>
Sourcepub fn stable_id(&self) -> usize
A stable identifier for this connection.
Peer addresses and connection IDs can change, but this value will remain fixed for
the lifetime of the connection.
-Sourcepub fn export_keying_material(
+
Sourcepub fn export_keying_material(
&self,
output: &mut [u8],
label: &[u8],
@@ -96,14 +96,14 @@ arguments and output buffers of equal length, they will get the
same sequence of bytes in output. These bytes are cryptographically
strong and pseudorandom, and are suitable for use as keying material.
See RFC5705 for more information.
-
Sourcepub fn set_max_concurrent_uni_streams(&self, count: VarInt)
Modifies the number of unidirectional streams that may be concurrently opened.
+Sourcepub fn set_max_concurrent_uni_streams(&self, count: VarInt)
Modifies the number of unidirectional streams that may be concurrently opened.
No streams may be opened by the peer unless fewer than count are already
open. Large counts increase both minimum and worst-case memory consumption.
-Sourcepub fn set_receive_window(&self, receive_window: VarInt)
Sourcepub fn set_max_concurrent_bi_streams(&self, count: VarInt)
Modifies the number of bidirectional streams that may be concurrently opened.
+Sourcepub fn set_receive_window(&self, receive_window: VarInt)
Sourcepub fn set_max_concurrent_bi_streams(&self, count: VarInt)
Modifies the number of bidirectional streams that may be concurrently opened.
No streams may be opened by the peer unless fewer than count are already
open. Large counts increase both minimum and worst-case memory consumption.
-Trait Implementations§
Source§impl Clone for Connection
Source§fn clone(&self) -> Connection
Returns a copy of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreAuto Trait Implementations§
§impl Freeze for Connection
§impl RefUnwindSafe for Connection
§impl Send for Connection
§impl Sync for Connection
§impl Unpin for Connection
§impl UnwindSafe for Connection
Blanket Implementations§
Trait Implementations§
Source§impl Clone for Connection
Source§fn clone(&self) -> Connection
Returns a copy of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreAuto Trait Implementations§
§impl Freeze for Connection
§impl RefUnwindSafe for Connection
§impl Send for Connection
§impl Sync for Connection
§impl Unpin for Connection
§impl UnwindSafe for Connection
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/3217/docs/iroh/endpoint/struct.DirectAddr.html b/pr/3217/docs/iroh/endpoint/struct.DirectAddr.html
index 61a667e47d..04760c9021 100644
--- a/pr/3217/docs/iroh/endpoint/struct.DirectAddr.html
+++ b/pr/3217/docs/iroh/endpoint/struct.DirectAddr.html
@@ -1,4 +1,4 @@
-DirectAddr in iroh::endpoint - Rust pub struct DirectAddr {
+DirectAddr in iroh::endpoint - Rust pub struct DirectAddr {
pub addr: SocketAddr,
pub typ: DirectAddrType,
}
Expand description
A direct address on which an iroh-node might be contactable.
@@ -7,16 +7,16 @@ contacted. These can come from various sources depending on the network topolog
iroh node, see DirectAddrType for the several kinds of sources.
Fields§
§addr: SocketAddrThe address.
§typ: DirectAddrTypeThe origin of this direct address.
-Trait Implementations§
Source§impl Clone for DirectAddr
Source§fn clone(&self) -> DirectAddr
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 DirectAddr
Source§impl Hash for DirectAddr
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
+Trait Implementations§
Source§impl Clone for DirectAddr
Source§fn clone(&self) -> DirectAddr
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 DirectAddr
Source§impl Hash for DirectAddr
Source§impl Ord for DirectAddr
Source§impl Ord for DirectAddr
Source§fn cmp(&self, other: &DirectAddr) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read moreSource§impl PartialEq for DirectAddr
Source§impl PartialOrd for DirectAddr
Source§impl PartialEq for DirectAddr
Source§impl PartialOrd for DirectAddr
Source§impl Eq for DirectAddr
Source§impl StructuralPartialEq for DirectAddr
Auto Trait Implementations§
§impl Freeze for DirectAddr
§impl RefUnwindSafe for DirectAddr
§impl Send for DirectAddr
§impl Sync for DirectAddr
§impl Unpin for DirectAddr
§impl UnwindSafe for DirectAddr
Blanket Implementations§
Source§impl Eq for DirectAddr
Source§impl StructuralPartialEq for DirectAddr
Auto Trait Implementations§
§impl Freeze for DirectAddr
§impl RefUnwindSafe for DirectAddr
§impl Send for DirectAddr
§impl Sync for DirectAddr
§impl Unpin for DirectAddr
§impl UnwindSafe for DirectAddr
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/3217/docs/iroh/endpoint/struct.Endpoint.html b/pr/3217/docs/iroh/endpoint/struct.Endpoint.html
index e25e697700..0b8c9af7b3 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Endpoint.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Endpoint.html
@@ -1,4 +1,4 @@
-Endpoint in iroh::endpoint - Rust pub struct Endpoint { /* private fields */ }
Expand description
Controls an iroh node, establishing connections with other nodes.
+Endpoint in iroh::endpoint - Rust pub struct Endpoint { /* private fields */ }
Expand description
Controls an iroh node, establishing connections with other nodes.
This is the main API interface to create connections to, and accept connections from
other iroh nodes. The connections are peer-to-peer and encrypted, a Relay server is
used to make the connections reliable. See the [crate docs] for a more detailed
@@ -16,17 +16,17 @@ the peer are created using the Connection::open_uni and Connection::open_bi functions.
Note that due to the light-weight properties of streams a stream will only be accepted
once the initiating peer has sent some data on it.
-Implementations§
Source§impl Endpoint
Sourcepub fn builder() -> Builder
Returns the builder for an Endpoint, with a production configuration.
-Sourcepub fn set_alpns(&self, alpns: Vec<Vec<u8>>) -> Result<()>
Sets the list of accepted ALPN protocols.
+Implementations§
Source§impl Endpoint
Sourcepub fn builder() -> Builder
Returns the builder for an Endpoint, with a production configuration.
+Sourcepub async fn connect(
&self,
node_addr: impl Into<NodeAddr>,
alpn: &[u8],
) -> Result<Connection>
Connects to a remote Endpoint.
A value that can be converted into a NodeAddr is required. This can be either a
-NodeAddr, a NodeId or a iroh_base::ticket::NodeTicket.
+NodeAddr, a NodeId or a [iroh_base::ticket::NodeTicket].
The NodeAddr must contain the NodeId to dial and may also contain a RelayUrl
and direct addresses. If direct addresses are provided, they will be used to try and
establish a direct connection without involving a relay server.
@@ -41,7 +41,7 @@ connection attempt will fail with an error.
The alpn, or application-level protocol identifier, is also required. The remote
endpoint must support this alpn, otherwise the connection attempt will fail with
an error.
-Sourcepub async fn connect_with_opts(
+
Sourcepub async fn connect_with_opts(
&self,
node_addr: impl Into<NodeAddr>,
alpn: &[u8],
@@ -61,13 +61,13 @@ security concerns.
establishing and maintaining direct connections. Carefully test settings you use and
consider this currently as still rather experimental.
-
Sourcepub fn accept(&self) -> Accept<'_> ⓘ
Accepts an incoming connection on the endpoint.
Only connections with the ALPNs configured in Builder::alpns will be accepted.
If multiple ALPNs have been configured the ALPN can be inspected before accepting
the connection using Connecting::alpn.
The returned future will yield None if the endpoint is closed by calling
Endpoint::close.
-Sourcepub fn add_node_addr(&self, node_addr: NodeAddr) -> Result<()>
Informs this Endpoint about addresses of the iroh node.
+Sourcepub fn add_node_addr(&self, node_addr: NodeAddr) -> Result<()>
Informs this Endpoint about addresses of the iroh node.
This updates the local state for the remote node. If the provided NodeAddr
contains a RelayUrl this will be used as the new relay server for this node. If
it contains any new IP endpoints they will also be stored and tried when next
@@ -80,7 +80,7 @@ This provides more flexibility and future proofing.
§Errors
Will return an error if we attempt to add our own NodeId to the node map or
if the direct addresses are a subset of ours.
-Sourcepub fn add_node_addr_with_source(
+
Sourcepub fn secret_key(&self) -> &SecretKey
Returns the secret_key of this endpoint.
-Sourcepub fn secret_key(&self) -> &SecretKey
Returns the secret_key of this endpoint.
+Sourcepub fn node_id(&self) -> NodeId
Returns the node id of this endpoint.
This ID is the unique addressing information of this node and other peers must know
it to be able to connect to this node.
-Sourcepub async fn node_addr(&self) -> Result<NodeAddr>
Returns the current NodeAddr for this endpoint.
+Sourcepub async fn node_addr(&self) -> Result<NodeAddr>
Returns the current NodeAddr for this endpoint.
The returned NodeAddr will have the current RelayUrl and direct addresses
as they would be returned by Endpoint::home_relay and
Endpoint::direct_addresses.
In browsers, because direct addresses are unavailable, this will only wait for
the home relay to be available before returning.
-Sourcepub fn home_relay(&self) -> Watcher<Option<RelayUrl>>
Sourcepub fn home_relay(&self) -> Watcher<Option<RelayUrl>>
Returns a Watcher for the RelayUrl of the Relay server used as home relay.
Every endpoint has a home Relay server which it chooses as the server with the
lowest latency out of the configured servers provided by Builder::relay_mode.
This is the server other iroh nodes can use to reliably establish a connection
@@ -122,7 +122,7 @@ some time to connect to find and connect to the home relay server.
let mep = Endpoint::builder().bind().await.unwrap();
let _relay_url = mep.home_relay().initialized().await.unwrap();
-Sourcepub fn direct_addresses(&self) -> Watcher<Option<BTreeSet<DirectAddr>>>
Sourcepub fn direct_addresses(&self) -> Watcher<Option<BTreeSet<DirectAddr>>>
Returns a Watcher for the direct addresses of this Endpoint.
The direct addresses of the Endpoint are those that could be used by other
iroh nodes to establish direct connectivity, depending on the network
situation. The yielded lists of direct addresses contain both the locally-bound
@@ -145,10 +145,10 @@ recently discovered direct addresses.
let mep = Endpoint::builder().bind().await.unwrap();
let _addrs = mep.direct_addresses().initialized().await.unwrap();
-Sourcepub fn bound_sockets(&self) -> (SocketAddr, Option<SocketAddr>)
Available on non-wasm_browser only.
Returns the local socket addresses on which the underlying sockets are bound.
+Sourcepub fn bound_sockets(&self) -> (SocketAddr, Option<SocketAddr>)
Available on non-wasm_browser only.
Returns the local socket addresses on which the underlying sockets are bound.
The Endpoint always binds on an IPv4 address and also tries to bind on an IPv6
address if available.
-Sourcepub fn remote_info(&self, node_id: NodeId) -> Option<RemoteInfo>
Returns information about the remote node identified by a NodeId.
+Sourcepub fn remote_info(&self, node_id: NodeId) -> Option<RemoteInfo>
Returns information about the remote node identified by a NodeId.
The Endpoint keeps some information about remote iroh nodes, which it uses to find
the best path to a node. Having information on a remote node, however, does not mean we have
ever connected to it to or even whether a connection is even possible. The information about a
@@ -157,14 +157,14 @@ calls may return different information. Furthermore, node information may even b
completely evicted as it becomes stale.
See also Endpoint::remote_info_iter which returns information on all nodes known
by this Endpoint.
-Sourcepub fn remote_info_iter(&self) -> impl Iterator<Item = RemoteInfo>
Returns information about all the remote nodes this Endpoint knows about.
+Sourcepub fn remote_info_iter(&self) -> impl Iterator<Item = RemoteInfo>
Returns information about all the remote nodes this Endpoint knows about.
This returns the same information as Endpoint::remote_info for each node known to this
Endpoint.
The Endpoint keeps some information about remote iroh nodes, which it uses to find
the best path to a node. This returns all the nodes it knows about, regardless of whether a
connection was ever made or is even possible.
See also Endpoint::remote_info to only retrieve information about a single node.
-Sourcepub fn discovery_stream(
+
Sourcepub fn discovery_stream(
&self,
) -> impl Stream<Item = Result<DiscoveryItem, Lagged>>
Returns a stream of all remote nodes discovered through the endpoint’s discovery services.
Whenever a node is discovered via the endpoint’s discovery service, the corresponding
@@ -183,7 +183,7 @@ at the time of adding it to the static provider.
Lagged may be yielded, indicating that items were missed.
See also Endpoint::remote_info_iter, which returns an iterator over all remotes
the endpoint knows about at a specific point in time.
-Sourcepub fn conn_type(&self, node_id: NodeId) -> Result<Watcher<ConnectionType>>
Returns a Watcher that reports the current connection type and any changes for
+
Sourcepub fn conn_type(&self, node_id: NodeId) -> Result<Watcher<ConnectionType>>
Returns a Watcher that reports the current connection type and any changes for
given remote node.
This watcher allows observing a stream of ConnectionType items by calling
Watcher::stream(). If the underlying connection to a remote node changes, it will
@@ -202,11 +202,11 @@ recently connected to this node id but previous methods of reaching the node hav
become inaccessible.
§Errors
Will error if we do not have any address information for the given node_id.
-Sourcepub fn dns_resolver(&self) -> &DnsResolver
Available on non-wasm_browser only.
Returns the DNS resolver used in this Endpoint.
+Sourcepub fn dns_resolver(&self) -> &DnsResolver
Available on non-wasm_browser only.
Returns the DNS resolver used in this Endpoint.
-Sourcepub fn discovery(&self) -> Option<&dyn Discovery>
Returns the discovery mechanism, if configured.
+Sourcepub fn discovery(&self) -> Option<&dyn Discovery>
Returns the discovery mechanism, if configured.
See Builder::discovery.
-Sourcepub async fn network_change(&self)
Notifies the system of potential network changes.
+Sourcepub async fn network_change(&self)
Notifies the system of potential network changes.
On many systems iroh is able to detect network changes by itself, however
some systems like android do not expose this functionality to native code.
Android does however provide this functionality to Java code. This
@@ -214,12 +214,12 @@ function allows for notifying iroh of any potential network changes like
this.
Even when the network did not change, or iroh was already able to detect
the network change itself, there is no harm in calling this function.
-Sourcepub fn set_user_data_for_discovery(&self, user_data: Option<UserData>)
Sets the initial user-defined data to be published in discovery services for this node.
+Sourcepub fn set_user_data_for_discovery(&self, user_data: Option<UserData>)
Sets the initial user-defined data to be published in discovery services for this node.
If the user-defined data passed to this function is different to the previous one,
the endpoint will republish its node info to the configured discovery services.
See also Builder::user_data_for_discovery for setting an initial value when
building the endpoint.
-Sourcepub async fn close(&self)
Closes the QUIC endpoint and the magic socket.
This will close any remaining open Connections with an error code
of 0 and an empty reason. Though it is best practice to close those
explicitly before with a custom error code and reason.
@@ -245,8 +245,8 @@ while TCP sockets usually get closed and drained by the operating system in the
kernel during the “Time-Wait” period of the TCP socket.
Be aware however that the underlying UDP sockets are only closed once all clones of
the the respective Endpoint are dropped.
-Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Endpoint
§impl !RefUnwindSafe for Endpoint
§impl Send for Endpoint
§impl Sync for Endpoint
§impl Unpin for Endpoint
§impl !UnwindSafe for Endpoint
Blanket Implementations§
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Endpoint
§impl !RefUnwindSafe for Endpoint
§impl Send for Endpoint
§impl Sync for Endpoint
§impl Unpin for Endpoint
§impl !UnwindSafe for Endpoint
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/3217/docs/iroh/endpoint/struct.Incoming.html b/pr/3217/docs/iroh/endpoint/struct.Incoming.html
index 61f28360fa..6b71064a82 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Incoming.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Incoming.html
@@ -1,29 +1,29 @@
-Incoming in iroh::endpoint - Rust pub struct Incoming { /* private fields */ }
Expand description
An incoming connection for which the server has not yet begun its parts of the
+
Incoming in iroh::endpoint - Rust pub struct Incoming { /* private fields */ }
Expand description
An incoming connection for which the server has not yet begun its parts of the
handshake.
-Implementations§
Source§impl Incoming
Sourcepub fn accept(self) -> Result<Connecting, ConnectionError>
Attempts to accept this incoming connection (an error may still occur).
+Implementations§
Source§impl Incoming
Sourcepub fn accept(self) -> Result<Connecting, ConnectionError>
Attempts to accept this incoming connection (an error may still occur).
Errors occurring here are likely not caused by the application or remote. The QUIC
connection listens on a normal UDP socket and any reachable network endpoint can
send datagrams to it, solicited or not. Even if the first few bytes look like a
QUIC packet, it might not even be a QUIC packet that is being received.
Thus it is common to simply log the errors here and accept them as something which
can happen.
-Sourcepub fn accept_with(
+
Sourcepub fn accept_with(
self,
server_config: Arc<ServerConfig>,
) -> Result<Connecting, ConnectionError>
Accepts this incoming connection using a custom configuration.
See accept() for more details.
-Sourcepub fn retry(self) -> Result<(), RetryError>
Responds with a retry packet.
+Sourcepub fn retry(self) -> Result<(), RetryError>
Responds with a retry packet.
This requires the client to retry with address validation.
Errors if remote_address_validated() is true.
-Sourcepub fn ignore(self)
Ignores this incoming connection attempt, not sending any packet in response.
-Sourcepub fn local_ip(&self) -> Option<IpAddr>
Returns the local IP address which was used when the peer established the
+
Sourcepub fn ignore(self)
Ignores this incoming connection attempt, not sending any packet in response.
+Sourcepub fn local_ip(&self) -> Option<IpAddr>
Returns the local IP address which was used when the peer established the
connection.
-Sourcepub fn remote_address(&self) -> SocketAddr
Returns the peer’s UDP address.
-Sourcepub fn remote_address_validated(&self) -> bool
Whether the socket address that is initiating this connection has been validated.
+Sourcepub fn remote_address(&self) -> SocketAddr
Returns the peer’s UDP address.
+Sourcepub fn remote_address_validated(&self) -> bool
Whether the socket address that is initiating this connection has been validated.
This means that the sender of the initial packet has proved that they can receive
traffic sent to self.remote_address().
-Trait Implementations§
Source§impl IntoFuture for Incoming
Source§type Output = Result<Connection, ConnectionError>
The output that the future will produce on completion.Source§type IntoFuture = IncomingFuture
Which kind of future are we turning this into?Source§fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read moreAuto Trait Implementations§
§impl !Freeze for Incoming
§impl !RefUnwindSafe for Incoming
§impl Send for Incoming
§impl Sync for Incoming
§impl Unpin for Incoming
§impl !UnwindSafe for Incoming
Blanket Implementations§
Trait Implementations§
Source§impl IntoFuture for Incoming
Source§type Output = Result<Connection, ConnectionError>
The output that the future will produce on completion.Source§type IntoFuture = IncomingFuture
Which kind of future are we turning this into?Source§fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read moreAuto Trait Implementations§
§impl !Freeze for Incoming
§impl !RefUnwindSafe for Incoming
§impl Send for Incoming
§impl Sync for Incoming
§impl Unpin for Incoming
§impl !UnwindSafe for Incoming
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/3217/docs/iroh/endpoint/struct.IncomingFuture.html b/pr/3217/docs/iroh/endpoint/struct.IncomingFuture.html
index 504c012c78..3934a53120 100644
--- a/pr/3217/docs/iroh/endpoint/struct.IncomingFuture.html
+++ b/pr/3217/docs/iroh/endpoint/struct.IncomingFuture.html
@@ -1,6 +1,6 @@
-IncomingFuture in iroh::endpoint - Rust pub struct IncomingFuture { /* private fields */ }
Expand description
Adaptor to let Incoming be awaited like a Connecting.
-Trait Implementations§
Source§impl Debug for IncomingFuture
Source§impl Future for IncomingFuture
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for IncomingFuturewhere
+IncomingFuture in iroh::endpoint - Rust pub struct IncomingFuture { /* private fields */ }
Expand description
Adaptor to let Incoming be awaited like a Connecting.
+Trait Implementations§
Source§impl Debug for IncomingFuture
Source§impl Future for IncomingFuture
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for IncomingFuturewhere
PinnedFieldsOf<__IncomingFuture<'pin>>: Unpin,
Auto Trait Implementations§
§impl !Freeze for IncomingFuture
§impl !RefUnwindSafe for IncomingFuture
§impl Send for IncomingFuture
§impl Sync for IncomingFuture
§impl !UnwindSafe for IncomingFuture
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html b/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html
index 792290d8f5..d03f08d892 100644
--- a/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html
+++ b/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html
@@ -1,7 +1,7 @@
-ZeroRttAccepted in iroh::endpoint - Rust pub struct ZeroRttAccepted { /* private fields */ }
Expand description
Future that completes when a connection is fully established.
+ZeroRttAccepted in iroh::endpoint - Rust pub struct ZeroRttAccepted { /* private fields */ }
Expand description
Future that completes when a connection is fully established.
For clients, the resulting value indicates if 0-RTT was accepted. For servers, the resulting
value is meaningless.
-Trait Implementations§
Source§impl Debug for ZeroRttAccepted
Source§impl Future for ZeroRttAccepted
Source§fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>
Attempts to resolve the future to a final value, registering
+Trait Implementations§
Source§impl Debug for ZeroRttAccepted
Source§impl Future for ZeroRttAccepted
Auto Trait Implementations§
§impl Freeze for ZeroRttAccepted
§impl !RefUnwindSafe for ZeroRttAccepted
§impl Send for ZeroRttAccepted
§impl Sync for ZeroRttAccepted
§impl Unpin for ZeroRttAccepted
§impl !UnwindSafe for ZeroRttAccepted
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/enum.KeyParsingError.html b/pr/3217/docs/iroh/enum.KeyParsingError.html
index 55941cda04..c7925e588b 100644
--- a/pr/3217/docs/iroh/enum.KeyParsingError.html
+++ b/pr/3217/docs/iroh/enum.KeyParsingError.html
@@ -1,4 +1,4 @@
-KeyParsingError in iroh - Rust pub enum KeyParsingError {
+KeyParsingError in iroh - Rust Enum KeyParsingError
pub enum KeyParsingError {
Decode(DecodeError),
Key(Error),
DecodeInvalidLength,
@@ -6,7 +6,7 @@
Variants§
§Decode(DecodeError)
Error when decoding.
§Key(Error)
Error when decoding the public key.
§DecodeInvalidLength
The encoded information had the wrong length.
-Trait Implementations§
Source§impl Debug for KeyParsingError
Source§impl Display for KeyParsingError
Source§impl Error for KeyParsingError
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()Source§impl From<DecodeError> for KeyParsingError
Source§fn from(source: DecodeError) -> KeyParsingError
Converts to this type from the input type.Source§impl From<Error> for KeyParsingError
Source§fn from(source: Error) -> KeyParsingError
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for KeyParsingError
§impl !RefUnwindSafe for KeyParsingError
§impl Send for KeyParsingError
§impl Sync for KeyParsingError
§impl Unpin for KeyParsingError
§impl !UnwindSafe for KeyParsingError
Blanket Implementations§
Trait Implementations§
§impl Debug for KeyParsingError
§impl Display for KeyParsingError
§impl Error for KeyParsingError
§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()§impl From<DecodeError> for KeyParsingError
§fn from(source: DecodeError) -> KeyParsingError
Converts to this type from the input type.§impl From<Error> for KeyParsingError
§fn from(source: Error) -> KeyParsingError
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for KeyParsingError
§impl !RefUnwindSafe for KeyParsingError
§impl Send for KeyParsingError
§impl Sync for KeyParsingError
§impl Unpin for KeyParsingError
§impl !UnwindSafe for KeyParsingError
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/3217/docs/iroh/metrics/struct.RelayMetrics.html b/pr/3217/docs/iroh/metrics/struct.RelayMetrics.html
index 83ae1acdcc..6f22d04f93 100644
--- a/pr/3217/docs/iroh/metrics/struct.RelayMetrics.html
+++ b/pr/3217/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/3217/docs/iroh/node_info/constant.IROH_TXT_NAME.html b/pr/3217/docs/iroh/node_info/constant.IROH_TXT_NAME.html
index c78d056a1f..0c1e657fb3 100644
--- a/pr/3217/docs/iroh/node_info/constant.IROH_TXT_NAME.html
+++ b/pr/3217/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/3217/docs/iroh/node_info/index.html b/pr/3217/docs/iroh/node_info/index.html
index 9884414f78..5130358fc8 100644
--- a/pr/3217/docs/iroh/node_info/index.html
+++ b/pr/3217/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/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html b/pr/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html
index 2f1c9b7234..33cd3a33fc 100644
--- a/pr/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html
+++ b/pr/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html
@@ -1,5 +1,5 @@
-MaxLengthExceededError in iroh::node_info - Rust
pub fn default_relay_mode() -> RelayModeExpand description
Returns the default relay mode.
+pub fn force_staging_infra() -> boolExpand description
Returns true if the use of staging relays is forced.
Expand description
The Endpoint allows establishing connections to other iroh nodes.
Expand description
The Endpoint allows establishing connections to other iroh nodes.
The Endpoint is the main API interface to manage a local iroh node. It allows
connecting to and accepting connections from other nodes. See the module docs for
more details on how iroh connections work.
pub struct Accept<'a> { /* private fields */ }Expand description
Future produced by Endpoint::accept.
Trait Implementations§
impl<'pin, 'a> Unpin for Accept<'a>where
+Accept in iroh::endpoint - Rust pub struct Accept<'a> { /* private fields */ }
Expand description
Future produced by Endpoint::accept.
+Trait Implementations§
Source§impl<'pin, 'a> Unpin for Accept<'a>where
PinnedFieldsOf<__Accept<'pin, 'a>>: Unpin,
Auto Trait Implementations§
§impl<'a> !Freeze for Accept<'a>
§impl<'a> !RefUnwindSafe for Accept<'a>
§impl<'a> Send for Accept<'a>
§impl<'a> Sync for Accept<'a>
§impl<'a> !UnwindSafe for Accept<'a>
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/endpoint/struct.Builder.html b/pr/3217/docs/iroh/endpoint/struct.Builder.html
index 6872da2482..46b31e019e 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Builder.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Builder.html
@@ -1,24 +1,24 @@
-Builder in iroh::endpoint - Rust pub struct Builder { /* private fields */ }
Expand description
Builder for Endpoint.
+Builder in iroh::endpoint - Rust pub struct Builder { /* private fields */ }
Expand description
Builder for Endpoint.
By default the endpoint will generate a new random SecretKey, which will result in a
new NodeId.
To create the Endpoint call Builder::bind.
-Implementations§
Source§impl Builder
Sourcepub fn bind_addr_v4(self, addr: SocketAddrV4) -> Self
Sets the IPv4 bind address.
+Implementations§
Source§impl Builder
Sourcepub fn bind_addr_v4(self, addr: SocketAddrV4) -> Self
Sets the IPv4 bind address.
Setting the port to 0 will use a random port.
If the port specified is already in use, it will fallback to choosing a random port.
By default will use 0.0.0.0:0 to bind to.
-Sourcepub fn bind_addr_v6(self, addr: SocketAddrV6) -> Self
Sets the IPv6 bind address.
+Sourcepub fn bind_addr_v6(self, addr: SocketAddrV6) -> Self
Sets the IPv6 bind address.
Setting the port to 0 will use a random port.
If the port specified is already in use, it will fallback to choosing a random port.
By default will use [::]:0 to bind to.
-Sourcepub fn secret_key(self, secret_key: SecretKey) -> Self
Sets a secret key to authenticate with other peers.
+Sourcepub fn secret_key(self, secret_key: SecretKey) -> Self
Sourcepub fn alpns(self, alpn_protocols: Vec<Vec<u8>>) -> Self
Sets the ALPN protocols that this endpoint will accept on incoming connections.
+Sourcepub fn relay_mode(self, relay_mode: RelayMode) -> Self
Sets the relay servers to assist in establishing connectivity.
+Sourcepub fn relay_mode(self, relay_mode: RelayMode) -> Self
Sets the relay servers to assist in establishing connectivity.
Relay servers are used to establish initial connection with another iroh node.
They also perform various functions related to hole punching, see the crate docs
for more details.
@@ -26,15 +26,22 @@ for more details.
When using RelayMode::Custom, the provided relay_map must contain at least one
configured relay node. If an invalid RelayMap is provided bind
will result in an error.
-Sourcepub fn clear_discovery(self) -> Self
Removes all discovery services from the builder.
-Sourcepub fn discovery(self, discovery: Box<dyn Discovery>) -> Self
Optionally sets a discovery mechanism for this endpoint.
+Sourcepub fn relay_conn_protocol(self, protocol: Protocol) -> Self
Sets the protocol to use for relay connections.
+Options are either Protocol::Websocket or Protocol::Relay.
+Websocket will work with relays version 0.19 and above, so likely with any relays
+deployed at the time of writing this option (websocket support was released 9 months ago).
+Relay will work for now, but will likely be removed with the 1.0 release.
+Default is set to Relay at the moment, until we’ve thoroughly tested and improved
+websocket performance.
+Sourcepub fn clear_discovery(self) -> Self
Removes all discovery services from the builder.
+Sourcepub fn discovery(self, discovery: Box<dyn Discovery>) -> Self
Optionally sets a discovery mechanism for this endpoint.
If you want to combine multiple discovery services, you can use
Builder::add_discovery instead. This will internally create a
crate::discovery::ConcurrentDiscovery.
If no discovery service is set, connecting to a node without providing its
direct addresses or relay URLs will fail.
See the documentation of the Discovery trait for details.
-Sourcepub fn add_discovery<F, D>(self, discovery: F) -> Selfwhere
+
Sourcepub fn add_discovery<F, D>(self, discovery: F) -> Self
Adds a discovery mechanism for this endpoint.
The function discovery
@@ -47,7 +54,7 @@ to use this secret key to sign the information.
direct addresses or relay URLs will fail.
To clear all discovery services, use Builder::clear_discovery.
See the documentation of the Discovery trait for details.
-Sourcepub fn discovery_n0(self) -> Self
Configures the endpoint to use the default n0 DNS discovery service.
+Sourcepub fn discovery_n0(self) -> Self
Configures the endpoint to use the default n0 DNS discovery service.
The default discovery service publishes to and resolves from the
n0.computer dns server iroh.link.
This is equivalent to adding both a crate::discovery::pkarr::PkarrPublisher
@@ -56,29 +63,29 @@ n0.computer dns server.
This will by default use N0_DNS_PKARR_RELAY_PROD.
When in tests, or when the test-utils feature is enabled, this will use the
N0_DNS_PKARR_RELAY_STAGING.
-Sourcepub fn tls_x509(self) -> Self
Use libp2p based self signed certificates for TLS.
For details see the libp2p spec at https://github.com/libp2p/specs/blob/master/tls/tls.md
This is the only mechanism available in iroh@0.33.0 and earlier.
-Sourcepub fn tls_raw_public_keys(self) -> Self
Use TLS Raw Public Keys
+Sourcepub fn tls_raw_public_keys(self) -> Self
Use TLS Raw Public Keys
This is the default, but is not compatible with older versions of iroh.
-Sourcepub fn discovery_dht(self) -> Self
Available on crate feature discovery-pkarr-dht only.
Configures the endpoint to also use the mainline DHT with default settings.
+Sourcepub fn discovery_dht(self) -> Self
Available on crate feature discovery-pkarr-dht only.
Configures the endpoint to also use the mainline DHT with default settings.
This is equivalent to adding a crate::discovery::pkarr::dht::DhtDiscovery
with default settings. Note that DhtDiscovery has various more advanced
configuration options. If you need any of those, you should manually
create a DhtDiscovery and add it with Builder::add_discovery.
-Sourcepub fn discovery_local_network(self) -> Self
Available on crate feature discovery-local-network only.
Configures the endpoint to also use local network discovery.
+Sourcepub fn discovery_local_network(self) -> Self
Available on crate feature discovery-local-network only.
Configures the endpoint to also use local network discovery.
This is equivalent to adding a crate::discovery::mdns::MdnsDiscovery
with default settings. Note that MdnsDiscovery has various more advanced
configuration options. If you need any of those, you should manually
create a MdnsDiscovery and add it with Builder::add_discovery.
-Sourcepub fn user_data_for_discovery(self, user_data: UserData) -> Self
Sets the initial user-defined data to be published in discovery services for this node.
+Sourcepub fn user_data_for_discovery(self, user_data: UserData) -> Self
Sets the initial user-defined data to be published in discovery services for this node.
When using discovery services, this string of UserData will be published together
with the node’s addresses and relay URL. When other nodes discover this node,
they retrieve the UserData in addition to the addressing info.
Iroh itself does not interpret the user-defined data in any way, it is purely left
for applications to parse and use.
-Sourcepub fn known_nodes(self, nodes: Vec<NodeAddr>) -> Self
Optionally set a list of known nodes.
-Sourcepub fn transport_config(self, transport_config: TransportConfig) -> Self
Sets a custom quinn::TransportConfig for this endpoint.
+Sourcepub fn known_nodes(self, nodes: Vec<NodeAddr>) -> Self
Optionally set a list of known nodes.
+Sourcepub fn transport_config(self, transport_config: TransportConfig) -> Self
Sets a custom quinn::TransportConfig for this endpoint.
The transport config contains parameters governing the QUIC state machine.
If unset, the default config is used. Default values should be suitable for most
internet applications. Applications protocols which forbid remotely-initiated
@@ -86,31 +93,31 @@ streams should set max_concurrent_bidi_streams and max_concur
zero.
Please be aware that changing some settings may have adverse effects on establishing
and maintaining direct connections.
-Sourcepub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self
Available on non-wasm_browser only.
Optionally sets a custom DNS resolver to use for this endpoint.
+Sourcepub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self
Available on non-wasm_browser only.
Optionally sets a custom DNS resolver to use for this endpoint.
The DNS resolver is used to resolve relay hostnames, and node addresses if
crate::discovery::dns::DnsDiscovery is configured.
By default, a new DNS resolver is created which is configured to use the
host system’s DNS configuration. You can pass a custom instance of DnsResolver
here to use a differently configured DNS resolver for this endpoint, or to share
a DnsResolver between multiple endpoints.
-Sourcepub fn proxy_url(self, url: Url) -> Self
Sets an explicit proxy url to proxy all HTTP(S) traffic through.
-Sourcepub fn proxy_from_env(self) -> Self
Sets the proxy url from the environment, in this order:
+Sourcepub fn proxy_url(self, url: Url) -> Self
Sets an explicit proxy url to proxy all HTTP(S) traffic through.
+Sourcepub fn proxy_from_env(self) -> Self
Sets the proxy url from the environment, in this order:
HTTP_PROXY
http_proxy
HTTPS_PROXY
https_proxy
-Sourcepub fn keylog(self, keylog: bool) -> Self
Enables saving the TLS pre-master key for connections.
+Sourcepub fn keylog(self, keylog: bool) -> Self
Enables saving the TLS pre-master key for connections.
This key should normally remain secret but can be useful to debug networking issues
by decrypting captured traffic.
If keylog is true then setting the SSLKEYLOGFILE environment variable to a
filename will result in this file being used to log the TLS pre-master keys.
-Sourcepub fn insecure_skip_relay_cert_verify(self, skip_verify: bool) -> Self
Available on crate feature test-utils only.
Skip verification of SSL certificates from relay servers
+Sourcepub fn insecure_skip_relay_cert_verify(self, skip_verify: bool) -> Self
Available on crate feature test-utils only.
Skip verification of SSL certificates from relay servers
May only be used in tests.
-Sourcepub fn path_selection(self, path_selection: PathSelection) -> Self
Available on crate feature test-utils only.
This implies we only use the relay to communicate
+
Sourcepub fn path_selection(self, path_selection: PathSelection) -> Self
Available on crate feature test-utils only.
This implies we only use the relay to communicate
and do not attempt to do any hole punching.
-Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Builder
§impl !RefUnwindSafe for Builder
§impl Send for Builder
§impl Sync for Builder
§impl Unpin for Builder
§impl !UnwindSafe for Builder
Blanket Implementations§
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Builder
§impl !RefUnwindSafe for Builder
§impl Send for Builder
§impl Sync for Builder
§impl Unpin for Builder
§impl !UnwindSafe for Builder
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/3217/docs/iroh/endpoint/struct.ConnectOptions.html b/pr/3217/docs/iroh/endpoint/struct.ConnectOptions.html
index d82c67e528..4b2b9fa2d5 100644
--- a/pr/3217/docs/iroh/endpoint/struct.ConnectOptions.html
+++ b/pr/3217/docs/iroh/endpoint/struct.ConnectOptions.html
@@ -1,12 +1,12 @@
-ConnectOptions in iroh::endpoint - Rust pub struct ConnectOptions { /* private fields */ }
Expand description
Options for the Endpoint::connect_with_opts function.
-Implementations§
Source§impl ConnectOptions
Sourcepub fn new() -> Self
Initializes new connection options.
+ConnectOptions in iroh::endpoint - Rust pub struct ConnectOptions { /* private fields */ }
Expand description
Options for the Endpoint::connect_with_opts function.
+Implementations§
Source§impl ConnectOptions
Sourcepub fn new() -> Self
Initializes new connection options.
By default, the connection will use the same options
as Endpoint::connect, e.g. a default TransportConfig.
-Sourcepub fn with_transport_config(
+
Sourcepub fn with_transport_config(
self,
transport_config: Arc<TransportConfig>,
) -> Self
Sets the QUIC transport config options for this connection.
-Trait Implementations§
Source§impl Clone for ConnectOptions
Source§fn clone(&self) -> ConnectOptions
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 ConnectOptions
Source§impl Default for ConnectOptions
Source§fn default() -> ConnectOptions
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for ConnectOptions
§impl !RefUnwindSafe for ConnectOptions
§impl Send for ConnectOptions
§impl Sync for ConnectOptions
§impl Unpin for ConnectOptions
§impl !UnwindSafe for ConnectOptions
Blanket Implementations§
Trait Implementations§
Source§impl Clone for ConnectOptions
Source§fn clone(&self) -> ConnectOptions
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 ConnectOptions
Source§impl Default for ConnectOptions
Source§fn default() -> ConnectOptions
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for ConnectOptions
§impl !RefUnwindSafe for ConnectOptions
§impl Send for ConnectOptions
§impl Sync for ConnectOptions
§impl Unpin for ConnectOptions
§impl !UnwindSafe for ConnectOptions
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/3217/docs/iroh/endpoint/struct.Connecting.html b/pr/3217/docs/iroh/endpoint/struct.Connecting.html
index 41a03946a4..e190a84876 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Connecting.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Connecting.html
@@ -1,5 +1,5 @@
-Connecting in iroh::endpoint - Rust pub struct Connecting { /* private fields */ }
Expand description
In-progress connection attempt future
-Implementations§
Source§impl Connecting
Sourcepub fn into_0rtt(self) -> Result<(Connection, ZeroRttAccepted), Self>
Converts this Connecting into a 0-RTT or 0.5-RTT connection at the cost of weakened
+
Connecting in iroh::endpoint - Rust pub struct Connecting { /* private fields */ }
Expand description
In-progress connection attempt future
+Implementations§
Source§impl Connecting
Sourcepub fn into_0rtt(self) -> Result<(Connection, ZeroRttAccepted), Self>
Converts this Connecting into a 0-RTT or 0.5-RTT connection at the cost of weakened
security.
Returns Ok immediately if the local endpoint is able to attempt sending 0/0.5-RTT data.
If so, the returned Connection can be used to send application data without waiting for
@@ -33,10 +33,10 @@ before TLS client authentication has occurred, and should therefore not be used
data for which client authentication is being used.
You can use RecvStream::is_0rtt to check whether a stream has been opened in 0-RTT
and thus whether parts of the stream are operating under this reduced security level.
-Sourcepub async fn handshake_data(&mut self) -> Result<Box<dyn Any>, ConnectionError>
Parameters negotiated during the handshake
-Trait Implementations§
Source§impl Debug for Connecting
Source§impl Future for Connecting
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for Connectingwhere
+Sourcepub async fn handshake_data(&mut self) -> Result<Box<dyn Any>, ConnectionError>
Parameters negotiated during the handshake
+
Trait Implementations§
Source§impl Debug for Connecting
Source§impl Future for Connecting
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for Connectingwhere
PinnedFieldsOf<__Connecting<'pin>>: Unpin,
Auto Trait Implementations§
§impl Freeze for Connecting
§impl !RefUnwindSafe for Connecting
§impl Send for Connecting
§impl Sync for Connecting
§impl !UnwindSafe for Connecting
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/endpoint/struct.Connection.html b/pr/3217/docs/iroh/endpoint/struct.Connection.html
index 8e81609487..928cdb9918 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Connection.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Connection.html
@@ -1,4 +1,4 @@
-Connection in iroh::endpoint - Rust pub struct Connection { /* private fields */ }
Expand description
A QUIC connection.
+Connection in iroh::endpoint - Rust pub struct Connection { /* private fields */ }
Expand description
A QUIC connection.
If all references to a connection (including every clone of the Connection handle,
streams of incoming streams, and the various stream types) have been dropped, then the
connection will be automatically closed with an error_code of 0 and an empty reason. You
@@ -8,29 +8,29 @@ receiving CONNECTION_CLOSE the peer may drop any stream data not yet delivered t
application. Connection::close describes in more detail how to gracefully close a
connection without losing application data.
May be cloned to obtain another handle to the same connection.
-Implementations§
Source§impl Connection
Implementations§
Source§impl Connection
Sourcepub fn open_uni(&self) -> OpenUni<'_> ⓘ
Initiates a new outgoing unidirectional stream.
Streams are cheap and instantaneous to open unless blocked by flow control. As a
consequence, the peer won’t be notified that a stream has been opened until the
stream is actually used.
-Sourcepub fn open_bi(&self) -> OpenBi<'_> ⓘ
Initiates a new outgoing bidirectional stream.
Streams are cheap and instantaneous to open unless blocked by flow control. As a
consequence, the peer won’t be notified that a stream has been opened until the
stream is actually used. Calling open_bi then waiting on the RecvStream
without writing anything to SendStream will never succeed.
-Sourcepub fn accept_uni(&self) -> AcceptUni<'_> ⓘ
Accepts the next incoming uni-directional stream.
-Sourcepub fn accept_uni(&self) -> AcceptUni<'_> ⓘ
Accepts the next incoming uni-directional stream.
+Sourcepub fn accept_bi(&self) -> AcceptBi<'_> ⓘ
Accept the next incoming bidirectional stream.
Important Note: The peer that calls open_bi must write to its SendStream
before the peer Connection is able to accept the stream using
accept_bi(). Calling open_bi then waiting on the RecvStream without
writing anything to the connected SendStream will never succeed.
-Sourcepub fn read_datagram(&self) -> ReadDatagram<'_> ⓘ
Receives an application datagram.
-Sourcepub async fn closed(&self) -> ConnectionError
Wait for the connection to be closed for any reason.
+Sourcepub fn read_datagram(&self) -> ReadDatagram<'_> ⓘ
Receives an application datagram.
+Sourcepub async fn closed(&self) -> ConnectionError
Wait for the connection to be closed for any reason.
Despite the return type’s name, closed connections are often not an error condition
at the application layer. Cases that might be routine include
ConnectionError::LocallyClosed and ConnectionError::ApplicationClosed.
-Sourcepub fn close_reason(&self) -> Option<ConnectionError>
If the connection is closed, the reason why.
+Sourcepub fn close_reason(&self) -> Option<ConnectionError>
If the connection is closed, the reason why.
Returns None if the connection is still open.
-Sourcepub fn close(&self, error_code: VarInt, reason: &[u8])
Closes the connection immediately.
Pending operations will fail immediately with ConnectionError::LocallyClosed. No
more data is sent to the peer and the peer may drop buffered data upon receiving the
CONNECTION_CLOSE frame.
@@ -51,41 +51,41 @@ endpoint. Once the local side sends a CONNECTION_CLOSE frame in response to call
close the remote endpoint may drop any data it received but is as yet
undelivered to the application, including data that was acknowledged as received to
the local endpoint.
-Sourcepub fn send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError>
Transmits data as an unreliable, unordered application datagram.
+Sourcepub fn send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError>
Transmits data as an unreliable, unordered application datagram.
Application datagrams are a low-level primitive. They may be lost or delivered out
of order, and data must both fit inside a single QUIC packet and be smaller than
the maximum dictated by the peer.
-Sourcepub fn max_datagram_size(&self) -> Option<usize>
Computes the maximum size of datagrams that may be passed to send_datagram.
+Sourcepub fn max_datagram_size(&self) -> Option<usize>
Computes the maximum size of datagrams that may be passed to send_datagram.
Returns None if datagrams are unsupported by the peer or disabled locally.
This may change over the lifetime of a connection according to variation in the path
MTU estimate. The peer can also enforce an arbitrarily small fixed limit, but if the
peer’s limit is large this is guaranteed to be a little over a kilobyte at minimum.
Not necessarily the maximum size of received datagrams.
-Sourcepub fn datagram_send_buffer_space(&self) -> usize
Bytes available in the outgoing datagram buffer.
+Sourcepub fn datagram_send_buffer_space(&self) -> usize
Bytes available in the outgoing datagram buffer.
When greater than zero, calling send_datagram with a
datagram of at most this size is guaranteed not to cause older datagrams to be
dropped.
-Sourcepub fn rtt(&self) -> Duration
Current best estimate of this connection’s latency (round-trip-time).
-Sourcepub fn stats(&self) -> ConnectionStats
Returns connection statistics.
-Sourcepub fn congestion_state(&self) -> Box<dyn Controller>
Current state of the congestion control algorithm, for debugging purposes.
-Sourcepub fn handshake_data(&self) -> Option<Box<dyn Any>>
Parameters negotiated during the handshake.
+Sourcepub fn rtt(&self) -> Duration
Current best estimate of this connection’s latency (round-trip-time).
+Sourcepub fn stats(&self) -> ConnectionStats
Returns connection statistics.
+Sourcepub fn congestion_state(&self) -> Box<dyn Controller>
Current state of the congestion control algorithm, for debugging purposes.
+Sourcepub fn handshake_data(&self) -> Option<Box<dyn Any>>
Parameters negotiated during the handshake.
Guaranteed to return Some on fully established connections or after
Connecting::handshake_data() succeeds. See that method’s documentations for
details on the returned value.
-Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
-Sourcepub fn peer_identity(&self) -> Option<Box<dyn Any>>
Cryptographic identity of the peer.
+Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
+Sourcepub fn peer_identity(&self) -> Option<Box<dyn Any>>
Sourcepub fn remote_node_id(&self) -> Result<NodeId>
Returns the NodeId from the peer’s TLS certificate.
+Sourcepub fn remote_node_id(&self) -> Result<NodeId>
Sourcepub fn stable_id(&self) -> usize
A stable identifier for this connection.
Peer addresses and connection IDs can change, but this value will remain fixed for
the lifetime of the connection.
-Sourcepub fn export_keying_material(
+
Sourcepub fn export_keying_material(
&self,
output: &mut [u8],
label: &[u8],
@@ -96,14 +96,14 @@ arguments and output buffers of equal length, they will get the
same sequence of bytes in output. These bytes are cryptographically
strong and pseudorandom, and are suitable for use as keying material.
See RFC5705 for more information.
-
Sourcepub fn set_max_concurrent_uni_streams(&self, count: VarInt)
Modifies the number of unidirectional streams that may be concurrently opened.
+Sourcepub fn set_max_concurrent_uni_streams(&self, count: VarInt)
Modifies the number of unidirectional streams that may be concurrently opened.
No streams may be opened by the peer unless fewer than count are already
open. Large counts increase both minimum and worst-case memory consumption.
-Sourcepub fn set_receive_window(&self, receive_window: VarInt)
Sourcepub fn set_max_concurrent_bi_streams(&self, count: VarInt)
Modifies the number of bidirectional streams that may be concurrently opened.
+Sourcepub fn set_receive_window(&self, receive_window: VarInt)
Sourcepub fn set_max_concurrent_bi_streams(&self, count: VarInt)
Modifies the number of bidirectional streams that may be concurrently opened.
No streams may be opened by the peer unless fewer than count are already
open. Large counts increase both minimum and worst-case memory consumption.
-Trait Implementations§
Source§impl Clone for Connection
Source§fn clone(&self) -> Connection
Returns a copy of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreAuto Trait Implementations§
§impl Freeze for Connection
§impl RefUnwindSafe for Connection
§impl Send for Connection
§impl Sync for Connection
§impl Unpin for Connection
§impl UnwindSafe for Connection
Blanket Implementations§
Trait Implementations§
Source§impl Clone for Connection
Source§fn clone(&self) -> Connection
Returns a copy of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreAuto Trait Implementations§
§impl Freeze for Connection
§impl RefUnwindSafe for Connection
§impl Send for Connection
§impl Sync for Connection
§impl Unpin for Connection
§impl UnwindSafe for Connection
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/3217/docs/iroh/endpoint/struct.DirectAddr.html b/pr/3217/docs/iroh/endpoint/struct.DirectAddr.html
index 61a667e47d..04760c9021 100644
--- a/pr/3217/docs/iroh/endpoint/struct.DirectAddr.html
+++ b/pr/3217/docs/iroh/endpoint/struct.DirectAddr.html
@@ -1,4 +1,4 @@
-DirectAddr in iroh::endpoint - Rust pub struct DirectAddr {
+DirectAddr in iroh::endpoint - Rust pub struct DirectAddr {
pub addr: SocketAddr,
pub typ: DirectAddrType,
}
Expand description
A direct address on which an iroh-node might be contactable.
@@ -7,16 +7,16 @@ contacted. These can come from various sources depending on the network topolog
iroh node, see DirectAddrType for the several kinds of sources.
Fields§
§addr: SocketAddrThe address.
§typ: DirectAddrTypeThe origin of this direct address.
-Trait Implementations§
Source§impl Clone for DirectAddr
Source§fn clone(&self) -> DirectAddr
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 DirectAddr
Source§impl Hash for DirectAddr
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
+Trait Implementations§
Source§impl Clone for DirectAddr
Source§fn clone(&self) -> DirectAddr
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 DirectAddr
Source§impl Hash for DirectAddr
Source§impl Ord for DirectAddr
Source§impl Ord for DirectAddr
Source§fn cmp(&self, other: &DirectAddr) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read moreSource§impl PartialEq for DirectAddr
Source§impl PartialOrd for DirectAddr
Source§impl PartialEq for DirectAddr
Source§impl PartialOrd for DirectAddr
Source§impl Eq for DirectAddr
Source§impl StructuralPartialEq for DirectAddr
Auto Trait Implementations§
§impl Freeze for DirectAddr
§impl RefUnwindSafe for DirectAddr
§impl Send for DirectAddr
§impl Sync for DirectAddr
§impl Unpin for DirectAddr
§impl UnwindSafe for DirectAddr
Blanket Implementations§
Source§impl Eq for DirectAddr
Source§impl StructuralPartialEq for DirectAddr
Auto Trait Implementations§
§impl Freeze for DirectAddr
§impl RefUnwindSafe for DirectAddr
§impl Send for DirectAddr
§impl Sync for DirectAddr
§impl Unpin for DirectAddr
§impl UnwindSafe for DirectAddr
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/3217/docs/iroh/endpoint/struct.Endpoint.html b/pr/3217/docs/iroh/endpoint/struct.Endpoint.html
index e25e697700..0b8c9af7b3 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Endpoint.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Endpoint.html
@@ -1,4 +1,4 @@
-Endpoint in iroh::endpoint - Rust pub struct Endpoint { /* private fields */ }
Expand description
Controls an iroh node, establishing connections with other nodes.
+Endpoint in iroh::endpoint - Rust pub struct Endpoint { /* private fields */ }
Expand description
Controls an iroh node, establishing connections with other nodes.
This is the main API interface to create connections to, and accept connections from
other iroh nodes. The connections are peer-to-peer and encrypted, a Relay server is
used to make the connections reliable. See the [crate docs] for a more detailed
@@ -16,17 +16,17 @@ the peer are created using the Connection::open_uni and Connection::open_bi functions.
Note that due to the light-weight properties of streams a stream will only be accepted
once the initiating peer has sent some data on it.
-Implementations§
Source§impl Endpoint
Sourcepub fn builder() -> Builder
Returns the builder for an Endpoint, with a production configuration.
-Sourcepub fn set_alpns(&self, alpns: Vec<Vec<u8>>) -> Result<()>
Sets the list of accepted ALPN protocols.
+Implementations§
Source§impl Endpoint
Sourcepub fn builder() -> Builder
Returns the builder for an Endpoint, with a production configuration.
+Sourcepub async fn connect(
&self,
node_addr: impl Into<NodeAddr>,
alpn: &[u8],
) -> Result<Connection>
Connects to a remote Endpoint.
A value that can be converted into a NodeAddr is required. This can be either a
-NodeAddr, a NodeId or a iroh_base::ticket::NodeTicket.
+NodeAddr, a NodeId or a [iroh_base::ticket::NodeTicket].
The NodeAddr must contain the NodeId to dial and may also contain a RelayUrl
and direct addresses. If direct addresses are provided, they will be used to try and
establish a direct connection without involving a relay server.
@@ -41,7 +41,7 @@ connection attempt will fail with an error.
The alpn, or application-level protocol identifier, is also required. The remote
endpoint must support this alpn, otherwise the connection attempt will fail with
an error.
-Sourcepub async fn connect_with_opts(
+
Sourcepub async fn connect_with_opts(
&self,
node_addr: impl Into<NodeAddr>,
alpn: &[u8],
@@ -61,13 +61,13 @@ security concerns.
establishing and maintaining direct connections. Carefully test settings you use and
consider this currently as still rather experimental.
-
Sourcepub fn accept(&self) -> Accept<'_> ⓘ
Accepts an incoming connection on the endpoint.
Only connections with the ALPNs configured in Builder::alpns will be accepted.
If multiple ALPNs have been configured the ALPN can be inspected before accepting
the connection using Connecting::alpn.
The returned future will yield None if the endpoint is closed by calling
Endpoint::close.
-Sourcepub fn add_node_addr(&self, node_addr: NodeAddr) -> Result<()>
Informs this Endpoint about addresses of the iroh node.
+Sourcepub fn add_node_addr(&self, node_addr: NodeAddr) -> Result<()>
Informs this Endpoint about addresses of the iroh node.
This updates the local state for the remote node. If the provided NodeAddr
contains a RelayUrl this will be used as the new relay server for this node. If
it contains any new IP endpoints they will also be stored and tried when next
@@ -80,7 +80,7 @@ This provides more flexibility and future proofing.
§Errors
Will return an error if we attempt to add our own NodeId to the node map or
if the direct addresses are a subset of ours.
-Sourcepub fn add_node_addr_with_source(
+
Sourcepub fn secret_key(&self) -> &SecretKey
Returns the secret_key of this endpoint.
-Sourcepub fn secret_key(&self) -> &SecretKey
Returns the secret_key of this endpoint.
+Sourcepub fn node_id(&self) -> NodeId
Returns the node id of this endpoint.
This ID is the unique addressing information of this node and other peers must know
it to be able to connect to this node.
-Sourcepub async fn node_addr(&self) -> Result<NodeAddr>
Returns the current NodeAddr for this endpoint.
+Sourcepub async fn node_addr(&self) -> Result<NodeAddr>
Returns the current NodeAddr for this endpoint.
The returned NodeAddr will have the current RelayUrl and direct addresses
as they would be returned by Endpoint::home_relay and
Endpoint::direct_addresses.
In browsers, because direct addresses are unavailable, this will only wait for
the home relay to be available before returning.
-Sourcepub fn home_relay(&self) -> Watcher<Option<RelayUrl>>
Sourcepub fn home_relay(&self) -> Watcher<Option<RelayUrl>>
Returns a Watcher for the RelayUrl of the Relay server used as home relay.
Every endpoint has a home Relay server which it chooses as the server with the
lowest latency out of the configured servers provided by Builder::relay_mode.
This is the server other iroh nodes can use to reliably establish a connection
@@ -122,7 +122,7 @@ some time to connect to find and connect to the home relay server.
let mep = Endpoint::builder().bind().await.unwrap();
let _relay_url = mep.home_relay().initialized().await.unwrap();
-Sourcepub fn direct_addresses(&self) -> Watcher<Option<BTreeSet<DirectAddr>>>
Sourcepub fn direct_addresses(&self) -> Watcher<Option<BTreeSet<DirectAddr>>>
Returns a Watcher for the direct addresses of this Endpoint.
The direct addresses of the Endpoint are those that could be used by other
iroh nodes to establish direct connectivity, depending on the network
situation. The yielded lists of direct addresses contain both the locally-bound
@@ -145,10 +145,10 @@ recently discovered direct addresses.
let mep = Endpoint::builder().bind().await.unwrap();
let _addrs = mep.direct_addresses().initialized().await.unwrap();
-Sourcepub fn bound_sockets(&self) -> (SocketAddr, Option<SocketAddr>)
Available on non-wasm_browser only.
Returns the local socket addresses on which the underlying sockets are bound.
+Sourcepub fn bound_sockets(&self) -> (SocketAddr, Option<SocketAddr>)
Available on non-wasm_browser only.
Returns the local socket addresses on which the underlying sockets are bound.
The Endpoint always binds on an IPv4 address and also tries to bind on an IPv6
address if available.
-Sourcepub fn remote_info(&self, node_id: NodeId) -> Option<RemoteInfo>
Returns information about the remote node identified by a NodeId.
+Sourcepub fn remote_info(&self, node_id: NodeId) -> Option<RemoteInfo>
Returns information about the remote node identified by a NodeId.
The Endpoint keeps some information about remote iroh nodes, which it uses to find
the best path to a node. Having information on a remote node, however, does not mean we have
ever connected to it to or even whether a connection is even possible. The information about a
@@ -157,14 +157,14 @@ calls may return different information. Furthermore, node information may even b
completely evicted as it becomes stale.
See also Endpoint::remote_info_iter which returns information on all nodes known
by this Endpoint.
-Sourcepub fn remote_info_iter(&self) -> impl Iterator<Item = RemoteInfo>
Returns information about all the remote nodes this Endpoint knows about.
+Sourcepub fn remote_info_iter(&self) -> impl Iterator<Item = RemoteInfo>
Returns information about all the remote nodes this Endpoint knows about.
This returns the same information as Endpoint::remote_info for each node known to this
Endpoint.
The Endpoint keeps some information about remote iroh nodes, which it uses to find
the best path to a node. This returns all the nodes it knows about, regardless of whether a
connection was ever made or is even possible.
See also Endpoint::remote_info to only retrieve information about a single node.
-Sourcepub fn discovery_stream(
+
Sourcepub fn discovery_stream(
&self,
) -> impl Stream<Item = Result<DiscoveryItem, Lagged>>
Returns a stream of all remote nodes discovered through the endpoint’s discovery services.
Whenever a node is discovered via the endpoint’s discovery service, the corresponding
@@ -183,7 +183,7 @@ at the time of adding it to the static provider.
Lagged may be yielded, indicating that items were missed.
See also Endpoint::remote_info_iter, which returns an iterator over all remotes
the endpoint knows about at a specific point in time.
-Sourcepub fn conn_type(&self, node_id: NodeId) -> Result<Watcher<ConnectionType>>
Returns a Watcher that reports the current connection type and any changes for
+
Sourcepub fn conn_type(&self, node_id: NodeId) -> Result<Watcher<ConnectionType>>
Returns a Watcher that reports the current connection type and any changes for
given remote node.
This watcher allows observing a stream of ConnectionType items by calling
Watcher::stream(). If the underlying connection to a remote node changes, it will
@@ -202,11 +202,11 @@ recently connected to this node id but previous methods of reaching the node hav
become inaccessible.
§Errors
Will error if we do not have any address information for the given node_id.
-Sourcepub fn dns_resolver(&self) -> &DnsResolver
Available on non-wasm_browser only.
Returns the DNS resolver used in this Endpoint.
+Sourcepub fn dns_resolver(&self) -> &DnsResolver
Available on non-wasm_browser only.
Returns the DNS resolver used in this Endpoint.
-Sourcepub fn discovery(&self) -> Option<&dyn Discovery>
Returns the discovery mechanism, if configured.
+Sourcepub fn discovery(&self) -> Option<&dyn Discovery>
Returns the discovery mechanism, if configured.
See Builder::discovery.
-Sourcepub async fn network_change(&self)
Notifies the system of potential network changes.
+Sourcepub async fn network_change(&self)
Notifies the system of potential network changes.
On many systems iroh is able to detect network changes by itself, however
some systems like android do not expose this functionality to native code.
Android does however provide this functionality to Java code. This
@@ -214,12 +214,12 @@ function allows for notifying iroh of any potential network changes like
this.
Even when the network did not change, or iroh was already able to detect
the network change itself, there is no harm in calling this function.
-Sourcepub fn set_user_data_for_discovery(&self, user_data: Option<UserData>)
Sets the initial user-defined data to be published in discovery services for this node.
+Sourcepub fn set_user_data_for_discovery(&self, user_data: Option<UserData>)
Sets the initial user-defined data to be published in discovery services for this node.
If the user-defined data passed to this function is different to the previous one,
the endpoint will republish its node info to the configured discovery services.
See also Builder::user_data_for_discovery for setting an initial value when
building the endpoint.
-Sourcepub async fn close(&self)
Closes the QUIC endpoint and the magic socket.
This will close any remaining open Connections with an error code
of 0 and an empty reason. Though it is best practice to close those
explicitly before with a custom error code and reason.
@@ -245,8 +245,8 @@ while TCP sockets usually get closed and drained by the operating system in the
kernel during the “Time-Wait” period of the TCP socket.
Be aware however that the underlying UDP sockets are only closed once all clones of
the the respective Endpoint are dropped.
-Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Endpoint
§impl !RefUnwindSafe for Endpoint
§impl Send for Endpoint
§impl Sync for Endpoint
§impl Unpin for Endpoint
§impl !UnwindSafe for Endpoint
Blanket Implementations§
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Endpoint
§impl !RefUnwindSafe for Endpoint
§impl Send for Endpoint
§impl Sync for Endpoint
§impl Unpin for Endpoint
§impl !UnwindSafe for Endpoint
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/3217/docs/iroh/endpoint/struct.Incoming.html b/pr/3217/docs/iroh/endpoint/struct.Incoming.html
index 61f28360fa..6b71064a82 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Incoming.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Incoming.html
@@ -1,29 +1,29 @@
-Incoming in iroh::endpoint - Rust pub struct Incoming { /* private fields */ }
Expand description
An incoming connection for which the server has not yet begun its parts of the
+
Incoming in iroh::endpoint - Rust pub struct Incoming { /* private fields */ }
Expand description
An incoming connection for which the server has not yet begun its parts of the
handshake.
-Implementations§
Source§impl Incoming
Sourcepub fn accept(self) -> Result<Connecting, ConnectionError>
Attempts to accept this incoming connection (an error may still occur).
+Implementations§
Source§impl Incoming
Sourcepub fn accept(self) -> Result<Connecting, ConnectionError>
Attempts to accept this incoming connection (an error may still occur).
Errors occurring here are likely not caused by the application or remote. The QUIC
connection listens on a normal UDP socket and any reachable network endpoint can
send datagrams to it, solicited or not. Even if the first few bytes look like a
QUIC packet, it might not even be a QUIC packet that is being received.
Thus it is common to simply log the errors here and accept them as something which
can happen.
-Sourcepub fn accept_with(
+
Sourcepub fn accept_with(
self,
server_config: Arc<ServerConfig>,
) -> Result<Connecting, ConnectionError>
Accepts this incoming connection using a custom configuration.
See accept() for more details.
-Sourcepub fn retry(self) -> Result<(), RetryError>
Responds with a retry packet.
+Sourcepub fn retry(self) -> Result<(), RetryError>
Responds with a retry packet.
This requires the client to retry with address validation.
Errors if remote_address_validated() is true.
-Sourcepub fn ignore(self)
Ignores this incoming connection attempt, not sending any packet in response.
-Sourcepub fn local_ip(&self) -> Option<IpAddr>
Returns the local IP address which was used when the peer established the
+
Sourcepub fn ignore(self)
Ignores this incoming connection attempt, not sending any packet in response.
+Sourcepub fn local_ip(&self) -> Option<IpAddr>
Returns the local IP address which was used when the peer established the
connection.
-Sourcepub fn remote_address(&self) -> SocketAddr
Returns the peer’s UDP address.
-Sourcepub fn remote_address_validated(&self) -> bool
Whether the socket address that is initiating this connection has been validated.
+Sourcepub fn remote_address(&self) -> SocketAddr
Returns the peer’s UDP address.
+Sourcepub fn remote_address_validated(&self) -> bool
Whether the socket address that is initiating this connection has been validated.
This means that the sender of the initial packet has proved that they can receive
traffic sent to self.remote_address().
-Trait Implementations§
Source§impl IntoFuture for Incoming
Source§type Output = Result<Connection, ConnectionError>
The output that the future will produce on completion.Source§type IntoFuture = IncomingFuture
Which kind of future are we turning this into?Source§fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read moreAuto Trait Implementations§
§impl !Freeze for Incoming
§impl !RefUnwindSafe for Incoming
§impl Send for Incoming
§impl Sync for Incoming
§impl Unpin for Incoming
§impl !UnwindSafe for Incoming
Blanket Implementations§
Trait Implementations§
Source§impl IntoFuture for Incoming
Source§type Output = Result<Connection, ConnectionError>
The output that the future will produce on completion.Source§type IntoFuture = IncomingFuture
Which kind of future are we turning this into?Source§fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read moreAuto Trait Implementations§
§impl !Freeze for Incoming
§impl !RefUnwindSafe for Incoming
§impl Send for Incoming
§impl Sync for Incoming
§impl Unpin for Incoming
§impl !UnwindSafe for Incoming
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/3217/docs/iroh/endpoint/struct.IncomingFuture.html b/pr/3217/docs/iroh/endpoint/struct.IncomingFuture.html
index 504c012c78..3934a53120 100644
--- a/pr/3217/docs/iroh/endpoint/struct.IncomingFuture.html
+++ b/pr/3217/docs/iroh/endpoint/struct.IncomingFuture.html
@@ -1,6 +1,6 @@
-IncomingFuture in iroh::endpoint - Rust pub struct IncomingFuture { /* private fields */ }
Expand description
Adaptor to let Incoming be awaited like a Connecting.
-Trait Implementations§
Source§impl Debug for IncomingFuture
Source§impl Future for IncomingFuture
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for IncomingFuturewhere
+IncomingFuture in iroh::endpoint - Rust pub struct IncomingFuture { /* private fields */ }
Expand description
Adaptor to let Incoming be awaited like a Connecting.
+Trait Implementations§
Source§impl Debug for IncomingFuture
Source§impl Future for IncomingFuture
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for IncomingFuturewhere
PinnedFieldsOf<__IncomingFuture<'pin>>: Unpin,
Auto Trait Implementations§
§impl !Freeze for IncomingFuture
§impl !RefUnwindSafe for IncomingFuture
§impl Send for IncomingFuture
§impl Sync for IncomingFuture
§impl !UnwindSafe for IncomingFuture
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html b/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html
index 792290d8f5..d03f08d892 100644
--- a/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html
+++ b/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html
@@ -1,7 +1,7 @@
-ZeroRttAccepted in iroh::endpoint - Rust pub struct ZeroRttAccepted { /* private fields */ }
Expand description
Future that completes when a connection is fully established.
+ZeroRttAccepted in iroh::endpoint - Rust pub struct ZeroRttAccepted { /* private fields */ }
Expand description
Future that completes when a connection is fully established.
For clients, the resulting value indicates if 0-RTT was accepted. For servers, the resulting
value is meaningless.
-Trait Implementations§
Source§impl Debug for ZeroRttAccepted
Source§impl Future for ZeroRttAccepted
Source§fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>
Attempts to resolve the future to a final value, registering
+Trait Implementations§
Source§impl Debug for ZeroRttAccepted
Source§impl Future for ZeroRttAccepted
Auto Trait Implementations§
§impl Freeze for ZeroRttAccepted
§impl !RefUnwindSafe for ZeroRttAccepted
§impl Send for ZeroRttAccepted
§impl Sync for ZeroRttAccepted
§impl Unpin for ZeroRttAccepted
§impl !UnwindSafe for ZeroRttAccepted
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/enum.KeyParsingError.html b/pr/3217/docs/iroh/enum.KeyParsingError.html
index 55941cda04..c7925e588b 100644
--- a/pr/3217/docs/iroh/enum.KeyParsingError.html
+++ b/pr/3217/docs/iroh/enum.KeyParsingError.html
@@ -1,4 +1,4 @@
-KeyParsingError in iroh - Rust pub enum KeyParsingError {
+KeyParsingError in iroh - Rust Enum KeyParsingError
pub enum KeyParsingError {
Decode(DecodeError),
Key(Error),
DecodeInvalidLength,
@@ -6,7 +6,7 @@
Variants§
§Decode(DecodeError)
Error when decoding.
§Key(Error)
Error when decoding the public key.
§DecodeInvalidLength
The encoded information had the wrong length.
-Trait Implementations§
Source§impl Debug for KeyParsingError
Source§impl Display for KeyParsingError
Source§impl Error for KeyParsingError
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()Source§impl From<DecodeError> for KeyParsingError
Source§fn from(source: DecodeError) -> KeyParsingError
Converts to this type from the input type.Source§impl From<Error> for KeyParsingError
Source§fn from(source: Error) -> KeyParsingError
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for KeyParsingError
§impl !RefUnwindSafe for KeyParsingError
§impl Send for KeyParsingError
§impl Sync for KeyParsingError
§impl Unpin for KeyParsingError
§impl !UnwindSafe for KeyParsingError
Blanket Implementations§
Trait Implementations§
§impl Debug for KeyParsingError
§impl Display for KeyParsingError
§impl Error for KeyParsingError
§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()§impl From<DecodeError> for KeyParsingError
§fn from(source: DecodeError) -> KeyParsingError
Converts to this type from the input type.§impl From<Error> for KeyParsingError
§fn from(source: Error) -> KeyParsingError
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for KeyParsingError
§impl !RefUnwindSafe for KeyParsingError
§impl Send for KeyParsingError
§impl Sync for KeyParsingError
§impl Unpin for KeyParsingError
§impl !UnwindSafe for KeyParsingError
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/3217/docs/iroh/metrics/struct.RelayMetrics.html b/pr/3217/docs/iroh/metrics/struct.RelayMetrics.html
index 83ae1acdcc..6f22d04f93 100644
--- a/pr/3217/docs/iroh/metrics/struct.RelayMetrics.html
+++ b/pr/3217/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/3217/docs/iroh/node_info/constant.IROH_TXT_NAME.html b/pr/3217/docs/iroh/node_info/constant.IROH_TXT_NAME.html
index c78d056a1f..0c1e657fb3 100644
--- a/pr/3217/docs/iroh/node_info/constant.IROH_TXT_NAME.html
+++ b/pr/3217/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/3217/docs/iroh/node_info/index.html b/pr/3217/docs/iroh/node_info/index.html
index 9884414f78..5130358fc8 100644
--- a/pr/3217/docs/iroh/node_info/index.html
+++ b/pr/3217/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/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html b/pr/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html
index 2f1c9b7234..33cd3a33fc 100644
--- a/pr/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html
+++ b/pr/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html
@@ -1,5 +1,5 @@
-MaxLengthExceededError in iroh::node_info - Rust
pub struct Accept<'a> { /* private fields */ }Expand description
Future produced by Endpoint::accept.
Trait Implementations§
impl<'pin, 'a> Unpin for Accept<'a>where
PinnedFieldsOf<__Accept<'pin, 'a>>: Unpin,
Auto Trait Implementations§
impl<'a> !Freeze for Accept<'a>
impl<'a> !RefUnwindSafe for Accept<'a>
impl<'a> Send for Accept<'a>
impl<'a> Sync for Accept<'a>
impl<'a> !UnwindSafe for Accept<'a>
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/3217/docs/iroh/endpoint/struct.Builder.html b/pr/3217/docs/iroh/endpoint/struct.Builder.html
index 6872da2482..46b31e019e 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Builder.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Builder.html
@@ -1,24 +1,24 @@
-Builder in iroh::endpoint - Rust pub struct Builder { /* private fields */ }
Expand description
Builder for Endpoint.
+Builder in iroh::endpoint - Rust pub struct Builder { /* private fields */ }
Expand description
Builder for Endpoint.
By default the endpoint will generate a new random SecretKey, which will result in a
new NodeId.
To create the Endpoint call Builder::bind.
-Implementations§
Source§impl Builder
Sourcepub fn bind_addr_v4(self, addr: SocketAddrV4) -> Self
Sets the IPv4 bind address.
+Implementations§
Source§impl Builder
Sourcepub fn bind_addr_v4(self, addr: SocketAddrV4) -> Self
Sets the IPv4 bind address.
Setting the port to 0 will use a random port.
If the port specified is already in use, it will fallback to choosing a random port.
By default will use 0.0.0.0:0 to bind to.
-Sourcepub fn bind_addr_v6(self, addr: SocketAddrV6) -> Self
Sets the IPv6 bind address.
+Sourcepub fn bind_addr_v6(self, addr: SocketAddrV6) -> Self
Sets the IPv6 bind address.
Setting the port to 0 will use a random port.
If the port specified is already in use, it will fallback to choosing a random port.
By default will use [::]:0 to bind to.
-Sourcepub fn secret_key(self, secret_key: SecretKey) -> Self
Sets a secret key to authenticate with other peers.
+Sourcepub fn secret_key(self, secret_key: SecretKey) -> Self
Sourcepub fn alpns(self, alpn_protocols: Vec<Vec<u8>>) -> Self
Sets the ALPN protocols that this endpoint will accept on incoming connections.
+Sourcepub fn relay_mode(self, relay_mode: RelayMode) -> Self
Sets the relay servers to assist in establishing connectivity.
+Sourcepub fn relay_mode(self, relay_mode: RelayMode) -> Self
Sets the relay servers to assist in establishing connectivity.
Relay servers are used to establish initial connection with another iroh node.
They also perform various functions related to hole punching, see the crate docs
for more details.
@@ -26,15 +26,22 @@ for more details.
When using RelayMode::Custom, the provided relay_map must contain at least one
configured relay node. If an invalid RelayMap is provided bind
will result in an error.
-Sourcepub fn clear_discovery(self) -> Self
Removes all discovery services from the builder.
-Sourcepub fn discovery(self, discovery: Box<dyn Discovery>) -> Self
Optionally sets a discovery mechanism for this endpoint.
+Sourcepub fn relay_conn_protocol(self, protocol: Protocol) -> Self
Sets the protocol to use for relay connections.
+Options are either Protocol::Websocket or Protocol::Relay.
+Websocket will work with relays version 0.19 and above, so likely with any relays
+deployed at the time of writing this option (websocket support was released 9 months ago).
+Relay will work for now, but will likely be removed with the 1.0 release.
+Default is set to Relay at the moment, until we’ve thoroughly tested and improved
+websocket performance.
+Sourcepub fn clear_discovery(self) -> Self
Removes all discovery services from the builder.
+Sourcepub fn discovery(self, discovery: Box<dyn Discovery>) -> Self
Optionally sets a discovery mechanism for this endpoint.
If you want to combine multiple discovery services, you can use
Builder::add_discovery instead. This will internally create a
crate::discovery::ConcurrentDiscovery.
If no discovery service is set, connecting to a node without providing its
direct addresses or relay URLs will fail.
See the documentation of the Discovery trait for details.
-Sourcepub fn add_discovery<F, D>(self, discovery: F) -> Selfwhere
+
Sourcepub fn add_discovery<F, D>(self, discovery: F) -> Self
Adds a discovery mechanism for this endpoint.
The function discovery
@@ -47,7 +54,7 @@ to use this secret key to sign the information.
direct addresses or relay URLs will fail.
To clear all discovery services, use Builder::clear_discovery.
See the documentation of the Discovery trait for details.
-Sourcepub fn discovery_n0(self) -> Self
Configures the endpoint to use the default n0 DNS discovery service.
+Sourcepub fn discovery_n0(self) -> Self
Configures the endpoint to use the default n0 DNS discovery service.
The default discovery service publishes to and resolves from the
n0.computer dns server iroh.link.
This is equivalent to adding both a crate::discovery::pkarr::PkarrPublisher
@@ -56,29 +63,29 @@ n0.computer dns server.
This will by default use N0_DNS_PKARR_RELAY_PROD.
When in tests, or when the test-utils feature is enabled, this will use the
N0_DNS_PKARR_RELAY_STAGING.
-Sourcepub fn tls_x509(self) -> Self
Use libp2p based self signed certificates for TLS.
For details see the libp2p spec at https://github.com/libp2p/specs/blob/master/tls/tls.md
This is the only mechanism available in iroh@0.33.0 and earlier.
-Sourcepub fn tls_raw_public_keys(self) -> Self
Use TLS Raw Public Keys
+Sourcepub fn tls_raw_public_keys(self) -> Self
Use TLS Raw Public Keys
This is the default, but is not compatible with older versions of iroh.
-Sourcepub fn discovery_dht(self) -> Self
Available on crate feature discovery-pkarr-dht only.
Configures the endpoint to also use the mainline DHT with default settings.
+Sourcepub fn discovery_dht(self) -> Self
Available on crate feature discovery-pkarr-dht only.
Configures the endpoint to also use the mainline DHT with default settings.
This is equivalent to adding a crate::discovery::pkarr::dht::DhtDiscovery
with default settings. Note that DhtDiscovery has various more advanced
configuration options. If you need any of those, you should manually
create a DhtDiscovery and add it with Builder::add_discovery.
-Sourcepub fn discovery_local_network(self) -> Self
Available on crate feature discovery-local-network only.
Configures the endpoint to also use local network discovery.
+Sourcepub fn discovery_local_network(self) -> Self
Available on crate feature discovery-local-network only.
Configures the endpoint to also use local network discovery.
This is equivalent to adding a crate::discovery::mdns::MdnsDiscovery
with default settings. Note that MdnsDiscovery has various more advanced
configuration options. If you need any of those, you should manually
create a MdnsDiscovery and add it with Builder::add_discovery.
-Sourcepub fn user_data_for_discovery(self, user_data: UserData) -> Self
Sets the initial user-defined data to be published in discovery services for this node.
+Sourcepub fn user_data_for_discovery(self, user_data: UserData) -> Self
Sets the initial user-defined data to be published in discovery services for this node.
When using discovery services, this string of UserData will be published together
with the node’s addresses and relay URL. When other nodes discover this node,
they retrieve the UserData in addition to the addressing info.
Iroh itself does not interpret the user-defined data in any way, it is purely left
for applications to parse and use.
-Sourcepub fn known_nodes(self, nodes: Vec<NodeAddr>) -> Self
Optionally set a list of known nodes.
-Sourcepub fn transport_config(self, transport_config: TransportConfig) -> Self
Sets a custom quinn::TransportConfig for this endpoint.
+Sourcepub fn known_nodes(self, nodes: Vec<NodeAddr>) -> Self
Optionally set a list of known nodes.
+Sourcepub fn transport_config(self, transport_config: TransportConfig) -> Self
Sets a custom quinn::TransportConfig for this endpoint.
The transport config contains parameters governing the QUIC state machine.
If unset, the default config is used. Default values should be suitable for most
internet applications. Applications protocols which forbid remotely-initiated
@@ -86,31 +93,31 @@ streams should set max_concurrent_bidi_streams and max_concur
zero.
Please be aware that changing some settings may have adverse effects on establishing
and maintaining direct connections.
-Sourcepub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self
Available on non-wasm_browser only.
Optionally sets a custom DNS resolver to use for this endpoint.
+Sourcepub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self
Available on non-wasm_browser only.
Optionally sets a custom DNS resolver to use for this endpoint.
The DNS resolver is used to resolve relay hostnames, and node addresses if
crate::discovery::dns::DnsDiscovery is configured.
By default, a new DNS resolver is created which is configured to use the
host system’s DNS configuration. You can pass a custom instance of DnsResolver
here to use a differently configured DNS resolver for this endpoint, or to share
a DnsResolver between multiple endpoints.
-Sourcepub fn proxy_url(self, url: Url) -> Self
Sets an explicit proxy url to proxy all HTTP(S) traffic through.
-Sourcepub fn proxy_from_env(self) -> Self
Sets the proxy url from the environment, in this order:
+Sourcepub fn proxy_url(self, url: Url) -> Self
Sets an explicit proxy url to proxy all HTTP(S) traffic through.
+Sourcepub fn proxy_from_env(self) -> Self
Sets the proxy url from the environment, in this order:
HTTP_PROXY
http_proxy
HTTPS_PROXY
https_proxy
-Sourcepub fn keylog(self, keylog: bool) -> Self
Enables saving the TLS pre-master key for connections.
+Sourcepub fn keylog(self, keylog: bool) -> Self
Enables saving the TLS pre-master key for connections.
This key should normally remain secret but can be useful to debug networking issues
by decrypting captured traffic.
If keylog is true then setting the SSLKEYLOGFILE environment variable to a
filename will result in this file being used to log the TLS pre-master keys.
-Sourcepub fn insecure_skip_relay_cert_verify(self, skip_verify: bool) -> Self
Available on crate feature test-utils only.
Skip verification of SSL certificates from relay servers
+Sourcepub fn insecure_skip_relay_cert_verify(self, skip_verify: bool) -> Self
Available on crate feature test-utils only.
Skip verification of SSL certificates from relay servers
May only be used in tests.
-Sourcepub fn path_selection(self, path_selection: PathSelection) -> Self
Available on crate feature test-utils only.
This implies we only use the relay to communicate
+
Sourcepub fn path_selection(self, path_selection: PathSelection) -> Self
Available on crate feature test-utils only.
This implies we only use the relay to communicate
and do not attempt to do any hole punching.
-Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Builder
§impl !RefUnwindSafe for Builder
§impl Send for Builder
§impl Sync for Builder
§impl Unpin for Builder
§impl !UnwindSafe for Builder
Blanket Implementations§
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Builder
§impl !RefUnwindSafe for Builder
§impl Send for Builder
§impl Sync for Builder
§impl Unpin for Builder
§impl !UnwindSafe for Builder
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/3217/docs/iroh/endpoint/struct.ConnectOptions.html b/pr/3217/docs/iroh/endpoint/struct.ConnectOptions.html
index d82c67e528..4b2b9fa2d5 100644
--- a/pr/3217/docs/iroh/endpoint/struct.ConnectOptions.html
+++ b/pr/3217/docs/iroh/endpoint/struct.ConnectOptions.html
@@ -1,12 +1,12 @@
-ConnectOptions in iroh::endpoint - Rust pub struct ConnectOptions { /* private fields */ }
Expand description
Options for the Endpoint::connect_with_opts function.
-Implementations§
Source§impl ConnectOptions
Sourcepub fn new() -> Self
Initializes new connection options.
+ConnectOptions in iroh::endpoint - Rust pub struct ConnectOptions { /* private fields */ }
Expand description
Options for the Endpoint::connect_with_opts function.
+Implementations§
Source§impl ConnectOptions
Sourcepub fn new() -> Self
Initializes new connection options.
By default, the connection will use the same options
as Endpoint::connect, e.g. a default TransportConfig.
-Sourcepub fn with_transport_config(
+
Sourcepub fn with_transport_config(
self,
transport_config: Arc<TransportConfig>,
) -> Self
Sets the QUIC transport config options for this connection.
-Trait Implementations§
Source§impl Clone for ConnectOptions
Source§fn clone(&self) -> ConnectOptions
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 ConnectOptions
Source§impl Default for ConnectOptions
Source§fn default() -> ConnectOptions
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for ConnectOptions
§impl !RefUnwindSafe for ConnectOptions
§impl Send for ConnectOptions
§impl Sync for ConnectOptions
§impl Unpin for ConnectOptions
§impl !UnwindSafe for ConnectOptions
Blanket Implementations§
Trait Implementations§
Source§impl Clone for ConnectOptions
Source§fn clone(&self) -> ConnectOptions
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 ConnectOptions
Source§impl Default for ConnectOptions
Source§fn default() -> ConnectOptions
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for ConnectOptions
§impl !RefUnwindSafe for ConnectOptions
§impl Send for ConnectOptions
§impl Sync for ConnectOptions
§impl Unpin for ConnectOptions
§impl !UnwindSafe for ConnectOptions
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/3217/docs/iroh/endpoint/struct.Connecting.html b/pr/3217/docs/iroh/endpoint/struct.Connecting.html
index 41a03946a4..e190a84876 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Connecting.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Connecting.html
@@ -1,5 +1,5 @@
-Connecting in iroh::endpoint - Rust pub struct Connecting { /* private fields */ }
Expand description
In-progress connection attempt future
-Implementations§
Source§impl Connecting
Sourcepub fn into_0rtt(self) -> Result<(Connection, ZeroRttAccepted), Self>
Converts this Connecting into a 0-RTT or 0.5-RTT connection at the cost of weakened
+
Connecting in iroh::endpoint - Rust pub struct Connecting { /* private fields */ }
Expand description
In-progress connection attempt future
+Implementations§
Source§impl Connecting
Sourcepub fn into_0rtt(self) -> Result<(Connection, ZeroRttAccepted), Self>
Converts this Connecting into a 0-RTT or 0.5-RTT connection at the cost of weakened
security.
Returns Ok immediately if the local endpoint is able to attempt sending 0/0.5-RTT data.
If so, the returned Connection can be used to send application data without waiting for
@@ -33,10 +33,10 @@ before TLS client authentication has occurred, and should therefore not be used
data for which client authentication is being used.
You can use RecvStream::is_0rtt to check whether a stream has been opened in 0-RTT
and thus whether parts of the stream are operating under this reduced security level.
-Sourcepub async fn handshake_data(&mut self) -> Result<Box<dyn Any>, ConnectionError>
Parameters negotiated during the handshake
-Trait Implementations§
Source§impl Debug for Connecting
Source§impl Future for Connecting
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for Connectingwhere
+Sourcepub async fn handshake_data(&mut self) -> Result<Box<dyn Any>, ConnectionError>
Parameters negotiated during the handshake
+
Trait Implementations§
Source§impl Debug for Connecting
Source§impl Future for Connecting
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for Connectingwhere
PinnedFieldsOf<__Connecting<'pin>>: Unpin,
Auto Trait Implementations§
§impl Freeze for Connecting
§impl !RefUnwindSafe for Connecting
§impl Send for Connecting
§impl Sync for Connecting
§impl !UnwindSafe for Connecting
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/endpoint/struct.Connection.html b/pr/3217/docs/iroh/endpoint/struct.Connection.html
index 8e81609487..928cdb9918 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Connection.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Connection.html
@@ -1,4 +1,4 @@
-Connection in iroh::endpoint - Rust pub struct Connection { /* private fields */ }
Expand description
A QUIC connection.
+Connection in iroh::endpoint - Rust pub struct Connection { /* private fields */ }
Expand description
A QUIC connection.
If all references to a connection (including every clone of the Connection handle,
streams of incoming streams, and the various stream types) have been dropped, then the
connection will be automatically closed with an error_code of 0 and an empty reason. You
@@ -8,29 +8,29 @@ receiving CONNECTION_CLOSE the peer may drop any stream data not yet delivered t
application. Connection::close describes in more detail how to gracefully close a
connection without losing application data.
May be cloned to obtain another handle to the same connection.
-Implementations§
Source§impl Connection
Implementations§
Source§impl Connection
Sourcepub fn open_uni(&self) -> OpenUni<'_> ⓘ
Initiates a new outgoing unidirectional stream.
Streams are cheap and instantaneous to open unless blocked by flow control. As a
consequence, the peer won’t be notified that a stream has been opened until the
stream is actually used.
-Sourcepub fn open_bi(&self) -> OpenBi<'_> ⓘ
Initiates a new outgoing bidirectional stream.
Streams are cheap and instantaneous to open unless blocked by flow control. As a
consequence, the peer won’t be notified that a stream has been opened until the
stream is actually used. Calling open_bi then waiting on the RecvStream
without writing anything to SendStream will never succeed.
-Sourcepub fn accept_uni(&self) -> AcceptUni<'_> ⓘ
Accepts the next incoming uni-directional stream.
-Sourcepub fn accept_uni(&self) -> AcceptUni<'_> ⓘ
Accepts the next incoming uni-directional stream.
+Sourcepub fn accept_bi(&self) -> AcceptBi<'_> ⓘ
Accept the next incoming bidirectional stream.
Important Note: The peer that calls open_bi must write to its SendStream
before the peer Connection is able to accept the stream using
accept_bi(). Calling open_bi then waiting on the RecvStream without
writing anything to the connected SendStream will never succeed.
-Sourcepub fn read_datagram(&self) -> ReadDatagram<'_> ⓘ
Receives an application datagram.
-Sourcepub async fn closed(&self) -> ConnectionError
Wait for the connection to be closed for any reason.
+Sourcepub fn read_datagram(&self) -> ReadDatagram<'_> ⓘ
Receives an application datagram.
+Sourcepub async fn closed(&self) -> ConnectionError
Wait for the connection to be closed for any reason.
Despite the return type’s name, closed connections are often not an error condition
at the application layer. Cases that might be routine include
ConnectionError::LocallyClosed and ConnectionError::ApplicationClosed.
-Sourcepub fn close_reason(&self) -> Option<ConnectionError>
If the connection is closed, the reason why.
+Sourcepub fn close_reason(&self) -> Option<ConnectionError>
If the connection is closed, the reason why.
Returns None if the connection is still open.
-Sourcepub fn close(&self, error_code: VarInt, reason: &[u8])
Closes the connection immediately.
Pending operations will fail immediately with ConnectionError::LocallyClosed. No
more data is sent to the peer and the peer may drop buffered data upon receiving the
CONNECTION_CLOSE frame.
@@ -51,41 +51,41 @@ endpoint. Once the local side sends a CONNECTION_CLOSE frame in response to call
close the remote endpoint may drop any data it received but is as yet
undelivered to the application, including data that was acknowledged as received to
the local endpoint.
-Sourcepub fn send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError>
Transmits data as an unreliable, unordered application datagram.
+Sourcepub fn send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError>
Transmits data as an unreliable, unordered application datagram.
Application datagrams are a low-level primitive. They may be lost or delivered out
of order, and data must both fit inside a single QUIC packet and be smaller than
the maximum dictated by the peer.
-Sourcepub fn max_datagram_size(&self) -> Option<usize>
Computes the maximum size of datagrams that may be passed to send_datagram.
+Sourcepub fn max_datagram_size(&self) -> Option<usize>
Computes the maximum size of datagrams that may be passed to send_datagram.
Returns None if datagrams are unsupported by the peer or disabled locally.
This may change over the lifetime of a connection according to variation in the path
MTU estimate. The peer can also enforce an arbitrarily small fixed limit, but if the
peer’s limit is large this is guaranteed to be a little over a kilobyte at minimum.
Not necessarily the maximum size of received datagrams.
-Sourcepub fn datagram_send_buffer_space(&self) -> usize
Bytes available in the outgoing datagram buffer.
+Sourcepub fn datagram_send_buffer_space(&self) -> usize
Bytes available in the outgoing datagram buffer.
When greater than zero, calling send_datagram with a
datagram of at most this size is guaranteed not to cause older datagrams to be
dropped.
-Sourcepub fn rtt(&self) -> Duration
Current best estimate of this connection’s latency (round-trip-time).
-Sourcepub fn stats(&self) -> ConnectionStats
Returns connection statistics.
-Sourcepub fn congestion_state(&self) -> Box<dyn Controller>
Current state of the congestion control algorithm, for debugging purposes.
-Sourcepub fn handshake_data(&self) -> Option<Box<dyn Any>>
Parameters negotiated during the handshake.
+Sourcepub fn rtt(&self) -> Duration
Current best estimate of this connection’s latency (round-trip-time).
+Sourcepub fn stats(&self) -> ConnectionStats
Returns connection statistics.
+Sourcepub fn congestion_state(&self) -> Box<dyn Controller>
Current state of the congestion control algorithm, for debugging purposes.
+Sourcepub fn handshake_data(&self) -> Option<Box<dyn Any>>
Parameters negotiated during the handshake.
Guaranteed to return Some on fully established connections or after
Connecting::handshake_data() succeeds. See that method’s documentations for
details on the returned value.
-Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
-Sourcepub fn peer_identity(&self) -> Option<Box<dyn Any>>
Cryptographic identity of the peer.
+Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
+Sourcepub fn peer_identity(&self) -> Option<Box<dyn Any>>
Sourcepub fn remote_node_id(&self) -> Result<NodeId>
Returns the NodeId from the peer’s TLS certificate.
+Sourcepub fn remote_node_id(&self) -> Result<NodeId>
Sourcepub fn stable_id(&self) -> usize
A stable identifier for this connection.
Peer addresses and connection IDs can change, but this value will remain fixed for
the lifetime of the connection.
-Sourcepub fn export_keying_material(
+
Sourcepub fn export_keying_material(
&self,
output: &mut [u8],
label: &[u8],
@@ -96,14 +96,14 @@ arguments and output buffers of equal length, they will get the
same sequence of bytes in output. These bytes are cryptographically
strong and pseudorandom, and are suitable for use as keying material.
See RFC5705 for more information.
-
Sourcepub fn set_max_concurrent_uni_streams(&self, count: VarInt)
Modifies the number of unidirectional streams that may be concurrently opened.
+Sourcepub fn set_max_concurrent_uni_streams(&self, count: VarInt)
Modifies the number of unidirectional streams that may be concurrently opened.
No streams may be opened by the peer unless fewer than count are already
open. Large counts increase both minimum and worst-case memory consumption.
-Sourcepub fn set_receive_window(&self, receive_window: VarInt)
Sourcepub fn set_max_concurrent_bi_streams(&self, count: VarInt)
Modifies the number of bidirectional streams that may be concurrently opened.
+Sourcepub fn set_receive_window(&self, receive_window: VarInt)
Sourcepub fn set_max_concurrent_bi_streams(&self, count: VarInt)
Modifies the number of bidirectional streams that may be concurrently opened.
No streams may be opened by the peer unless fewer than count are already
open. Large counts increase both minimum and worst-case memory consumption.
-Trait Implementations§
Source§impl Clone for Connection
Source§fn clone(&self) -> Connection
Returns a copy of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreAuto Trait Implementations§
§impl Freeze for Connection
§impl RefUnwindSafe for Connection
§impl Send for Connection
§impl Sync for Connection
§impl Unpin for Connection
§impl UnwindSafe for Connection
Blanket Implementations§
Trait Implementations§
Source§impl Clone for Connection
Source§fn clone(&self) -> Connection
Returns a copy of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreAuto Trait Implementations§
§impl Freeze for Connection
§impl RefUnwindSafe for Connection
§impl Send for Connection
§impl Sync for Connection
§impl Unpin for Connection
§impl UnwindSafe for Connection
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/3217/docs/iroh/endpoint/struct.DirectAddr.html b/pr/3217/docs/iroh/endpoint/struct.DirectAddr.html
index 61a667e47d..04760c9021 100644
--- a/pr/3217/docs/iroh/endpoint/struct.DirectAddr.html
+++ b/pr/3217/docs/iroh/endpoint/struct.DirectAddr.html
@@ -1,4 +1,4 @@
-DirectAddr in iroh::endpoint - Rust pub struct DirectAddr {
+DirectAddr in iroh::endpoint - Rust pub struct DirectAddr {
pub addr: SocketAddr,
pub typ: DirectAddrType,
}
Expand description
A direct address on which an iroh-node might be contactable.
@@ -7,16 +7,16 @@ contacted. These can come from various sources depending on the network topolog
iroh node, see DirectAddrType for the several kinds of sources.
Fields§
§addr: SocketAddrThe address.
§typ: DirectAddrTypeThe origin of this direct address.
-Trait Implementations§
Source§impl Clone for DirectAddr
Source§fn clone(&self) -> DirectAddr
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 DirectAddr
Source§impl Hash for DirectAddr
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
+Trait Implementations§
Source§impl Clone for DirectAddr
Source§fn clone(&self) -> DirectAddr
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 DirectAddr
Source§impl Hash for DirectAddr
Source§impl Ord for DirectAddr
Source§impl Ord for DirectAddr
Source§fn cmp(&self, other: &DirectAddr) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read moreSource§impl PartialEq for DirectAddr
Source§impl PartialOrd for DirectAddr
Source§impl PartialEq for DirectAddr
Source§impl PartialOrd for DirectAddr
Source§impl Eq for DirectAddr
Source§impl StructuralPartialEq for DirectAddr
Auto Trait Implementations§
§impl Freeze for DirectAddr
§impl RefUnwindSafe for DirectAddr
§impl Send for DirectAddr
§impl Sync for DirectAddr
§impl Unpin for DirectAddr
§impl UnwindSafe for DirectAddr
Blanket Implementations§
Source§impl Eq for DirectAddr
Source§impl StructuralPartialEq for DirectAddr
Auto Trait Implementations§
§impl Freeze for DirectAddr
§impl RefUnwindSafe for DirectAddr
§impl Send for DirectAddr
§impl Sync for DirectAddr
§impl Unpin for DirectAddr
§impl UnwindSafe for DirectAddr
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/3217/docs/iroh/endpoint/struct.Endpoint.html b/pr/3217/docs/iroh/endpoint/struct.Endpoint.html
index e25e697700..0b8c9af7b3 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Endpoint.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Endpoint.html
@@ -1,4 +1,4 @@
-Endpoint in iroh::endpoint - Rust pub struct Endpoint { /* private fields */ }
Expand description
Controls an iroh node, establishing connections with other nodes.
+Endpoint in iroh::endpoint - Rust pub struct Endpoint { /* private fields */ }
Expand description
Controls an iroh node, establishing connections with other nodes.
This is the main API interface to create connections to, and accept connections from
other iroh nodes. The connections are peer-to-peer and encrypted, a Relay server is
used to make the connections reliable. See the [crate docs] for a more detailed
@@ -16,17 +16,17 @@ the peer are created using the Connection::open_uni and Connection::open_bi functions.
Note that due to the light-weight properties of streams a stream will only be accepted
once the initiating peer has sent some data on it.
-Implementations§
Source§impl Endpoint
Sourcepub fn builder() -> Builder
Returns the builder for an Endpoint, with a production configuration.
-Sourcepub fn set_alpns(&self, alpns: Vec<Vec<u8>>) -> Result<()>
Sets the list of accepted ALPN protocols.
+Implementations§
Source§impl Endpoint
Sourcepub fn builder() -> Builder
Returns the builder for an Endpoint, with a production configuration.
+Sourcepub async fn connect(
&self,
node_addr: impl Into<NodeAddr>,
alpn: &[u8],
) -> Result<Connection>
Connects to a remote Endpoint.
A value that can be converted into a NodeAddr is required. This can be either a
-NodeAddr, a NodeId or a iroh_base::ticket::NodeTicket.
+NodeAddr, a NodeId or a [iroh_base::ticket::NodeTicket].
The NodeAddr must contain the NodeId to dial and may also contain a RelayUrl
and direct addresses. If direct addresses are provided, they will be used to try and
establish a direct connection without involving a relay server.
@@ -41,7 +41,7 @@ connection attempt will fail with an error.
The alpn, or application-level protocol identifier, is also required. The remote
endpoint must support this alpn, otherwise the connection attempt will fail with
an error.
-Sourcepub async fn connect_with_opts(
+
Sourcepub async fn connect_with_opts(
&self,
node_addr: impl Into<NodeAddr>,
alpn: &[u8],
@@ -61,13 +61,13 @@ security concerns.
establishing and maintaining direct connections. Carefully test settings you use and
consider this currently as still rather experimental.
-
Sourcepub fn accept(&self) -> Accept<'_> ⓘ
Accepts an incoming connection on the endpoint.
Only connections with the ALPNs configured in Builder::alpns will be accepted.
If multiple ALPNs have been configured the ALPN can be inspected before accepting
the connection using Connecting::alpn.
The returned future will yield None if the endpoint is closed by calling
Endpoint::close.
-Sourcepub fn add_node_addr(&self, node_addr: NodeAddr) -> Result<()>
Informs this Endpoint about addresses of the iroh node.
+Sourcepub fn add_node_addr(&self, node_addr: NodeAddr) -> Result<()>
Informs this Endpoint about addresses of the iroh node.
This updates the local state for the remote node. If the provided NodeAddr
contains a RelayUrl this will be used as the new relay server for this node. If
it contains any new IP endpoints they will also be stored and tried when next
@@ -80,7 +80,7 @@ This provides more flexibility and future proofing.
§Errors
Will return an error if we attempt to add our own NodeId to the node map or
if the direct addresses are a subset of ours.
-Sourcepub fn add_node_addr_with_source(
+
Sourcepub fn secret_key(&self) -> &SecretKey
Returns the secret_key of this endpoint.
-Sourcepub fn secret_key(&self) -> &SecretKey
Returns the secret_key of this endpoint.
+Sourcepub fn node_id(&self) -> NodeId
Returns the node id of this endpoint.
This ID is the unique addressing information of this node and other peers must know
it to be able to connect to this node.
-Sourcepub async fn node_addr(&self) -> Result<NodeAddr>
Returns the current NodeAddr for this endpoint.
+Sourcepub async fn node_addr(&self) -> Result<NodeAddr>
Returns the current NodeAddr for this endpoint.
The returned NodeAddr will have the current RelayUrl and direct addresses
as they would be returned by Endpoint::home_relay and
Endpoint::direct_addresses.
In browsers, because direct addresses are unavailable, this will only wait for
the home relay to be available before returning.
-Sourcepub fn home_relay(&self) -> Watcher<Option<RelayUrl>>
Sourcepub fn home_relay(&self) -> Watcher<Option<RelayUrl>>
Returns a Watcher for the RelayUrl of the Relay server used as home relay.
Every endpoint has a home Relay server which it chooses as the server with the
lowest latency out of the configured servers provided by Builder::relay_mode.
This is the server other iroh nodes can use to reliably establish a connection
@@ -122,7 +122,7 @@ some time to connect to find and connect to the home relay server.
let mep = Endpoint::builder().bind().await.unwrap();
let _relay_url = mep.home_relay().initialized().await.unwrap();
-Sourcepub fn direct_addresses(&self) -> Watcher<Option<BTreeSet<DirectAddr>>>
Sourcepub fn direct_addresses(&self) -> Watcher<Option<BTreeSet<DirectAddr>>>
Returns a Watcher for the direct addresses of this Endpoint.
The direct addresses of the Endpoint are those that could be used by other
iroh nodes to establish direct connectivity, depending on the network
situation. The yielded lists of direct addresses contain both the locally-bound
@@ -145,10 +145,10 @@ recently discovered direct addresses.
let mep = Endpoint::builder().bind().await.unwrap();
let _addrs = mep.direct_addresses().initialized().await.unwrap();
-Sourcepub fn bound_sockets(&self) -> (SocketAddr, Option<SocketAddr>)
Available on non-wasm_browser only.
Returns the local socket addresses on which the underlying sockets are bound.
+Sourcepub fn bound_sockets(&self) -> (SocketAddr, Option<SocketAddr>)
Available on non-wasm_browser only.
Returns the local socket addresses on which the underlying sockets are bound.
The Endpoint always binds on an IPv4 address and also tries to bind on an IPv6
address if available.
-Sourcepub fn remote_info(&self, node_id: NodeId) -> Option<RemoteInfo>
Returns information about the remote node identified by a NodeId.
+Sourcepub fn remote_info(&self, node_id: NodeId) -> Option<RemoteInfo>
Returns information about the remote node identified by a NodeId.
The Endpoint keeps some information about remote iroh nodes, which it uses to find
the best path to a node. Having information on a remote node, however, does not mean we have
ever connected to it to or even whether a connection is even possible. The information about a
@@ -157,14 +157,14 @@ calls may return different information. Furthermore, node information may even b
completely evicted as it becomes stale.
See also Endpoint::remote_info_iter which returns information on all nodes known
by this Endpoint.
-Sourcepub fn remote_info_iter(&self) -> impl Iterator<Item = RemoteInfo>
Returns information about all the remote nodes this Endpoint knows about.
+Sourcepub fn remote_info_iter(&self) -> impl Iterator<Item = RemoteInfo>
Returns information about all the remote nodes this Endpoint knows about.
This returns the same information as Endpoint::remote_info for each node known to this
Endpoint.
The Endpoint keeps some information about remote iroh nodes, which it uses to find
the best path to a node. This returns all the nodes it knows about, regardless of whether a
connection was ever made or is even possible.
See also Endpoint::remote_info to only retrieve information about a single node.
-Sourcepub fn discovery_stream(
+
Sourcepub fn discovery_stream(
&self,
) -> impl Stream<Item = Result<DiscoveryItem, Lagged>>
Returns a stream of all remote nodes discovered through the endpoint’s discovery services.
Whenever a node is discovered via the endpoint’s discovery service, the corresponding
@@ -183,7 +183,7 @@ at the time of adding it to the static provider.
Lagged may be yielded, indicating that items were missed.
See also Endpoint::remote_info_iter, which returns an iterator over all remotes
the endpoint knows about at a specific point in time.
-Sourcepub fn conn_type(&self, node_id: NodeId) -> Result<Watcher<ConnectionType>>
Returns a Watcher that reports the current connection type and any changes for
+
Sourcepub fn conn_type(&self, node_id: NodeId) -> Result<Watcher<ConnectionType>>
Returns a Watcher that reports the current connection type and any changes for
given remote node.
This watcher allows observing a stream of ConnectionType items by calling
Watcher::stream(). If the underlying connection to a remote node changes, it will
@@ -202,11 +202,11 @@ recently connected to this node id but previous methods of reaching the node hav
become inaccessible.
§Errors
Will error if we do not have any address information for the given node_id.
-Sourcepub fn dns_resolver(&self) -> &DnsResolver
Available on non-wasm_browser only.
Returns the DNS resolver used in this Endpoint.
+Sourcepub fn dns_resolver(&self) -> &DnsResolver
Available on non-wasm_browser only.
Returns the DNS resolver used in this Endpoint.
-Sourcepub fn discovery(&self) -> Option<&dyn Discovery>
Returns the discovery mechanism, if configured.
+Sourcepub fn discovery(&self) -> Option<&dyn Discovery>
Returns the discovery mechanism, if configured.
See Builder::discovery.
-Sourcepub async fn network_change(&self)
Notifies the system of potential network changes.
+Sourcepub async fn network_change(&self)
Notifies the system of potential network changes.
On many systems iroh is able to detect network changes by itself, however
some systems like android do not expose this functionality to native code.
Android does however provide this functionality to Java code. This
@@ -214,12 +214,12 @@ function allows for notifying iroh of any potential network changes like
this.
Even when the network did not change, or iroh was already able to detect
the network change itself, there is no harm in calling this function.
-Sourcepub fn set_user_data_for_discovery(&self, user_data: Option<UserData>)
Sets the initial user-defined data to be published in discovery services for this node.
+Sourcepub fn set_user_data_for_discovery(&self, user_data: Option<UserData>)
Sets the initial user-defined data to be published in discovery services for this node.
If the user-defined data passed to this function is different to the previous one,
the endpoint will republish its node info to the configured discovery services.
See also Builder::user_data_for_discovery for setting an initial value when
building the endpoint.
-Sourcepub async fn close(&self)
Closes the QUIC endpoint and the magic socket.
This will close any remaining open Connections with an error code
of 0 and an empty reason. Though it is best practice to close those
explicitly before with a custom error code and reason.
@@ -245,8 +245,8 @@ while TCP sockets usually get closed and drained by the operating system in the
kernel during the “Time-Wait” period of the TCP socket.
Be aware however that the underlying UDP sockets are only closed once all clones of
the the respective Endpoint are dropped.
-Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Endpoint
§impl !RefUnwindSafe for Endpoint
§impl Send for Endpoint
§impl Sync for Endpoint
§impl Unpin for Endpoint
§impl !UnwindSafe for Endpoint
Blanket Implementations§
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Endpoint
§impl !RefUnwindSafe for Endpoint
§impl Send for Endpoint
§impl Sync for Endpoint
§impl Unpin for Endpoint
§impl !UnwindSafe for Endpoint
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/3217/docs/iroh/endpoint/struct.Incoming.html b/pr/3217/docs/iroh/endpoint/struct.Incoming.html
index 61f28360fa..6b71064a82 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Incoming.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Incoming.html
@@ -1,29 +1,29 @@
-Incoming in iroh::endpoint - Rust pub struct Incoming { /* private fields */ }
Expand description
An incoming connection for which the server has not yet begun its parts of the
+
Incoming in iroh::endpoint - Rust pub struct Incoming { /* private fields */ }
Expand description
An incoming connection for which the server has not yet begun its parts of the
handshake.
-Implementations§
Source§impl Incoming
Sourcepub fn accept(self) -> Result<Connecting, ConnectionError>
Attempts to accept this incoming connection (an error may still occur).
+Implementations§
Source§impl Incoming
Sourcepub fn accept(self) -> Result<Connecting, ConnectionError>
Attempts to accept this incoming connection (an error may still occur).
Errors occurring here are likely not caused by the application or remote. The QUIC
connection listens on a normal UDP socket and any reachable network endpoint can
send datagrams to it, solicited or not. Even if the first few bytes look like a
QUIC packet, it might not even be a QUIC packet that is being received.
Thus it is common to simply log the errors here and accept them as something which
can happen.
-Sourcepub fn accept_with(
+
Sourcepub fn accept_with(
self,
server_config: Arc<ServerConfig>,
) -> Result<Connecting, ConnectionError>
Accepts this incoming connection using a custom configuration.
See accept() for more details.
-Sourcepub fn retry(self) -> Result<(), RetryError>
Responds with a retry packet.
+Sourcepub fn retry(self) -> Result<(), RetryError>
Responds with a retry packet.
This requires the client to retry with address validation.
Errors if remote_address_validated() is true.
-Sourcepub fn ignore(self)
Ignores this incoming connection attempt, not sending any packet in response.
-Sourcepub fn local_ip(&self) -> Option<IpAddr>
Returns the local IP address which was used when the peer established the
+
Sourcepub fn ignore(self)
Ignores this incoming connection attempt, not sending any packet in response.
+Sourcepub fn local_ip(&self) -> Option<IpAddr>
Returns the local IP address which was used when the peer established the
connection.
-Sourcepub fn remote_address(&self) -> SocketAddr
Returns the peer’s UDP address.
-Sourcepub fn remote_address_validated(&self) -> bool
Whether the socket address that is initiating this connection has been validated.
+Sourcepub fn remote_address(&self) -> SocketAddr
Returns the peer’s UDP address.
+Sourcepub fn remote_address_validated(&self) -> bool
Whether the socket address that is initiating this connection has been validated.
This means that the sender of the initial packet has proved that they can receive
traffic sent to self.remote_address().
-Trait Implementations§
Source§impl IntoFuture for Incoming
Source§type Output = Result<Connection, ConnectionError>
The output that the future will produce on completion.Source§type IntoFuture = IncomingFuture
Which kind of future are we turning this into?Source§fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read moreAuto Trait Implementations§
§impl !Freeze for Incoming
§impl !RefUnwindSafe for Incoming
§impl Send for Incoming
§impl Sync for Incoming
§impl Unpin for Incoming
§impl !UnwindSafe for Incoming
Blanket Implementations§
Trait Implementations§
Source§impl IntoFuture for Incoming
Source§type Output = Result<Connection, ConnectionError>
The output that the future will produce on completion.Source§type IntoFuture = IncomingFuture
Which kind of future are we turning this into?Source§fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read moreAuto Trait Implementations§
§impl !Freeze for Incoming
§impl !RefUnwindSafe for Incoming
§impl Send for Incoming
§impl Sync for Incoming
§impl Unpin for Incoming
§impl !UnwindSafe for Incoming
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/3217/docs/iroh/endpoint/struct.IncomingFuture.html b/pr/3217/docs/iroh/endpoint/struct.IncomingFuture.html
index 504c012c78..3934a53120 100644
--- a/pr/3217/docs/iroh/endpoint/struct.IncomingFuture.html
+++ b/pr/3217/docs/iroh/endpoint/struct.IncomingFuture.html
@@ -1,6 +1,6 @@
-IncomingFuture in iroh::endpoint - Rust pub struct IncomingFuture { /* private fields */ }
Expand description
Adaptor to let Incoming be awaited like a Connecting.
-Trait Implementations§
Source§impl Debug for IncomingFuture
Source§impl Future for IncomingFuture
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for IncomingFuturewhere
+IncomingFuture in iroh::endpoint - Rust pub struct IncomingFuture { /* private fields */ }
Expand description
Adaptor to let Incoming be awaited like a Connecting.
+Trait Implementations§
Source§impl Debug for IncomingFuture
Source§impl Future for IncomingFuture
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for IncomingFuturewhere
PinnedFieldsOf<__IncomingFuture<'pin>>: Unpin,
Auto Trait Implementations§
§impl !Freeze for IncomingFuture
§impl !RefUnwindSafe for IncomingFuture
§impl Send for IncomingFuture
§impl Sync for IncomingFuture
§impl !UnwindSafe for IncomingFuture
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html b/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html
index 792290d8f5..d03f08d892 100644
--- a/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html
+++ b/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html
@@ -1,7 +1,7 @@
-ZeroRttAccepted in iroh::endpoint - Rust pub struct ZeroRttAccepted { /* private fields */ }
Expand description
Future that completes when a connection is fully established.
+ZeroRttAccepted in iroh::endpoint - Rust pub struct ZeroRttAccepted { /* private fields */ }
Expand description
Future that completes when a connection is fully established.
For clients, the resulting value indicates if 0-RTT was accepted. For servers, the resulting
value is meaningless.
-Trait Implementations§
Source§impl Debug for ZeroRttAccepted
Source§impl Future for ZeroRttAccepted
Source§fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>
Attempts to resolve the future to a final value, registering
+Trait Implementations§
Source§impl Debug for ZeroRttAccepted
Source§impl Future for ZeroRttAccepted
Auto Trait Implementations§
§impl Freeze for ZeroRttAccepted
§impl !RefUnwindSafe for ZeroRttAccepted
§impl Send for ZeroRttAccepted
§impl Sync for ZeroRttAccepted
§impl Unpin for ZeroRttAccepted
§impl !UnwindSafe for ZeroRttAccepted
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/enum.KeyParsingError.html b/pr/3217/docs/iroh/enum.KeyParsingError.html
index 55941cda04..c7925e588b 100644
--- a/pr/3217/docs/iroh/enum.KeyParsingError.html
+++ b/pr/3217/docs/iroh/enum.KeyParsingError.html
@@ -1,4 +1,4 @@
-KeyParsingError in iroh - Rust pub enum KeyParsingError {
+KeyParsingError in iroh - Rust Enum KeyParsingError
pub enum KeyParsingError {
Decode(DecodeError),
Key(Error),
DecodeInvalidLength,
@@ -6,7 +6,7 @@
Variants§
§Decode(DecodeError)
Error when decoding.
§Key(Error)
Error when decoding the public key.
§DecodeInvalidLength
The encoded information had the wrong length.
-Trait Implementations§
Source§impl Debug for KeyParsingError
Source§impl Display for KeyParsingError
Source§impl Error for KeyParsingError
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()Source§impl From<DecodeError> for KeyParsingError
Source§fn from(source: DecodeError) -> KeyParsingError
Converts to this type from the input type.Source§impl From<Error> for KeyParsingError
Source§fn from(source: Error) -> KeyParsingError
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for KeyParsingError
§impl !RefUnwindSafe for KeyParsingError
§impl Send for KeyParsingError
§impl Sync for KeyParsingError
§impl Unpin for KeyParsingError
§impl !UnwindSafe for KeyParsingError
Blanket Implementations§
Trait Implementations§
§impl Debug for KeyParsingError
§impl Display for KeyParsingError
§impl Error for KeyParsingError
§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()§impl From<DecodeError> for KeyParsingError
§fn from(source: DecodeError) -> KeyParsingError
Converts to this type from the input type.§impl From<Error> for KeyParsingError
§fn from(source: Error) -> KeyParsingError
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for KeyParsingError
§impl !RefUnwindSafe for KeyParsingError
§impl Send for KeyParsingError
§impl Sync for KeyParsingError
§impl Unpin for KeyParsingError
§impl !UnwindSafe for KeyParsingError
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/3217/docs/iroh/metrics/struct.RelayMetrics.html b/pr/3217/docs/iroh/metrics/struct.RelayMetrics.html
index 83ae1acdcc..6f22d04f93 100644
--- a/pr/3217/docs/iroh/metrics/struct.RelayMetrics.html
+++ b/pr/3217/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/3217/docs/iroh/node_info/constant.IROH_TXT_NAME.html b/pr/3217/docs/iroh/node_info/constant.IROH_TXT_NAME.html
index c78d056a1f..0c1e657fb3 100644
--- a/pr/3217/docs/iroh/node_info/constant.IROH_TXT_NAME.html
+++ b/pr/3217/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/3217/docs/iroh/node_info/index.html b/pr/3217/docs/iroh/node_info/index.html
index 9884414f78..5130358fc8 100644
--- a/pr/3217/docs/iroh/node_info/index.html
+++ b/pr/3217/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/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html b/pr/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html
index 2f1c9b7234..33cd3a33fc 100644
--- a/pr/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html
+++ b/pr/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html
@@ -1,5 +1,5 @@
-MaxLengthExceededError in iroh::node_info - Rust
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/endpoint/struct.Builder.html b/pr/3217/docs/iroh/endpoint/struct.Builder.html
index 6872da2482..46b31e019e 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Builder.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Builder.html
@@ -1,24 +1,24 @@
-Builder in iroh::endpoint - Rust pub struct Builder { /* private fields */ }
Expand description
Builder for Endpoint.
+Builder in iroh::endpoint - Rust pub struct Builder { /* private fields */ }
Expand description
Builder for Endpoint.
By default the endpoint will generate a new random SecretKey, which will result in a
new NodeId.
To create the Endpoint call Builder::bind.
-Implementations§
Source§impl Builder
Sourcepub fn bind_addr_v4(self, addr: SocketAddrV4) -> Self
Sets the IPv4 bind address.
+Implementations§
Source§impl Builder
Sourcepub fn bind_addr_v4(self, addr: SocketAddrV4) -> Self
Sets the IPv4 bind address.
Setting the port to 0 will use a random port.
If the port specified is already in use, it will fallback to choosing a random port.
By default will use 0.0.0.0:0 to bind to.
-Sourcepub fn bind_addr_v6(self, addr: SocketAddrV6) -> Self
Sets the IPv6 bind address.
+Sourcepub fn bind_addr_v6(self, addr: SocketAddrV6) -> Self
Sets the IPv6 bind address.
Setting the port to 0 will use a random port.
If the port specified is already in use, it will fallback to choosing a random port.
By default will use [::]:0 to bind to.
-Sourcepub fn secret_key(self, secret_key: SecretKey) -> Self
Sets a secret key to authenticate with other peers.
+Sourcepub fn secret_key(self, secret_key: SecretKey) -> Self
Sourcepub fn alpns(self, alpn_protocols: Vec<Vec<u8>>) -> Self
Sets the ALPN protocols that this endpoint will accept on incoming connections.
+Sourcepub fn relay_mode(self, relay_mode: RelayMode) -> Self
Sets the relay servers to assist in establishing connectivity.
+Sourcepub fn relay_mode(self, relay_mode: RelayMode) -> Self
Sets the relay servers to assist in establishing connectivity.
Relay servers are used to establish initial connection with another iroh node.
They also perform various functions related to hole punching, see the crate docs
for more details.
@@ -26,15 +26,22 @@ for more details.
When using RelayMode::Custom, the provided relay_map must contain at least one
configured relay node. If an invalid RelayMap is provided bind
will result in an error.
-Sourcepub fn clear_discovery(self) -> Self
Removes all discovery services from the builder.
-Sourcepub fn discovery(self, discovery: Box<dyn Discovery>) -> Self
Optionally sets a discovery mechanism for this endpoint.
+Sourcepub fn relay_conn_protocol(self, protocol: Protocol) -> Self
Sets the protocol to use for relay connections.
+Options are either Protocol::Websocket or Protocol::Relay.
+Websocket will work with relays version 0.19 and above, so likely with any relays
+deployed at the time of writing this option (websocket support was released 9 months ago).
+Relay will work for now, but will likely be removed with the 1.0 release.
+Default is set to Relay at the moment, until we’ve thoroughly tested and improved
+websocket performance.
+Sourcepub fn clear_discovery(self) -> Self
Removes all discovery services from the builder.
+Sourcepub fn discovery(self, discovery: Box<dyn Discovery>) -> Self
Optionally sets a discovery mechanism for this endpoint.
If you want to combine multiple discovery services, you can use
Builder::add_discovery instead. This will internally create a
crate::discovery::ConcurrentDiscovery.
If no discovery service is set, connecting to a node without providing its
direct addresses or relay URLs will fail.
See the documentation of the Discovery trait for details.
-Sourcepub fn add_discovery<F, D>(self, discovery: F) -> Selfwhere
+
Sourcepub fn add_discovery<F, D>(self, discovery: F) -> Self
Adds a discovery mechanism for this endpoint.
The function discovery
@@ -47,7 +54,7 @@ to use this secret key to sign the information.
direct addresses or relay URLs will fail.
To clear all discovery services, use Builder::clear_discovery.
See the documentation of the Discovery trait for details.
-Sourcepub fn discovery_n0(self) -> Self
Configures the endpoint to use the default n0 DNS discovery service.
+Sourcepub fn discovery_n0(self) -> Self
Configures the endpoint to use the default n0 DNS discovery service.
The default discovery service publishes to and resolves from the
n0.computer dns server iroh.link.
This is equivalent to adding both a crate::discovery::pkarr::PkarrPublisher
@@ -56,29 +63,29 @@ n0.computer dns server.
This will by default use N0_DNS_PKARR_RELAY_PROD.
When in tests, or when the test-utils feature is enabled, this will use the
N0_DNS_PKARR_RELAY_STAGING.
-Sourcepub fn tls_x509(self) -> Self
Use libp2p based self signed certificates for TLS.
For details see the libp2p spec at https://github.com/libp2p/specs/blob/master/tls/tls.md
This is the only mechanism available in iroh@0.33.0 and earlier.
-Sourcepub fn tls_raw_public_keys(self) -> Self
Use TLS Raw Public Keys
+Sourcepub fn tls_raw_public_keys(self) -> Self
Use TLS Raw Public Keys
This is the default, but is not compatible with older versions of iroh.
-Sourcepub fn discovery_dht(self) -> Self
Available on crate feature discovery-pkarr-dht only.
Configures the endpoint to also use the mainline DHT with default settings.
+Sourcepub fn discovery_dht(self) -> Self
Available on crate feature discovery-pkarr-dht only.
Configures the endpoint to also use the mainline DHT with default settings.
This is equivalent to adding a crate::discovery::pkarr::dht::DhtDiscovery
with default settings. Note that DhtDiscovery has various more advanced
configuration options. If you need any of those, you should manually
create a DhtDiscovery and add it with Builder::add_discovery.
-Sourcepub fn discovery_local_network(self) -> Self
Available on crate feature discovery-local-network only.
Configures the endpoint to also use local network discovery.
+Sourcepub fn discovery_local_network(self) -> Self
Available on crate feature discovery-local-network only.
Configures the endpoint to also use local network discovery.
This is equivalent to adding a crate::discovery::mdns::MdnsDiscovery
with default settings. Note that MdnsDiscovery has various more advanced
configuration options. If you need any of those, you should manually
create a MdnsDiscovery and add it with Builder::add_discovery.
-Sourcepub fn user_data_for_discovery(self, user_data: UserData) -> Self
Sets the initial user-defined data to be published in discovery services for this node.
+Sourcepub fn user_data_for_discovery(self, user_data: UserData) -> Self
Sets the initial user-defined data to be published in discovery services for this node.
When using discovery services, this string of UserData will be published together
with the node’s addresses and relay URL. When other nodes discover this node,
they retrieve the UserData in addition to the addressing info.
Iroh itself does not interpret the user-defined data in any way, it is purely left
for applications to parse and use.
-Sourcepub fn known_nodes(self, nodes: Vec<NodeAddr>) -> Self
Optionally set a list of known nodes.
-Sourcepub fn transport_config(self, transport_config: TransportConfig) -> Self
Sets a custom quinn::TransportConfig for this endpoint.
+Sourcepub fn known_nodes(self, nodes: Vec<NodeAddr>) -> Self
Optionally set a list of known nodes.
+Sourcepub fn transport_config(self, transport_config: TransportConfig) -> Self
Sets a custom quinn::TransportConfig for this endpoint.
The transport config contains parameters governing the QUIC state machine.
If unset, the default config is used. Default values should be suitable for most
internet applications. Applications protocols which forbid remotely-initiated
@@ -86,31 +93,31 @@ streams should set max_concurrent_bidi_streams and max_concur
zero.
Please be aware that changing some settings may have adverse effects on establishing
and maintaining direct connections.
-Sourcepub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self
Available on non-wasm_browser only.
Optionally sets a custom DNS resolver to use for this endpoint.
+Sourcepub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self
Available on non-wasm_browser only.
Optionally sets a custom DNS resolver to use for this endpoint.
The DNS resolver is used to resolve relay hostnames, and node addresses if
crate::discovery::dns::DnsDiscovery is configured.
By default, a new DNS resolver is created which is configured to use the
host system’s DNS configuration. You can pass a custom instance of DnsResolver
here to use a differently configured DNS resolver for this endpoint, or to share
a DnsResolver between multiple endpoints.
-Sourcepub fn proxy_url(self, url: Url) -> Self
Sets an explicit proxy url to proxy all HTTP(S) traffic through.
-Sourcepub fn proxy_from_env(self) -> Self
Sets the proxy url from the environment, in this order:
+Sourcepub fn proxy_url(self, url: Url) -> Self
Sets an explicit proxy url to proxy all HTTP(S) traffic through.
+Sourcepub fn proxy_from_env(self) -> Self
Sets the proxy url from the environment, in this order:
HTTP_PROXY
http_proxy
HTTPS_PROXY
https_proxy
-Sourcepub fn keylog(self, keylog: bool) -> Self
Enables saving the TLS pre-master key for connections.
+Sourcepub fn keylog(self, keylog: bool) -> Self
Enables saving the TLS pre-master key for connections.
This key should normally remain secret but can be useful to debug networking issues
by decrypting captured traffic.
If keylog is true then setting the SSLKEYLOGFILE environment variable to a
filename will result in this file being used to log the TLS pre-master keys.
-Sourcepub fn insecure_skip_relay_cert_verify(self, skip_verify: bool) -> Self
Available on crate feature test-utils only.
Skip verification of SSL certificates from relay servers
+Sourcepub fn insecure_skip_relay_cert_verify(self, skip_verify: bool) -> Self
Available on crate feature test-utils only.
Skip verification of SSL certificates from relay servers
May only be used in tests.
-Sourcepub fn path_selection(self, path_selection: PathSelection) -> Self
Available on crate feature test-utils only.
This implies we only use the relay to communicate
+
Sourcepub fn path_selection(self, path_selection: PathSelection) -> Self
Available on crate feature test-utils only.
This implies we only use the relay to communicate
and do not attempt to do any hole punching.
-Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Builder
§impl !RefUnwindSafe for Builder
§impl Send for Builder
§impl Sync for Builder
§impl Unpin for Builder
§impl !UnwindSafe for Builder
Blanket Implementations§
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Builder
§impl !RefUnwindSafe for Builder
§impl Send for Builder
§impl Sync for Builder
§impl Unpin for Builder
§impl !UnwindSafe for Builder
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/3217/docs/iroh/endpoint/struct.ConnectOptions.html b/pr/3217/docs/iroh/endpoint/struct.ConnectOptions.html
index d82c67e528..4b2b9fa2d5 100644
--- a/pr/3217/docs/iroh/endpoint/struct.ConnectOptions.html
+++ b/pr/3217/docs/iroh/endpoint/struct.ConnectOptions.html
@@ -1,12 +1,12 @@
-ConnectOptions in iroh::endpoint - Rust pub struct ConnectOptions { /* private fields */ }
Expand description
Options for the Endpoint::connect_with_opts function.
-Implementations§
Source§impl ConnectOptions
Sourcepub fn new() -> Self
Initializes new connection options.
+ConnectOptions in iroh::endpoint - Rust pub struct ConnectOptions { /* private fields */ }
Expand description
Options for the Endpoint::connect_with_opts function.
+Implementations§
Source§impl ConnectOptions
Sourcepub fn new() -> Self
Initializes new connection options.
By default, the connection will use the same options
as Endpoint::connect, e.g. a default TransportConfig.
-Sourcepub fn with_transport_config(
+
Sourcepub fn with_transport_config(
self,
transport_config: Arc<TransportConfig>,
) -> Self
Sets the QUIC transport config options for this connection.
-Trait Implementations§
Source§impl Clone for ConnectOptions
Source§fn clone(&self) -> ConnectOptions
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 ConnectOptions
Source§impl Default for ConnectOptions
Source§fn default() -> ConnectOptions
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for ConnectOptions
§impl !RefUnwindSafe for ConnectOptions
§impl Send for ConnectOptions
§impl Sync for ConnectOptions
§impl Unpin for ConnectOptions
§impl !UnwindSafe for ConnectOptions
Blanket Implementations§
Trait Implementations§
Source§impl Clone for ConnectOptions
Source§fn clone(&self) -> ConnectOptions
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 ConnectOptions
Source§impl Default for ConnectOptions
Source§fn default() -> ConnectOptions
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for ConnectOptions
§impl !RefUnwindSafe for ConnectOptions
§impl Send for ConnectOptions
§impl Sync for ConnectOptions
§impl Unpin for ConnectOptions
§impl !UnwindSafe for ConnectOptions
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/3217/docs/iroh/endpoint/struct.Connecting.html b/pr/3217/docs/iroh/endpoint/struct.Connecting.html
index 41a03946a4..e190a84876 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Connecting.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Connecting.html
@@ -1,5 +1,5 @@
-Connecting in iroh::endpoint - Rust pub struct Connecting { /* private fields */ }
Expand description
In-progress connection attempt future
-Implementations§
Source§impl Connecting
Sourcepub fn into_0rtt(self) -> Result<(Connection, ZeroRttAccepted), Self>
Converts this Connecting into a 0-RTT or 0.5-RTT connection at the cost of weakened
+
Connecting in iroh::endpoint - Rust pub struct Connecting { /* private fields */ }
Expand description
In-progress connection attempt future
+Implementations§
Source§impl Connecting
Sourcepub fn into_0rtt(self) -> Result<(Connection, ZeroRttAccepted), Self>
Converts this Connecting into a 0-RTT or 0.5-RTT connection at the cost of weakened
security.
Returns Ok immediately if the local endpoint is able to attempt sending 0/0.5-RTT data.
If so, the returned Connection can be used to send application data without waiting for
@@ -33,10 +33,10 @@ before TLS client authentication has occurred, and should therefore not be used
data for which client authentication is being used.
You can use RecvStream::is_0rtt to check whether a stream has been opened in 0-RTT
and thus whether parts of the stream are operating under this reduced security level.
-Sourcepub async fn handshake_data(&mut self) -> Result<Box<dyn Any>, ConnectionError>
Parameters negotiated during the handshake
-Trait Implementations§
Source§impl Debug for Connecting
Source§impl Future for Connecting
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for Connectingwhere
+Sourcepub async fn handshake_data(&mut self) -> Result<Box<dyn Any>, ConnectionError>
Parameters negotiated during the handshake
+
Trait Implementations§
Source§impl Debug for Connecting
Source§impl Future for Connecting
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for Connectingwhere
PinnedFieldsOf<__Connecting<'pin>>: Unpin,
Auto Trait Implementations§
§impl Freeze for Connecting
§impl !RefUnwindSafe for Connecting
§impl Send for Connecting
§impl Sync for Connecting
§impl !UnwindSafe for Connecting
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/endpoint/struct.Connection.html b/pr/3217/docs/iroh/endpoint/struct.Connection.html
index 8e81609487..928cdb9918 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Connection.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Connection.html
@@ -1,4 +1,4 @@
-Connection in iroh::endpoint - Rust pub struct Connection { /* private fields */ }
Expand description
A QUIC connection.
+Connection in iroh::endpoint - Rust pub struct Connection { /* private fields */ }
Expand description
A QUIC connection.
If all references to a connection (including every clone of the Connection handle,
streams of incoming streams, and the various stream types) have been dropped, then the
connection will be automatically closed with an error_code of 0 and an empty reason. You
@@ -8,29 +8,29 @@ receiving CONNECTION_CLOSE the peer may drop any stream data not yet delivered t
application. Connection::close describes in more detail how to gracefully close a
connection without losing application data.
May be cloned to obtain another handle to the same connection.
-Implementations§
Source§impl Connection
Implementations§
Source§impl Connection
Sourcepub fn open_uni(&self) -> OpenUni<'_> ⓘ
Initiates a new outgoing unidirectional stream.
Streams are cheap and instantaneous to open unless blocked by flow control. As a
consequence, the peer won’t be notified that a stream has been opened until the
stream is actually used.
-Sourcepub fn open_bi(&self) -> OpenBi<'_> ⓘ
Initiates a new outgoing bidirectional stream.
Streams are cheap and instantaneous to open unless blocked by flow control. As a
consequence, the peer won’t be notified that a stream has been opened until the
stream is actually used. Calling open_bi then waiting on the RecvStream
without writing anything to SendStream will never succeed.
-Sourcepub fn accept_uni(&self) -> AcceptUni<'_> ⓘ
Accepts the next incoming uni-directional stream.
-Sourcepub fn accept_uni(&self) -> AcceptUni<'_> ⓘ
Accepts the next incoming uni-directional stream.
+Sourcepub fn accept_bi(&self) -> AcceptBi<'_> ⓘ
Accept the next incoming bidirectional stream.
Important Note: The peer that calls open_bi must write to its SendStream
before the peer Connection is able to accept the stream using
accept_bi(). Calling open_bi then waiting on the RecvStream without
writing anything to the connected SendStream will never succeed.
-Sourcepub fn read_datagram(&self) -> ReadDatagram<'_> ⓘ
Receives an application datagram.
-Sourcepub async fn closed(&self) -> ConnectionError
Wait for the connection to be closed for any reason.
+Sourcepub fn read_datagram(&self) -> ReadDatagram<'_> ⓘ
Receives an application datagram.
+Sourcepub async fn closed(&self) -> ConnectionError
Wait for the connection to be closed for any reason.
Despite the return type’s name, closed connections are often not an error condition
at the application layer. Cases that might be routine include
ConnectionError::LocallyClosed and ConnectionError::ApplicationClosed.
-Sourcepub fn close_reason(&self) -> Option<ConnectionError>
If the connection is closed, the reason why.
+Sourcepub fn close_reason(&self) -> Option<ConnectionError>
If the connection is closed, the reason why.
Returns None if the connection is still open.
-Sourcepub fn close(&self, error_code: VarInt, reason: &[u8])
Closes the connection immediately.
Pending operations will fail immediately with ConnectionError::LocallyClosed. No
more data is sent to the peer and the peer may drop buffered data upon receiving the
CONNECTION_CLOSE frame.
@@ -51,41 +51,41 @@ endpoint. Once the local side sends a CONNECTION_CLOSE frame in response to call
close the remote endpoint may drop any data it received but is as yet
undelivered to the application, including data that was acknowledged as received to
the local endpoint.
-Sourcepub fn send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError>
Transmits data as an unreliable, unordered application datagram.
+Sourcepub fn send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError>
Transmits data as an unreliable, unordered application datagram.
Application datagrams are a low-level primitive. They may be lost or delivered out
of order, and data must both fit inside a single QUIC packet and be smaller than
the maximum dictated by the peer.
-Sourcepub fn max_datagram_size(&self) -> Option<usize>
Computes the maximum size of datagrams that may be passed to send_datagram.
+Sourcepub fn max_datagram_size(&self) -> Option<usize>
Computes the maximum size of datagrams that may be passed to send_datagram.
Returns None if datagrams are unsupported by the peer or disabled locally.
This may change over the lifetime of a connection according to variation in the path
MTU estimate. The peer can also enforce an arbitrarily small fixed limit, but if the
peer’s limit is large this is guaranteed to be a little over a kilobyte at minimum.
Not necessarily the maximum size of received datagrams.
-Sourcepub fn datagram_send_buffer_space(&self) -> usize
Bytes available in the outgoing datagram buffer.
+Sourcepub fn datagram_send_buffer_space(&self) -> usize
Bytes available in the outgoing datagram buffer.
When greater than zero, calling send_datagram with a
datagram of at most this size is guaranteed not to cause older datagrams to be
dropped.
-Sourcepub fn rtt(&self) -> Duration
Current best estimate of this connection’s latency (round-trip-time).
-Sourcepub fn stats(&self) -> ConnectionStats
Returns connection statistics.
-Sourcepub fn congestion_state(&self) -> Box<dyn Controller>
Current state of the congestion control algorithm, for debugging purposes.
-Sourcepub fn handshake_data(&self) -> Option<Box<dyn Any>>
Parameters negotiated during the handshake.
+Sourcepub fn rtt(&self) -> Duration
Current best estimate of this connection’s latency (round-trip-time).
+Sourcepub fn stats(&self) -> ConnectionStats
Returns connection statistics.
+Sourcepub fn congestion_state(&self) -> Box<dyn Controller>
Current state of the congestion control algorithm, for debugging purposes.
+Sourcepub fn handshake_data(&self) -> Option<Box<dyn Any>>
Parameters negotiated during the handshake.
Guaranteed to return Some on fully established connections or after
Connecting::handshake_data() succeeds. See that method’s documentations for
details on the returned value.
-Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
-Sourcepub fn peer_identity(&self) -> Option<Box<dyn Any>>
Cryptographic identity of the peer.
+Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
+Sourcepub fn peer_identity(&self) -> Option<Box<dyn Any>>
Sourcepub fn remote_node_id(&self) -> Result<NodeId>
Returns the NodeId from the peer’s TLS certificate.
+Sourcepub fn remote_node_id(&self) -> Result<NodeId>
Sourcepub fn stable_id(&self) -> usize
A stable identifier for this connection.
Peer addresses and connection IDs can change, but this value will remain fixed for
the lifetime of the connection.
-Sourcepub fn export_keying_material(
+
Sourcepub fn export_keying_material(
&self,
output: &mut [u8],
label: &[u8],
@@ -96,14 +96,14 @@ arguments and output buffers of equal length, they will get the
same sequence of bytes in output. These bytes are cryptographically
strong and pseudorandom, and are suitable for use as keying material.
See RFC5705 for more information.
-
Sourcepub fn set_max_concurrent_uni_streams(&self, count: VarInt)
Modifies the number of unidirectional streams that may be concurrently opened.
+Sourcepub fn set_max_concurrent_uni_streams(&self, count: VarInt)
Modifies the number of unidirectional streams that may be concurrently opened.
No streams may be opened by the peer unless fewer than count are already
open. Large counts increase both minimum and worst-case memory consumption.
-Sourcepub fn set_receive_window(&self, receive_window: VarInt)
Sourcepub fn set_max_concurrent_bi_streams(&self, count: VarInt)
Modifies the number of bidirectional streams that may be concurrently opened.
+Sourcepub fn set_receive_window(&self, receive_window: VarInt)
Sourcepub fn set_max_concurrent_bi_streams(&self, count: VarInt)
Modifies the number of bidirectional streams that may be concurrently opened.
No streams may be opened by the peer unless fewer than count are already
open. Large counts increase both minimum and worst-case memory consumption.
-Trait Implementations§
Source§impl Clone for Connection
Source§fn clone(&self) -> Connection
Returns a copy of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreAuto Trait Implementations§
§impl Freeze for Connection
§impl RefUnwindSafe for Connection
§impl Send for Connection
§impl Sync for Connection
§impl Unpin for Connection
§impl UnwindSafe for Connection
Blanket Implementations§
Trait Implementations§
Source§impl Clone for Connection
Source§fn clone(&self) -> Connection
Returns a copy of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreAuto Trait Implementations§
§impl Freeze for Connection
§impl RefUnwindSafe for Connection
§impl Send for Connection
§impl Sync for Connection
§impl Unpin for Connection
§impl UnwindSafe for Connection
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/3217/docs/iroh/endpoint/struct.DirectAddr.html b/pr/3217/docs/iroh/endpoint/struct.DirectAddr.html
index 61a667e47d..04760c9021 100644
--- a/pr/3217/docs/iroh/endpoint/struct.DirectAddr.html
+++ b/pr/3217/docs/iroh/endpoint/struct.DirectAddr.html
@@ -1,4 +1,4 @@
-DirectAddr in iroh::endpoint - Rust pub struct DirectAddr {
+DirectAddr in iroh::endpoint - Rust pub struct DirectAddr {
pub addr: SocketAddr,
pub typ: DirectAddrType,
}
Expand description
A direct address on which an iroh-node might be contactable.
@@ -7,16 +7,16 @@ contacted. These can come from various sources depending on the network topolog
iroh node, see DirectAddrType for the several kinds of sources.
Fields§
§addr: SocketAddrThe address.
§typ: DirectAddrTypeThe origin of this direct address.
-Trait Implementations§
Source§impl Clone for DirectAddr
Source§fn clone(&self) -> DirectAddr
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 DirectAddr
Source§impl Hash for DirectAddr
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
+Trait Implementations§
Source§impl Clone for DirectAddr
Source§fn clone(&self) -> DirectAddr
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 DirectAddr
Source§impl Hash for DirectAddr
Source§impl Ord for DirectAddr
Source§impl Ord for DirectAddr
Source§fn cmp(&self, other: &DirectAddr) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read moreSource§impl PartialEq for DirectAddr
Source§impl PartialOrd for DirectAddr
Source§impl PartialEq for DirectAddr
Source§impl PartialOrd for DirectAddr
Source§impl Eq for DirectAddr
Source§impl StructuralPartialEq for DirectAddr
Auto Trait Implementations§
§impl Freeze for DirectAddr
§impl RefUnwindSafe for DirectAddr
§impl Send for DirectAddr
§impl Sync for DirectAddr
§impl Unpin for DirectAddr
§impl UnwindSafe for DirectAddr
Blanket Implementations§
Source§impl Eq for DirectAddr
Source§impl StructuralPartialEq for DirectAddr
Auto Trait Implementations§
§impl Freeze for DirectAddr
§impl RefUnwindSafe for DirectAddr
§impl Send for DirectAddr
§impl Sync for DirectAddr
§impl Unpin for DirectAddr
§impl UnwindSafe for DirectAddr
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/3217/docs/iroh/endpoint/struct.Endpoint.html b/pr/3217/docs/iroh/endpoint/struct.Endpoint.html
index e25e697700..0b8c9af7b3 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Endpoint.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Endpoint.html
@@ -1,4 +1,4 @@
-Endpoint in iroh::endpoint - Rust pub struct Endpoint { /* private fields */ }
Expand description
Controls an iroh node, establishing connections with other nodes.
+Endpoint in iroh::endpoint - Rust pub struct Endpoint { /* private fields */ }
Expand description
Controls an iroh node, establishing connections with other nodes.
This is the main API interface to create connections to, and accept connections from
other iroh nodes. The connections are peer-to-peer and encrypted, a Relay server is
used to make the connections reliable. See the [crate docs] for a more detailed
@@ -16,17 +16,17 @@ the peer are created using the Connection::open_uni and Connection::open_bi functions.
Note that due to the light-weight properties of streams a stream will only be accepted
once the initiating peer has sent some data on it.
-Implementations§
Source§impl Endpoint
Sourcepub fn builder() -> Builder
Returns the builder for an Endpoint, with a production configuration.
-Sourcepub fn set_alpns(&self, alpns: Vec<Vec<u8>>) -> Result<()>
Sets the list of accepted ALPN protocols.
+Implementations§
Source§impl Endpoint
Sourcepub fn builder() -> Builder
Returns the builder for an Endpoint, with a production configuration.
+Sourcepub async fn connect(
&self,
node_addr: impl Into<NodeAddr>,
alpn: &[u8],
) -> Result<Connection>
Connects to a remote Endpoint.
A value that can be converted into a NodeAddr is required. This can be either a
-NodeAddr, a NodeId or a iroh_base::ticket::NodeTicket.
+NodeAddr, a NodeId or a [iroh_base::ticket::NodeTicket].
The NodeAddr must contain the NodeId to dial and may also contain a RelayUrl
and direct addresses. If direct addresses are provided, they will be used to try and
establish a direct connection without involving a relay server.
@@ -41,7 +41,7 @@ connection attempt will fail with an error.
The alpn, or application-level protocol identifier, is also required. The remote
endpoint must support this alpn, otherwise the connection attempt will fail with
an error.
-Sourcepub async fn connect_with_opts(
+
Sourcepub async fn connect_with_opts(
&self,
node_addr: impl Into<NodeAddr>,
alpn: &[u8],
@@ -61,13 +61,13 @@ security concerns.
establishing and maintaining direct connections. Carefully test settings you use and
consider this currently as still rather experimental.
-
Sourcepub fn accept(&self) -> Accept<'_> ⓘ
Accepts an incoming connection on the endpoint.
Only connections with the ALPNs configured in Builder::alpns will be accepted.
If multiple ALPNs have been configured the ALPN can be inspected before accepting
the connection using Connecting::alpn.
The returned future will yield None if the endpoint is closed by calling
Endpoint::close.
-Sourcepub fn add_node_addr(&self, node_addr: NodeAddr) -> Result<()>
Informs this Endpoint about addresses of the iroh node.
+Sourcepub fn add_node_addr(&self, node_addr: NodeAddr) -> Result<()>
Informs this Endpoint about addresses of the iroh node.
This updates the local state for the remote node. If the provided NodeAddr
contains a RelayUrl this will be used as the new relay server for this node. If
it contains any new IP endpoints they will also be stored and tried when next
@@ -80,7 +80,7 @@ This provides more flexibility and future proofing.
§Errors
Will return an error if we attempt to add our own NodeId to the node map or
if the direct addresses are a subset of ours.
-Sourcepub fn add_node_addr_with_source(
+
Sourcepub fn secret_key(&self) -> &SecretKey
Returns the secret_key of this endpoint.
-Sourcepub fn secret_key(&self) -> &SecretKey
Returns the secret_key of this endpoint.
+Sourcepub fn node_id(&self) -> NodeId
Returns the node id of this endpoint.
This ID is the unique addressing information of this node and other peers must know
it to be able to connect to this node.
-Sourcepub async fn node_addr(&self) -> Result<NodeAddr>
Returns the current NodeAddr for this endpoint.
+Sourcepub async fn node_addr(&self) -> Result<NodeAddr>
Returns the current NodeAddr for this endpoint.
The returned NodeAddr will have the current RelayUrl and direct addresses
as they would be returned by Endpoint::home_relay and
Endpoint::direct_addresses.
In browsers, because direct addresses are unavailable, this will only wait for
the home relay to be available before returning.
-Sourcepub fn home_relay(&self) -> Watcher<Option<RelayUrl>>
Sourcepub fn home_relay(&self) -> Watcher<Option<RelayUrl>>
Returns a Watcher for the RelayUrl of the Relay server used as home relay.
Every endpoint has a home Relay server which it chooses as the server with the
lowest latency out of the configured servers provided by Builder::relay_mode.
This is the server other iroh nodes can use to reliably establish a connection
@@ -122,7 +122,7 @@ some time to connect to find and connect to the home relay server.
let mep = Endpoint::builder().bind().await.unwrap();
let _relay_url = mep.home_relay().initialized().await.unwrap();
-Sourcepub fn direct_addresses(&self) -> Watcher<Option<BTreeSet<DirectAddr>>>
Sourcepub fn direct_addresses(&self) -> Watcher<Option<BTreeSet<DirectAddr>>>
Returns a Watcher for the direct addresses of this Endpoint.
The direct addresses of the Endpoint are those that could be used by other
iroh nodes to establish direct connectivity, depending on the network
situation. The yielded lists of direct addresses contain both the locally-bound
@@ -145,10 +145,10 @@ recently discovered direct addresses.
let mep = Endpoint::builder().bind().await.unwrap();
let _addrs = mep.direct_addresses().initialized().await.unwrap();
-Sourcepub fn bound_sockets(&self) -> (SocketAddr, Option<SocketAddr>)
Available on non-wasm_browser only.
Returns the local socket addresses on which the underlying sockets are bound.
+Sourcepub fn bound_sockets(&self) -> (SocketAddr, Option<SocketAddr>)
Available on non-wasm_browser only.
Returns the local socket addresses on which the underlying sockets are bound.
The Endpoint always binds on an IPv4 address and also tries to bind on an IPv6
address if available.
-Sourcepub fn remote_info(&self, node_id: NodeId) -> Option<RemoteInfo>
Returns information about the remote node identified by a NodeId.
+Sourcepub fn remote_info(&self, node_id: NodeId) -> Option<RemoteInfo>
Returns information about the remote node identified by a NodeId.
The Endpoint keeps some information about remote iroh nodes, which it uses to find
the best path to a node. Having information on a remote node, however, does not mean we have
ever connected to it to or even whether a connection is even possible. The information about a
@@ -157,14 +157,14 @@ calls may return different information. Furthermore, node information may even b
completely evicted as it becomes stale.
See also Endpoint::remote_info_iter which returns information on all nodes known
by this Endpoint.
-Sourcepub fn remote_info_iter(&self) -> impl Iterator<Item = RemoteInfo>
Returns information about all the remote nodes this Endpoint knows about.
+Sourcepub fn remote_info_iter(&self) -> impl Iterator<Item = RemoteInfo>
Returns information about all the remote nodes this Endpoint knows about.
This returns the same information as Endpoint::remote_info for each node known to this
Endpoint.
The Endpoint keeps some information about remote iroh nodes, which it uses to find
the best path to a node. This returns all the nodes it knows about, regardless of whether a
connection was ever made or is even possible.
See also Endpoint::remote_info to only retrieve information about a single node.
-Sourcepub fn discovery_stream(
+
Sourcepub fn discovery_stream(
&self,
) -> impl Stream<Item = Result<DiscoveryItem, Lagged>>
Returns a stream of all remote nodes discovered through the endpoint’s discovery services.
Whenever a node is discovered via the endpoint’s discovery service, the corresponding
@@ -183,7 +183,7 @@ at the time of adding it to the static provider.
Lagged may be yielded, indicating that items were missed.
See also Endpoint::remote_info_iter, which returns an iterator over all remotes
the endpoint knows about at a specific point in time.
-Sourcepub fn conn_type(&self, node_id: NodeId) -> Result<Watcher<ConnectionType>>
Returns a Watcher that reports the current connection type and any changes for
+
Sourcepub fn conn_type(&self, node_id: NodeId) -> Result<Watcher<ConnectionType>>
Returns a Watcher that reports the current connection type and any changes for
given remote node.
This watcher allows observing a stream of ConnectionType items by calling
Watcher::stream(). If the underlying connection to a remote node changes, it will
@@ -202,11 +202,11 @@ recently connected to this node id but previous methods of reaching the node hav
become inaccessible.
§Errors
Will error if we do not have any address information for the given node_id.
-Sourcepub fn dns_resolver(&self) -> &DnsResolver
Available on non-wasm_browser only.
Returns the DNS resolver used in this Endpoint.
+Sourcepub fn dns_resolver(&self) -> &DnsResolver
Available on non-wasm_browser only.
Returns the DNS resolver used in this Endpoint.
-Sourcepub fn discovery(&self) -> Option<&dyn Discovery>
Returns the discovery mechanism, if configured.
+Sourcepub fn discovery(&self) -> Option<&dyn Discovery>
Returns the discovery mechanism, if configured.
See Builder::discovery.
-Sourcepub async fn network_change(&self)
Notifies the system of potential network changes.
+Sourcepub async fn network_change(&self)
Notifies the system of potential network changes.
On many systems iroh is able to detect network changes by itself, however
some systems like android do not expose this functionality to native code.
Android does however provide this functionality to Java code. This
@@ -214,12 +214,12 @@ function allows for notifying iroh of any potential network changes like
this.
Even when the network did not change, or iroh was already able to detect
the network change itself, there is no harm in calling this function.
-Sourcepub fn set_user_data_for_discovery(&self, user_data: Option<UserData>)
Sets the initial user-defined data to be published in discovery services for this node.
+Sourcepub fn set_user_data_for_discovery(&self, user_data: Option<UserData>)
Sets the initial user-defined data to be published in discovery services for this node.
If the user-defined data passed to this function is different to the previous one,
the endpoint will republish its node info to the configured discovery services.
See also Builder::user_data_for_discovery for setting an initial value when
building the endpoint.
-Sourcepub async fn close(&self)
Closes the QUIC endpoint and the magic socket.
This will close any remaining open Connections with an error code
of 0 and an empty reason. Though it is best practice to close those
explicitly before with a custom error code and reason.
@@ -245,8 +245,8 @@ while TCP sockets usually get closed and drained by the operating system in the
kernel during the “Time-Wait” period of the TCP socket.
Be aware however that the underlying UDP sockets are only closed once all clones of
the the respective Endpoint are dropped.
-Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Endpoint
§impl !RefUnwindSafe for Endpoint
§impl Send for Endpoint
§impl Sync for Endpoint
§impl Unpin for Endpoint
§impl !UnwindSafe for Endpoint
Blanket Implementations§
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Endpoint
§impl !RefUnwindSafe for Endpoint
§impl Send for Endpoint
§impl Sync for Endpoint
§impl Unpin for Endpoint
§impl !UnwindSafe for Endpoint
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/3217/docs/iroh/endpoint/struct.Incoming.html b/pr/3217/docs/iroh/endpoint/struct.Incoming.html
index 61f28360fa..6b71064a82 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Incoming.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Incoming.html
@@ -1,29 +1,29 @@
-Incoming in iroh::endpoint - Rust pub struct Incoming { /* private fields */ }
Expand description
An incoming connection for which the server has not yet begun its parts of the
+
Incoming in iroh::endpoint - Rust pub struct Incoming { /* private fields */ }
Expand description
An incoming connection for which the server has not yet begun its parts of the
handshake.
-Implementations§
Source§impl Incoming
Sourcepub fn accept(self) -> Result<Connecting, ConnectionError>
Attempts to accept this incoming connection (an error may still occur).
+Implementations§
Source§impl Incoming
Sourcepub fn accept(self) -> Result<Connecting, ConnectionError>
Attempts to accept this incoming connection (an error may still occur).
Errors occurring here are likely not caused by the application or remote. The QUIC
connection listens on a normal UDP socket and any reachable network endpoint can
send datagrams to it, solicited or not. Even if the first few bytes look like a
QUIC packet, it might not even be a QUIC packet that is being received.
Thus it is common to simply log the errors here and accept them as something which
can happen.
-Sourcepub fn accept_with(
+
Sourcepub fn accept_with(
self,
server_config: Arc<ServerConfig>,
) -> Result<Connecting, ConnectionError>
Accepts this incoming connection using a custom configuration.
See accept() for more details.
-Sourcepub fn retry(self) -> Result<(), RetryError>
Responds with a retry packet.
+Sourcepub fn retry(self) -> Result<(), RetryError>
Responds with a retry packet.
This requires the client to retry with address validation.
Errors if remote_address_validated() is true.
-Sourcepub fn ignore(self)
Ignores this incoming connection attempt, not sending any packet in response.
-Sourcepub fn local_ip(&self) -> Option<IpAddr>
Returns the local IP address which was used when the peer established the
+
Sourcepub fn ignore(self)
Ignores this incoming connection attempt, not sending any packet in response.
+Sourcepub fn local_ip(&self) -> Option<IpAddr>
Returns the local IP address which was used when the peer established the
connection.
-Sourcepub fn remote_address(&self) -> SocketAddr
Returns the peer’s UDP address.
-Sourcepub fn remote_address_validated(&self) -> bool
Whether the socket address that is initiating this connection has been validated.
+Sourcepub fn remote_address(&self) -> SocketAddr
Returns the peer’s UDP address.
+Sourcepub fn remote_address_validated(&self) -> bool
Whether the socket address that is initiating this connection has been validated.
This means that the sender of the initial packet has proved that they can receive
traffic sent to self.remote_address().
-Trait Implementations§
Source§impl IntoFuture for Incoming
Source§type Output = Result<Connection, ConnectionError>
The output that the future will produce on completion.Source§type IntoFuture = IncomingFuture
Which kind of future are we turning this into?Source§fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read moreAuto Trait Implementations§
§impl !Freeze for Incoming
§impl !RefUnwindSafe for Incoming
§impl Send for Incoming
§impl Sync for Incoming
§impl Unpin for Incoming
§impl !UnwindSafe for Incoming
Blanket Implementations§
Trait Implementations§
Source§impl IntoFuture for Incoming
Source§type Output = Result<Connection, ConnectionError>
The output that the future will produce on completion.Source§type IntoFuture = IncomingFuture
Which kind of future are we turning this into?Source§fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read moreAuto Trait Implementations§
§impl !Freeze for Incoming
§impl !RefUnwindSafe for Incoming
§impl Send for Incoming
§impl Sync for Incoming
§impl Unpin for Incoming
§impl !UnwindSafe for Incoming
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/3217/docs/iroh/endpoint/struct.IncomingFuture.html b/pr/3217/docs/iroh/endpoint/struct.IncomingFuture.html
index 504c012c78..3934a53120 100644
--- a/pr/3217/docs/iroh/endpoint/struct.IncomingFuture.html
+++ b/pr/3217/docs/iroh/endpoint/struct.IncomingFuture.html
@@ -1,6 +1,6 @@
-IncomingFuture in iroh::endpoint - Rust pub struct IncomingFuture { /* private fields */ }
Expand description
Adaptor to let Incoming be awaited like a Connecting.
-Trait Implementations§
Source§impl Debug for IncomingFuture
Source§impl Future for IncomingFuture
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for IncomingFuturewhere
+IncomingFuture in iroh::endpoint - Rust pub struct IncomingFuture { /* private fields */ }
Expand description
Adaptor to let Incoming be awaited like a Connecting.
+Trait Implementations§
Source§impl Debug for IncomingFuture
Source§impl Future for IncomingFuture
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for IncomingFuturewhere
PinnedFieldsOf<__IncomingFuture<'pin>>: Unpin,
Auto Trait Implementations§
§impl !Freeze for IncomingFuture
§impl !RefUnwindSafe for IncomingFuture
§impl Send for IncomingFuture
§impl Sync for IncomingFuture
§impl !UnwindSafe for IncomingFuture
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html b/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html
index 792290d8f5..d03f08d892 100644
--- a/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html
+++ b/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html
@@ -1,7 +1,7 @@
-ZeroRttAccepted in iroh::endpoint - Rust pub struct ZeroRttAccepted { /* private fields */ }
Expand description
Future that completes when a connection is fully established.
+ZeroRttAccepted in iroh::endpoint - Rust pub struct ZeroRttAccepted { /* private fields */ }
Expand description
Future that completes when a connection is fully established.
For clients, the resulting value indicates if 0-RTT was accepted. For servers, the resulting
value is meaningless.
-Trait Implementations§
Source§impl Debug for ZeroRttAccepted
Source§impl Future for ZeroRttAccepted
Source§fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>
Attempts to resolve the future to a final value, registering
+Trait Implementations§
Source§impl Debug for ZeroRttAccepted
Source§impl Future for ZeroRttAccepted
Auto Trait Implementations§
§impl Freeze for ZeroRttAccepted
§impl !RefUnwindSafe for ZeroRttAccepted
§impl Send for ZeroRttAccepted
§impl Sync for ZeroRttAccepted
§impl Unpin for ZeroRttAccepted
§impl !UnwindSafe for ZeroRttAccepted
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/enum.KeyParsingError.html b/pr/3217/docs/iroh/enum.KeyParsingError.html
index 55941cda04..c7925e588b 100644
--- a/pr/3217/docs/iroh/enum.KeyParsingError.html
+++ b/pr/3217/docs/iroh/enum.KeyParsingError.html
@@ -1,4 +1,4 @@
-KeyParsingError in iroh - Rust pub enum KeyParsingError {
+KeyParsingError in iroh - Rust Enum KeyParsingError
pub enum KeyParsingError {
Decode(DecodeError),
Key(Error),
DecodeInvalidLength,
@@ -6,7 +6,7 @@
Variants§
§Decode(DecodeError)
Error when decoding.
§Key(Error)
Error when decoding the public key.
§DecodeInvalidLength
The encoded information had the wrong length.
-Trait Implementations§
Source§impl Debug for KeyParsingError
Source§impl Display for KeyParsingError
Source§impl Error for KeyParsingError
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()Source§impl From<DecodeError> for KeyParsingError
Source§fn from(source: DecodeError) -> KeyParsingError
Converts to this type from the input type.Source§impl From<Error> for KeyParsingError
Source§fn from(source: Error) -> KeyParsingError
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for KeyParsingError
§impl !RefUnwindSafe for KeyParsingError
§impl Send for KeyParsingError
§impl Sync for KeyParsingError
§impl Unpin for KeyParsingError
§impl !UnwindSafe for KeyParsingError
Blanket Implementations§
Trait Implementations§
§impl Debug for KeyParsingError
§impl Display for KeyParsingError
§impl Error for KeyParsingError
§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()§impl From<DecodeError> for KeyParsingError
§fn from(source: DecodeError) -> KeyParsingError
Converts to this type from the input type.§impl From<Error> for KeyParsingError
§fn from(source: Error) -> KeyParsingError
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for KeyParsingError
§impl !RefUnwindSafe for KeyParsingError
§impl Send for KeyParsingError
§impl Sync for KeyParsingError
§impl Unpin for KeyParsingError
§impl !UnwindSafe for KeyParsingError
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/3217/docs/iroh/metrics/struct.RelayMetrics.html b/pr/3217/docs/iroh/metrics/struct.RelayMetrics.html
index 83ae1acdcc..6f22d04f93 100644
--- a/pr/3217/docs/iroh/metrics/struct.RelayMetrics.html
+++ b/pr/3217/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/3217/docs/iroh/node_info/constant.IROH_TXT_NAME.html b/pr/3217/docs/iroh/node_info/constant.IROH_TXT_NAME.html
index c78d056a1f..0c1e657fb3 100644
--- a/pr/3217/docs/iroh/node_info/constant.IROH_TXT_NAME.html
+++ b/pr/3217/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/3217/docs/iroh/node_info/index.html b/pr/3217/docs/iroh/node_info/index.html
index 9884414f78..5130358fc8 100644
--- a/pr/3217/docs/iroh/node_info/index.html
+++ b/pr/3217/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/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html b/pr/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html
index 2f1c9b7234..33cd3a33fc 100644
--- a/pr/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html
+++ b/pr/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html
@@ -1,5 +1,5 @@
-MaxLengthExceededError in iroh::node_info - Rust
pub struct Builder { /* private fields */ }Expand description
Builder for Endpoint.
pub struct Builder { /* private fields */ }Expand description
Builder for Endpoint.
By default the endpoint will generate a new random SecretKey, which will result in a
new NodeId.
To create the Endpoint call Builder::bind.
Implementations§
Source§impl Builder
impl Builder
Sourcepub fn bind_addr_v4(self, addr: SocketAddrV4) -> Self
pub fn bind_addr_v4(self, addr: SocketAddrV4) -> Self
Sets the IPv4 bind address.
+Implementations§
Source§impl Builder
impl Builder
Sourcepub fn bind_addr_v4(self, addr: SocketAddrV4) -> Self
pub fn bind_addr_v4(self, addr: SocketAddrV4) -> Self
Sets the IPv4 bind address.
Setting the port to 0 will use a random port.
If the port specified is already in use, it will fallback to choosing a random port.
By default will use 0.0.0.0:0 to bind to.
Sourcepub fn bind_addr_v6(self, addr: SocketAddrV6) -> Self
pub fn bind_addr_v6(self, addr: SocketAddrV6) -> Self
Sets the IPv6 bind address.
+Sourcepub fn bind_addr_v6(self, addr: SocketAddrV6) -> Self
pub fn bind_addr_v6(self, addr: SocketAddrV6) -> Self
Sets the IPv6 bind address.
Setting the port to 0 will use a random port.
If the port specified is already in use, it will fallback to choosing a random port.
By default will use [::]:0 to bind to.
Sourcepub fn secret_key(self, secret_key: SecretKey) -> Self
pub fn secret_key(self, secret_key: SecretKey) -> Self
Sets a secret key to authenticate with other peers.
+Sourcepub fn secret_key(self, secret_key: SecretKey) -> Self
pub fn secret_key(self, secret_key: SecretKey) -> Self
Sourcepub fn alpns(self, alpn_protocols: Vec<Vec<u8>>) -> Self
pub fn alpns(self, alpn_protocols: Vec<Vec<u8>>) -> Self
Sets the ALPN protocols that this endpoint will accept on incoming connections.
+Sourcepub fn relay_mode(self, relay_mode: RelayMode) -> Self
pub fn relay_mode(self, relay_mode: RelayMode) -> Self
Sets the relay servers to assist in establishing connectivity.
+Sourcepub fn relay_mode(self, relay_mode: RelayMode) -> Self
pub fn relay_mode(self, relay_mode: RelayMode) -> Self
Sets the relay servers to assist in establishing connectivity.
Relay servers are used to establish initial connection with another iroh node. They also perform various functions related to hole punching, see the crate docs for more details.
@@ -26,15 +26,22 @@ for more details.When using RelayMode::Custom, the provided relay_map must contain at least one
configured relay node. If an invalid RelayMap is provided bind
will result in an error.
Sourcepub fn clear_discovery(self) -> Self
pub fn clear_discovery(self) -> Self
Removes all discovery services from the builder.
-Sourcepub fn discovery(self, discovery: Box<dyn Discovery>) -> Self
pub fn discovery(self, discovery: Box<dyn Discovery>) -> Self
Optionally sets a discovery mechanism for this endpoint.
+Sourcepub fn relay_conn_protocol(self, protocol: Protocol) -> Self
pub fn relay_conn_protocol(self, protocol: Protocol) -> Self
Sets the protocol to use for relay connections.
+Options are either Protocol::Websocket or Protocol::Relay.
Websocket will work with relays version 0.19 and above, so likely with any relays
+deployed at the time of writing this option (websocket support was released 9 months ago).
Relay will work for now, but will likely be removed with the 1.0 release.
Default is set to Relay at the moment, until we’ve thoroughly tested and improved
+websocket performance.
Sourcepub fn clear_discovery(self) -> Self
pub fn clear_discovery(self) -> Self
Removes all discovery services from the builder.
+Sourcepub fn discovery(self, discovery: Box<dyn Discovery>) -> Self
pub fn discovery(self, discovery: Box<dyn Discovery>) -> Self
Optionally sets a discovery mechanism for this endpoint.
If you want to combine multiple discovery services, you can use
Builder::add_discovery instead. This will internally create a
crate::discovery::ConcurrentDiscovery.
If no discovery service is set, connecting to a node without providing its direct addresses or relay URLs will fail.
See the documentation of the Discovery trait for details.
Sourcepub fn add_discovery<F, D>(self, discovery: F) -> Selfwhere
+
pub fn add_discovery<F, D>(self, discovery: F) -> Selfwhere
+
Sourcepub fn add_discovery<F, D>(self, discovery: F) -> Self
pub fn add_discovery<F, D>(self, discovery: F) -> Self
Adds a discovery mechanism for this endpoint.
The function discovery
@@ -47,7 +54,7 @@ to use this secret key to sign the information.
To clear all discovery services, use Builder::clear_discovery.
See the documentation of the Discovery trait for details.
Sourcepub fn discovery_n0(self) -> Self
pub fn discovery_n0(self) -> Self
Configures the endpoint to use the default n0 DNS discovery service.
+Sourcepub fn discovery_n0(self) -> Self
pub fn discovery_n0(self) -> Self
Configures the endpoint to use the default n0 DNS discovery service.
The default discovery service publishes to and resolves from the
n0.computer dns server iroh.link.
This is equivalent to adding both a crate::discovery::pkarr::PkarrPublisher
@@ -56,29 +63,29 @@ n0.computer dns server.
This will by default use N0_DNS_PKARR_RELAY_PROD.
When in tests, or when the test-utils feature is enabled, this will use the
N0_DNS_PKARR_RELAY_STAGING.
Sourcepub fn tls_x509(self) -> Self
pub fn tls_x509(self) -> Self
Use libp2p based self signed certificates for TLS.
For details see the libp2p spec at https://github.com/libp2p/specs/blob/master/tls/tls.md
This is the only mechanism available in iroh@0.33.0 and earlier.
Sourcepub fn tls_raw_public_keys(self) -> Self
pub fn tls_raw_public_keys(self) -> Self
Use TLS Raw Public Keys
+Sourcepub fn tls_raw_public_keys(self) -> Self
pub fn tls_raw_public_keys(self) -> Self
Use TLS Raw Public Keys
This is the default, but is not compatible with older versions of iroh.
-Sourcepub fn discovery_dht(self) -> Self
Available on crate feature discovery-pkarr-dht only.
pub fn discovery_dht(self) -> Self
discovery-pkarr-dht only.Configures the endpoint to also use the mainline DHT with default settings.
+Sourcepub fn discovery_dht(self) -> Self
Available on crate feature discovery-pkarr-dht only.
pub fn discovery_dht(self) -> Self
discovery-pkarr-dht only.Configures the endpoint to also use the mainline DHT with default settings.
This is equivalent to adding a crate::discovery::pkarr::dht::DhtDiscovery
with default settings. Note that DhtDiscovery has various more advanced
configuration options. If you need any of those, you should manually
create a DhtDiscovery and add it with Builder::add_discovery.
Sourcepub fn discovery_local_network(self) -> Self
Available on crate feature discovery-local-network only.
pub fn discovery_local_network(self) -> Self
discovery-local-network only.Configures the endpoint to also use local network discovery.
+Sourcepub fn discovery_local_network(self) -> Self
Available on crate feature discovery-local-network only.
pub fn discovery_local_network(self) -> Self
discovery-local-network only.Configures the endpoint to also use local network discovery.
This is equivalent to adding a crate::discovery::mdns::MdnsDiscovery
with default settings. Note that MdnsDiscovery has various more advanced
configuration options. If you need any of those, you should manually
create a MdnsDiscovery and add it with Builder::add_discovery.
Sourcepub fn user_data_for_discovery(self, user_data: UserData) -> Self
pub fn user_data_for_discovery(self, user_data: UserData) -> Self
Sets the initial user-defined data to be published in discovery services for this node.
+Sourcepub fn user_data_for_discovery(self, user_data: UserData) -> Self
pub fn user_data_for_discovery(self, user_data: UserData) -> Self
Sets the initial user-defined data to be published in discovery services for this node.
When using discovery services, this string of UserData will be published together
with the node’s addresses and relay URL. When other nodes discover this node,
they retrieve the UserData in addition to the addressing info.
Iroh itself does not interpret the user-defined data in any way, it is purely left for applications to parse and use.
-Sourcepub fn known_nodes(self, nodes: Vec<NodeAddr>) -> Self
pub fn known_nodes(self, nodes: Vec<NodeAddr>) -> Self
Optionally set a list of known nodes.
-Sourcepub fn transport_config(self, transport_config: TransportConfig) -> Self
pub fn transport_config(self, transport_config: TransportConfig) -> Self
Sets a custom quinn::TransportConfig for this endpoint.
Sourcepub fn known_nodes(self, nodes: Vec<NodeAddr>) -> Self
pub fn known_nodes(self, nodes: Vec<NodeAddr>) -> Self
Optionally set a list of known nodes.
+Sourcepub fn transport_config(self, transport_config: TransportConfig) -> Self
pub fn transport_config(self, transport_config: TransportConfig) -> Self
Sets a custom quinn::TransportConfig for this endpoint.
The transport config contains parameters governing the QUIC state machine.
If unset, the default config is used. Default values should be suitable for most
internet applications. Applications protocols which forbid remotely-initiated
@@ -86,31 +93,31 @@ streams should set max_concurrent_bidi_streams and max_concur
zero.
Please be aware that changing some settings may have adverse effects on establishing and maintaining direct connections.
-Sourcepub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self
Available on non-wasm_browser only.
pub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self
wasm_browser only.Optionally sets a custom DNS resolver to use for this endpoint.
+Sourcepub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self
Available on non-wasm_browser only.
pub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self
wasm_browser only.Optionally sets a custom DNS resolver to use for this endpoint.
The DNS resolver is used to resolve relay hostnames, and node addresses if
crate::discovery::dns::DnsDiscovery is configured.
By default, a new DNS resolver is created which is configured to use the
host system’s DNS configuration. You can pass a custom instance of DnsResolver
here to use a differently configured DNS resolver for this endpoint, or to share
a DnsResolver between multiple endpoints.
Sourcepub fn proxy_url(self, url: Url) -> Self
pub fn proxy_url(self, url: Url) -> Self
Sets an explicit proxy url to proxy all HTTP(S) traffic through.
-Sourcepub fn proxy_from_env(self) -> Self
pub fn proxy_from_env(self) -> Self
Sets the proxy url from the environment, in this order:
+Sourcepub fn proxy_url(self, url: Url) -> Self
pub fn proxy_url(self, url: Url) -> Self
Sets an explicit proxy url to proxy all HTTP(S) traffic through.
+Sourcepub fn proxy_from_env(self) -> Self
pub fn proxy_from_env(self) -> Self
Sets the proxy url from the environment, in this order:
HTTP_PROXYhttp_proxyHTTPS_PROXYhttps_proxy
Sourcepub fn keylog(self, keylog: bool) -> Self
pub fn keylog(self, keylog: bool) -> Self
Enables saving the TLS pre-master key for connections.
+Sourcepub fn keylog(self, keylog: bool) -> Self
pub fn keylog(self, keylog: bool) -> Self
Enables saving the TLS pre-master key for connections.
This key should normally remain secret but can be useful to debug networking issues by decrypting captured traffic.
If keylog is true then setting the SSLKEYLOGFILE environment variable to a
filename will result in this file being used to log the TLS pre-master keys.
Sourcepub fn insecure_skip_relay_cert_verify(self, skip_verify: bool) -> Self
Available on crate feature test-utils only.
pub fn insecure_skip_relay_cert_verify(self, skip_verify: bool) -> Self
test-utils only.Skip verification of SSL certificates from relay servers
+Sourcepub fn insecure_skip_relay_cert_verify(self, skip_verify: bool) -> Self
Available on crate feature test-utils only.
pub fn insecure_skip_relay_cert_verify(self, skip_verify: bool) -> Self
test-utils only.Skip verification of SSL certificates from relay servers
May only be used in tests.
-Sourcepub fn path_selection(self, path_selection: PathSelection) -> Self
Available on crate feature test-utils only.
pub fn path_selection(self, path_selection: PathSelection) -> Self
test-utils only.This implies we only use the relay to communicate +
Sourcepub fn path_selection(self, path_selection: PathSelection) -> Self
Available on crate feature test-utils only.
pub fn path_selection(self, path_selection: PathSelection) -> Self
test-utils only.This implies we only use the relay to communicate and do not attempt to do any hole punching.
-Trait Implementations§
Auto Trait Implementations§
impl Freeze for Builder
impl !RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl !UnwindSafe for Builder
Blanket Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Builder
impl !RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl !UnwindSafe for Builder
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/3217/docs/iroh/endpoint/struct.ConnectOptions.html b/pr/3217/docs/iroh/endpoint/struct.ConnectOptions.html
index d82c67e528..4b2b9fa2d5 100644
--- a/pr/3217/docs/iroh/endpoint/struct.ConnectOptions.html
+++ b/pr/3217/docs/iroh/endpoint/struct.ConnectOptions.html
@@ -1,12 +1,12 @@
-ConnectOptions in iroh::endpoint - Rust pub struct ConnectOptions { /* private fields */ }
Expand description
Options for the Endpoint::connect_with_opts function.
-Implementations§
Source§impl ConnectOptions
Sourcepub fn new() -> Self
Initializes new connection options.
+ConnectOptions in iroh::endpoint - Rust pub struct ConnectOptions { /* private fields */ }
Expand description
Options for the Endpoint::connect_with_opts function.
+Implementations§
Source§impl ConnectOptions
Sourcepub fn new() -> Self
Initializes new connection options.
By default, the connection will use the same options
as Endpoint::connect, e.g. a default TransportConfig.
-Sourcepub fn with_transport_config(
+
Sourcepub fn with_transport_config(
self,
transport_config: Arc<TransportConfig>,
) -> Self
Sets the QUIC transport config options for this connection.
-Trait Implementations§
Source§impl Clone for ConnectOptions
Source§fn clone(&self) -> ConnectOptions
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 ConnectOptions
Source§impl Default for ConnectOptions
Source§fn default() -> ConnectOptions
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for ConnectOptions
§impl !RefUnwindSafe for ConnectOptions
§impl Send for ConnectOptions
§impl Sync for ConnectOptions
§impl Unpin for ConnectOptions
§impl !UnwindSafe for ConnectOptions
Blanket Implementations§
Trait Implementations§
Source§impl Clone for ConnectOptions
Source§fn clone(&self) -> ConnectOptions
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 ConnectOptions
Source§impl Default for ConnectOptions
Source§fn default() -> ConnectOptions
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for ConnectOptions
§impl !RefUnwindSafe for ConnectOptions
§impl Send for ConnectOptions
§impl Sync for ConnectOptions
§impl Unpin for ConnectOptions
§impl !UnwindSafe for ConnectOptions
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/3217/docs/iroh/endpoint/struct.Connecting.html b/pr/3217/docs/iroh/endpoint/struct.Connecting.html
index 41a03946a4..e190a84876 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Connecting.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Connecting.html
@@ -1,5 +1,5 @@
-Connecting in iroh::endpoint - Rust pub struct Connecting { /* private fields */ }
Expand description
In-progress connection attempt future
-Implementations§
Source§impl Connecting
Sourcepub fn into_0rtt(self) -> Result<(Connection, ZeroRttAccepted), Self>
Converts this Connecting into a 0-RTT or 0.5-RTT connection at the cost of weakened
+
Connecting in iroh::endpoint - Rust pub struct Connecting { /* private fields */ }
Expand description
In-progress connection attempt future
+Implementations§
Source§impl Connecting
Sourcepub fn into_0rtt(self) -> Result<(Connection, ZeroRttAccepted), Self>
Converts this Connecting into a 0-RTT or 0.5-RTT connection at the cost of weakened
security.
Returns Ok immediately if the local endpoint is able to attempt sending 0/0.5-RTT data.
If so, the returned Connection can be used to send application data without waiting for
@@ -33,10 +33,10 @@ before TLS client authentication has occurred, and should therefore not be used
data for which client authentication is being used.
You can use RecvStream::is_0rtt to check whether a stream has been opened in 0-RTT
and thus whether parts of the stream are operating under this reduced security level.
-Sourcepub async fn handshake_data(&mut self) -> Result<Box<dyn Any>, ConnectionError>
Parameters negotiated during the handshake
-Trait Implementations§
Source§impl Debug for Connecting
Source§impl Future for Connecting
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for Connectingwhere
+Sourcepub async fn handshake_data(&mut self) -> Result<Box<dyn Any>, ConnectionError>
Parameters negotiated during the handshake
+
Trait Implementations§
Source§impl Debug for Connecting
Source§impl Future for Connecting
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for Connectingwhere
PinnedFieldsOf<__Connecting<'pin>>: Unpin,
Auto Trait Implementations§
§impl Freeze for Connecting
§impl !RefUnwindSafe for Connecting
§impl Send for Connecting
§impl Sync for Connecting
§impl !UnwindSafe for Connecting
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/endpoint/struct.Connection.html b/pr/3217/docs/iroh/endpoint/struct.Connection.html
index 8e81609487..928cdb9918 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Connection.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Connection.html
@@ -1,4 +1,4 @@
-Connection in iroh::endpoint - Rust pub struct Connection { /* private fields */ }
Expand description
A QUIC connection.
+Connection in iroh::endpoint - Rust pub struct Connection { /* private fields */ }
Expand description
A QUIC connection.
If all references to a connection (including every clone of the Connection handle,
streams of incoming streams, and the various stream types) have been dropped, then the
connection will be automatically closed with an error_code of 0 and an empty reason. You
@@ -8,29 +8,29 @@ receiving CONNECTION_CLOSE the peer may drop any stream data not yet delivered t
application. Connection::close describes in more detail how to gracefully close a
connection without losing application data.
May be cloned to obtain another handle to the same connection.
-Implementations§
Source§impl Connection
Implementations§
Source§impl Connection
Sourcepub fn open_uni(&self) -> OpenUni<'_> ⓘ
Initiates a new outgoing unidirectional stream.
Streams are cheap and instantaneous to open unless blocked by flow control. As a
consequence, the peer won’t be notified that a stream has been opened until the
stream is actually used.
-Sourcepub fn open_bi(&self) -> OpenBi<'_> ⓘ
Initiates a new outgoing bidirectional stream.
Streams are cheap and instantaneous to open unless blocked by flow control. As a
consequence, the peer won’t be notified that a stream has been opened until the
stream is actually used. Calling open_bi then waiting on the RecvStream
without writing anything to SendStream will never succeed.
-Sourcepub fn accept_uni(&self) -> AcceptUni<'_> ⓘ
Accepts the next incoming uni-directional stream.
-Sourcepub fn accept_uni(&self) -> AcceptUni<'_> ⓘ
Accepts the next incoming uni-directional stream.
+Sourcepub fn accept_bi(&self) -> AcceptBi<'_> ⓘ
Accept the next incoming bidirectional stream.
Important Note: The peer that calls open_bi must write to its SendStream
before the peer Connection is able to accept the stream using
accept_bi(). Calling open_bi then waiting on the RecvStream without
writing anything to the connected SendStream will never succeed.
-Sourcepub fn read_datagram(&self) -> ReadDatagram<'_> ⓘ
Receives an application datagram.
-Sourcepub async fn closed(&self) -> ConnectionError
Wait for the connection to be closed for any reason.
+Sourcepub fn read_datagram(&self) -> ReadDatagram<'_> ⓘ
Receives an application datagram.
+Sourcepub async fn closed(&self) -> ConnectionError
Wait for the connection to be closed for any reason.
Despite the return type’s name, closed connections are often not an error condition
at the application layer. Cases that might be routine include
ConnectionError::LocallyClosed and ConnectionError::ApplicationClosed.
-Sourcepub fn close_reason(&self) -> Option<ConnectionError>
If the connection is closed, the reason why.
+Sourcepub fn close_reason(&self) -> Option<ConnectionError>
If the connection is closed, the reason why.
Returns None if the connection is still open.
-Sourcepub fn close(&self, error_code: VarInt, reason: &[u8])
Closes the connection immediately.
Pending operations will fail immediately with ConnectionError::LocallyClosed. No
more data is sent to the peer and the peer may drop buffered data upon receiving the
CONNECTION_CLOSE frame.
@@ -51,41 +51,41 @@ endpoint. Once the local side sends a CONNECTION_CLOSE frame in response to call
close the remote endpoint may drop any data it received but is as yet
undelivered to the application, including data that was acknowledged as received to
the local endpoint.
-Sourcepub fn send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError>
Transmits data as an unreliable, unordered application datagram.
+Sourcepub fn send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError>
Transmits data as an unreliable, unordered application datagram.
Application datagrams are a low-level primitive. They may be lost or delivered out
of order, and data must both fit inside a single QUIC packet and be smaller than
the maximum dictated by the peer.
-Sourcepub fn max_datagram_size(&self) -> Option<usize>
Computes the maximum size of datagrams that may be passed to send_datagram.
+Sourcepub fn max_datagram_size(&self) -> Option<usize>
Computes the maximum size of datagrams that may be passed to send_datagram.
Returns None if datagrams are unsupported by the peer or disabled locally.
This may change over the lifetime of a connection according to variation in the path
MTU estimate. The peer can also enforce an arbitrarily small fixed limit, but if the
peer’s limit is large this is guaranteed to be a little over a kilobyte at minimum.
Not necessarily the maximum size of received datagrams.
-Sourcepub fn datagram_send_buffer_space(&self) -> usize
Bytes available in the outgoing datagram buffer.
+Sourcepub fn datagram_send_buffer_space(&self) -> usize
Bytes available in the outgoing datagram buffer.
When greater than zero, calling send_datagram with a
datagram of at most this size is guaranteed not to cause older datagrams to be
dropped.
-Sourcepub fn rtt(&self) -> Duration
Current best estimate of this connection’s latency (round-trip-time).
-Sourcepub fn stats(&self) -> ConnectionStats
Returns connection statistics.
-Sourcepub fn congestion_state(&self) -> Box<dyn Controller>
Current state of the congestion control algorithm, for debugging purposes.
-Sourcepub fn handshake_data(&self) -> Option<Box<dyn Any>>
Parameters negotiated during the handshake.
+Sourcepub fn rtt(&self) -> Duration
Current best estimate of this connection’s latency (round-trip-time).
+Sourcepub fn stats(&self) -> ConnectionStats
Returns connection statistics.
+Sourcepub fn congestion_state(&self) -> Box<dyn Controller>
Current state of the congestion control algorithm, for debugging purposes.
+Sourcepub fn handshake_data(&self) -> Option<Box<dyn Any>>
Parameters negotiated during the handshake.
Guaranteed to return Some on fully established connections or after
Connecting::handshake_data() succeeds. See that method’s documentations for
details on the returned value.
-Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
-Sourcepub fn peer_identity(&self) -> Option<Box<dyn Any>>
Cryptographic identity of the peer.
+Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
+Sourcepub fn peer_identity(&self) -> Option<Box<dyn Any>>
Sourcepub fn remote_node_id(&self) -> Result<NodeId>
Returns the NodeId from the peer’s TLS certificate.
+Sourcepub fn remote_node_id(&self) -> Result<NodeId>
Sourcepub fn stable_id(&self) -> usize
A stable identifier for this connection.
Peer addresses and connection IDs can change, but this value will remain fixed for
the lifetime of the connection.
-Sourcepub fn export_keying_material(
+
Sourcepub fn export_keying_material(
&self,
output: &mut [u8],
label: &[u8],
@@ -96,14 +96,14 @@ arguments and output buffers of equal length, they will get the
same sequence of bytes in output. These bytes are cryptographically
strong and pseudorandom, and are suitable for use as keying material.
See RFC5705 for more information.
-
Sourcepub fn set_max_concurrent_uni_streams(&self, count: VarInt)
Modifies the number of unidirectional streams that may be concurrently opened.
+Sourcepub fn set_max_concurrent_uni_streams(&self, count: VarInt)
Modifies the number of unidirectional streams that may be concurrently opened.
No streams may be opened by the peer unless fewer than count are already
open. Large counts increase both minimum and worst-case memory consumption.
-Sourcepub fn set_receive_window(&self, receive_window: VarInt)
Sourcepub fn set_max_concurrent_bi_streams(&self, count: VarInt)
Modifies the number of bidirectional streams that may be concurrently opened.
+Sourcepub fn set_receive_window(&self, receive_window: VarInt)
Sourcepub fn set_max_concurrent_bi_streams(&self, count: VarInt)
Modifies the number of bidirectional streams that may be concurrently opened.
No streams may be opened by the peer unless fewer than count are already
open. Large counts increase both minimum and worst-case memory consumption.
-Trait Implementations§
Source§impl Clone for Connection
Source§fn clone(&self) -> Connection
Returns a copy of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreAuto Trait Implementations§
§impl Freeze for Connection
§impl RefUnwindSafe for Connection
§impl Send for Connection
§impl Sync for Connection
§impl Unpin for Connection
§impl UnwindSafe for Connection
Blanket Implementations§
Trait Implementations§
Source§impl Clone for Connection
Source§fn clone(&self) -> Connection
Returns a copy of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreAuto Trait Implementations§
§impl Freeze for Connection
§impl RefUnwindSafe for Connection
§impl Send for Connection
§impl Sync for Connection
§impl Unpin for Connection
§impl UnwindSafe for Connection
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/3217/docs/iroh/endpoint/struct.DirectAddr.html b/pr/3217/docs/iroh/endpoint/struct.DirectAddr.html
index 61a667e47d..04760c9021 100644
--- a/pr/3217/docs/iroh/endpoint/struct.DirectAddr.html
+++ b/pr/3217/docs/iroh/endpoint/struct.DirectAddr.html
@@ -1,4 +1,4 @@
-DirectAddr in iroh::endpoint - Rust pub struct DirectAddr {
+DirectAddr in iroh::endpoint - Rust pub struct DirectAddr {
pub addr: SocketAddr,
pub typ: DirectAddrType,
}
Expand description
A direct address on which an iroh-node might be contactable.
@@ -7,16 +7,16 @@ contacted. These can come from various sources depending on the network topolog
iroh node, see DirectAddrType for the several kinds of sources.
Fields§
§addr: SocketAddrThe address.
§typ: DirectAddrTypeThe origin of this direct address.
-Trait Implementations§
Source§impl Clone for DirectAddr
Source§fn clone(&self) -> DirectAddr
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 DirectAddr
Source§impl Hash for DirectAddr
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
+Trait Implementations§
Source§impl Clone for DirectAddr
Source§fn clone(&self) -> DirectAddr
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 DirectAddr
Source§impl Hash for DirectAddr
Source§impl Ord for DirectAddr
Source§impl Ord for DirectAddr
Source§fn cmp(&self, other: &DirectAddr) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read moreSource§impl PartialEq for DirectAddr
Source§impl PartialOrd for DirectAddr
Source§impl PartialEq for DirectAddr
Source§impl PartialOrd for DirectAddr
Source§impl Eq for DirectAddr
Source§impl StructuralPartialEq for DirectAddr
Auto Trait Implementations§
§impl Freeze for DirectAddr
§impl RefUnwindSafe for DirectAddr
§impl Send for DirectAddr
§impl Sync for DirectAddr
§impl Unpin for DirectAddr
§impl UnwindSafe for DirectAddr
Blanket Implementations§
Source§impl Eq for DirectAddr
Source§impl StructuralPartialEq for DirectAddr
Auto Trait Implementations§
§impl Freeze for DirectAddr
§impl RefUnwindSafe for DirectAddr
§impl Send for DirectAddr
§impl Sync for DirectAddr
§impl Unpin for DirectAddr
§impl UnwindSafe for DirectAddr
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/3217/docs/iroh/endpoint/struct.Endpoint.html b/pr/3217/docs/iroh/endpoint/struct.Endpoint.html
index e25e697700..0b8c9af7b3 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Endpoint.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Endpoint.html
@@ -1,4 +1,4 @@
-Endpoint in iroh::endpoint - Rust pub struct Endpoint { /* private fields */ }
Expand description
Controls an iroh node, establishing connections with other nodes.
+Endpoint in iroh::endpoint - Rust pub struct Endpoint { /* private fields */ }
Expand description
Controls an iroh node, establishing connections with other nodes.
This is the main API interface to create connections to, and accept connections from
other iroh nodes. The connections are peer-to-peer and encrypted, a Relay server is
used to make the connections reliable. See the [crate docs] for a more detailed
@@ -16,17 +16,17 @@ the peer are created using the Connection::open_uni and Connection::open_bi functions.
Note that due to the light-weight properties of streams a stream will only be accepted
once the initiating peer has sent some data on it.
-Implementations§
Source§impl Endpoint
Sourcepub fn builder() -> Builder
Returns the builder for an Endpoint, with a production configuration.
-Sourcepub fn set_alpns(&self, alpns: Vec<Vec<u8>>) -> Result<()>
Sets the list of accepted ALPN protocols.
+Implementations§
Source§impl Endpoint
Sourcepub fn builder() -> Builder
Returns the builder for an Endpoint, with a production configuration.
+Sourcepub async fn connect(
&self,
node_addr: impl Into<NodeAddr>,
alpn: &[u8],
) -> Result<Connection>
Connects to a remote Endpoint.
A value that can be converted into a NodeAddr is required. This can be either a
-NodeAddr, a NodeId or a iroh_base::ticket::NodeTicket.
+NodeAddr, a NodeId or a [iroh_base::ticket::NodeTicket].
The NodeAddr must contain the NodeId to dial and may also contain a RelayUrl
and direct addresses. If direct addresses are provided, they will be used to try and
establish a direct connection without involving a relay server.
@@ -41,7 +41,7 @@ connection attempt will fail with an error.
The alpn, or application-level protocol identifier, is also required. The remote
endpoint must support this alpn, otherwise the connection attempt will fail with
an error.
-Sourcepub async fn connect_with_opts(
+
Sourcepub async fn connect_with_opts(
&self,
node_addr: impl Into<NodeAddr>,
alpn: &[u8],
@@ -61,13 +61,13 @@ security concerns.
establishing and maintaining direct connections. Carefully test settings you use and
consider this currently as still rather experimental.
-
Sourcepub fn accept(&self) -> Accept<'_> ⓘ
Accepts an incoming connection on the endpoint.
Only connections with the ALPNs configured in Builder::alpns will be accepted.
If multiple ALPNs have been configured the ALPN can be inspected before accepting
the connection using Connecting::alpn.
The returned future will yield None if the endpoint is closed by calling
Endpoint::close.
-Sourcepub fn add_node_addr(&self, node_addr: NodeAddr) -> Result<()>
Informs this Endpoint about addresses of the iroh node.
+Sourcepub fn add_node_addr(&self, node_addr: NodeAddr) -> Result<()>
Informs this Endpoint about addresses of the iroh node.
This updates the local state for the remote node. If the provided NodeAddr
contains a RelayUrl this will be used as the new relay server for this node. If
it contains any new IP endpoints they will also be stored and tried when next
@@ -80,7 +80,7 @@ This provides more flexibility and future proofing.
§Errors
Will return an error if we attempt to add our own NodeId to the node map or
if the direct addresses are a subset of ours.
-Sourcepub fn add_node_addr_with_source(
+
Sourcepub fn secret_key(&self) -> &SecretKey
Returns the secret_key of this endpoint.
-Sourcepub fn secret_key(&self) -> &SecretKey
Returns the secret_key of this endpoint.
+Sourcepub fn node_id(&self) -> NodeId
Returns the node id of this endpoint.
This ID is the unique addressing information of this node and other peers must know
it to be able to connect to this node.
-Sourcepub async fn node_addr(&self) -> Result<NodeAddr>
Returns the current NodeAddr for this endpoint.
+Sourcepub async fn node_addr(&self) -> Result<NodeAddr>
Returns the current NodeAddr for this endpoint.
The returned NodeAddr will have the current RelayUrl and direct addresses
as they would be returned by Endpoint::home_relay and
Endpoint::direct_addresses.
In browsers, because direct addresses are unavailable, this will only wait for
the home relay to be available before returning.
-Sourcepub fn home_relay(&self) -> Watcher<Option<RelayUrl>>
Sourcepub fn home_relay(&self) -> Watcher<Option<RelayUrl>>
Returns a Watcher for the RelayUrl of the Relay server used as home relay.
Every endpoint has a home Relay server which it chooses as the server with the
lowest latency out of the configured servers provided by Builder::relay_mode.
This is the server other iroh nodes can use to reliably establish a connection
@@ -122,7 +122,7 @@ some time to connect to find and connect to the home relay server.
let mep = Endpoint::builder().bind().await.unwrap();
let _relay_url = mep.home_relay().initialized().await.unwrap();
-Sourcepub fn direct_addresses(&self) -> Watcher<Option<BTreeSet<DirectAddr>>>
Sourcepub fn direct_addresses(&self) -> Watcher<Option<BTreeSet<DirectAddr>>>
Returns a Watcher for the direct addresses of this Endpoint.
The direct addresses of the Endpoint are those that could be used by other
iroh nodes to establish direct connectivity, depending on the network
situation. The yielded lists of direct addresses contain both the locally-bound
@@ -145,10 +145,10 @@ recently discovered direct addresses.
let mep = Endpoint::builder().bind().await.unwrap();
let _addrs = mep.direct_addresses().initialized().await.unwrap();
-Sourcepub fn bound_sockets(&self) -> (SocketAddr, Option<SocketAddr>)
Available on non-wasm_browser only.
Returns the local socket addresses on which the underlying sockets are bound.
+Sourcepub fn bound_sockets(&self) -> (SocketAddr, Option<SocketAddr>)
Available on non-wasm_browser only.
Returns the local socket addresses on which the underlying sockets are bound.
The Endpoint always binds on an IPv4 address and also tries to bind on an IPv6
address if available.
-Sourcepub fn remote_info(&self, node_id: NodeId) -> Option<RemoteInfo>
Returns information about the remote node identified by a NodeId.
+Sourcepub fn remote_info(&self, node_id: NodeId) -> Option<RemoteInfo>
Returns information about the remote node identified by a NodeId.
The Endpoint keeps some information about remote iroh nodes, which it uses to find
the best path to a node. Having information on a remote node, however, does not mean we have
ever connected to it to or even whether a connection is even possible. The information about a
@@ -157,14 +157,14 @@ calls may return different information. Furthermore, node information may even b
completely evicted as it becomes stale.
See also Endpoint::remote_info_iter which returns information on all nodes known
by this Endpoint.
-Sourcepub fn remote_info_iter(&self) -> impl Iterator<Item = RemoteInfo>
Returns information about all the remote nodes this Endpoint knows about.
+Sourcepub fn remote_info_iter(&self) -> impl Iterator<Item = RemoteInfo>
Returns information about all the remote nodes this Endpoint knows about.
This returns the same information as Endpoint::remote_info for each node known to this
Endpoint.
The Endpoint keeps some information about remote iroh nodes, which it uses to find
the best path to a node. This returns all the nodes it knows about, regardless of whether a
connection was ever made or is even possible.
See also Endpoint::remote_info to only retrieve information about a single node.
-Sourcepub fn discovery_stream(
+
Sourcepub fn discovery_stream(
&self,
) -> impl Stream<Item = Result<DiscoveryItem, Lagged>>
Returns a stream of all remote nodes discovered through the endpoint’s discovery services.
Whenever a node is discovered via the endpoint’s discovery service, the corresponding
@@ -183,7 +183,7 @@ at the time of adding it to the static provider.
Lagged may be yielded, indicating that items were missed.
See also Endpoint::remote_info_iter, which returns an iterator over all remotes
the endpoint knows about at a specific point in time.
-Sourcepub fn conn_type(&self, node_id: NodeId) -> Result<Watcher<ConnectionType>>
Returns a Watcher that reports the current connection type and any changes for
+
Sourcepub fn conn_type(&self, node_id: NodeId) -> Result<Watcher<ConnectionType>>
Returns a Watcher that reports the current connection type and any changes for
given remote node.
This watcher allows observing a stream of ConnectionType items by calling
Watcher::stream(). If the underlying connection to a remote node changes, it will
@@ -202,11 +202,11 @@ recently connected to this node id but previous methods of reaching the node hav
become inaccessible.
§Errors
Will error if we do not have any address information for the given node_id.
-Sourcepub fn dns_resolver(&self) -> &DnsResolver
Available on non-wasm_browser only.
Returns the DNS resolver used in this Endpoint.
+Sourcepub fn dns_resolver(&self) -> &DnsResolver
Available on non-wasm_browser only.
Returns the DNS resolver used in this Endpoint.
-Sourcepub fn discovery(&self) -> Option<&dyn Discovery>
Returns the discovery mechanism, if configured.
+Sourcepub fn discovery(&self) -> Option<&dyn Discovery>
Returns the discovery mechanism, if configured.
See Builder::discovery.
-Sourcepub async fn network_change(&self)
Notifies the system of potential network changes.
+Sourcepub async fn network_change(&self)
Notifies the system of potential network changes.
On many systems iroh is able to detect network changes by itself, however
some systems like android do not expose this functionality to native code.
Android does however provide this functionality to Java code. This
@@ -214,12 +214,12 @@ function allows for notifying iroh of any potential network changes like
this.
Even when the network did not change, or iroh was already able to detect
the network change itself, there is no harm in calling this function.
-Sourcepub fn set_user_data_for_discovery(&self, user_data: Option<UserData>)
Sets the initial user-defined data to be published in discovery services for this node.
+Sourcepub fn set_user_data_for_discovery(&self, user_data: Option<UserData>)
Sets the initial user-defined data to be published in discovery services for this node.
If the user-defined data passed to this function is different to the previous one,
the endpoint will republish its node info to the configured discovery services.
See also Builder::user_data_for_discovery for setting an initial value when
building the endpoint.
-Sourcepub async fn close(&self)
Closes the QUIC endpoint and the magic socket.
This will close any remaining open Connections with an error code
of 0 and an empty reason. Though it is best practice to close those
explicitly before with a custom error code and reason.
@@ -245,8 +245,8 @@ while TCP sockets usually get closed and drained by the operating system in the
kernel during the “Time-Wait” period of the TCP socket.
Be aware however that the underlying UDP sockets are only closed once all clones of
the the respective Endpoint are dropped.
-Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Endpoint
§impl !RefUnwindSafe for Endpoint
§impl Send for Endpoint
§impl Sync for Endpoint
§impl Unpin for Endpoint
§impl !UnwindSafe for Endpoint
Blanket Implementations§
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Endpoint
§impl !RefUnwindSafe for Endpoint
§impl Send for Endpoint
§impl Sync for Endpoint
§impl Unpin for Endpoint
§impl !UnwindSafe for Endpoint
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/3217/docs/iroh/endpoint/struct.Incoming.html b/pr/3217/docs/iroh/endpoint/struct.Incoming.html
index 61f28360fa..6b71064a82 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Incoming.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Incoming.html
@@ -1,29 +1,29 @@
-Incoming in iroh::endpoint - Rust pub struct Incoming { /* private fields */ }
Expand description
An incoming connection for which the server has not yet begun its parts of the
+
Incoming in iroh::endpoint - Rust pub struct Incoming { /* private fields */ }
Expand description
An incoming connection for which the server has not yet begun its parts of the
handshake.
-Implementations§
Source§impl Incoming
Sourcepub fn accept(self) -> Result<Connecting, ConnectionError>
Attempts to accept this incoming connection (an error may still occur).
+Implementations§
Source§impl Incoming
Sourcepub fn accept(self) -> Result<Connecting, ConnectionError>
Attempts to accept this incoming connection (an error may still occur).
Errors occurring here are likely not caused by the application or remote. The QUIC
connection listens on a normal UDP socket and any reachable network endpoint can
send datagrams to it, solicited or not. Even if the first few bytes look like a
QUIC packet, it might not even be a QUIC packet that is being received.
Thus it is common to simply log the errors here and accept them as something which
can happen.
-Sourcepub fn accept_with(
+
Sourcepub fn accept_with(
self,
server_config: Arc<ServerConfig>,
) -> Result<Connecting, ConnectionError>
Accepts this incoming connection using a custom configuration.
See accept() for more details.
-Sourcepub fn retry(self) -> Result<(), RetryError>
Responds with a retry packet.
+Sourcepub fn retry(self) -> Result<(), RetryError>
Responds with a retry packet.
This requires the client to retry with address validation.
Errors if remote_address_validated() is true.
-Sourcepub fn ignore(self)
Ignores this incoming connection attempt, not sending any packet in response.
-Sourcepub fn local_ip(&self) -> Option<IpAddr>
Returns the local IP address which was used when the peer established the
+
Sourcepub fn ignore(self)
Ignores this incoming connection attempt, not sending any packet in response.
+Sourcepub fn local_ip(&self) -> Option<IpAddr>
Returns the local IP address which was used when the peer established the
connection.
-Sourcepub fn remote_address(&self) -> SocketAddr
Returns the peer’s UDP address.
-Sourcepub fn remote_address_validated(&self) -> bool
Whether the socket address that is initiating this connection has been validated.
+Sourcepub fn remote_address(&self) -> SocketAddr
Returns the peer’s UDP address.
+Sourcepub fn remote_address_validated(&self) -> bool
Whether the socket address that is initiating this connection has been validated.
This means that the sender of the initial packet has proved that they can receive
traffic sent to self.remote_address().
-Trait Implementations§
Source§impl IntoFuture for Incoming
Source§type Output = Result<Connection, ConnectionError>
The output that the future will produce on completion.Source§type IntoFuture = IncomingFuture
Which kind of future are we turning this into?Source§fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read moreAuto Trait Implementations§
§impl !Freeze for Incoming
§impl !RefUnwindSafe for Incoming
§impl Send for Incoming
§impl Sync for Incoming
§impl Unpin for Incoming
§impl !UnwindSafe for Incoming
Blanket Implementations§
Trait Implementations§
Source§impl IntoFuture for Incoming
Source§type Output = Result<Connection, ConnectionError>
The output that the future will produce on completion.Source§type IntoFuture = IncomingFuture
Which kind of future are we turning this into?Source§fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read moreAuto Trait Implementations§
§impl !Freeze for Incoming
§impl !RefUnwindSafe for Incoming
§impl Send for Incoming
§impl Sync for Incoming
§impl Unpin for Incoming
§impl !UnwindSafe for Incoming
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/3217/docs/iroh/endpoint/struct.IncomingFuture.html b/pr/3217/docs/iroh/endpoint/struct.IncomingFuture.html
index 504c012c78..3934a53120 100644
--- a/pr/3217/docs/iroh/endpoint/struct.IncomingFuture.html
+++ b/pr/3217/docs/iroh/endpoint/struct.IncomingFuture.html
@@ -1,6 +1,6 @@
-IncomingFuture in iroh::endpoint - Rust pub struct IncomingFuture { /* private fields */ }
Expand description
Adaptor to let Incoming be awaited like a Connecting.
-Trait Implementations§
Source§impl Debug for IncomingFuture
Source§impl Future for IncomingFuture
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for IncomingFuturewhere
+IncomingFuture in iroh::endpoint - Rust pub struct IncomingFuture { /* private fields */ }
Expand description
Adaptor to let Incoming be awaited like a Connecting.
+Trait Implementations§
Source§impl Debug for IncomingFuture
Source§impl Future for IncomingFuture
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for IncomingFuturewhere
PinnedFieldsOf<__IncomingFuture<'pin>>: Unpin,
Auto Trait Implementations§
§impl !Freeze for IncomingFuture
§impl !RefUnwindSafe for IncomingFuture
§impl Send for IncomingFuture
§impl Sync for IncomingFuture
§impl !UnwindSafe for IncomingFuture
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html b/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html
index 792290d8f5..d03f08d892 100644
--- a/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html
+++ b/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html
@@ -1,7 +1,7 @@
-ZeroRttAccepted in iroh::endpoint - Rust pub struct ZeroRttAccepted { /* private fields */ }
Expand description
Future that completes when a connection is fully established.
+ZeroRttAccepted in iroh::endpoint - Rust pub struct ZeroRttAccepted { /* private fields */ }
Expand description
Future that completes when a connection is fully established.
For clients, the resulting value indicates if 0-RTT was accepted. For servers, the resulting
value is meaningless.
-Trait Implementations§
Source§impl Debug for ZeroRttAccepted
Source§impl Future for ZeroRttAccepted
Source§fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>
Attempts to resolve the future to a final value, registering
+Trait Implementations§
Source§impl Debug for ZeroRttAccepted
Source§impl Future for ZeroRttAccepted
Auto Trait Implementations§
§impl Freeze for ZeroRttAccepted
§impl !RefUnwindSafe for ZeroRttAccepted
§impl Send for ZeroRttAccepted
§impl Sync for ZeroRttAccepted
§impl Unpin for ZeroRttAccepted
§impl !UnwindSafe for ZeroRttAccepted
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/enum.KeyParsingError.html b/pr/3217/docs/iroh/enum.KeyParsingError.html
index 55941cda04..c7925e588b 100644
--- a/pr/3217/docs/iroh/enum.KeyParsingError.html
+++ b/pr/3217/docs/iroh/enum.KeyParsingError.html
@@ -1,4 +1,4 @@
-KeyParsingError in iroh - Rust pub enum KeyParsingError {
+KeyParsingError in iroh - Rust Enum KeyParsingError
pub enum KeyParsingError {
Decode(DecodeError),
Key(Error),
DecodeInvalidLength,
@@ -6,7 +6,7 @@
Variants§
§Decode(DecodeError)
Error when decoding.
§Key(Error)
Error when decoding the public key.
§DecodeInvalidLength
The encoded information had the wrong length.
-Trait Implementations§
Source§impl Debug for KeyParsingError
Source§impl Display for KeyParsingError
Source§impl Error for KeyParsingError
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()Source§impl From<DecodeError> for KeyParsingError
Source§fn from(source: DecodeError) -> KeyParsingError
Converts to this type from the input type.Source§impl From<Error> for KeyParsingError
Source§fn from(source: Error) -> KeyParsingError
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for KeyParsingError
§impl !RefUnwindSafe for KeyParsingError
§impl Send for KeyParsingError
§impl Sync for KeyParsingError
§impl Unpin for KeyParsingError
§impl !UnwindSafe for KeyParsingError
Blanket Implementations§
Trait Implementations§
§impl Debug for KeyParsingError
§impl Display for KeyParsingError
§impl Error for KeyParsingError
§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()§impl From<DecodeError> for KeyParsingError
§fn from(source: DecodeError) -> KeyParsingError
Converts to this type from the input type.§impl From<Error> for KeyParsingError
§fn from(source: Error) -> KeyParsingError
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for KeyParsingError
§impl !RefUnwindSafe for KeyParsingError
§impl Send for KeyParsingError
§impl Sync for KeyParsingError
§impl Unpin for KeyParsingError
§impl !UnwindSafe for KeyParsingError
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/3217/docs/iroh/metrics/struct.RelayMetrics.html b/pr/3217/docs/iroh/metrics/struct.RelayMetrics.html
index 83ae1acdcc..6f22d04f93 100644
--- a/pr/3217/docs/iroh/metrics/struct.RelayMetrics.html
+++ b/pr/3217/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/3217/docs/iroh/node_info/constant.IROH_TXT_NAME.html b/pr/3217/docs/iroh/node_info/constant.IROH_TXT_NAME.html
index c78d056a1f..0c1e657fb3 100644
--- a/pr/3217/docs/iroh/node_info/constant.IROH_TXT_NAME.html
+++ b/pr/3217/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/3217/docs/iroh/node_info/index.html b/pr/3217/docs/iroh/node_info/index.html
index 9884414f78..5130358fc8 100644
--- a/pr/3217/docs/iroh/node_info/index.html
+++ b/pr/3217/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/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html b/pr/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html
index 2f1c9b7234..33cd3a33fc 100644
--- a/pr/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html
+++ b/pr/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html
@@ -1,5 +1,5 @@
-MaxLengthExceededError in iroh::node_info - Rust
pub struct ConnectOptions { /* private fields */ }Expand description
Options for the Endpoint::connect_with_opts function.
Implementations§
Source§impl ConnectOptions
impl ConnectOptions
Sourcepub fn new() -> Self
pub fn new() -> Self
Initializes new connection options.
+pub struct ConnectOptions { /* private fields */ }Expand description
Options for the Endpoint::connect_with_opts function.
Implementations§
Source§impl ConnectOptions
impl ConnectOptions
Sourcepub fn new() -> Self
pub fn new() -> Self
Initializes new connection options.
By default, the connection will use the same options
as Endpoint::connect, e.g. a default TransportConfig.
Sourcepub fn with_transport_config(
+
pub fn with_transport_config( +
Sourcepub fn with_transport_config(
self,
transport_config: Arc<TransportConfig>,
) -> Self
pub fn with_transport_config( self, transport_config: Arc<TransportConfig>, ) -> Self
Sets the QUIC transport config options for this connection.
-Trait Implementations§
Source§impl Clone for ConnectOptions
impl Clone for ConnectOptions
Source§fn clone(&self) -> ConnectOptions
fn clone(&self) -> ConnectOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ConnectOptions
impl Debug for ConnectOptions
Source§impl Default for ConnectOptions
impl Default for ConnectOptions
Source§fn default() -> ConnectOptions
fn default() -> ConnectOptions
Auto Trait Implementations§
impl Freeze for ConnectOptions
impl !RefUnwindSafe for ConnectOptions
impl Send for ConnectOptions
impl Sync for ConnectOptions
impl Unpin for ConnectOptions
impl !UnwindSafe for ConnectOptions
Blanket Implementations§
Trait Implementations§
Source§impl Clone for ConnectOptions
impl Clone for ConnectOptions
Source§fn clone(&self) -> ConnectOptions
fn clone(&self) -> ConnectOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ConnectOptions
impl Debug for ConnectOptions
Source§impl Default for ConnectOptions
impl Default for ConnectOptions
Source§fn default() -> ConnectOptions
fn default() -> ConnectOptions
Auto Trait Implementations§
impl Freeze for ConnectOptions
impl !RefUnwindSafe for ConnectOptions
impl Send for ConnectOptions
impl Sync for ConnectOptions
impl Unpin for ConnectOptions
impl !UnwindSafe for ConnectOptions
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/3217/docs/iroh/endpoint/struct.Connecting.html b/pr/3217/docs/iroh/endpoint/struct.Connecting.html
index 41a03946a4..e190a84876 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Connecting.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Connecting.html
@@ -1,5 +1,5 @@
-Connecting in iroh::endpoint - Rust pub struct Connecting { /* private fields */ }
Expand description
In-progress connection attempt future
-Implementations§
Source§impl Connecting
Sourcepub fn into_0rtt(self) -> Result<(Connection, ZeroRttAccepted), Self>
Converts this Connecting into a 0-RTT or 0.5-RTT connection at the cost of weakened
+
Connecting in iroh::endpoint - Rust pub struct Connecting { /* private fields */ }
Expand description
In-progress connection attempt future
+Implementations§
Source§impl Connecting
Sourcepub fn into_0rtt(self) -> Result<(Connection, ZeroRttAccepted), Self>
Converts this Connecting into a 0-RTT or 0.5-RTT connection at the cost of weakened
security.
Returns Ok immediately if the local endpoint is able to attempt sending 0/0.5-RTT data.
If so, the returned Connection can be used to send application data without waiting for
@@ -33,10 +33,10 @@ before TLS client authentication has occurred, and should therefore not be used
data for which client authentication is being used.
You can use RecvStream::is_0rtt to check whether a stream has been opened in 0-RTT
and thus whether parts of the stream are operating under this reduced security level.
-Sourcepub async fn handshake_data(&mut self) -> Result<Box<dyn Any>, ConnectionError>
Parameters negotiated during the handshake
-Trait Implementations§
Source§impl Debug for Connecting
Source§impl Future for Connecting
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for Connectingwhere
+Sourcepub async fn handshake_data(&mut self) -> Result<Box<dyn Any>, ConnectionError>
Parameters negotiated during the handshake
+
Trait Implementations§
Source§impl Debug for Connecting
Source§impl Future for Connecting
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for Connectingwhere
PinnedFieldsOf<__Connecting<'pin>>: Unpin,
Auto Trait Implementations§
§impl Freeze for Connecting
§impl !RefUnwindSafe for Connecting
§impl Send for Connecting
§impl Sync for Connecting
§impl !UnwindSafe for Connecting
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/endpoint/struct.Connection.html b/pr/3217/docs/iroh/endpoint/struct.Connection.html
index 8e81609487..928cdb9918 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Connection.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Connection.html
@@ -1,4 +1,4 @@
-Connection in iroh::endpoint - Rust pub struct Connection { /* private fields */ }
Expand description
A QUIC connection.
+Connection in iroh::endpoint - Rust pub struct Connection { /* private fields */ }
Expand description
A QUIC connection.
If all references to a connection (including every clone of the Connection handle,
streams of incoming streams, and the various stream types) have been dropped, then the
connection will be automatically closed with an error_code of 0 and an empty reason. You
@@ -8,29 +8,29 @@ receiving CONNECTION_CLOSE the peer may drop any stream data not yet delivered t
application. Connection::close describes in more detail how to gracefully close a
connection without losing application data.
May be cloned to obtain another handle to the same connection.
-Implementations§
Source§impl Connection
Implementations§
Source§impl Connection
Sourcepub fn open_uni(&self) -> OpenUni<'_> ⓘ
Initiates a new outgoing unidirectional stream.
Streams are cheap and instantaneous to open unless blocked by flow control. As a
consequence, the peer won’t be notified that a stream has been opened until the
stream is actually used.
-Sourcepub fn open_bi(&self) -> OpenBi<'_> ⓘ
Initiates a new outgoing bidirectional stream.
Streams are cheap and instantaneous to open unless blocked by flow control. As a
consequence, the peer won’t be notified that a stream has been opened until the
stream is actually used. Calling open_bi then waiting on the RecvStream
without writing anything to SendStream will never succeed.
-Sourcepub fn accept_uni(&self) -> AcceptUni<'_> ⓘ
Accepts the next incoming uni-directional stream.
-Sourcepub fn accept_uni(&self) -> AcceptUni<'_> ⓘ
Accepts the next incoming uni-directional stream.
+Sourcepub fn accept_bi(&self) -> AcceptBi<'_> ⓘ
Accept the next incoming bidirectional stream.
Important Note: The peer that calls open_bi must write to its SendStream
before the peer Connection is able to accept the stream using
accept_bi(). Calling open_bi then waiting on the RecvStream without
writing anything to the connected SendStream will never succeed.
-Sourcepub fn read_datagram(&self) -> ReadDatagram<'_> ⓘ
Receives an application datagram.
-Sourcepub async fn closed(&self) -> ConnectionError
Wait for the connection to be closed for any reason.
+Sourcepub fn read_datagram(&self) -> ReadDatagram<'_> ⓘ
Receives an application datagram.
+Sourcepub async fn closed(&self) -> ConnectionError
Wait for the connection to be closed for any reason.
Despite the return type’s name, closed connections are often not an error condition
at the application layer. Cases that might be routine include
ConnectionError::LocallyClosed and ConnectionError::ApplicationClosed.
-Sourcepub fn close_reason(&self) -> Option<ConnectionError>
If the connection is closed, the reason why.
+Sourcepub fn close_reason(&self) -> Option<ConnectionError>
If the connection is closed, the reason why.
Returns None if the connection is still open.
-Sourcepub fn close(&self, error_code: VarInt, reason: &[u8])
Closes the connection immediately.
Pending operations will fail immediately with ConnectionError::LocallyClosed. No
more data is sent to the peer and the peer may drop buffered data upon receiving the
CONNECTION_CLOSE frame.
@@ -51,41 +51,41 @@ endpoint. Once the local side sends a CONNECTION_CLOSE frame in response to call
close the remote endpoint may drop any data it received but is as yet
undelivered to the application, including data that was acknowledged as received to
the local endpoint.
-Sourcepub fn send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError>
Transmits data as an unreliable, unordered application datagram.
+Sourcepub fn send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError>
Transmits data as an unreliable, unordered application datagram.
Application datagrams are a low-level primitive. They may be lost or delivered out
of order, and data must both fit inside a single QUIC packet and be smaller than
the maximum dictated by the peer.
-Sourcepub fn max_datagram_size(&self) -> Option<usize>
Computes the maximum size of datagrams that may be passed to send_datagram.
+Sourcepub fn max_datagram_size(&self) -> Option<usize>
Computes the maximum size of datagrams that may be passed to send_datagram.
Returns None if datagrams are unsupported by the peer or disabled locally.
This may change over the lifetime of a connection according to variation in the path
MTU estimate. The peer can also enforce an arbitrarily small fixed limit, but if the
peer’s limit is large this is guaranteed to be a little over a kilobyte at minimum.
Not necessarily the maximum size of received datagrams.
-Sourcepub fn datagram_send_buffer_space(&self) -> usize
Bytes available in the outgoing datagram buffer.
+Sourcepub fn datagram_send_buffer_space(&self) -> usize
Bytes available in the outgoing datagram buffer.
When greater than zero, calling send_datagram with a
datagram of at most this size is guaranteed not to cause older datagrams to be
dropped.
-Sourcepub fn rtt(&self) -> Duration
Current best estimate of this connection’s latency (round-trip-time).
-Sourcepub fn stats(&self) -> ConnectionStats
Returns connection statistics.
-Sourcepub fn congestion_state(&self) -> Box<dyn Controller>
Current state of the congestion control algorithm, for debugging purposes.
-Sourcepub fn handshake_data(&self) -> Option<Box<dyn Any>>
Parameters negotiated during the handshake.
+Sourcepub fn rtt(&self) -> Duration
Current best estimate of this connection’s latency (round-trip-time).
+Sourcepub fn stats(&self) -> ConnectionStats
Returns connection statistics.
+Sourcepub fn congestion_state(&self) -> Box<dyn Controller>
Current state of the congestion control algorithm, for debugging purposes.
+Sourcepub fn handshake_data(&self) -> Option<Box<dyn Any>>
Parameters negotiated during the handshake.
Guaranteed to return Some on fully established connections or after
Connecting::handshake_data() succeeds. See that method’s documentations for
details on the returned value.
-Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
-Sourcepub fn peer_identity(&self) -> Option<Box<dyn Any>>
Cryptographic identity of the peer.
+Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
+Sourcepub fn peer_identity(&self) -> Option<Box<dyn Any>>
Sourcepub fn remote_node_id(&self) -> Result<NodeId>
Returns the NodeId from the peer’s TLS certificate.
+Sourcepub fn remote_node_id(&self) -> Result<NodeId>
Sourcepub fn stable_id(&self) -> usize
A stable identifier for this connection.
Peer addresses and connection IDs can change, but this value will remain fixed for
the lifetime of the connection.
-Sourcepub fn export_keying_material(
+
Sourcepub fn export_keying_material(
&self,
output: &mut [u8],
label: &[u8],
@@ -96,14 +96,14 @@ arguments and output buffers of equal length, they will get the
same sequence of bytes in output. These bytes are cryptographically
strong and pseudorandom, and are suitable for use as keying material.
See RFC5705 for more information.
-
Sourcepub fn set_max_concurrent_uni_streams(&self, count: VarInt)
Modifies the number of unidirectional streams that may be concurrently opened.
+Sourcepub fn set_max_concurrent_uni_streams(&self, count: VarInt)
Modifies the number of unidirectional streams that may be concurrently opened.
No streams may be opened by the peer unless fewer than count are already
open. Large counts increase both minimum and worst-case memory consumption.
-Sourcepub fn set_receive_window(&self, receive_window: VarInt)
Sourcepub fn set_max_concurrent_bi_streams(&self, count: VarInt)
Modifies the number of bidirectional streams that may be concurrently opened.
+Sourcepub fn set_receive_window(&self, receive_window: VarInt)
Sourcepub fn set_max_concurrent_bi_streams(&self, count: VarInt)
Modifies the number of bidirectional streams that may be concurrently opened.
No streams may be opened by the peer unless fewer than count are already
open. Large counts increase both minimum and worst-case memory consumption.
-Trait Implementations§
Source§impl Clone for Connection
Source§fn clone(&self) -> Connection
Returns a copy of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreAuto Trait Implementations§
§impl Freeze for Connection
§impl RefUnwindSafe for Connection
§impl Send for Connection
§impl Sync for Connection
§impl Unpin for Connection
§impl UnwindSafe for Connection
Blanket Implementations§
Trait Implementations§
Source§impl Clone for Connection
Source§fn clone(&self) -> Connection
Returns a copy of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreAuto Trait Implementations§
§impl Freeze for Connection
§impl RefUnwindSafe for Connection
§impl Send for Connection
§impl Sync for Connection
§impl Unpin for Connection
§impl UnwindSafe for Connection
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/3217/docs/iroh/endpoint/struct.DirectAddr.html b/pr/3217/docs/iroh/endpoint/struct.DirectAddr.html
index 61a667e47d..04760c9021 100644
--- a/pr/3217/docs/iroh/endpoint/struct.DirectAddr.html
+++ b/pr/3217/docs/iroh/endpoint/struct.DirectAddr.html
@@ -1,4 +1,4 @@
-DirectAddr in iroh::endpoint - Rust pub struct DirectAddr {
+DirectAddr in iroh::endpoint - Rust pub struct DirectAddr {
pub addr: SocketAddr,
pub typ: DirectAddrType,
}
Expand description
A direct address on which an iroh-node might be contactable.
@@ -7,16 +7,16 @@ contacted. These can come from various sources depending on the network topolog
iroh node, see DirectAddrType for the several kinds of sources.
Fields§
§addr: SocketAddrThe address.
§typ: DirectAddrTypeThe origin of this direct address.
-Trait Implementations§
Source§impl Clone for DirectAddr
Source§fn clone(&self) -> DirectAddr
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 DirectAddr
Source§impl Hash for DirectAddr
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
+Trait Implementations§
Source§impl Clone for DirectAddr
Source§fn clone(&self) -> DirectAddr
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 DirectAddr
Source§impl Hash for DirectAddr
Source§impl Ord for DirectAddr
Source§impl Ord for DirectAddr
Source§fn cmp(&self, other: &DirectAddr) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read moreSource§impl PartialEq for DirectAddr
Source§impl PartialOrd for DirectAddr
Source§impl PartialEq for DirectAddr
Source§impl PartialOrd for DirectAddr
Source§impl Eq for DirectAddr
Source§impl StructuralPartialEq for DirectAddr
Auto Trait Implementations§
§impl Freeze for DirectAddr
§impl RefUnwindSafe for DirectAddr
§impl Send for DirectAddr
§impl Sync for DirectAddr
§impl Unpin for DirectAddr
§impl UnwindSafe for DirectAddr
Blanket Implementations§
Source§impl Eq for DirectAddr
Source§impl StructuralPartialEq for DirectAddr
Auto Trait Implementations§
§impl Freeze for DirectAddr
§impl RefUnwindSafe for DirectAddr
§impl Send for DirectAddr
§impl Sync for DirectAddr
§impl Unpin for DirectAddr
§impl UnwindSafe for DirectAddr
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/3217/docs/iroh/endpoint/struct.Endpoint.html b/pr/3217/docs/iroh/endpoint/struct.Endpoint.html
index e25e697700..0b8c9af7b3 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Endpoint.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Endpoint.html
@@ -1,4 +1,4 @@
-Endpoint in iroh::endpoint - Rust pub struct Endpoint { /* private fields */ }
Expand description
Controls an iroh node, establishing connections with other nodes.
+Endpoint in iroh::endpoint - Rust pub struct Endpoint { /* private fields */ }
Expand description
Controls an iroh node, establishing connections with other nodes.
This is the main API interface to create connections to, and accept connections from
other iroh nodes. The connections are peer-to-peer and encrypted, a Relay server is
used to make the connections reliable. See the [crate docs] for a more detailed
@@ -16,17 +16,17 @@ the peer are created using the Connection::open_uni and Connection::open_bi functions.
Note that due to the light-weight properties of streams a stream will only be accepted
once the initiating peer has sent some data on it.
-Implementations§
Source§impl Endpoint
Sourcepub fn builder() -> Builder
Returns the builder for an Endpoint, with a production configuration.
-Sourcepub fn set_alpns(&self, alpns: Vec<Vec<u8>>) -> Result<()>
Sets the list of accepted ALPN protocols.
+Implementations§
Source§impl Endpoint
Sourcepub fn builder() -> Builder
Returns the builder for an Endpoint, with a production configuration.
+Sourcepub async fn connect(
&self,
node_addr: impl Into<NodeAddr>,
alpn: &[u8],
) -> Result<Connection>
Connects to a remote Endpoint.
A value that can be converted into a NodeAddr is required. This can be either a
-NodeAddr, a NodeId or a iroh_base::ticket::NodeTicket.
+NodeAddr, a NodeId or a [iroh_base::ticket::NodeTicket].
The NodeAddr must contain the NodeId to dial and may also contain a RelayUrl
and direct addresses. If direct addresses are provided, they will be used to try and
establish a direct connection without involving a relay server.
@@ -41,7 +41,7 @@ connection attempt will fail with an error.
The alpn, or application-level protocol identifier, is also required. The remote
endpoint must support this alpn, otherwise the connection attempt will fail with
an error.
-Sourcepub async fn connect_with_opts(
+
Sourcepub async fn connect_with_opts(
&self,
node_addr: impl Into<NodeAddr>,
alpn: &[u8],
@@ -61,13 +61,13 @@ security concerns.
establishing and maintaining direct connections. Carefully test settings you use and
consider this currently as still rather experimental.
-
Sourcepub fn accept(&self) -> Accept<'_> ⓘ
Accepts an incoming connection on the endpoint.
Only connections with the ALPNs configured in Builder::alpns will be accepted.
If multiple ALPNs have been configured the ALPN can be inspected before accepting
the connection using Connecting::alpn.
The returned future will yield None if the endpoint is closed by calling
Endpoint::close.
-Sourcepub fn add_node_addr(&self, node_addr: NodeAddr) -> Result<()>
Informs this Endpoint about addresses of the iroh node.
+Sourcepub fn add_node_addr(&self, node_addr: NodeAddr) -> Result<()>
Informs this Endpoint about addresses of the iroh node.
This updates the local state for the remote node. If the provided NodeAddr
contains a RelayUrl this will be used as the new relay server for this node. If
it contains any new IP endpoints they will also be stored and tried when next
@@ -80,7 +80,7 @@ This provides more flexibility and future proofing.
§Errors
Will return an error if we attempt to add our own NodeId to the node map or
if the direct addresses are a subset of ours.
-Sourcepub fn add_node_addr_with_source(
+
Sourcepub fn secret_key(&self) -> &SecretKey
Returns the secret_key of this endpoint.
-Sourcepub fn secret_key(&self) -> &SecretKey
Returns the secret_key of this endpoint.
+Sourcepub fn node_id(&self) -> NodeId
Returns the node id of this endpoint.
This ID is the unique addressing information of this node and other peers must know
it to be able to connect to this node.
-Sourcepub async fn node_addr(&self) -> Result<NodeAddr>
Returns the current NodeAddr for this endpoint.
+Sourcepub async fn node_addr(&self) -> Result<NodeAddr>
Returns the current NodeAddr for this endpoint.
The returned NodeAddr will have the current RelayUrl and direct addresses
as they would be returned by Endpoint::home_relay and
Endpoint::direct_addresses.
In browsers, because direct addresses are unavailable, this will only wait for
the home relay to be available before returning.
-Sourcepub fn home_relay(&self) -> Watcher<Option<RelayUrl>>
Sourcepub fn home_relay(&self) -> Watcher<Option<RelayUrl>>
Returns a Watcher for the RelayUrl of the Relay server used as home relay.
Every endpoint has a home Relay server which it chooses as the server with the
lowest latency out of the configured servers provided by Builder::relay_mode.
This is the server other iroh nodes can use to reliably establish a connection
@@ -122,7 +122,7 @@ some time to connect to find and connect to the home relay server.
let mep = Endpoint::builder().bind().await.unwrap();
let _relay_url = mep.home_relay().initialized().await.unwrap();
-Sourcepub fn direct_addresses(&self) -> Watcher<Option<BTreeSet<DirectAddr>>>
Sourcepub fn direct_addresses(&self) -> Watcher<Option<BTreeSet<DirectAddr>>>
Returns a Watcher for the direct addresses of this Endpoint.
The direct addresses of the Endpoint are those that could be used by other
iroh nodes to establish direct connectivity, depending on the network
situation. The yielded lists of direct addresses contain both the locally-bound
@@ -145,10 +145,10 @@ recently discovered direct addresses.
let mep = Endpoint::builder().bind().await.unwrap();
let _addrs = mep.direct_addresses().initialized().await.unwrap();
-Sourcepub fn bound_sockets(&self) -> (SocketAddr, Option<SocketAddr>)
Available on non-wasm_browser only.
Returns the local socket addresses on which the underlying sockets are bound.
+Sourcepub fn bound_sockets(&self) -> (SocketAddr, Option<SocketAddr>)
Available on non-wasm_browser only.
Returns the local socket addresses on which the underlying sockets are bound.
The Endpoint always binds on an IPv4 address and also tries to bind on an IPv6
address if available.
-Sourcepub fn remote_info(&self, node_id: NodeId) -> Option<RemoteInfo>
Returns information about the remote node identified by a NodeId.
+Sourcepub fn remote_info(&self, node_id: NodeId) -> Option<RemoteInfo>
Returns information about the remote node identified by a NodeId.
The Endpoint keeps some information about remote iroh nodes, which it uses to find
the best path to a node. Having information on a remote node, however, does not mean we have
ever connected to it to or even whether a connection is even possible. The information about a
@@ -157,14 +157,14 @@ calls may return different information. Furthermore, node information may even b
completely evicted as it becomes stale.
See also Endpoint::remote_info_iter which returns information on all nodes known
by this Endpoint.
-Sourcepub fn remote_info_iter(&self) -> impl Iterator<Item = RemoteInfo>
Returns information about all the remote nodes this Endpoint knows about.
+Sourcepub fn remote_info_iter(&self) -> impl Iterator<Item = RemoteInfo>
Returns information about all the remote nodes this Endpoint knows about.
This returns the same information as Endpoint::remote_info for each node known to this
Endpoint.
The Endpoint keeps some information about remote iroh nodes, which it uses to find
the best path to a node. This returns all the nodes it knows about, regardless of whether a
connection was ever made or is even possible.
See also Endpoint::remote_info to only retrieve information about a single node.
-Sourcepub fn discovery_stream(
+
Sourcepub fn discovery_stream(
&self,
) -> impl Stream<Item = Result<DiscoveryItem, Lagged>>
Returns a stream of all remote nodes discovered through the endpoint’s discovery services.
Whenever a node is discovered via the endpoint’s discovery service, the corresponding
@@ -183,7 +183,7 @@ at the time of adding it to the static provider.
Lagged may be yielded, indicating that items were missed.
See also Endpoint::remote_info_iter, which returns an iterator over all remotes
the endpoint knows about at a specific point in time.
-Sourcepub fn conn_type(&self, node_id: NodeId) -> Result<Watcher<ConnectionType>>
Returns a Watcher that reports the current connection type and any changes for
+
Sourcepub fn conn_type(&self, node_id: NodeId) -> Result<Watcher<ConnectionType>>
Returns a Watcher that reports the current connection type and any changes for
given remote node.
This watcher allows observing a stream of ConnectionType items by calling
Watcher::stream(). If the underlying connection to a remote node changes, it will
@@ -202,11 +202,11 @@ recently connected to this node id but previous methods of reaching the node hav
become inaccessible.
§Errors
Will error if we do not have any address information for the given node_id.
-Sourcepub fn dns_resolver(&self) -> &DnsResolver
Available on non-wasm_browser only.
Returns the DNS resolver used in this Endpoint.
+Sourcepub fn dns_resolver(&self) -> &DnsResolver
Available on non-wasm_browser only.
Returns the DNS resolver used in this Endpoint.
-Sourcepub fn discovery(&self) -> Option<&dyn Discovery>
Returns the discovery mechanism, if configured.
+Sourcepub fn discovery(&self) -> Option<&dyn Discovery>
Returns the discovery mechanism, if configured.
See Builder::discovery.
-Sourcepub async fn network_change(&self)
Notifies the system of potential network changes.
+Sourcepub async fn network_change(&self)
Notifies the system of potential network changes.
On many systems iroh is able to detect network changes by itself, however
some systems like android do not expose this functionality to native code.
Android does however provide this functionality to Java code. This
@@ -214,12 +214,12 @@ function allows for notifying iroh of any potential network changes like
this.
Even when the network did not change, or iroh was already able to detect
the network change itself, there is no harm in calling this function.
-Sourcepub fn set_user_data_for_discovery(&self, user_data: Option<UserData>)
Sets the initial user-defined data to be published in discovery services for this node.
+Sourcepub fn set_user_data_for_discovery(&self, user_data: Option<UserData>)
Sets the initial user-defined data to be published in discovery services for this node.
If the user-defined data passed to this function is different to the previous one,
the endpoint will republish its node info to the configured discovery services.
See also Builder::user_data_for_discovery for setting an initial value when
building the endpoint.
-Sourcepub async fn close(&self)
Closes the QUIC endpoint and the magic socket.
This will close any remaining open Connections with an error code
of 0 and an empty reason. Though it is best practice to close those
explicitly before with a custom error code and reason.
@@ -245,8 +245,8 @@ while TCP sockets usually get closed and drained by the operating system in the
kernel during the “Time-Wait” period of the TCP socket.
Be aware however that the underlying UDP sockets are only closed once all clones of
the the respective Endpoint are dropped.
-Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Endpoint
§impl !RefUnwindSafe for Endpoint
§impl Send for Endpoint
§impl Sync for Endpoint
§impl Unpin for Endpoint
§impl !UnwindSafe for Endpoint
Blanket Implementations§
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Endpoint
§impl !RefUnwindSafe for Endpoint
§impl Send for Endpoint
§impl Sync for Endpoint
§impl Unpin for Endpoint
§impl !UnwindSafe for Endpoint
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/3217/docs/iroh/endpoint/struct.Incoming.html b/pr/3217/docs/iroh/endpoint/struct.Incoming.html
index 61f28360fa..6b71064a82 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Incoming.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Incoming.html
@@ -1,29 +1,29 @@
-Incoming in iroh::endpoint - Rust pub struct Incoming { /* private fields */ }
Expand description
An incoming connection for which the server has not yet begun its parts of the
+
Incoming in iroh::endpoint - Rust pub struct Incoming { /* private fields */ }
Expand description
An incoming connection for which the server has not yet begun its parts of the
handshake.
-Implementations§
Source§impl Incoming
Sourcepub fn accept(self) -> Result<Connecting, ConnectionError>
Attempts to accept this incoming connection (an error may still occur).
+Implementations§
Source§impl Incoming
Sourcepub fn accept(self) -> Result<Connecting, ConnectionError>
Attempts to accept this incoming connection (an error may still occur).
Errors occurring here are likely not caused by the application or remote. The QUIC
connection listens on a normal UDP socket and any reachable network endpoint can
send datagrams to it, solicited or not. Even if the first few bytes look like a
QUIC packet, it might not even be a QUIC packet that is being received.
Thus it is common to simply log the errors here and accept them as something which
can happen.
-Sourcepub fn accept_with(
+
Sourcepub fn accept_with(
self,
server_config: Arc<ServerConfig>,
) -> Result<Connecting, ConnectionError>
Accepts this incoming connection using a custom configuration.
See accept() for more details.
-Sourcepub fn retry(self) -> Result<(), RetryError>
Responds with a retry packet.
+Sourcepub fn retry(self) -> Result<(), RetryError>
Responds with a retry packet.
This requires the client to retry with address validation.
Errors if remote_address_validated() is true.
-Sourcepub fn ignore(self)
Ignores this incoming connection attempt, not sending any packet in response.
-Sourcepub fn local_ip(&self) -> Option<IpAddr>
Returns the local IP address which was used when the peer established the
+
Sourcepub fn ignore(self)
Ignores this incoming connection attempt, not sending any packet in response.
+Sourcepub fn local_ip(&self) -> Option<IpAddr>
Returns the local IP address which was used when the peer established the
connection.
-Sourcepub fn remote_address(&self) -> SocketAddr
Returns the peer’s UDP address.
-Sourcepub fn remote_address_validated(&self) -> bool
Whether the socket address that is initiating this connection has been validated.
+Sourcepub fn remote_address(&self) -> SocketAddr
Returns the peer’s UDP address.
+Sourcepub fn remote_address_validated(&self) -> bool
Whether the socket address that is initiating this connection has been validated.
This means that the sender of the initial packet has proved that they can receive
traffic sent to self.remote_address().
-Trait Implementations§
Source§impl IntoFuture for Incoming
Source§type Output = Result<Connection, ConnectionError>
The output that the future will produce on completion.Source§type IntoFuture = IncomingFuture
Which kind of future are we turning this into?Source§fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read moreAuto Trait Implementations§
§impl !Freeze for Incoming
§impl !RefUnwindSafe for Incoming
§impl Send for Incoming
§impl Sync for Incoming
§impl Unpin for Incoming
§impl !UnwindSafe for Incoming
Blanket Implementations§
Trait Implementations§
Source§impl IntoFuture for Incoming
Source§type Output = Result<Connection, ConnectionError>
The output that the future will produce on completion.Source§type IntoFuture = IncomingFuture
Which kind of future are we turning this into?Source§fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read moreAuto Trait Implementations§
§impl !Freeze for Incoming
§impl !RefUnwindSafe for Incoming
§impl Send for Incoming
§impl Sync for Incoming
§impl Unpin for Incoming
§impl !UnwindSafe for Incoming
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/3217/docs/iroh/endpoint/struct.IncomingFuture.html b/pr/3217/docs/iroh/endpoint/struct.IncomingFuture.html
index 504c012c78..3934a53120 100644
--- a/pr/3217/docs/iroh/endpoint/struct.IncomingFuture.html
+++ b/pr/3217/docs/iroh/endpoint/struct.IncomingFuture.html
@@ -1,6 +1,6 @@
-IncomingFuture in iroh::endpoint - Rust pub struct IncomingFuture { /* private fields */ }
Expand description
Adaptor to let Incoming be awaited like a Connecting.
-Trait Implementations§
Source§impl Debug for IncomingFuture
Source§impl Future for IncomingFuture
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for IncomingFuturewhere
+IncomingFuture in iroh::endpoint - Rust pub struct IncomingFuture { /* private fields */ }
Expand description
Adaptor to let Incoming be awaited like a Connecting.
+Trait Implementations§
Source§impl Debug for IncomingFuture
Source§impl Future for IncomingFuture
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for IncomingFuturewhere
PinnedFieldsOf<__IncomingFuture<'pin>>: Unpin,
Auto Trait Implementations§
§impl !Freeze for IncomingFuture
§impl !RefUnwindSafe for IncomingFuture
§impl Send for IncomingFuture
§impl Sync for IncomingFuture
§impl !UnwindSafe for IncomingFuture
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html b/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html
index 792290d8f5..d03f08d892 100644
--- a/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html
+++ b/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html
@@ -1,7 +1,7 @@
-ZeroRttAccepted in iroh::endpoint - Rust pub struct ZeroRttAccepted { /* private fields */ }
Expand description
Future that completes when a connection is fully established.
+ZeroRttAccepted in iroh::endpoint - Rust pub struct ZeroRttAccepted { /* private fields */ }
Expand description
Future that completes when a connection is fully established.
For clients, the resulting value indicates if 0-RTT was accepted. For servers, the resulting
value is meaningless.
-Trait Implementations§
Source§impl Debug for ZeroRttAccepted
Source§impl Future for ZeroRttAccepted
Source§fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>
Attempts to resolve the future to a final value, registering
+Trait Implementations§
Source§impl Debug for ZeroRttAccepted
Source§impl Future for ZeroRttAccepted
Auto Trait Implementations§
§impl Freeze for ZeroRttAccepted
§impl !RefUnwindSafe for ZeroRttAccepted
§impl Send for ZeroRttAccepted
§impl Sync for ZeroRttAccepted
§impl Unpin for ZeroRttAccepted
§impl !UnwindSafe for ZeroRttAccepted
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/enum.KeyParsingError.html b/pr/3217/docs/iroh/enum.KeyParsingError.html
index 55941cda04..c7925e588b 100644
--- a/pr/3217/docs/iroh/enum.KeyParsingError.html
+++ b/pr/3217/docs/iroh/enum.KeyParsingError.html
@@ -1,4 +1,4 @@
-KeyParsingError in iroh - Rust pub enum KeyParsingError {
+KeyParsingError in iroh - Rust Enum KeyParsingError
pub enum KeyParsingError {
Decode(DecodeError),
Key(Error),
DecodeInvalidLength,
@@ -6,7 +6,7 @@
Variants§
§Decode(DecodeError)
Error when decoding.
§Key(Error)
Error when decoding the public key.
§DecodeInvalidLength
The encoded information had the wrong length.
-Trait Implementations§
Source§impl Debug for KeyParsingError
Source§impl Display for KeyParsingError
Source§impl Error for KeyParsingError
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()Source§impl From<DecodeError> for KeyParsingError
Source§fn from(source: DecodeError) -> KeyParsingError
Converts to this type from the input type.Source§impl From<Error> for KeyParsingError
Source§fn from(source: Error) -> KeyParsingError
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for KeyParsingError
§impl !RefUnwindSafe for KeyParsingError
§impl Send for KeyParsingError
§impl Sync for KeyParsingError
§impl Unpin for KeyParsingError
§impl !UnwindSafe for KeyParsingError
Blanket Implementations§
Trait Implementations§
§impl Debug for KeyParsingError
§impl Display for KeyParsingError
§impl Error for KeyParsingError
§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()§impl From<DecodeError> for KeyParsingError
§fn from(source: DecodeError) -> KeyParsingError
Converts to this type from the input type.§impl From<Error> for KeyParsingError
§fn from(source: Error) -> KeyParsingError
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for KeyParsingError
§impl !RefUnwindSafe for KeyParsingError
§impl Send for KeyParsingError
§impl Sync for KeyParsingError
§impl Unpin for KeyParsingError
§impl !UnwindSafe for KeyParsingError
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/3217/docs/iroh/metrics/struct.RelayMetrics.html b/pr/3217/docs/iroh/metrics/struct.RelayMetrics.html
index 83ae1acdcc..6f22d04f93 100644
--- a/pr/3217/docs/iroh/metrics/struct.RelayMetrics.html
+++ b/pr/3217/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/3217/docs/iroh/node_info/constant.IROH_TXT_NAME.html b/pr/3217/docs/iroh/node_info/constant.IROH_TXT_NAME.html
index c78d056a1f..0c1e657fb3 100644
--- a/pr/3217/docs/iroh/node_info/constant.IROH_TXT_NAME.html
+++ b/pr/3217/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/3217/docs/iroh/node_info/index.html b/pr/3217/docs/iroh/node_info/index.html
index 9884414f78..5130358fc8 100644
--- a/pr/3217/docs/iroh/node_info/index.html
+++ b/pr/3217/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/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html b/pr/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html
index 2f1c9b7234..33cd3a33fc 100644
--- a/pr/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html
+++ b/pr/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html
@@ -1,5 +1,5 @@
-MaxLengthExceededError in iroh::node_info - Rust
pub struct Connecting { /* private fields */ }Expand description
In-progress connection attempt future
-Implementations§
Source§impl Connecting
impl Connecting
Sourcepub fn into_0rtt(self) -> Result<(Connection, ZeroRttAccepted), Self>
pub fn into_0rtt(self) -> Result<(Connection, ZeroRttAccepted), Self>
Converts this Connecting into a 0-RTT or 0.5-RTT connection at the cost of weakened
+
pub struct Connecting { /* private fields */ }Expand description
In-progress connection attempt future
+Implementations§
Source§impl Connecting
impl Connecting
Sourcepub fn into_0rtt(self) -> Result<(Connection, ZeroRttAccepted), Self>
pub fn into_0rtt(self) -> Result<(Connection, ZeroRttAccepted), Self>
Converts this Connecting into a 0-RTT or 0.5-RTT connection at the cost of weakened
security.
Returns Ok immediately if the local endpoint is able to attempt sending 0/0.5-RTT data.
If so, the returned Connection can be used to send application data without waiting for
@@ -33,10 +33,10 @@ before TLS client authentication has occurred, and should therefore not be used
data for which client authentication is being used.
You can use RecvStream::is_0rtt to check whether a stream has been opened in 0-RTT
and thus whether parts of the stream are operating under this reduced security level.
Sourcepub async fn handshake_data(&mut self) -> Result<Box<dyn Any>, ConnectionError>
pub async fn handshake_data(&mut self) -> Result<Box<dyn Any>, ConnectionError>
Parameters negotiated during the handshake
-Trait Implementations§
Source§impl Debug for Connecting
impl Debug for Connecting
Source§impl Future for Connecting
impl Future for Connecting
Source§type Output = Result<Connection, ConnectionError>
type Output = Result<Connection, ConnectionError>
impl<'pin> Unpin for Connectingwhere
+Sourcepub async fn handshake_data(&mut self) -> Result<Box<dyn Any>, ConnectionError>
Parameters negotiated during the handshake
+
Sourcepub async fn handshake_data(&mut self) -> Result<Box<dyn Any>, ConnectionError>
pub async fn handshake_data(&mut self) -> Result<Box<dyn Any>, ConnectionError>
Parameters negotiated during the handshake
+Trait Implementations§
Source§impl Debug for Connecting
impl Debug for Connecting
Source§impl Future for Connecting
impl Future for Connecting
Source§type Output = Result<Connection, ConnectionError>
type Output = Result<Connection, ConnectionError>
impl<'pin> Unpin for Connectingwhere
PinnedFieldsOf<__Connecting<'pin>>: Unpin,
Auto Trait Implementations§
impl Freeze for Connecting
impl !RefUnwindSafe for Connecting
impl Send for Connecting
impl Sync for Connecting
impl !UnwindSafe for Connecting
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/3217/docs/iroh/endpoint/struct.Connection.html b/pr/3217/docs/iroh/endpoint/struct.Connection.html
index 8e81609487..928cdb9918 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Connection.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Connection.html
@@ -1,4 +1,4 @@
-Connection in iroh::endpoint - Rust pub struct Connection { /* private fields */ }
Expand description
A QUIC connection.
+Connection in iroh::endpoint - Rust pub struct Connection { /* private fields */ }
Expand description
A QUIC connection.
If all references to a connection (including every clone of the Connection handle,
streams of incoming streams, and the various stream types) have been dropped, then the
connection will be automatically closed with an error_code of 0 and an empty reason. You
@@ -8,29 +8,29 @@ receiving CONNECTION_CLOSE the peer may drop any stream data not yet delivered t
application. Connection::close describes in more detail how to gracefully close a
connection without losing application data.
May be cloned to obtain another handle to the same connection.
-Implementations§
Source§impl Connection
Implementations§
Source§impl Connection
Sourcepub fn open_uni(&self) -> OpenUni<'_> ⓘ
Initiates a new outgoing unidirectional stream.
Streams are cheap and instantaneous to open unless blocked by flow control. As a
consequence, the peer won’t be notified that a stream has been opened until the
stream is actually used.
-Sourcepub fn open_bi(&self) -> OpenBi<'_> ⓘ
Initiates a new outgoing bidirectional stream.
Streams are cheap and instantaneous to open unless blocked by flow control. As a
consequence, the peer won’t be notified that a stream has been opened until the
stream is actually used. Calling open_bi then waiting on the RecvStream
without writing anything to SendStream will never succeed.
-Sourcepub fn accept_uni(&self) -> AcceptUni<'_> ⓘ
Accepts the next incoming uni-directional stream.
-Sourcepub fn accept_uni(&self) -> AcceptUni<'_> ⓘ
Accepts the next incoming uni-directional stream.
+Sourcepub fn accept_bi(&self) -> AcceptBi<'_> ⓘ
Accept the next incoming bidirectional stream.
Important Note: The peer that calls open_bi must write to its SendStream
before the peer Connection is able to accept the stream using
accept_bi(). Calling open_bi then waiting on the RecvStream without
writing anything to the connected SendStream will never succeed.
-Sourcepub fn read_datagram(&self) -> ReadDatagram<'_> ⓘ
Receives an application datagram.
-Sourcepub async fn closed(&self) -> ConnectionError
Wait for the connection to be closed for any reason.
+Sourcepub fn read_datagram(&self) -> ReadDatagram<'_> ⓘ
Receives an application datagram.
+Sourcepub async fn closed(&self) -> ConnectionError
Wait for the connection to be closed for any reason.
Despite the return type’s name, closed connections are often not an error condition
at the application layer. Cases that might be routine include
ConnectionError::LocallyClosed and ConnectionError::ApplicationClosed.
-Sourcepub fn close_reason(&self) -> Option<ConnectionError>
If the connection is closed, the reason why.
+Sourcepub fn close_reason(&self) -> Option<ConnectionError>
If the connection is closed, the reason why.
Returns None if the connection is still open.
-Sourcepub fn close(&self, error_code: VarInt, reason: &[u8])
Closes the connection immediately.
Pending operations will fail immediately with ConnectionError::LocallyClosed. No
more data is sent to the peer and the peer may drop buffered data upon receiving the
CONNECTION_CLOSE frame.
@@ -51,41 +51,41 @@ endpoint. Once the local side sends a CONNECTION_CLOSE frame in response to call
close the remote endpoint may drop any data it received but is as yet
undelivered to the application, including data that was acknowledged as received to
the local endpoint.
-Sourcepub fn send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError>
Transmits data as an unreliable, unordered application datagram.
+Sourcepub fn send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError>
Transmits data as an unreliable, unordered application datagram.
Application datagrams are a low-level primitive. They may be lost or delivered out
of order, and data must both fit inside a single QUIC packet and be smaller than
the maximum dictated by the peer.
-Sourcepub fn max_datagram_size(&self) -> Option<usize>
Computes the maximum size of datagrams that may be passed to send_datagram.
+Sourcepub fn max_datagram_size(&self) -> Option<usize>
Computes the maximum size of datagrams that may be passed to send_datagram.
Returns None if datagrams are unsupported by the peer or disabled locally.
This may change over the lifetime of a connection according to variation in the path
MTU estimate. The peer can also enforce an arbitrarily small fixed limit, but if the
peer’s limit is large this is guaranteed to be a little over a kilobyte at minimum.
Not necessarily the maximum size of received datagrams.
-Sourcepub fn datagram_send_buffer_space(&self) -> usize
Bytes available in the outgoing datagram buffer.
+Sourcepub fn datagram_send_buffer_space(&self) -> usize
Bytes available in the outgoing datagram buffer.
When greater than zero, calling send_datagram with a
datagram of at most this size is guaranteed not to cause older datagrams to be
dropped.
-Sourcepub fn rtt(&self) -> Duration
Current best estimate of this connection’s latency (round-trip-time).
-Sourcepub fn stats(&self) -> ConnectionStats
Returns connection statistics.
-Sourcepub fn congestion_state(&self) -> Box<dyn Controller>
Current state of the congestion control algorithm, for debugging purposes.
-Sourcepub fn handshake_data(&self) -> Option<Box<dyn Any>>
Parameters negotiated during the handshake.
+Sourcepub fn rtt(&self) -> Duration
Current best estimate of this connection’s latency (round-trip-time).
+Sourcepub fn stats(&self) -> ConnectionStats
Returns connection statistics.
+Sourcepub fn congestion_state(&self) -> Box<dyn Controller>
Current state of the congestion control algorithm, for debugging purposes.
+Sourcepub fn handshake_data(&self) -> Option<Box<dyn Any>>
Parameters negotiated during the handshake.
Guaranteed to return Some on fully established connections or after
Connecting::handshake_data() succeeds. See that method’s documentations for
details on the returned value.
-Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
-Sourcepub fn peer_identity(&self) -> Option<Box<dyn Any>>
Cryptographic identity of the peer.
+Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
+Sourcepub fn peer_identity(&self) -> Option<Box<dyn Any>>
Sourcepub fn remote_node_id(&self) -> Result<NodeId>
Returns the NodeId from the peer’s TLS certificate.
+Sourcepub fn remote_node_id(&self) -> Result<NodeId>
Sourcepub fn stable_id(&self) -> usize
A stable identifier for this connection.
Peer addresses and connection IDs can change, but this value will remain fixed for
the lifetime of the connection.
-Sourcepub fn export_keying_material(
+
Sourcepub fn export_keying_material(
&self,
output: &mut [u8],
label: &[u8],
@@ -96,14 +96,14 @@ arguments and output buffers of equal length, they will get the
same sequence of bytes in output. These bytes are cryptographically
strong and pseudorandom, and are suitable for use as keying material.
See RFC5705 for more information.
-
Sourcepub fn set_max_concurrent_uni_streams(&self, count: VarInt)
Modifies the number of unidirectional streams that may be concurrently opened.
+Sourcepub fn set_max_concurrent_uni_streams(&self, count: VarInt)
Modifies the number of unidirectional streams that may be concurrently opened.
No streams may be opened by the peer unless fewer than count are already
open. Large counts increase both minimum and worst-case memory consumption.
-Sourcepub fn set_receive_window(&self, receive_window: VarInt)
Sourcepub fn set_max_concurrent_bi_streams(&self, count: VarInt)
Modifies the number of bidirectional streams that may be concurrently opened.
+Sourcepub fn set_receive_window(&self, receive_window: VarInt)
Sourcepub fn set_max_concurrent_bi_streams(&self, count: VarInt)
Modifies the number of bidirectional streams that may be concurrently opened.
No streams may be opened by the peer unless fewer than count are already
open. Large counts increase both minimum and worst-case memory consumption.
-Trait Implementations§
Source§impl Clone for Connection
Source§fn clone(&self) -> Connection
Returns a copy of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreAuto Trait Implementations§
§impl Freeze for Connection
§impl RefUnwindSafe for Connection
§impl Send for Connection
§impl Sync for Connection
§impl Unpin for Connection
§impl UnwindSafe for Connection
Blanket Implementations§
Trait Implementations§
Source§impl Clone for Connection
Source§fn clone(&self) -> Connection
Returns a copy of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreAuto Trait Implementations§
§impl Freeze for Connection
§impl RefUnwindSafe for Connection
§impl Send for Connection
§impl Sync for Connection
§impl Unpin for Connection
§impl UnwindSafe for Connection
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/3217/docs/iroh/endpoint/struct.DirectAddr.html b/pr/3217/docs/iroh/endpoint/struct.DirectAddr.html
index 61a667e47d..04760c9021 100644
--- a/pr/3217/docs/iroh/endpoint/struct.DirectAddr.html
+++ b/pr/3217/docs/iroh/endpoint/struct.DirectAddr.html
@@ -1,4 +1,4 @@
-DirectAddr in iroh::endpoint - Rust pub struct DirectAddr {
+DirectAddr in iroh::endpoint - Rust pub struct DirectAddr {
pub addr: SocketAddr,
pub typ: DirectAddrType,
}
Expand description
A direct address on which an iroh-node might be contactable.
@@ -7,16 +7,16 @@ contacted. These can come from various sources depending on the network topolog
iroh node, see DirectAddrType for the several kinds of sources.
Fields§
§addr: SocketAddrThe address.
§typ: DirectAddrTypeThe origin of this direct address.
-Trait Implementations§
Source§impl Clone for DirectAddr
Source§fn clone(&self) -> DirectAddr
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 DirectAddr
Source§impl Hash for DirectAddr
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
+Trait Implementations§
Source§impl Clone for DirectAddr
Source§fn clone(&self) -> DirectAddr
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 DirectAddr
Source§impl Hash for DirectAddr
Source§impl Ord for DirectAddr
Source§impl Ord for DirectAddr
Source§fn cmp(&self, other: &DirectAddr) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read moreSource§impl PartialEq for DirectAddr
Source§impl PartialOrd for DirectAddr
Source§impl PartialEq for DirectAddr
Source§impl PartialOrd for DirectAddr
Source§impl Eq for DirectAddr
Source§impl StructuralPartialEq for DirectAddr
Auto Trait Implementations§
§impl Freeze for DirectAddr
§impl RefUnwindSafe for DirectAddr
§impl Send for DirectAddr
§impl Sync for DirectAddr
§impl Unpin for DirectAddr
§impl UnwindSafe for DirectAddr
Blanket Implementations§
Source§impl Eq for DirectAddr
Source§impl StructuralPartialEq for DirectAddr
Auto Trait Implementations§
§impl Freeze for DirectAddr
§impl RefUnwindSafe for DirectAddr
§impl Send for DirectAddr
§impl Sync for DirectAddr
§impl Unpin for DirectAddr
§impl UnwindSafe for DirectAddr
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/3217/docs/iroh/endpoint/struct.Endpoint.html b/pr/3217/docs/iroh/endpoint/struct.Endpoint.html
index e25e697700..0b8c9af7b3 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Endpoint.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Endpoint.html
@@ -1,4 +1,4 @@
-Endpoint in iroh::endpoint - Rust pub struct Endpoint { /* private fields */ }
Expand description
Controls an iroh node, establishing connections with other nodes.
+Endpoint in iroh::endpoint - Rust pub struct Endpoint { /* private fields */ }
Expand description
Controls an iroh node, establishing connections with other nodes.
This is the main API interface to create connections to, and accept connections from
other iroh nodes. The connections are peer-to-peer and encrypted, a Relay server is
used to make the connections reliable. See the [crate docs] for a more detailed
@@ -16,17 +16,17 @@ the peer are created using the Connection::open_uni and Connection::open_bi functions.
Note that due to the light-weight properties of streams a stream will only be accepted
once the initiating peer has sent some data on it.
-Implementations§
Source§impl Endpoint
Sourcepub fn builder() -> Builder
Returns the builder for an Endpoint, with a production configuration.
-Sourcepub fn set_alpns(&self, alpns: Vec<Vec<u8>>) -> Result<()>
Sets the list of accepted ALPN protocols.
+Implementations§
Source§impl Endpoint
Sourcepub fn builder() -> Builder
Returns the builder for an Endpoint, with a production configuration.
+Sourcepub async fn connect(
&self,
node_addr: impl Into<NodeAddr>,
alpn: &[u8],
) -> Result<Connection>
Connects to a remote Endpoint.
A value that can be converted into a NodeAddr is required. This can be either a
-NodeAddr, a NodeId or a iroh_base::ticket::NodeTicket.
+NodeAddr, a NodeId or a [iroh_base::ticket::NodeTicket].
The NodeAddr must contain the NodeId to dial and may also contain a RelayUrl
and direct addresses. If direct addresses are provided, they will be used to try and
establish a direct connection without involving a relay server.
@@ -41,7 +41,7 @@ connection attempt will fail with an error.
The alpn, or application-level protocol identifier, is also required. The remote
endpoint must support this alpn, otherwise the connection attempt will fail with
an error.
-Sourcepub async fn connect_with_opts(
+
Sourcepub async fn connect_with_opts(
&self,
node_addr: impl Into<NodeAddr>,
alpn: &[u8],
@@ -61,13 +61,13 @@ security concerns.
establishing and maintaining direct connections. Carefully test settings you use and
consider this currently as still rather experimental.
-
Sourcepub fn accept(&self) -> Accept<'_> ⓘ
Accepts an incoming connection on the endpoint.
Only connections with the ALPNs configured in Builder::alpns will be accepted.
If multiple ALPNs have been configured the ALPN can be inspected before accepting
the connection using Connecting::alpn.
The returned future will yield None if the endpoint is closed by calling
Endpoint::close.
-Sourcepub fn add_node_addr(&self, node_addr: NodeAddr) -> Result<()>
Informs this Endpoint about addresses of the iroh node.
+Sourcepub fn add_node_addr(&self, node_addr: NodeAddr) -> Result<()>
Informs this Endpoint about addresses of the iroh node.
This updates the local state for the remote node. If the provided NodeAddr
contains a RelayUrl this will be used as the new relay server for this node. If
it contains any new IP endpoints they will also be stored and tried when next
@@ -80,7 +80,7 @@ This provides more flexibility and future proofing.
§Errors
Will return an error if we attempt to add our own NodeId to the node map or
if the direct addresses are a subset of ours.
-Sourcepub fn add_node_addr_with_source(
+
Sourcepub fn secret_key(&self) -> &SecretKey
Returns the secret_key of this endpoint.
-Sourcepub fn secret_key(&self) -> &SecretKey
Returns the secret_key of this endpoint.
+Sourcepub fn node_id(&self) -> NodeId
Returns the node id of this endpoint.
This ID is the unique addressing information of this node and other peers must know
it to be able to connect to this node.
-Sourcepub async fn node_addr(&self) -> Result<NodeAddr>
Returns the current NodeAddr for this endpoint.
+Sourcepub async fn node_addr(&self) -> Result<NodeAddr>
Returns the current NodeAddr for this endpoint.
The returned NodeAddr will have the current RelayUrl and direct addresses
as they would be returned by Endpoint::home_relay and
Endpoint::direct_addresses.
In browsers, because direct addresses are unavailable, this will only wait for
the home relay to be available before returning.
-Sourcepub fn home_relay(&self) -> Watcher<Option<RelayUrl>>
Sourcepub fn home_relay(&self) -> Watcher<Option<RelayUrl>>
Returns a Watcher for the RelayUrl of the Relay server used as home relay.
Every endpoint has a home Relay server which it chooses as the server with the
lowest latency out of the configured servers provided by Builder::relay_mode.
This is the server other iroh nodes can use to reliably establish a connection
@@ -122,7 +122,7 @@ some time to connect to find and connect to the home relay server.
let mep = Endpoint::builder().bind().await.unwrap();
let _relay_url = mep.home_relay().initialized().await.unwrap();
-Sourcepub fn direct_addresses(&self) -> Watcher<Option<BTreeSet<DirectAddr>>>
Sourcepub fn direct_addresses(&self) -> Watcher<Option<BTreeSet<DirectAddr>>>
Returns a Watcher for the direct addresses of this Endpoint.
The direct addresses of the Endpoint are those that could be used by other
iroh nodes to establish direct connectivity, depending on the network
situation. The yielded lists of direct addresses contain both the locally-bound
@@ -145,10 +145,10 @@ recently discovered direct addresses.
let mep = Endpoint::builder().bind().await.unwrap();
let _addrs = mep.direct_addresses().initialized().await.unwrap();
-Sourcepub fn bound_sockets(&self) -> (SocketAddr, Option<SocketAddr>)
Available on non-wasm_browser only.
Returns the local socket addresses on which the underlying sockets are bound.
+Sourcepub fn bound_sockets(&self) -> (SocketAddr, Option<SocketAddr>)
Available on non-wasm_browser only.
Returns the local socket addresses on which the underlying sockets are bound.
The Endpoint always binds on an IPv4 address and also tries to bind on an IPv6
address if available.
-Sourcepub fn remote_info(&self, node_id: NodeId) -> Option<RemoteInfo>
Returns information about the remote node identified by a NodeId.
+Sourcepub fn remote_info(&self, node_id: NodeId) -> Option<RemoteInfo>
Returns information about the remote node identified by a NodeId.
The Endpoint keeps some information about remote iroh nodes, which it uses to find
the best path to a node. Having information on a remote node, however, does not mean we have
ever connected to it to or even whether a connection is even possible. The information about a
@@ -157,14 +157,14 @@ calls may return different information. Furthermore, node information may even b
completely evicted as it becomes stale.
See also Endpoint::remote_info_iter which returns information on all nodes known
by this Endpoint.
-Sourcepub fn remote_info_iter(&self) -> impl Iterator<Item = RemoteInfo>
Returns information about all the remote nodes this Endpoint knows about.
+Sourcepub fn remote_info_iter(&self) -> impl Iterator<Item = RemoteInfo>
Returns information about all the remote nodes this Endpoint knows about.
This returns the same information as Endpoint::remote_info for each node known to this
Endpoint.
The Endpoint keeps some information about remote iroh nodes, which it uses to find
the best path to a node. This returns all the nodes it knows about, regardless of whether a
connection was ever made or is even possible.
See also Endpoint::remote_info to only retrieve information about a single node.
-Sourcepub fn discovery_stream(
+
Sourcepub fn discovery_stream(
&self,
) -> impl Stream<Item = Result<DiscoveryItem, Lagged>>
Returns a stream of all remote nodes discovered through the endpoint’s discovery services.
Whenever a node is discovered via the endpoint’s discovery service, the corresponding
@@ -183,7 +183,7 @@ at the time of adding it to the static provider.
Lagged may be yielded, indicating that items were missed.
See also Endpoint::remote_info_iter, which returns an iterator over all remotes
the endpoint knows about at a specific point in time.
-Sourcepub fn conn_type(&self, node_id: NodeId) -> Result<Watcher<ConnectionType>>
Returns a Watcher that reports the current connection type and any changes for
+
Sourcepub fn conn_type(&self, node_id: NodeId) -> Result<Watcher<ConnectionType>>
Returns a Watcher that reports the current connection type and any changes for
given remote node.
This watcher allows observing a stream of ConnectionType items by calling
Watcher::stream(). If the underlying connection to a remote node changes, it will
@@ -202,11 +202,11 @@ recently connected to this node id but previous methods of reaching the node hav
become inaccessible.
§Errors
Will error if we do not have any address information for the given node_id.
-Sourcepub fn dns_resolver(&self) -> &DnsResolver
Available on non-wasm_browser only.
Returns the DNS resolver used in this Endpoint.
+Sourcepub fn dns_resolver(&self) -> &DnsResolver
Available on non-wasm_browser only.
Returns the DNS resolver used in this Endpoint.
-Sourcepub fn discovery(&self) -> Option<&dyn Discovery>
Returns the discovery mechanism, if configured.
+Sourcepub fn discovery(&self) -> Option<&dyn Discovery>
Returns the discovery mechanism, if configured.
See Builder::discovery.
-Sourcepub async fn network_change(&self)
Notifies the system of potential network changes.
+Sourcepub async fn network_change(&self)
Notifies the system of potential network changes.
On many systems iroh is able to detect network changes by itself, however
some systems like android do not expose this functionality to native code.
Android does however provide this functionality to Java code. This
@@ -214,12 +214,12 @@ function allows for notifying iroh of any potential network changes like
this.
Even when the network did not change, or iroh was already able to detect
the network change itself, there is no harm in calling this function.
-Sourcepub fn set_user_data_for_discovery(&self, user_data: Option<UserData>)
Sets the initial user-defined data to be published in discovery services for this node.
+Sourcepub fn set_user_data_for_discovery(&self, user_data: Option<UserData>)
Sets the initial user-defined data to be published in discovery services for this node.
If the user-defined data passed to this function is different to the previous one,
the endpoint will republish its node info to the configured discovery services.
See also Builder::user_data_for_discovery for setting an initial value when
building the endpoint.
-Sourcepub async fn close(&self)
Closes the QUIC endpoint and the magic socket.
This will close any remaining open Connections with an error code
of 0 and an empty reason. Though it is best practice to close those
explicitly before with a custom error code and reason.
@@ -245,8 +245,8 @@ while TCP sockets usually get closed and drained by the operating system in the
kernel during the “Time-Wait” period of the TCP socket.
Be aware however that the underlying UDP sockets are only closed once all clones of
the the respective Endpoint are dropped.
-Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Endpoint
§impl !RefUnwindSafe for Endpoint
§impl Send for Endpoint
§impl Sync for Endpoint
§impl Unpin for Endpoint
§impl !UnwindSafe for Endpoint
Blanket Implementations§
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Endpoint
§impl !RefUnwindSafe for Endpoint
§impl Send for Endpoint
§impl Sync for Endpoint
§impl Unpin for Endpoint
§impl !UnwindSafe for Endpoint
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/3217/docs/iroh/endpoint/struct.Incoming.html b/pr/3217/docs/iroh/endpoint/struct.Incoming.html
index 61f28360fa..6b71064a82 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Incoming.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Incoming.html
@@ -1,29 +1,29 @@
-Incoming in iroh::endpoint - Rust pub struct Incoming { /* private fields */ }
Expand description
An incoming connection for which the server has not yet begun its parts of the
+
Incoming in iroh::endpoint - Rust pub struct Incoming { /* private fields */ }
Expand description
An incoming connection for which the server has not yet begun its parts of the
handshake.
-Implementations§
Source§impl Incoming
Sourcepub fn accept(self) -> Result<Connecting, ConnectionError>
Attempts to accept this incoming connection (an error may still occur).
+Implementations§
Source§impl Incoming
Sourcepub fn accept(self) -> Result<Connecting, ConnectionError>
Attempts to accept this incoming connection (an error may still occur).
Errors occurring here are likely not caused by the application or remote. The QUIC
connection listens on a normal UDP socket and any reachable network endpoint can
send datagrams to it, solicited or not. Even if the first few bytes look like a
QUIC packet, it might not even be a QUIC packet that is being received.
Thus it is common to simply log the errors here and accept them as something which
can happen.
-Sourcepub fn accept_with(
+
Sourcepub fn accept_with(
self,
server_config: Arc<ServerConfig>,
) -> Result<Connecting, ConnectionError>
Accepts this incoming connection using a custom configuration.
See accept() for more details.
-Sourcepub fn retry(self) -> Result<(), RetryError>
Responds with a retry packet.
+Sourcepub fn retry(self) -> Result<(), RetryError>
Responds with a retry packet.
This requires the client to retry with address validation.
Errors if remote_address_validated() is true.
-Sourcepub fn ignore(self)
Ignores this incoming connection attempt, not sending any packet in response.
-Sourcepub fn local_ip(&self) -> Option<IpAddr>
Returns the local IP address which was used when the peer established the
+
Sourcepub fn ignore(self)
Ignores this incoming connection attempt, not sending any packet in response.
+Sourcepub fn local_ip(&self) -> Option<IpAddr>
Returns the local IP address which was used when the peer established the
connection.
-Sourcepub fn remote_address(&self) -> SocketAddr
Returns the peer’s UDP address.
-Sourcepub fn remote_address_validated(&self) -> bool
Whether the socket address that is initiating this connection has been validated.
+Sourcepub fn remote_address(&self) -> SocketAddr
Returns the peer’s UDP address.
+Sourcepub fn remote_address_validated(&self) -> bool
Whether the socket address that is initiating this connection has been validated.
This means that the sender of the initial packet has proved that they can receive
traffic sent to self.remote_address().
-Trait Implementations§
Source§impl IntoFuture for Incoming
Source§type Output = Result<Connection, ConnectionError>
The output that the future will produce on completion.Source§type IntoFuture = IncomingFuture
Which kind of future are we turning this into?Source§fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read moreAuto Trait Implementations§
§impl !Freeze for Incoming
§impl !RefUnwindSafe for Incoming
§impl Send for Incoming
§impl Sync for Incoming
§impl Unpin for Incoming
§impl !UnwindSafe for Incoming
Blanket Implementations§
Trait Implementations§
Source§impl IntoFuture for Incoming
Source§type Output = Result<Connection, ConnectionError>
The output that the future will produce on completion.Source§type IntoFuture = IncomingFuture
Which kind of future are we turning this into?Source§fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read moreAuto Trait Implementations§
§impl !Freeze for Incoming
§impl !RefUnwindSafe for Incoming
§impl Send for Incoming
§impl Sync for Incoming
§impl Unpin for Incoming
§impl !UnwindSafe for Incoming
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/3217/docs/iroh/endpoint/struct.IncomingFuture.html b/pr/3217/docs/iroh/endpoint/struct.IncomingFuture.html
index 504c012c78..3934a53120 100644
--- a/pr/3217/docs/iroh/endpoint/struct.IncomingFuture.html
+++ b/pr/3217/docs/iroh/endpoint/struct.IncomingFuture.html
@@ -1,6 +1,6 @@
-IncomingFuture in iroh::endpoint - Rust pub struct IncomingFuture { /* private fields */ }
Expand description
Adaptor to let Incoming be awaited like a Connecting.
-Trait Implementations§
Source§impl Debug for IncomingFuture
Source§impl Future for IncomingFuture
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for IncomingFuturewhere
+IncomingFuture in iroh::endpoint - Rust pub struct IncomingFuture { /* private fields */ }
Expand description
Adaptor to let Incoming be awaited like a Connecting.
+Trait Implementations§
Source§impl Debug for IncomingFuture
Source§impl Future for IncomingFuture
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for IncomingFuturewhere
PinnedFieldsOf<__IncomingFuture<'pin>>: Unpin,
Auto Trait Implementations§
§impl !Freeze for IncomingFuture
§impl !RefUnwindSafe for IncomingFuture
§impl Send for IncomingFuture
§impl Sync for IncomingFuture
§impl !UnwindSafe for IncomingFuture
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html b/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html
index 792290d8f5..d03f08d892 100644
--- a/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html
+++ b/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html
@@ -1,7 +1,7 @@
-ZeroRttAccepted in iroh::endpoint - Rust pub struct ZeroRttAccepted { /* private fields */ }
Expand description
Future that completes when a connection is fully established.
+ZeroRttAccepted in iroh::endpoint - Rust pub struct ZeroRttAccepted { /* private fields */ }
Expand description
Future that completes when a connection is fully established.
For clients, the resulting value indicates if 0-RTT was accepted. For servers, the resulting
value is meaningless.
-Trait Implementations§
Source§impl Debug for ZeroRttAccepted
Source§impl Future for ZeroRttAccepted
Source§fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>
Attempts to resolve the future to a final value, registering
+Trait Implementations§
Source§impl Debug for ZeroRttAccepted
Source§impl Future for ZeroRttAccepted
Auto Trait Implementations§
§impl Freeze for ZeroRttAccepted
§impl !RefUnwindSafe for ZeroRttAccepted
§impl Send for ZeroRttAccepted
§impl Sync for ZeroRttAccepted
§impl Unpin for ZeroRttAccepted
§impl !UnwindSafe for ZeroRttAccepted
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/enum.KeyParsingError.html b/pr/3217/docs/iroh/enum.KeyParsingError.html
index 55941cda04..c7925e588b 100644
--- a/pr/3217/docs/iroh/enum.KeyParsingError.html
+++ b/pr/3217/docs/iroh/enum.KeyParsingError.html
@@ -1,4 +1,4 @@
-KeyParsingError in iroh - Rust pub enum KeyParsingError {
+KeyParsingError in iroh - Rust Enum KeyParsingError
pub enum KeyParsingError {
Decode(DecodeError),
Key(Error),
DecodeInvalidLength,
@@ -6,7 +6,7 @@
Variants§
§Decode(DecodeError)
Error when decoding.
§Key(Error)
Error when decoding the public key.
§DecodeInvalidLength
The encoded information had the wrong length.
-Trait Implementations§
Source§impl Debug for KeyParsingError
Source§impl Display for KeyParsingError
Source§impl Error for KeyParsingError
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()Source§impl From<DecodeError> for KeyParsingError
Source§fn from(source: DecodeError) -> KeyParsingError
Converts to this type from the input type.Source§impl From<Error> for KeyParsingError
Source§fn from(source: Error) -> KeyParsingError
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for KeyParsingError
§impl !RefUnwindSafe for KeyParsingError
§impl Send for KeyParsingError
§impl Sync for KeyParsingError
§impl Unpin for KeyParsingError
§impl !UnwindSafe for KeyParsingError
Blanket Implementations§
Trait Implementations§
§impl Debug for KeyParsingError
§impl Display for KeyParsingError
§impl Error for KeyParsingError
§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()§impl From<DecodeError> for KeyParsingError
§fn from(source: DecodeError) -> KeyParsingError
Converts to this type from the input type.§impl From<Error> for KeyParsingError
§fn from(source: Error) -> KeyParsingError
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for KeyParsingError
§impl !RefUnwindSafe for KeyParsingError
§impl Send for KeyParsingError
§impl Sync for KeyParsingError
§impl Unpin for KeyParsingError
§impl !UnwindSafe for KeyParsingError
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/3217/docs/iroh/metrics/struct.RelayMetrics.html b/pr/3217/docs/iroh/metrics/struct.RelayMetrics.html
index 83ae1acdcc..6f22d04f93 100644
--- a/pr/3217/docs/iroh/metrics/struct.RelayMetrics.html
+++ b/pr/3217/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/3217/docs/iroh/node_info/constant.IROH_TXT_NAME.html b/pr/3217/docs/iroh/node_info/constant.IROH_TXT_NAME.html
index c78d056a1f..0c1e657fb3 100644
--- a/pr/3217/docs/iroh/node_info/constant.IROH_TXT_NAME.html
+++ b/pr/3217/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/3217/docs/iroh/node_info/index.html b/pr/3217/docs/iroh/node_info/index.html
index 9884414f78..5130358fc8 100644
--- a/pr/3217/docs/iroh/node_info/index.html
+++ b/pr/3217/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/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html b/pr/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html
index 2f1c9b7234..33cd3a33fc 100644
--- a/pr/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html
+++ b/pr/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html
@@ -1,5 +1,5 @@
-MaxLengthExceededError in iroh::node_info - Rust
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/endpoint/struct.Connection.html b/pr/3217/docs/iroh/endpoint/struct.Connection.html
index 8e81609487..928cdb9918 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Connection.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Connection.html
@@ -1,4 +1,4 @@
-Connection in iroh::endpoint - Rust pub struct Connection { /* private fields */ }
Expand description
A QUIC connection.
+Connection in iroh::endpoint - Rust pub struct Connection { /* private fields */ }
Expand description
A QUIC connection.
If all references to a connection (including every clone of the Connection handle,
streams of incoming streams, and the various stream types) have been dropped, then the
connection will be automatically closed with an error_code of 0 and an empty reason. You
@@ -8,29 +8,29 @@ receiving CONNECTION_CLOSE the peer may drop any stream data not yet delivered t
application. Connection::close describes in more detail how to gracefully close a
connection without losing application data.
May be cloned to obtain another handle to the same connection.
-Implementations§
Source§impl Connection
Implementations§
Source§impl Connection
Sourcepub fn open_uni(&self) -> OpenUni<'_> ⓘ
Initiates a new outgoing unidirectional stream.
Streams are cheap and instantaneous to open unless blocked by flow control. As a
consequence, the peer won’t be notified that a stream has been opened until the
stream is actually used.
-Sourcepub fn open_bi(&self) -> OpenBi<'_> ⓘ
Initiates a new outgoing bidirectional stream.
Streams are cheap and instantaneous to open unless blocked by flow control. As a
consequence, the peer won’t be notified that a stream has been opened until the
stream is actually used. Calling open_bi then waiting on the RecvStream
without writing anything to SendStream will never succeed.
-Sourcepub fn accept_uni(&self) -> AcceptUni<'_> ⓘ
Accepts the next incoming uni-directional stream.
-Sourcepub fn accept_uni(&self) -> AcceptUni<'_> ⓘ
Accepts the next incoming uni-directional stream.
+Sourcepub fn accept_bi(&self) -> AcceptBi<'_> ⓘ
Accept the next incoming bidirectional stream.
Important Note: The peer that calls open_bi must write to its SendStream
before the peer Connection is able to accept the stream using
accept_bi(). Calling open_bi then waiting on the RecvStream without
writing anything to the connected SendStream will never succeed.
-Sourcepub fn read_datagram(&self) -> ReadDatagram<'_> ⓘ
Receives an application datagram.
-Sourcepub async fn closed(&self) -> ConnectionError
Wait for the connection to be closed for any reason.
+Sourcepub fn read_datagram(&self) -> ReadDatagram<'_> ⓘ
Receives an application datagram.
+Sourcepub async fn closed(&self) -> ConnectionError
Wait for the connection to be closed for any reason.
Despite the return type’s name, closed connections are often not an error condition
at the application layer. Cases that might be routine include
ConnectionError::LocallyClosed and ConnectionError::ApplicationClosed.
-Sourcepub fn close_reason(&self) -> Option<ConnectionError>
If the connection is closed, the reason why.
+Sourcepub fn close_reason(&self) -> Option<ConnectionError>
If the connection is closed, the reason why.
Returns None if the connection is still open.
-Sourcepub fn close(&self, error_code: VarInt, reason: &[u8])
Closes the connection immediately.
Pending operations will fail immediately with ConnectionError::LocallyClosed. No
more data is sent to the peer and the peer may drop buffered data upon receiving the
CONNECTION_CLOSE frame.
@@ -51,41 +51,41 @@ endpoint. Once the local side sends a CONNECTION_CLOSE frame in response to call
close the remote endpoint may drop any data it received but is as yet
undelivered to the application, including data that was acknowledged as received to
the local endpoint.
-Sourcepub fn send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError>
Transmits data as an unreliable, unordered application datagram.
+Sourcepub fn send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError>
Transmits data as an unreliable, unordered application datagram.
Application datagrams are a low-level primitive. They may be lost or delivered out
of order, and data must both fit inside a single QUIC packet and be smaller than
the maximum dictated by the peer.
-Sourcepub fn max_datagram_size(&self) -> Option<usize>
Computes the maximum size of datagrams that may be passed to send_datagram.
+Sourcepub fn max_datagram_size(&self) -> Option<usize>
Computes the maximum size of datagrams that may be passed to send_datagram.
Returns None if datagrams are unsupported by the peer or disabled locally.
This may change over the lifetime of a connection according to variation in the path
MTU estimate. The peer can also enforce an arbitrarily small fixed limit, but if the
peer’s limit is large this is guaranteed to be a little over a kilobyte at minimum.
Not necessarily the maximum size of received datagrams.
-Sourcepub fn datagram_send_buffer_space(&self) -> usize
Bytes available in the outgoing datagram buffer.
+Sourcepub fn datagram_send_buffer_space(&self) -> usize
Bytes available in the outgoing datagram buffer.
When greater than zero, calling send_datagram with a
datagram of at most this size is guaranteed not to cause older datagrams to be
dropped.
-Sourcepub fn rtt(&self) -> Duration
Current best estimate of this connection’s latency (round-trip-time).
-Sourcepub fn stats(&self) -> ConnectionStats
Returns connection statistics.
-Sourcepub fn congestion_state(&self) -> Box<dyn Controller>
Current state of the congestion control algorithm, for debugging purposes.
-Sourcepub fn handshake_data(&self) -> Option<Box<dyn Any>>
Parameters negotiated during the handshake.
+Sourcepub fn rtt(&self) -> Duration
Current best estimate of this connection’s latency (round-trip-time).
+Sourcepub fn stats(&self) -> ConnectionStats
Returns connection statistics.
+Sourcepub fn congestion_state(&self) -> Box<dyn Controller>
Current state of the congestion control algorithm, for debugging purposes.
+Sourcepub fn handshake_data(&self) -> Option<Box<dyn Any>>
Parameters negotiated during the handshake.
Guaranteed to return Some on fully established connections or after
Connecting::handshake_data() succeeds. See that method’s documentations for
details on the returned value.
-Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
-Sourcepub fn peer_identity(&self) -> Option<Box<dyn Any>>
Cryptographic identity of the peer.
+Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
+Sourcepub fn peer_identity(&self) -> Option<Box<dyn Any>>
Sourcepub fn remote_node_id(&self) -> Result<NodeId>
Returns the NodeId from the peer’s TLS certificate.
+Sourcepub fn remote_node_id(&self) -> Result<NodeId>
Sourcepub fn stable_id(&self) -> usize
A stable identifier for this connection.
Peer addresses and connection IDs can change, but this value will remain fixed for
the lifetime of the connection.
-Sourcepub fn export_keying_material(
+
Sourcepub fn export_keying_material(
&self,
output: &mut [u8],
label: &[u8],
@@ -96,14 +96,14 @@ arguments and output buffers of equal length, they will get the
same sequence of bytes in output. These bytes are cryptographically
strong and pseudorandom, and are suitable for use as keying material.
See RFC5705 for more information.
-
Sourcepub fn set_max_concurrent_uni_streams(&self, count: VarInt)
Modifies the number of unidirectional streams that may be concurrently opened.
+Sourcepub fn set_max_concurrent_uni_streams(&self, count: VarInt)
Modifies the number of unidirectional streams that may be concurrently opened.
No streams may be opened by the peer unless fewer than count are already
open. Large counts increase both minimum and worst-case memory consumption.
-Sourcepub fn set_receive_window(&self, receive_window: VarInt)
Sourcepub fn set_max_concurrent_bi_streams(&self, count: VarInt)
Modifies the number of bidirectional streams that may be concurrently opened.
+Sourcepub fn set_receive_window(&self, receive_window: VarInt)
Sourcepub fn set_max_concurrent_bi_streams(&self, count: VarInt)
Modifies the number of bidirectional streams that may be concurrently opened.
No streams may be opened by the peer unless fewer than count are already
open. Large counts increase both minimum and worst-case memory consumption.
-Trait Implementations§
Source§impl Clone for Connection
Source§fn clone(&self) -> Connection
Returns a copy of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreAuto Trait Implementations§
§impl Freeze for Connection
§impl RefUnwindSafe for Connection
§impl Send for Connection
§impl Sync for Connection
§impl Unpin for Connection
§impl UnwindSafe for Connection
Blanket Implementations§
Trait Implementations§
Source§impl Clone for Connection
Source§fn clone(&self) -> Connection
Returns a copy of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreAuto Trait Implementations§
§impl Freeze for Connection
§impl RefUnwindSafe for Connection
§impl Send for Connection
§impl Sync for Connection
§impl Unpin for Connection
§impl UnwindSafe for Connection
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/3217/docs/iroh/endpoint/struct.DirectAddr.html b/pr/3217/docs/iroh/endpoint/struct.DirectAddr.html
index 61a667e47d..04760c9021 100644
--- a/pr/3217/docs/iroh/endpoint/struct.DirectAddr.html
+++ b/pr/3217/docs/iroh/endpoint/struct.DirectAddr.html
@@ -1,4 +1,4 @@
-DirectAddr in iroh::endpoint - Rust pub struct DirectAddr {
+DirectAddr in iroh::endpoint - Rust pub struct DirectAddr {
pub addr: SocketAddr,
pub typ: DirectAddrType,
}
Expand description
A direct address on which an iroh-node might be contactable.
@@ -7,16 +7,16 @@ contacted. These can come from various sources depending on the network topolog
iroh node, see DirectAddrType for the several kinds of sources.
Fields§
§addr: SocketAddrThe address.
§typ: DirectAddrTypeThe origin of this direct address.
-Trait Implementations§
Source§impl Clone for DirectAddr
Source§fn clone(&self) -> DirectAddr
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 DirectAddr
Source§impl Hash for DirectAddr
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
+Trait Implementations§
Source§impl Clone for DirectAddr
Source§fn clone(&self) -> DirectAddr
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 DirectAddr
Source§impl Hash for DirectAddr
Source§impl Ord for DirectAddr
Source§impl Ord for DirectAddr
Source§fn cmp(&self, other: &DirectAddr) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read moreSource§impl PartialEq for DirectAddr
Source§impl PartialOrd for DirectAddr
Source§impl PartialEq for DirectAddr
Source§impl PartialOrd for DirectAddr
Source§impl Eq for DirectAddr
Source§impl StructuralPartialEq for DirectAddr
Auto Trait Implementations§
§impl Freeze for DirectAddr
§impl RefUnwindSafe for DirectAddr
§impl Send for DirectAddr
§impl Sync for DirectAddr
§impl Unpin for DirectAddr
§impl UnwindSafe for DirectAddr
Blanket Implementations§
Source§impl Eq for DirectAddr
Source§impl StructuralPartialEq for DirectAddr
Auto Trait Implementations§
§impl Freeze for DirectAddr
§impl RefUnwindSafe for DirectAddr
§impl Send for DirectAddr
§impl Sync for DirectAddr
§impl Unpin for DirectAddr
§impl UnwindSafe for DirectAddr
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/3217/docs/iroh/endpoint/struct.Endpoint.html b/pr/3217/docs/iroh/endpoint/struct.Endpoint.html
index e25e697700..0b8c9af7b3 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Endpoint.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Endpoint.html
@@ -1,4 +1,4 @@
-Endpoint in iroh::endpoint - Rust pub struct Endpoint { /* private fields */ }
Expand description
Controls an iroh node, establishing connections with other nodes.
+Endpoint in iroh::endpoint - Rust pub struct Endpoint { /* private fields */ }
Expand description
Controls an iroh node, establishing connections with other nodes.
This is the main API interface to create connections to, and accept connections from
other iroh nodes. The connections are peer-to-peer and encrypted, a Relay server is
used to make the connections reliable. See the [crate docs] for a more detailed
@@ -16,17 +16,17 @@ the peer are created using the Connection::open_uni and Connection::open_bi functions.
Note that due to the light-weight properties of streams a stream will only be accepted
once the initiating peer has sent some data on it.
-Implementations§
Source§impl Endpoint
Sourcepub fn builder() -> Builder
Returns the builder for an Endpoint, with a production configuration.
-Sourcepub fn set_alpns(&self, alpns: Vec<Vec<u8>>) -> Result<()>
Sets the list of accepted ALPN protocols.
+Implementations§
Source§impl Endpoint
Sourcepub fn builder() -> Builder
Returns the builder for an Endpoint, with a production configuration.
+Sourcepub async fn connect(
&self,
node_addr: impl Into<NodeAddr>,
alpn: &[u8],
) -> Result<Connection>
Connects to a remote Endpoint.
A value that can be converted into a NodeAddr is required. This can be either a
-NodeAddr, a NodeId or a iroh_base::ticket::NodeTicket.
+NodeAddr, a NodeId or a [iroh_base::ticket::NodeTicket].
The NodeAddr must contain the NodeId to dial and may also contain a RelayUrl
and direct addresses. If direct addresses are provided, they will be used to try and
establish a direct connection without involving a relay server.
@@ -41,7 +41,7 @@ connection attempt will fail with an error.
The alpn, or application-level protocol identifier, is also required. The remote
endpoint must support this alpn, otherwise the connection attempt will fail with
an error.
-Sourcepub async fn connect_with_opts(
+
Sourcepub async fn connect_with_opts(
&self,
node_addr: impl Into<NodeAddr>,
alpn: &[u8],
@@ -61,13 +61,13 @@ security concerns.
establishing and maintaining direct connections. Carefully test settings you use and
consider this currently as still rather experimental.
-
Sourcepub fn accept(&self) -> Accept<'_> ⓘ
Accepts an incoming connection on the endpoint.
Only connections with the ALPNs configured in Builder::alpns will be accepted.
If multiple ALPNs have been configured the ALPN can be inspected before accepting
the connection using Connecting::alpn.
The returned future will yield None if the endpoint is closed by calling
Endpoint::close.
-Sourcepub fn add_node_addr(&self, node_addr: NodeAddr) -> Result<()>
Informs this Endpoint about addresses of the iroh node.
+Sourcepub fn add_node_addr(&self, node_addr: NodeAddr) -> Result<()>
Informs this Endpoint about addresses of the iroh node.
This updates the local state for the remote node. If the provided NodeAddr
contains a RelayUrl this will be used as the new relay server for this node. If
it contains any new IP endpoints they will also be stored and tried when next
@@ -80,7 +80,7 @@ This provides more flexibility and future proofing.
§Errors
Will return an error if we attempt to add our own NodeId to the node map or
if the direct addresses are a subset of ours.
-Sourcepub fn add_node_addr_with_source(
+
Sourcepub fn secret_key(&self) -> &SecretKey
Returns the secret_key of this endpoint.
-Sourcepub fn secret_key(&self) -> &SecretKey
Returns the secret_key of this endpoint.
+Sourcepub fn node_id(&self) -> NodeId
Returns the node id of this endpoint.
This ID is the unique addressing information of this node and other peers must know
it to be able to connect to this node.
-Sourcepub async fn node_addr(&self) -> Result<NodeAddr>
Returns the current NodeAddr for this endpoint.
+Sourcepub async fn node_addr(&self) -> Result<NodeAddr>
Returns the current NodeAddr for this endpoint.
The returned NodeAddr will have the current RelayUrl and direct addresses
as they would be returned by Endpoint::home_relay and
Endpoint::direct_addresses.
In browsers, because direct addresses are unavailable, this will only wait for
the home relay to be available before returning.
-Sourcepub fn home_relay(&self) -> Watcher<Option<RelayUrl>>
Sourcepub fn home_relay(&self) -> Watcher<Option<RelayUrl>>
Returns a Watcher for the RelayUrl of the Relay server used as home relay.
Every endpoint has a home Relay server which it chooses as the server with the
lowest latency out of the configured servers provided by Builder::relay_mode.
This is the server other iroh nodes can use to reliably establish a connection
@@ -122,7 +122,7 @@ some time to connect to find and connect to the home relay server.
let mep = Endpoint::builder().bind().await.unwrap();
let _relay_url = mep.home_relay().initialized().await.unwrap();
-Sourcepub fn direct_addresses(&self) -> Watcher<Option<BTreeSet<DirectAddr>>>
Sourcepub fn direct_addresses(&self) -> Watcher<Option<BTreeSet<DirectAddr>>>
Returns a Watcher for the direct addresses of this Endpoint.
The direct addresses of the Endpoint are those that could be used by other
iroh nodes to establish direct connectivity, depending on the network
situation. The yielded lists of direct addresses contain both the locally-bound
@@ -145,10 +145,10 @@ recently discovered direct addresses.
let mep = Endpoint::builder().bind().await.unwrap();
let _addrs = mep.direct_addresses().initialized().await.unwrap();
-Sourcepub fn bound_sockets(&self) -> (SocketAddr, Option<SocketAddr>)
Available on non-wasm_browser only.
Returns the local socket addresses on which the underlying sockets are bound.
+Sourcepub fn bound_sockets(&self) -> (SocketAddr, Option<SocketAddr>)
Available on non-wasm_browser only.
Returns the local socket addresses on which the underlying sockets are bound.
The Endpoint always binds on an IPv4 address and also tries to bind on an IPv6
address if available.
-Sourcepub fn remote_info(&self, node_id: NodeId) -> Option<RemoteInfo>
Returns information about the remote node identified by a NodeId.
+Sourcepub fn remote_info(&self, node_id: NodeId) -> Option<RemoteInfo>
Returns information about the remote node identified by a NodeId.
The Endpoint keeps some information about remote iroh nodes, which it uses to find
the best path to a node. Having information on a remote node, however, does not mean we have
ever connected to it to or even whether a connection is even possible. The information about a
@@ -157,14 +157,14 @@ calls may return different information. Furthermore, node information may even b
completely evicted as it becomes stale.
See also Endpoint::remote_info_iter which returns information on all nodes known
by this Endpoint.
-Sourcepub fn remote_info_iter(&self) -> impl Iterator<Item = RemoteInfo>
Returns information about all the remote nodes this Endpoint knows about.
+Sourcepub fn remote_info_iter(&self) -> impl Iterator<Item = RemoteInfo>
Returns information about all the remote nodes this Endpoint knows about.
This returns the same information as Endpoint::remote_info for each node known to this
Endpoint.
The Endpoint keeps some information about remote iroh nodes, which it uses to find
the best path to a node. This returns all the nodes it knows about, regardless of whether a
connection was ever made or is even possible.
See also Endpoint::remote_info to only retrieve information about a single node.
-Sourcepub fn discovery_stream(
+
Sourcepub fn discovery_stream(
&self,
) -> impl Stream<Item = Result<DiscoveryItem, Lagged>>
Returns a stream of all remote nodes discovered through the endpoint’s discovery services.
Whenever a node is discovered via the endpoint’s discovery service, the corresponding
@@ -183,7 +183,7 @@ at the time of adding it to the static provider.
Lagged may be yielded, indicating that items were missed.
See also Endpoint::remote_info_iter, which returns an iterator over all remotes
the endpoint knows about at a specific point in time.
-Sourcepub fn conn_type(&self, node_id: NodeId) -> Result<Watcher<ConnectionType>>
Returns a Watcher that reports the current connection type and any changes for
+
Sourcepub fn conn_type(&self, node_id: NodeId) -> Result<Watcher<ConnectionType>>
Returns a Watcher that reports the current connection type and any changes for
given remote node.
This watcher allows observing a stream of ConnectionType items by calling
Watcher::stream(). If the underlying connection to a remote node changes, it will
@@ -202,11 +202,11 @@ recently connected to this node id but previous methods of reaching the node hav
become inaccessible.
§Errors
Will error if we do not have any address information for the given node_id.
-Sourcepub fn dns_resolver(&self) -> &DnsResolver
Available on non-wasm_browser only.
Returns the DNS resolver used in this Endpoint.
+Sourcepub fn dns_resolver(&self) -> &DnsResolver
Available on non-wasm_browser only.
Returns the DNS resolver used in this Endpoint.
-Sourcepub fn discovery(&self) -> Option<&dyn Discovery>
Returns the discovery mechanism, if configured.
+Sourcepub fn discovery(&self) -> Option<&dyn Discovery>
Returns the discovery mechanism, if configured.
See Builder::discovery.
-Sourcepub async fn network_change(&self)
Notifies the system of potential network changes.
+Sourcepub async fn network_change(&self)
Notifies the system of potential network changes.
On many systems iroh is able to detect network changes by itself, however
some systems like android do not expose this functionality to native code.
Android does however provide this functionality to Java code. This
@@ -214,12 +214,12 @@ function allows for notifying iroh of any potential network changes like
this.
Even when the network did not change, or iroh was already able to detect
the network change itself, there is no harm in calling this function.
-Sourcepub fn set_user_data_for_discovery(&self, user_data: Option<UserData>)
Sets the initial user-defined data to be published in discovery services for this node.
+Sourcepub fn set_user_data_for_discovery(&self, user_data: Option<UserData>)
Sets the initial user-defined data to be published in discovery services for this node.
If the user-defined data passed to this function is different to the previous one,
the endpoint will republish its node info to the configured discovery services.
See also Builder::user_data_for_discovery for setting an initial value when
building the endpoint.
-Sourcepub async fn close(&self)
Closes the QUIC endpoint and the magic socket.
This will close any remaining open Connections with an error code
of 0 and an empty reason. Though it is best practice to close those
explicitly before with a custom error code and reason.
@@ -245,8 +245,8 @@ while TCP sockets usually get closed and drained by the operating system in the
kernel during the “Time-Wait” period of the TCP socket.
Be aware however that the underlying UDP sockets are only closed once all clones of
the the respective Endpoint are dropped.
-Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Endpoint
§impl !RefUnwindSafe for Endpoint
§impl Send for Endpoint
§impl Sync for Endpoint
§impl Unpin for Endpoint
§impl !UnwindSafe for Endpoint
Blanket Implementations§
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Endpoint
§impl !RefUnwindSafe for Endpoint
§impl Send for Endpoint
§impl Sync for Endpoint
§impl Unpin for Endpoint
§impl !UnwindSafe for Endpoint
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/3217/docs/iroh/endpoint/struct.Incoming.html b/pr/3217/docs/iroh/endpoint/struct.Incoming.html
index 61f28360fa..6b71064a82 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Incoming.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Incoming.html
@@ -1,29 +1,29 @@
-Incoming in iroh::endpoint - Rust pub struct Incoming { /* private fields */ }
Expand description
An incoming connection for which the server has not yet begun its parts of the
+
Incoming in iroh::endpoint - Rust pub struct Incoming { /* private fields */ }
Expand description
An incoming connection for which the server has not yet begun its parts of the
handshake.
-Implementations§
Source§impl Incoming
Sourcepub fn accept(self) -> Result<Connecting, ConnectionError>
Attempts to accept this incoming connection (an error may still occur).
+Implementations§
Source§impl Incoming
Sourcepub fn accept(self) -> Result<Connecting, ConnectionError>
Attempts to accept this incoming connection (an error may still occur).
Errors occurring here are likely not caused by the application or remote. The QUIC
connection listens on a normal UDP socket and any reachable network endpoint can
send datagrams to it, solicited or not. Even if the first few bytes look like a
QUIC packet, it might not even be a QUIC packet that is being received.
Thus it is common to simply log the errors here and accept them as something which
can happen.
-Sourcepub fn accept_with(
+
Sourcepub fn accept_with(
self,
server_config: Arc<ServerConfig>,
) -> Result<Connecting, ConnectionError>
Accepts this incoming connection using a custom configuration.
See accept() for more details.
-Sourcepub fn retry(self) -> Result<(), RetryError>
Responds with a retry packet.
+Sourcepub fn retry(self) -> Result<(), RetryError>
Responds with a retry packet.
This requires the client to retry with address validation.
Errors if remote_address_validated() is true.
-Sourcepub fn ignore(self)
Ignores this incoming connection attempt, not sending any packet in response.
-Sourcepub fn local_ip(&self) -> Option<IpAddr>
Returns the local IP address which was used when the peer established the
+
Sourcepub fn ignore(self)
Ignores this incoming connection attempt, not sending any packet in response.
+Sourcepub fn local_ip(&self) -> Option<IpAddr>
Returns the local IP address which was used when the peer established the
connection.
-Sourcepub fn remote_address(&self) -> SocketAddr
Returns the peer’s UDP address.
-Sourcepub fn remote_address_validated(&self) -> bool
Whether the socket address that is initiating this connection has been validated.
+Sourcepub fn remote_address(&self) -> SocketAddr
Returns the peer’s UDP address.
+Sourcepub fn remote_address_validated(&self) -> bool
Whether the socket address that is initiating this connection has been validated.
This means that the sender of the initial packet has proved that they can receive
traffic sent to self.remote_address().
-Trait Implementations§
Source§impl IntoFuture for Incoming
Source§type Output = Result<Connection, ConnectionError>
The output that the future will produce on completion.Source§type IntoFuture = IncomingFuture
Which kind of future are we turning this into?Source§fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read moreAuto Trait Implementations§
§impl !Freeze for Incoming
§impl !RefUnwindSafe for Incoming
§impl Send for Incoming
§impl Sync for Incoming
§impl Unpin for Incoming
§impl !UnwindSafe for Incoming
Blanket Implementations§
Trait Implementations§
Source§impl IntoFuture for Incoming
Source§type Output = Result<Connection, ConnectionError>
The output that the future will produce on completion.Source§type IntoFuture = IncomingFuture
Which kind of future are we turning this into?Source§fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read moreAuto Trait Implementations§
§impl !Freeze for Incoming
§impl !RefUnwindSafe for Incoming
§impl Send for Incoming
§impl Sync for Incoming
§impl Unpin for Incoming
§impl !UnwindSafe for Incoming
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/3217/docs/iroh/endpoint/struct.IncomingFuture.html b/pr/3217/docs/iroh/endpoint/struct.IncomingFuture.html
index 504c012c78..3934a53120 100644
--- a/pr/3217/docs/iroh/endpoint/struct.IncomingFuture.html
+++ b/pr/3217/docs/iroh/endpoint/struct.IncomingFuture.html
@@ -1,6 +1,6 @@
-IncomingFuture in iroh::endpoint - Rust pub struct IncomingFuture { /* private fields */ }
Expand description
Adaptor to let Incoming be awaited like a Connecting.
-Trait Implementations§
Source§impl Debug for IncomingFuture
Source§impl Future for IncomingFuture
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for IncomingFuturewhere
+IncomingFuture in iroh::endpoint - Rust pub struct IncomingFuture { /* private fields */ }
Expand description
Adaptor to let Incoming be awaited like a Connecting.
+Trait Implementations§
Source§impl Debug for IncomingFuture
Source§impl Future for IncomingFuture
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for IncomingFuturewhere
PinnedFieldsOf<__IncomingFuture<'pin>>: Unpin,
Auto Trait Implementations§
§impl !Freeze for IncomingFuture
§impl !RefUnwindSafe for IncomingFuture
§impl Send for IncomingFuture
§impl Sync for IncomingFuture
§impl !UnwindSafe for IncomingFuture
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html b/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html
index 792290d8f5..d03f08d892 100644
--- a/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html
+++ b/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html
@@ -1,7 +1,7 @@
-ZeroRttAccepted in iroh::endpoint - Rust pub struct ZeroRttAccepted { /* private fields */ }
Expand description
Future that completes when a connection is fully established.
+ZeroRttAccepted in iroh::endpoint - Rust pub struct ZeroRttAccepted { /* private fields */ }
Expand description
Future that completes when a connection is fully established.
For clients, the resulting value indicates if 0-RTT was accepted. For servers, the resulting
value is meaningless.
-Trait Implementations§
Source§impl Debug for ZeroRttAccepted
Source§impl Future for ZeroRttAccepted
Source§fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>
Attempts to resolve the future to a final value, registering
+Trait Implementations§
Source§impl Debug for ZeroRttAccepted
Source§impl Future for ZeroRttAccepted
Auto Trait Implementations§
§impl Freeze for ZeroRttAccepted
§impl !RefUnwindSafe for ZeroRttAccepted
§impl Send for ZeroRttAccepted
§impl Sync for ZeroRttAccepted
§impl Unpin for ZeroRttAccepted
§impl !UnwindSafe for ZeroRttAccepted
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/enum.KeyParsingError.html b/pr/3217/docs/iroh/enum.KeyParsingError.html
index 55941cda04..c7925e588b 100644
--- a/pr/3217/docs/iroh/enum.KeyParsingError.html
+++ b/pr/3217/docs/iroh/enum.KeyParsingError.html
@@ -1,4 +1,4 @@
-KeyParsingError in iroh - Rust pub enum KeyParsingError {
+KeyParsingError in iroh - Rust Enum KeyParsingError
pub enum KeyParsingError {
Decode(DecodeError),
Key(Error),
DecodeInvalidLength,
@@ -6,7 +6,7 @@
Variants§
§Decode(DecodeError)
Error when decoding.
§Key(Error)
Error when decoding the public key.
§DecodeInvalidLength
The encoded information had the wrong length.
-Trait Implementations§
Source§impl Debug for KeyParsingError
Source§impl Display for KeyParsingError
Source§impl Error for KeyParsingError
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()Source§impl From<DecodeError> for KeyParsingError
Source§fn from(source: DecodeError) -> KeyParsingError
Converts to this type from the input type.Source§impl From<Error> for KeyParsingError
Source§fn from(source: Error) -> KeyParsingError
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for KeyParsingError
§impl !RefUnwindSafe for KeyParsingError
§impl Send for KeyParsingError
§impl Sync for KeyParsingError
§impl Unpin for KeyParsingError
§impl !UnwindSafe for KeyParsingError
Blanket Implementations§
Trait Implementations§
§impl Debug for KeyParsingError
§impl Display for KeyParsingError
§impl Error for KeyParsingError
§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()§impl From<DecodeError> for KeyParsingError
§fn from(source: DecodeError) -> KeyParsingError
Converts to this type from the input type.§impl From<Error> for KeyParsingError
§fn from(source: Error) -> KeyParsingError
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for KeyParsingError
§impl !RefUnwindSafe for KeyParsingError
§impl Send for KeyParsingError
§impl Sync for KeyParsingError
§impl Unpin for KeyParsingError
§impl !UnwindSafe for KeyParsingError
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/3217/docs/iroh/metrics/struct.RelayMetrics.html b/pr/3217/docs/iroh/metrics/struct.RelayMetrics.html
index 83ae1acdcc..6f22d04f93 100644
--- a/pr/3217/docs/iroh/metrics/struct.RelayMetrics.html
+++ b/pr/3217/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/3217/docs/iroh/node_info/constant.IROH_TXT_NAME.html b/pr/3217/docs/iroh/node_info/constant.IROH_TXT_NAME.html
index c78d056a1f..0c1e657fb3 100644
--- a/pr/3217/docs/iroh/node_info/constant.IROH_TXT_NAME.html
+++ b/pr/3217/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/3217/docs/iroh/node_info/index.html b/pr/3217/docs/iroh/node_info/index.html
index 9884414f78..5130358fc8 100644
--- a/pr/3217/docs/iroh/node_info/index.html
+++ b/pr/3217/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/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html b/pr/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html
index 2f1c9b7234..33cd3a33fc 100644
--- a/pr/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html
+++ b/pr/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html
@@ -1,5 +1,5 @@
-MaxLengthExceededError in iroh::node_info - Rust
pub struct Connection { /* private fields */ }Expand description
A QUIC connection.
+pub struct Connection { /* private fields */ }Expand description
A QUIC connection.
If all references to a connection (including every clone of the Connection handle,
streams of incoming streams, and the various stream types) have been dropped, then the
connection will be automatically closed with an error_code of 0 and an empty reason. You
@@ -8,29 +8,29 @@ receiving CONNECTION_CLOSE the peer may drop any stream data not yet delivered t
application. Connection::close describes in more detail how to gracefully close a
connection without losing application data.
May be cloned to obtain another handle to the same connection.
-Implementations§
Source§impl Connection
impl Connection
Implementations§
Source§impl Connection
impl Connection
Sourcepub fn open_uni(&self) -> OpenUni<'_> ⓘ
pub fn open_uni(&self) -> OpenUni<'_> ⓘ
Initiates a new outgoing unidirectional stream.
Streams are cheap and instantaneous to open unless blocked by flow control. As a consequence, the peer won’t be notified that a stream has been opened until the stream is actually used.
-Sourcepub fn open_bi(&self) -> OpenBi<'_> ⓘ
pub fn open_bi(&self) -> OpenBi<'_> ⓘ
Initiates a new outgoing bidirectional stream.
Streams are cheap and instantaneous to open unless blocked by flow control. As a
consequence, the peer won’t be notified that a stream has been opened until the
stream is actually used. Calling open_bi then waiting on the RecvStream
without writing anything to SendStream will never succeed.
Sourcepub fn accept_uni(&self) -> AcceptUni<'_> ⓘ
pub fn accept_uni(&self) -> AcceptUni<'_> ⓘ
Accepts the next incoming uni-directional stream.
-Sourcepub fn accept_uni(&self) -> AcceptUni<'_> ⓘ
pub fn accept_uni(&self) -> AcceptUni<'_> ⓘ
Accepts the next incoming uni-directional stream.
+Sourcepub fn accept_bi(&self) -> AcceptBi<'_> ⓘ
pub fn accept_bi(&self) -> AcceptBi<'_> ⓘ
Accept the next incoming bidirectional stream.
Important Note: The peer that calls open_bi must write to its SendStream
before the peer Connection is able to accept the stream using
accept_bi(). Calling open_bi then waiting on the RecvStream without
writing anything to the connected SendStream will never succeed.
Sourcepub fn read_datagram(&self) -> ReadDatagram<'_> ⓘ
pub fn read_datagram(&self) -> ReadDatagram<'_> ⓘ
Receives an application datagram.
-Sourcepub async fn closed(&self) -> ConnectionError
pub async fn closed(&self) -> ConnectionError
Wait for the connection to be closed for any reason.
+Sourcepub fn read_datagram(&self) -> ReadDatagram<'_> ⓘ
pub fn read_datagram(&self) -> ReadDatagram<'_> ⓘ
Receives an application datagram.
+Sourcepub async fn closed(&self) -> ConnectionError
pub async fn closed(&self) -> ConnectionError
Wait for the connection to be closed for any reason.
Despite the return type’s name, closed connections are often not an error condition
at the application layer. Cases that might be routine include
ConnectionError::LocallyClosed and ConnectionError::ApplicationClosed.
Sourcepub fn close_reason(&self) -> Option<ConnectionError>
pub fn close_reason(&self) -> Option<ConnectionError>
If the connection is closed, the reason why.
+Sourcepub fn close_reason(&self) -> Option<ConnectionError>
pub fn close_reason(&self) -> Option<ConnectionError>
If the connection is closed, the reason why.
Returns None if the connection is still open.
Sourcepub fn close(&self, error_code: VarInt, reason: &[u8])
pub fn close(&self, error_code: VarInt, reason: &[u8])
Closes the connection immediately.
Pending operations will fail immediately with ConnectionError::LocallyClosed. No
more data is sent to the peer and the peer may drop buffered data upon receiving the
CONNECTION_CLOSE frame.
close the remote endpoint may drop any data it received but is as yet
undelivered to the application, including data that was acknowledged as received to
the local endpoint.
-Sourcepub fn send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError>
pub fn send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError>
Transmits data as an unreliable, unordered application datagram.
Sourcepub fn send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError>
pub fn send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError>
Transmits data as an unreliable, unordered application datagram.
Application datagrams are a low-level primitive. They may be lost or delivered out
of order, and data must both fit inside a single QUIC packet and be smaller than
the maximum dictated by the peer.
Sourcepub fn max_datagram_size(&self) -> Option<usize>
pub fn max_datagram_size(&self) -> Option<usize>
Computes the maximum size of datagrams that may be passed to send_datagram.
Sourcepub fn max_datagram_size(&self) -> Option<usize>
pub fn max_datagram_size(&self) -> Option<usize>
Computes the maximum size of datagrams that may be passed to send_datagram.
Returns None if datagrams are unsupported by the peer or disabled locally.
This may change over the lifetime of a connection according to variation in the path MTU estimate. The peer can also enforce an arbitrarily small fixed limit, but if the peer’s limit is large this is guaranteed to be a little over a kilobyte at minimum.
Not necessarily the maximum size of received datagrams.
-Sourcepub fn datagram_send_buffer_space(&self) -> usize
pub fn datagram_send_buffer_space(&self) -> usize
Bytes available in the outgoing datagram buffer.
+Sourcepub fn datagram_send_buffer_space(&self) -> usize
pub fn datagram_send_buffer_space(&self) -> usize
Bytes available in the outgoing datagram buffer.
When greater than zero, calling send_datagram with a
datagram of at most this size is guaranteed not to cause older datagrams to be
dropped.
Sourcepub fn rtt(&self) -> Duration
pub fn rtt(&self) -> Duration
Current best estimate of this connection’s latency (round-trip-time).
-Sourcepub fn stats(&self) -> ConnectionStats
pub fn stats(&self) -> ConnectionStats
Returns connection statistics.
-Sourcepub fn congestion_state(&self) -> Box<dyn Controller>
pub fn congestion_state(&self) -> Box<dyn Controller>
Current state of the congestion control algorithm, for debugging purposes.
-Sourcepub fn handshake_data(&self) -> Option<Box<dyn Any>>
pub fn handshake_data(&self) -> Option<Box<dyn Any>>
Parameters negotiated during the handshake.
+Sourcepub fn rtt(&self) -> Duration
pub fn rtt(&self) -> Duration
Current best estimate of this connection’s latency (round-trip-time).
+Sourcepub fn stats(&self) -> ConnectionStats
pub fn stats(&self) -> ConnectionStats
Returns connection statistics.
+Sourcepub fn congestion_state(&self) -> Box<dyn Controller>
pub fn congestion_state(&self) -> Box<dyn Controller>
Current state of the congestion control algorithm, for debugging purposes.
+Sourcepub fn handshake_data(&self) -> Option<Box<dyn Any>>
pub fn handshake_data(&self) -> Option<Box<dyn Any>>
Parameters negotiated during the handshake.
Guaranteed to return Some on fully established connections or after
Connecting::handshake_data() succeeds. See that method’s documentations for
details on the returned value.
Sourcepub fn alpn(&self) -> Option<Vec<u8>>
pub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
-Sourcepub fn peer_identity(&self) -> Option<Box<dyn Any>>
pub fn peer_identity(&self) -> Option<Box<dyn Any>>
Cryptographic identity of the peer.
+Sourcepub fn alpn(&self) -> Option<Vec<u8>>
pub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
+Sourcepub fn peer_identity(&self) -> Option<Box<dyn Any>>
pub fn peer_identity(&self) -> Option<Box<dyn Any>>
Sourcepub fn remote_node_id(&self) -> Result<NodeId>
pub fn remote_node_id(&self) -> Result<NodeId>
Returns the NodeId from the peer’s TLS certificate.
Sourcepub fn remote_node_id(&self) -> Result<NodeId>
pub fn remote_node_id(&self) -> Result<NodeId>
Sourcepub fn stable_id(&self) -> usize
pub fn stable_id(&self) -> usize
A stable identifier for this connection.
Peer addresses and connection IDs can change, but this value will remain fixed for the lifetime of the connection.
-Sourcepub fn export_keying_material(
+
pub fn export_keying_material( +
Sourcepub fn export_keying_material(
&self,
output: &mut [u8],
label: &[u8],
@@ -96,14 +96,14 @@ arguments and output buffers of equal length, they will get the
same sequence of bytes in output. These bytes are cryptographically
strong and pseudorandom, and are suitable for use as keying material.
See RFC5705 for more information.
-
pub fn export_keying_material(
&self,
output: &mut [u8],
label: &[u8],
@@ -96,14 +96,14 @@ arguments and output buffers of equal length, they will get the
same sequence of bytes in output. These bytes are cryptographically
strong and pseudorandom, and are suitable for use as keying material.
See RFC5705 for more information.
-Sourcepub fn set_max_concurrent_uni_streams(&self, count: VarInt)
pub fn set_max_concurrent_uni_streams(&self, count: VarInt)
Modifies the number of unidirectional streams that may be concurrently opened.
+Sourcepub fn set_max_concurrent_uni_streams(&self, count: VarInt)
pub fn set_max_concurrent_uni_streams(&self, count: VarInt)
Modifies the number of unidirectional streams that may be concurrently opened.
No streams may be opened by the peer unless fewer than count are already
open. Large counts increase both minimum and worst-case memory consumption.
Sourcepub fn set_receive_window(&self, receive_window: VarInt)
pub fn set_receive_window(&self, receive_window: VarInt)
Sourcepub fn set_max_concurrent_bi_streams(&self, count: VarInt)
pub fn set_max_concurrent_bi_streams(&self, count: VarInt)
Modifies the number of bidirectional streams that may be concurrently opened.
+Sourcepub fn set_receive_window(&self, receive_window: VarInt)
pub fn set_receive_window(&self, receive_window: VarInt)
Sourcepub fn set_max_concurrent_bi_streams(&self, count: VarInt)
pub fn set_max_concurrent_bi_streams(&self, count: VarInt)
Modifies the number of bidirectional streams that may be concurrently opened.
No streams may be opened by the peer unless fewer than count are already
open. Large counts increase both minimum and worst-case memory consumption.
Trait Implementations§
Source§impl Clone for Connection
impl Clone for Connection
Source§fn clone(&self) -> Connection
fn clone(&self) -> Connection
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for Connection
impl RefUnwindSafe for Connection
impl Send for Connection
impl Sync for Connection
impl Unpin for Connection
impl UnwindSafe for Connection
Blanket Implementations§
Trait Implementations§
Source§impl Clone for Connection
impl Clone for Connection
Source§fn clone(&self) -> Connection
fn clone(&self) -> Connection
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for Connection
impl RefUnwindSafe for Connection
impl Send for Connection
impl Sync for Connection
impl Unpin for Connection
impl UnwindSafe for Connection
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/3217/docs/iroh/endpoint/struct.DirectAddr.html b/pr/3217/docs/iroh/endpoint/struct.DirectAddr.html
index 61a667e47d..04760c9021 100644
--- a/pr/3217/docs/iroh/endpoint/struct.DirectAddr.html
+++ b/pr/3217/docs/iroh/endpoint/struct.DirectAddr.html
@@ -1,4 +1,4 @@
-DirectAddr in iroh::endpoint - Rust pub struct DirectAddr {
+DirectAddr in iroh::endpoint - Rust pub struct DirectAddr {
pub addr: SocketAddr,
pub typ: DirectAddrType,
}
Expand description
A direct address on which an iroh-node might be contactable.
@@ -7,16 +7,16 @@ contacted. These can come from various sources depending on the network topolog
iroh node, see DirectAddrType for the several kinds of sources.
Fields§
§addr: SocketAddrThe address.
§typ: DirectAddrTypeThe origin of this direct address.
-Trait Implementations§
Source§impl Clone for DirectAddr
Source§fn clone(&self) -> DirectAddr
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 DirectAddr
Source§impl Hash for DirectAddr
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
+Trait Implementations§
Source§impl Clone for DirectAddr
Source§fn clone(&self) -> DirectAddr
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 DirectAddr
Source§impl Hash for DirectAddr
Source§impl Ord for DirectAddr
Source§impl Ord for DirectAddr
Source§fn cmp(&self, other: &DirectAddr) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read moreSource§impl PartialEq for DirectAddr
Source§impl PartialOrd for DirectAddr
Source§impl PartialEq for DirectAddr
Source§impl PartialOrd for DirectAddr
Source§impl Eq for DirectAddr
Source§impl StructuralPartialEq for DirectAddr
Auto Trait Implementations§
§impl Freeze for DirectAddr
§impl RefUnwindSafe for DirectAddr
§impl Send for DirectAddr
§impl Sync for DirectAddr
§impl Unpin for DirectAddr
§impl UnwindSafe for DirectAddr
Blanket Implementations§
Source§impl Eq for DirectAddr
Source§impl StructuralPartialEq for DirectAddr
Auto Trait Implementations§
§impl Freeze for DirectAddr
§impl RefUnwindSafe for DirectAddr
§impl Send for DirectAddr
§impl Sync for DirectAddr
§impl Unpin for DirectAddr
§impl UnwindSafe for DirectAddr
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/3217/docs/iroh/endpoint/struct.Endpoint.html b/pr/3217/docs/iroh/endpoint/struct.Endpoint.html
index e25e697700..0b8c9af7b3 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Endpoint.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Endpoint.html
@@ -1,4 +1,4 @@
-Endpoint in iroh::endpoint - Rust pub struct Endpoint { /* private fields */ }
Expand description
Controls an iroh node, establishing connections with other nodes.
+Endpoint in iroh::endpoint - Rust pub struct Endpoint { /* private fields */ }
Expand description
Controls an iroh node, establishing connections with other nodes.
This is the main API interface to create connections to, and accept connections from
other iroh nodes. The connections are peer-to-peer and encrypted, a Relay server is
used to make the connections reliable. See the [crate docs] for a more detailed
@@ -16,17 +16,17 @@ the peer are created using the Connection::open_uni and Connection::open_bi functions.
Note that due to the light-weight properties of streams a stream will only be accepted
once the initiating peer has sent some data on it.
-Implementations§
Source§impl Endpoint
Sourcepub fn builder() -> Builder
Returns the builder for an Endpoint, with a production configuration.
-Sourcepub fn set_alpns(&self, alpns: Vec<Vec<u8>>) -> Result<()>
Sets the list of accepted ALPN protocols.
+Implementations§
Source§impl Endpoint
Sourcepub fn builder() -> Builder
Returns the builder for an Endpoint, with a production configuration.
+Sourcepub async fn connect(
&self,
node_addr: impl Into<NodeAddr>,
alpn: &[u8],
) -> Result<Connection>
Connects to a remote Endpoint.
A value that can be converted into a NodeAddr is required. This can be either a
-NodeAddr, a NodeId or a iroh_base::ticket::NodeTicket.
+NodeAddr, a NodeId or a [iroh_base::ticket::NodeTicket].
The NodeAddr must contain the NodeId to dial and may also contain a RelayUrl
and direct addresses. If direct addresses are provided, they will be used to try and
establish a direct connection without involving a relay server.
@@ -41,7 +41,7 @@ connection attempt will fail with an error.
The alpn, or application-level protocol identifier, is also required. The remote
endpoint must support this alpn, otherwise the connection attempt will fail with
an error.
-Sourcepub async fn connect_with_opts(
+
Sourcepub async fn connect_with_opts(
&self,
node_addr: impl Into<NodeAddr>,
alpn: &[u8],
@@ -61,13 +61,13 @@ security concerns.
establishing and maintaining direct connections. Carefully test settings you use and
consider this currently as still rather experimental.
-
Sourcepub fn accept(&self) -> Accept<'_> ⓘ
Accepts an incoming connection on the endpoint.
Only connections with the ALPNs configured in Builder::alpns will be accepted.
If multiple ALPNs have been configured the ALPN can be inspected before accepting
the connection using Connecting::alpn.
The returned future will yield None if the endpoint is closed by calling
Endpoint::close.
-Sourcepub fn add_node_addr(&self, node_addr: NodeAddr) -> Result<()>
Informs this Endpoint about addresses of the iroh node.
+Sourcepub fn add_node_addr(&self, node_addr: NodeAddr) -> Result<()>
Informs this Endpoint about addresses of the iroh node.
This updates the local state for the remote node. If the provided NodeAddr
contains a RelayUrl this will be used as the new relay server for this node. If
it contains any new IP endpoints they will also be stored and tried when next
@@ -80,7 +80,7 @@ This provides more flexibility and future proofing.
§Errors
Will return an error if we attempt to add our own NodeId to the node map or
if the direct addresses are a subset of ours.
-Sourcepub fn add_node_addr_with_source(
+
Sourcepub fn secret_key(&self) -> &SecretKey
Returns the secret_key of this endpoint.
-Sourcepub fn secret_key(&self) -> &SecretKey
Returns the secret_key of this endpoint.
+Sourcepub fn node_id(&self) -> NodeId
Returns the node id of this endpoint.
This ID is the unique addressing information of this node and other peers must know
it to be able to connect to this node.
-Sourcepub async fn node_addr(&self) -> Result<NodeAddr>
Returns the current NodeAddr for this endpoint.
+Sourcepub async fn node_addr(&self) -> Result<NodeAddr>
Returns the current NodeAddr for this endpoint.
The returned NodeAddr will have the current RelayUrl and direct addresses
as they would be returned by Endpoint::home_relay and
Endpoint::direct_addresses.
In browsers, because direct addresses are unavailable, this will only wait for
the home relay to be available before returning.
-Sourcepub fn home_relay(&self) -> Watcher<Option<RelayUrl>>
Sourcepub fn home_relay(&self) -> Watcher<Option<RelayUrl>>
Returns a Watcher for the RelayUrl of the Relay server used as home relay.
Every endpoint has a home Relay server which it chooses as the server with the
lowest latency out of the configured servers provided by Builder::relay_mode.
This is the server other iroh nodes can use to reliably establish a connection
@@ -122,7 +122,7 @@ some time to connect to find and connect to the home relay server.
let mep = Endpoint::builder().bind().await.unwrap();
let _relay_url = mep.home_relay().initialized().await.unwrap();
-Sourcepub fn direct_addresses(&self) -> Watcher<Option<BTreeSet<DirectAddr>>>
Sourcepub fn direct_addresses(&self) -> Watcher<Option<BTreeSet<DirectAddr>>>
Returns a Watcher for the direct addresses of this Endpoint.
The direct addresses of the Endpoint are those that could be used by other
iroh nodes to establish direct connectivity, depending on the network
situation. The yielded lists of direct addresses contain both the locally-bound
@@ -145,10 +145,10 @@ recently discovered direct addresses.
let mep = Endpoint::builder().bind().await.unwrap();
let _addrs = mep.direct_addresses().initialized().await.unwrap();
-Sourcepub fn bound_sockets(&self) -> (SocketAddr, Option<SocketAddr>)
Available on non-wasm_browser only.
Returns the local socket addresses on which the underlying sockets are bound.
+Sourcepub fn bound_sockets(&self) -> (SocketAddr, Option<SocketAddr>)
Available on non-wasm_browser only.
Returns the local socket addresses on which the underlying sockets are bound.
The Endpoint always binds on an IPv4 address and also tries to bind on an IPv6
address if available.
-Sourcepub fn remote_info(&self, node_id: NodeId) -> Option<RemoteInfo>
Returns information about the remote node identified by a NodeId.
+Sourcepub fn remote_info(&self, node_id: NodeId) -> Option<RemoteInfo>
Returns information about the remote node identified by a NodeId.
The Endpoint keeps some information about remote iroh nodes, which it uses to find
the best path to a node. Having information on a remote node, however, does not mean we have
ever connected to it to or even whether a connection is even possible. The information about a
@@ -157,14 +157,14 @@ calls may return different information. Furthermore, node information may even b
completely evicted as it becomes stale.
See also Endpoint::remote_info_iter which returns information on all nodes known
by this Endpoint.
-Sourcepub fn remote_info_iter(&self) -> impl Iterator<Item = RemoteInfo>
Returns information about all the remote nodes this Endpoint knows about.
+Sourcepub fn remote_info_iter(&self) -> impl Iterator<Item = RemoteInfo>
Returns information about all the remote nodes this Endpoint knows about.
This returns the same information as Endpoint::remote_info for each node known to this
Endpoint.
The Endpoint keeps some information about remote iroh nodes, which it uses to find
the best path to a node. This returns all the nodes it knows about, regardless of whether a
connection was ever made or is even possible.
See also Endpoint::remote_info to only retrieve information about a single node.
-Sourcepub fn discovery_stream(
+
Sourcepub fn discovery_stream(
&self,
) -> impl Stream<Item = Result<DiscoveryItem, Lagged>>
Returns a stream of all remote nodes discovered through the endpoint’s discovery services.
Whenever a node is discovered via the endpoint’s discovery service, the corresponding
@@ -183,7 +183,7 @@ at the time of adding it to the static provider.
Lagged may be yielded, indicating that items were missed.
See also Endpoint::remote_info_iter, which returns an iterator over all remotes
the endpoint knows about at a specific point in time.
-Sourcepub fn conn_type(&self, node_id: NodeId) -> Result<Watcher<ConnectionType>>
Returns a Watcher that reports the current connection type and any changes for
+
Sourcepub fn conn_type(&self, node_id: NodeId) -> Result<Watcher<ConnectionType>>
Returns a Watcher that reports the current connection type and any changes for
given remote node.
This watcher allows observing a stream of ConnectionType items by calling
Watcher::stream(). If the underlying connection to a remote node changes, it will
@@ -202,11 +202,11 @@ recently connected to this node id but previous methods of reaching the node hav
become inaccessible.
§Errors
Will error if we do not have any address information for the given node_id.
-Sourcepub fn dns_resolver(&self) -> &DnsResolver
Available on non-wasm_browser only.
Returns the DNS resolver used in this Endpoint.
+Sourcepub fn dns_resolver(&self) -> &DnsResolver
Available on non-wasm_browser only.
Returns the DNS resolver used in this Endpoint.
-Sourcepub fn discovery(&self) -> Option<&dyn Discovery>
Returns the discovery mechanism, if configured.
+Sourcepub fn discovery(&self) -> Option<&dyn Discovery>
Returns the discovery mechanism, if configured.
See Builder::discovery.
-Sourcepub async fn network_change(&self)
Notifies the system of potential network changes.
+Sourcepub async fn network_change(&self)
Notifies the system of potential network changes.
On many systems iroh is able to detect network changes by itself, however
some systems like android do not expose this functionality to native code.
Android does however provide this functionality to Java code. This
@@ -214,12 +214,12 @@ function allows for notifying iroh of any potential network changes like
this.
Even when the network did not change, or iroh was already able to detect
the network change itself, there is no harm in calling this function.
-Sourcepub fn set_user_data_for_discovery(&self, user_data: Option<UserData>)
Sets the initial user-defined data to be published in discovery services for this node.
+Sourcepub fn set_user_data_for_discovery(&self, user_data: Option<UserData>)
Sets the initial user-defined data to be published in discovery services for this node.
If the user-defined data passed to this function is different to the previous one,
the endpoint will republish its node info to the configured discovery services.
See also Builder::user_data_for_discovery for setting an initial value when
building the endpoint.
-Sourcepub async fn close(&self)
Closes the QUIC endpoint and the magic socket.
This will close any remaining open Connections with an error code
of 0 and an empty reason. Though it is best practice to close those
explicitly before with a custom error code and reason.
@@ -245,8 +245,8 @@ while TCP sockets usually get closed and drained by the operating system in the
kernel during the “Time-Wait” period of the TCP socket.
Be aware however that the underlying UDP sockets are only closed once all clones of
the the respective Endpoint are dropped.
-Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Endpoint
§impl !RefUnwindSafe for Endpoint
§impl Send for Endpoint
§impl Sync for Endpoint
§impl Unpin for Endpoint
§impl !UnwindSafe for Endpoint
Blanket Implementations§
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Endpoint
§impl !RefUnwindSafe for Endpoint
§impl Send for Endpoint
§impl Sync for Endpoint
§impl Unpin for Endpoint
§impl !UnwindSafe for Endpoint
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/3217/docs/iroh/endpoint/struct.Incoming.html b/pr/3217/docs/iroh/endpoint/struct.Incoming.html
index 61f28360fa..6b71064a82 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Incoming.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Incoming.html
@@ -1,29 +1,29 @@
-Incoming in iroh::endpoint - Rust pub struct Incoming { /* private fields */ }
Expand description
An incoming connection for which the server has not yet begun its parts of the
+
Incoming in iroh::endpoint - Rust pub struct Incoming { /* private fields */ }
Expand description
An incoming connection for which the server has not yet begun its parts of the
handshake.
-Implementations§
Source§impl Incoming
Sourcepub fn accept(self) -> Result<Connecting, ConnectionError>
Attempts to accept this incoming connection (an error may still occur).
+Implementations§
Source§impl Incoming
Sourcepub fn accept(self) -> Result<Connecting, ConnectionError>
Attempts to accept this incoming connection (an error may still occur).
Errors occurring here are likely not caused by the application or remote. The QUIC
connection listens on a normal UDP socket and any reachable network endpoint can
send datagrams to it, solicited or not. Even if the first few bytes look like a
QUIC packet, it might not even be a QUIC packet that is being received.
Thus it is common to simply log the errors here and accept them as something which
can happen.
-Sourcepub fn accept_with(
+
Sourcepub fn accept_with(
self,
server_config: Arc<ServerConfig>,
) -> Result<Connecting, ConnectionError>
Accepts this incoming connection using a custom configuration.
See accept() for more details.
-Sourcepub fn retry(self) -> Result<(), RetryError>
Responds with a retry packet.
+Sourcepub fn retry(self) -> Result<(), RetryError>
Responds with a retry packet.
This requires the client to retry with address validation.
Errors if remote_address_validated() is true.
-Sourcepub fn ignore(self)
Ignores this incoming connection attempt, not sending any packet in response.
-Sourcepub fn local_ip(&self) -> Option<IpAddr>
Returns the local IP address which was used when the peer established the
+
Sourcepub fn ignore(self)
Ignores this incoming connection attempt, not sending any packet in response.
+Sourcepub fn local_ip(&self) -> Option<IpAddr>
Returns the local IP address which was used when the peer established the
connection.
-Sourcepub fn remote_address(&self) -> SocketAddr
Returns the peer’s UDP address.
-Sourcepub fn remote_address_validated(&self) -> bool
Whether the socket address that is initiating this connection has been validated.
+Sourcepub fn remote_address(&self) -> SocketAddr
Returns the peer’s UDP address.
+Sourcepub fn remote_address_validated(&self) -> bool
Whether the socket address that is initiating this connection has been validated.
This means that the sender of the initial packet has proved that they can receive
traffic sent to self.remote_address().
-Trait Implementations§
Source§impl IntoFuture for Incoming
Source§type Output = Result<Connection, ConnectionError>
The output that the future will produce on completion.Source§type IntoFuture = IncomingFuture
Which kind of future are we turning this into?Source§fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read moreAuto Trait Implementations§
§impl !Freeze for Incoming
§impl !RefUnwindSafe for Incoming
§impl Send for Incoming
§impl Sync for Incoming
§impl Unpin for Incoming
§impl !UnwindSafe for Incoming
Blanket Implementations§
Trait Implementations§
Source§impl IntoFuture for Incoming
Source§type Output = Result<Connection, ConnectionError>
The output that the future will produce on completion.Source§type IntoFuture = IncomingFuture
Which kind of future are we turning this into?Source§fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read moreAuto Trait Implementations§
§impl !Freeze for Incoming
§impl !RefUnwindSafe for Incoming
§impl Send for Incoming
§impl Sync for Incoming
§impl Unpin for Incoming
§impl !UnwindSafe for Incoming
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/3217/docs/iroh/endpoint/struct.IncomingFuture.html b/pr/3217/docs/iroh/endpoint/struct.IncomingFuture.html
index 504c012c78..3934a53120 100644
--- a/pr/3217/docs/iroh/endpoint/struct.IncomingFuture.html
+++ b/pr/3217/docs/iroh/endpoint/struct.IncomingFuture.html
@@ -1,6 +1,6 @@
-IncomingFuture in iroh::endpoint - Rust pub struct IncomingFuture { /* private fields */ }
Expand description
Adaptor to let Incoming be awaited like a Connecting.
-Trait Implementations§
Source§impl Debug for IncomingFuture
Source§impl Future for IncomingFuture
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for IncomingFuturewhere
+IncomingFuture in iroh::endpoint - Rust pub struct IncomingFuture { /* private fields */ }
Expand description
Adaptor to let Incoming be awaited like a Connecting.
+Trait Implementations§
Source§impl Debug for IncomingFuture
Source§impl Future for IncomingFuture
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for IncomingFuturewhere
PinnedFieldsOf<__IncomingFuture<'pin>>: Unpin,
Auto Trait Implementations§
§impl !Freeze for IncomingFuture
§impl !RefUnwindSafe for IncomingFuture
§impl Send for IncomingFuture
§impl Sync for IncomingFuture
§impl !UnwindSafe for IncomingFuture
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html b/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html
index 792290d8f5..d03f08d892 100644
--- a/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html
+++ b/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html
@@ -1,7 +1,7 @@
-ZeroRttAccepted in iroh::endpoint - Rust pub struct ZeroRttAccepted { /* private fields */ }
Expand description
Future that completes when a connection is fully established.
+ZeroRttAccepted in iroh::endpoint - Rust pub struct ZeroRttAccepted { /* private fields */ }
Expand description
Future that completes when a connection is fully established.
For clients, the resulting value indicates if 0-RTT was accepted. For servers, the resulting
value is meaningless.
-Trait Implementations§
Source§impl Debug for ZeroRttAccepted
Source§impl Future for ZeroRttAccepted
Source§fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>
Attempts to resolve the future to a final value, registering
+Trait Implementations§
Source§impl Debug for ZeroRttAccepted
Source§impl Future for ZeroRttAccepted
Auto Trait Implementations§
§impl Freeze for ZeroRttAccepted
§impl !RefUnwindSafe for ZeroRttAccepted
§impl Send for ZeroRttAccepted
§impl Sync for ZeroRttAccepted
§impl Unpin for ZeroRttAccepted
§impl !UnwindSafe for ZeroRttAccepted
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/enum.KeyParsingError.html b/pr/3217/docs/iroh/enum.KeyParsingError.html
index 55941cda04..c7925e588b 100644
--- a/pr/3217/docs/iroh/enum.KeyParsingError.html
+++ b/pr/3217/docs/iroh/enum.KeyParsingError.html
@@ -1,4 +1,4 @@
-KeyParsingError in iroh - Rust pub enum KeyParsingError {
+KeyParsingError in iroh - Rust Enum KeyParsingError
pub enum KeyParsingError {
Decode(DecodeError),
Key(Error),
DecodeInvalidLength,
@@ -6,7 +6,7 @@
Variants§
§Decode(DecodeError)
Error when decoding.
§Key(Error)
Error when decoding the public key.
§DecodeInvalidLength
The encoded information had the wrong length.
-Trait Implementations§
Source§impl Debug for KeyParsingError
Source§impl Display for KeyParsingError
Source§impl Error for KeyParsingError
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()Source§impl From<DecodeError> for KeyParsingError
Source§fn from(source: DecodeError) -> KeyParsingError
Converts to this type from the input type.Source§impl From<Error> for KeyParsingError
Source§fn from(source: Error) -> KeyParsingError
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for KeyParsingError
§impl !RefUnwindSafe for KeyParsingError
§impl Send for KeyParsingError
§impl Sync for KeyParsingError
§impl Unpin for KeyParsingError
§impl !UnwindSafe for KeyParsingError
Blanket Implementations§
Trait Implementations§
§impl Debug for KeyParsingError
§impl Display for KeyParsingError
§impl Error for KeyParsingError
§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()§impl From<DecodeError> for KeyParsingError
§fn from(source: DecodeError) -> KeyParsingError
Converts to this type from the input type.§impl From<Error> for KeyParsingError
§fn from(source: Error) -> KeyParsingError
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for KeyParsingError
§impl !RefUnwindSafe for KeyParsingError
§impl Send for KeyParsingError
§impl Sync for KeyParsingError
§impl Unpin for KeyParsingError
§impl !UnwindSafe for KeyParsingError
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/3217/docs/iroh/metrics/struct.RelayMetrics.html b/pr/3217/docs/iroh/metrics/struct.RelayMetrics.html
index 83ae1acdcc..6f22d04f93 100644
--- a/pr/3217/docs/iroh/metrics/struct.RelayMetrics.html
+++ b/pr/3217/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/3217/docs/iroh/node_info/constant.IROH_TXT_NAME.html b/pr/3217/docs/iroh/node_info/constant.IROH_TXT_NAME.html
index c78d056a1f..0c1e657fb3 100644
--- a/pr/3217/docs/iroh/node_info/constant.IROH_TXT_NAME.html
+++ b/pr/3217/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/3217/docs/iroh/node_info/index.html b/pr/3217/docs/iroh/node_info/index.html
index 9884414f78..5130358fc8 100644
--- a/pr/3217/docs/iroh/node_info/index.html
+++ b/pr/3217/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/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html b/pr/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html
index 2f1c9b7234..33cd3a33fc 100644
--- a/pr/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html
+++ b/pr/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html
@@ -1,5 +1,5 @@
-MaxLengthExceededError in iroh::node_info - Rust
pub struct DirectAddr {
+DirectAddr in iroh::endpoint - Rust pub struct DirectAddr {
pub addr: SocketAddr,
pub typ: DirectAddrType,
}
Expand description
A direct address on which an iroh-node might be contactable.
@@ -7,16 +7,16 @@ contacted. These can come from various sources depending on the network topolog
iroh node, see DirectAddrType for the several kinds of sources.
Fields§
§addr: SocketAddrThe address.
§typ: DirectAddrTypeThe origin of this direct address.
-Trait Implementations§
Source§impl Clone for DirectAddr
Source§fn clone(&self) -> DirectAddr
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 DirectAddr
Source§impl Hash for DirectAddr
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
+Trait Implementations§
Source§impl Clone for DirectAddr
Source§fn clone(&self) -> DirectAddr
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 DirectAddr
Source§impl Hash for DirectAddr
Source§impl Ord for DirectAddr
Source§impl Ord for DirectAddr
Source§fn cmp(&self, other: &DirectAddr) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read moreSource§impl PartialEq for DirectAddr
Source§impl PartialOrd for DirectAddr
Source§impl PartialEq for DirectAddr
Source§impl PartialOrd for DirectAddr
Source§impl Eq for DirectAddr
Source§impl StructuralPartialEq for DirectAddr
Auto Trait Implementations§
§impl Freeze for DirectAddr
§impl RefUnwindSafe for DirectAddr
§impl Send for DirectAddr
§impl Sync for DirectAddr
§impl Unpin for DirectAddr
§impl UnwindSafe for DirectAddr
Blanket Implementations§
Source§impl Eq for DirectAddr
Source§impl StructuralPartialEq for DirectAddr
Auto Trait Implementations§
§impl Freeze for DirectAddr
§impl RefUnwindSafe for DirectAddr
§impl Send for DirectAddr
§impl Sync for DirectAddr
§impl Unpin for DirectAddr
§impl UnwindSafe for DirectAddr
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/3217/docs/iroh/endpoint/struct.Endpoint.html b/pr/3217/docs/iroh/endpoint/struct.Endpoint.html
index e25e697700..0b8c9af7b3 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Endpoint.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Endpoint.html
@@ -1,4 +1,4 @@
-Endpoint in iroh::endpoint - Rust pub struct Endpoint { /* private fields */ }
Expand description
Controls an iroh node, establishing connections with other nodes.
+Endpoint in iroh::endpoint - Rust pub struct Endpoint { /* private fields */ }
Expand description
Controls an iroh node, establishing connections with other nodes.
This is the main API interface to create connections to, and accept connections from
other iroh nodes. The connections are peer-to-peer and encrypted, a Relay server is
used to make the connections reliable. See the [crate docs] for a more detailed
@@ -16,17 +16,17 @@ the peer are created using the Connection::open_uni and Connection::open_bi functions.
Note that due to the light-weight properties of streams a stream will only be accepted
once the initiating peer has sent some data on it.
-Implementations§
Source§impl Endpoint
Sourcepub fn builder() -> Builder
Returns the builder for an Endpoint, with a production configuration.
-Sourcepub fn set_alpns(&self, alpns: Vec<Vec<u8>>) -> Result<()>
Sets the list of accepted ALPN protocols.
+Implementations§
Source§impl Endpoint
Sourcepub fn builder() -> Builder
Returns the builder for an Endpoint, with a production configuration.
+Sourcepub async fn connect(
&self,
node_addr: impl Into<NodeAddr>,
alpn: &[u8],
) -> Result<Connection>
Connects to a remote Endpoint.
A value that can be converted into a NodeAddr is required. This can be either a
-NodeAddr, a NodeId or a iroh_base::ticket::NodeTicket.
+NodeAddr, a NodeId or a [iroh_base::ticket::NodeTicket].
The NodeAddr must contain the NodeId to dial and may also contain a RelayUrl
and direct addresses. If direct addresses are provided, they will be used to try and
establish a direct connection without involving a relay server.
@@ -41,7 +41,7 @@ connection attempt will fail with an error.
The alpn, or application-level protocol identifier, is also required. The remote
endpoint must support this alpn, otherwise the connection attempt will fail with
an error.
-Sourcepub async fn connect_with_opts(
+
Sourcepub async fn connect_with_opts(
&self,
node_addr: impl Into<NodeAddr>,
alpn: &[u8],
@@ -61,13 +61,13 @@ security concerns.
establishing and maintaining direct connections. Carefully test settings you use and
consider this currently as still rather experimental.
-
Sourcepub fn accept(&self) -> Accept<'_> ⓘ
Accepts an incoming connection on the endpoint.
Only connections with the ALPNs configured in Builder::alpns will be accepted.
If multiple ALPNs have been configured the ALPN can be inspected before accepting
the connection using Connecting::alpn.
The returned future will yield None if the endpoint is closed by calling
Endpoint::close.
-Sourcepub fn add_node_addr(&self, node_addr: NodeAddr) -> Result<()>
Informs this Endpoint about addresses of the iroh node.
+Sourcepub fn add_node_addr(&self, node_addr: NodeAddr) -> Result<()>
Informs this Endpoint about addresses of the iroh node.
This updates the local state for the remote node. If the provided NodeAddr
contains a RelayUrl this will be used as the new relay server for this node. If
it contains any new IP endpoints they will also be stored and tried when next
@@ -80,7 +80,7 @@ This provides more flexibility and future proofing.
§Errors
Will return an error if we attempt to add our own NodeId to the node map or
if the direct addresses are a subset of ours.
-Sourcepub fn add_node_addr_with_source(
+
Sourcepub fn secret_key(&self) -> &SecretKey
Returns the secret_key of this endpoint.
-Sourcepub fn secret_key(&self) -> &SecretKey
Returns the secret_key of this endpoint.
+Sourcepub fn node_id(&self) -> NodeId
Returns the node id of this endpoint.
This ID is the unique addressing information of this node and other peers must know
it to be able to connect to this node.
-Sourcepub async fn node_addr(&self) -> Result<NodeAddr>
Returns the current NodeAddr for this endpoint.
+Sourcepub async fn node_addr(&self) -> Result<NodeAddr>
Returns the current NodeAddr for this endpoint.
The returned NodeAddr will have the current RelayUrl and direct addresses
as they would be returned by Endpoint::home_relay and
Endpoint::direct_addresses.
In browsers, because direct addresses are unavailable, this will only wait for
the home relay to be available before returning.
-Sourcepub fn home_relay(&self) -> Watcher<Option<RelayUrl>>
Sourcepub fn home_relay(&self) -> Watcher<Option<RelayUrl>>
Returns a Watcher for the RelayUrl of the Relay server used as home relay.
Every endpoint has a home Relay server which it chooses as the server with the
lowest latency out of the configured servers provided by Builder::relay_mode.
This is the server other iroh nodes can use to reliably establish a connection
@@ -122,7 +122,7 @@ some time to connect to find and connect to the home relay server.
let mep = Endpoint::builder().bind().await.unwrap();
let _relay_url = mep.home_relay().initialized().await.unwrap();
-Sourcepub fn direct_addresses(&self) -> Watcher<Option<BTreeSet<DirectAddr>>>
Sourcepub fn direct_addresses(&self) -> Watcher<Option<BTreeSet<DirectAddr>>>
Returns a Watcher for the direct addresses of this Endpoint.
The direct addresses of the Endpoint are those that could be used by other
iroh nodes to establish direct connectivity, depending on the network
situation. The yielded lists of direct addresses contain both the locally-bound
@@ -145,10 +145,10 @@ recently discovered direct addresses.
let mep = Endpoint::builder().bind().await.unwrap();
let _addrs = mep.direct_addresses().initialized().await.unwrap();
-Sourcepub fn bound_sockets(&self) -> (SocketAddr, Option<SocketAddr>)
Available on non-wasm_browser only.
Returns the local socket addresses on which the underlying sockets are bound.
+Sourcepub fn bound_sockets(&self) -> (SocketAddr, Option<SocketAddr>)
Available on non-wasm_browser only.
Returns the local socket addresses on which the underlying sockets are bound.
The Endpoint always binds on an IPv4 address and also tries to bind on an IPv6
address if available.
-Sourcepub fn remote_info(&self, node_id: NodeId) -> Option<RemoteInfo>
Returns information about the remote node identified by a NodeId.
+Sourcepub fn remote_info(&self, node_id: NodeId) -> Option<RemoteInfo>
Returns information about the remote node identified by a NodeId.
The Endpoint keeps some information about remote iroh nodes, which it uses to find
the best path to a node. Having information on a remote node, however, does not mean we have
ever connected to it to or even whether a connection is even possible. The information about a
@@ -157,14 +157,14 @@ calls may return different information. Furthermore, node information may even b
completely evicted as it becomes stale.
See also Endpoint::remote_info_iter which returns information on all nodes known
by this Endpoint.
-Sourcepub fn remote_info_iter(&self) -> impl Iterator<Item = RemoteInfo>
Returns information about all the remote nodes this Endpoint knows about.
+Sourcepub fn remote_info_iter(&self) -> impl Iterator<Item = RemoteInfo>
Returns information about all the remote nodes this Endpoint knows about.
This returns the same information as Endpoint::remote_info for each node known to this
Endpoint.
The Endpoint keeps some information about remote iroh nodes, which it uses to find
the best path to a node. This returns all the nodes it knows about, regardless of whether a
connection was ever made or is even possible.
See also Endpoint::remote_info to only retrieve information about a single node.
-Sourcepub fn discovery_stream(
+
Sourcepub fn discovery_stream(
&self,
) -> impl Stream<Item = Result<DiscoveryItem, Lagged>>
Returns a stream of all remote nodes discovered through the endpoint’s discovery services.
Whenever a node is discovered via the endpoint’s discovery service, the corresponding
@@ -183,7 +183,7 @@ at the time of adding it to the static provider.
Lagged may be yielded, indicating that items were missed.
See also Endpoint::remote_info_iter, which returns an iterator over all remotes
the endpoint knows about at a specific point in time.
-Sourcepub fn conn_type(&self, node_id: NodeId) -> Result<Watcher<ConnectionType>>
Returns a Watcher that reports the current connection type and any changes for
+
Sourcepub fn conn_type(&self, node_id: NodeId) -> Result<Watcher<ConnectionType>>
Returns a Watcher that reports the current connection type and any changes for
given remote node.
This watcher allows observing a stream of ConnectionType items by calling
Watcher::stream(). If the underlying connection to a remote node changes, it will
@@ -202,11 +202,11 @@ recently connected to this node id but previous methods of reaching the node hav
become inaccessible.
§Errors
Will error if we do not have any address information for the given node_id.
-Sourcepub fn dns_resolver(&self) -> &DnsResolver
Available on non-wasm_browser only.
Returns the DNS resolver used in this Endpoint.
+Sourcepub fn dns_resolver(&self) -> &DnsResolver
Available on non-wasm_browser only.
Returns the DNS resolver used in this Endpoint.
-Sourcepub fn discovery(&self) -> Option<&dyn Discovery>
Returns the discovery mechanism, if configured.
+Sourcepub fn discovery(&self) -> Option<&dyn Discovery>
Returns the discovery mechanism, if configured.
See Builder::discovery.
-Sourcepub async fn network_change(&self)
Notifies the system of potential network changes.
+Sourcepub async fn network_change(&self)
Notifies the system of potential network changes.
On many systems iroh is able to detect network changes by itself, however
some systems like android do not expose this functionality to native code.
Android does however provide this functionality to Java code. This
@@ -214,12 +214,12 @@ function allows for notifying iroh of any potential network changes like
this.
Even when the network did not change, or iroh was already able to detect
the network change itself, there is no harm in calling this function.
-Sourcepub fn set_user_data_for_discovery(&self, user_data: Option<UserData>)
Sets the initial user-defined data to be published in discovery services for this node.
+Sourcepub fn set_user_data_for_discovery(&self, user_data: Option<UserData>)
Sets the initial user-defined data to be published in discovery services for this node.
If the user-defined data passed to this function is different to the previous one,
the endpoint will republish its node info to the configured discovery services.
See also Builder::user_data_for_discovery for setting an initial value when
building the endpoint.
-Sourcepub async fn close(&self)
Closes the QUIC endpoint and the magic socket.
This will close any remaining open Connections with an error code
of 0 and an empty reason. Though it is best practice to close those
explicitly before with a custom error code and reason.
@@ -245,8 +245,8 @@ while TCP sockets usually get closed and drained by the operating system in the
kernel during the “Time-Wait” period of the TCP socket.
Be aware however that the underlying UDP sockets are only closed once all clones of
the the respective Endpoint are dropped.
-Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Endpoint
§impl !RefUnwindSafe for Endpoint
§impl Send for Endpoint
§impl Sync for Endpoint
§impl Unpin for Endpoint
§impl !UnwindSafe for Endpoint
Blanket Implementations§
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Endpoint
§impl !RefUnwindSafe for Endpoint
§impl Send for Endpoint
§impl Sync for Endpoint
§impl Unpin for Endpoint
§impl !UnwindSafe for Endpoint
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/3217/docs/iroh/endpoint/struct.Incoming.html b/pr/3217/docs/iroh/endpoint/struct.Incoming.html
index 61f28360fa..6b71064a82 100644
--- a/pr/3217/docs/iroh/endpoint/struct.Incoming.html
+++ b/pr/3217/docs/iroh/endpoint/struct.Incoming.html
@@ -1,29 +1,29 @@
-Incoming in iroh::endpoint - Rust pub struct Incoming { /* private fields */ }
Expand description
An incoming connection for which the server has not yet begun its parts of the
+
Incoming in iroh::endpoint - Rust pub struct Incoming { /* private fields */ }
Expand description
An incoming connection for which the server has not yet begun its parts of the
handshake.
-Implementations§
Source§impl Incoming
Sourcepub fn accept(self) -> Result<Connecting, ConnectionError>
Attempts to accept this incoming connection (an error may still occur).
+Implementations§
Source§impl Incoming
Sourcepub fn accept(self) -> Result<Connecting, ConnectionError>
Attempts to accept this incoming connection (an error may still occur).
Errors occurring here are likely not caused by the application or remote. The QUIC
connection listens on a normal UDP socket and any reachable network endpoint can
send datagrams to it, solicited or not. Even if the first few bytes look like a
QUIC packet, it might not even be a QUIC packet that is being received.
Thus it is common to simply log the errors here and accept them as something which
can happen.
-Sourcepub fn accept_with(
+
Sourcepub fn accept_with(
self,
server_config: Arc<ServerConfig>,
) -> Result<Connecting, ConnectionError>
Accepts this incoming connection using a custom configuration.
See accept() for more details.
-Sourcepub fn retry(self) -> Result<(), RetryError>
Responds with a retry packet.
+Sourcepub fn retry(self) -> Result<(), RetryError>
Responds with a retry packet.
This requires the client to retry with address validation.
Errors if remote_address_validated() is true.
-Sourcepub fn ignore(self)
Ignores this incoming connection attempt, not sending any packet in response.
-Sourcepub fn local_ip(&self) -> Option<IpAddr>
Returns the local IP address which was used when the peer established the
+
Sourcepub fn ignore(self)
Ignores this incoming connection attempt, not sending any packet in response.
+Sourcepub fn local_ip(&self) -> Option<IpAddr>
Returns the local IP address which was used when the peer established the
connection.
-Sourcepub fn remote_address(&self) -> SocketAddr
Returns the peer’s UDP address.
-Sourcepub fn remote_address_validated(&self) -> bool
Whether the socket address that is initiating this connection has been validated.
+Sourcepub fn remote_address(&self) -> SocketAddr
Returns the peer’s UDP address.
+Sourcepub fn remote_address_validated(&self) -> bool
Whether the socket address that is initiating this connection has been validated.
This means that the sender of the initial packet has proved that they can receive
traffic sent to self.remote_address().
-Trait Implementations§
Source§impl IntoFuture for Incoming
Source§type Output = Result<Connection, ConnectionError>
The output that the future will produce on completion.Source§type IntoFuture = IncomingFuture
Which kind of future are we turning this into?Source§fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read moreAuto Trait Implementations§
§impl !Freeze for Incoming
§impl !RefUnwindSafe for Incoming
§impl Send for Incoming
§impl Sync for Incoming
§impl Unpin for Incoming
§impl !UnwindSafe for Incoming
Blanket Implementations§
Trait Implementations§
Source§impl IntoFuture for Incoming
Source§type Output = Result<Connection, ConnectionError>
The output that the future will produce on completion.Source§type IntoFuture = IncomingFuture
Which kind of future are we turning this into?Source§fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read moreAuto Trait Implementations§
§impl !Freeze for Incoming
§impl !RefUnwindSafe for Incoming
§impl Send for Incoming
§impl Sync for Incoming
§impl Unpin for Incoming
§impl !UnwindSafe for Incoming
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/3217/docs/iroh/endpoint/struct.IncomingFuture.html b/pr/3217/docs/iroh/endpoint/struct.IncomingFuture.html
index 504c012c78..3934a53120 100644
--- a/pr/3217/docs/iroh/endpoint/struct.IncomingFuture.html
+++ b/pr/3217/docs/iroh/endpoint/struct.IncomingFuture.html
@@ -1,6 +1,6 @@
-IncomingFuture in iroh::endpoint - Rust pub struct IncomingFuture { /* private fields */ }
Expand description
Adaptor to let Incoming be awaited like a Connecting.
-Trait Implementations§
Source§impl Debug for IncomingFuture
Source§impl Future for IncomingFuture
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for IncomingFuturewhere
+IncomingFuture in iroh::endpoint - Rust pub struct IncomingFuture { /* private fields */ }
Expand description
Adaptor to let Incoming be awaited like a Connecting.
+Trait Implementations§
Source§impl Debug for IncomingFuture
Source§impl Future for IncomingFuture
Source§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.Source§impl<'pin> Unpin for IncomingFuturewhere
PinnedFieldsOf<__IncomingFuture<'pin>>: Unpin,
Auto Trait Implementations§
§impl !Freeze for IncomingFuture
§impl !RefUnwindSafe for IncomingFuture
§impl Send for IncomingFuture
§impl Sync for IncomingFuture
§impl !UnwindSafe for IncomingFuture
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html b/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html
index 792290d8f5..d03f08d892 100644
--- a/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html
+++ b/pr/3217/docs/iroh/endpoint/struct.ZeroRttAccepted.html
@@ -1,7 +1,7 @@
-ZeroRttAccepted in iroh::endpoint - Rust pub struct ZeroRttAccepted { /* private fields */ }
Expand description
Future that completes when a connection is fully established.
+ZeroRttAccepted in iroh::endpoint - Rust pub struct ZeroRttAccepted { /* private fields */ }
Expand description
Future that completes when a connection is fully established.
For clients, the resulting value indicates if 0-RTT was accepted. For servers, the resulting
value is meaningless.
-Trait Implementations§
Source§impl Debug for ZeroRttAccepted
Source§impl Future for ZeroRttAccepted
Source§fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>
Attempts to resolve the future to a final value, registering
+Trait Implementations§
Source§impl Debug for ZeroRttAccepted
Source§impl Future for ZeroRttAccepted
Auto Trait Implementations§
§impl Freeze for ZeroRttAccepted
§impl !RefUnwindSafe for ZeroRttAccepted
§impl Send for ZeroRttAccepted
§impl Sync for ZeroRttAccepted
§impl Unpin for ZeroRttAccepted
§impl !UnwindSafe for ZeroRttAccepted
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/3217/docs/iroh/enum.KeyParsingError.html b/pr/3217/docs/iroh/enum.KeyParsingError.html
index 55941cda04..c7925e588b 100644
--- a/pr/3217/docs/iroh/enum.KeyParsingError.html
+++ b/pr/3217/docs/iroh/enum.KeyParsingError.html
@@ -1,4 +1,4 @@
-KeyParsingError in iroh - Rust pub enum KeyParsingError {
+KeyParsingError in iroh - Rust Enum KeyParsingError
pub enum KeyParsingError {
Decode(DecodeError),
Key(Error),
DecodeInvalidLength,
@@ -6,7 +6,7 @@
Variants§
§Decode(DecodeError)
Error when decoding.
§Key(Error)
Error when decoding the public key.
§DecodeInvalidLength
The encoded information had the wrong length.
-Trait Implementations§
Source§impl Debug for KeyParsingError
Source§impl Display for KeyParsingError
Source§impl Error for KeyParsingError
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()Source§impl From<DecodeError> for KeyParsingError
Source§fn from(source: DecodeError) -> KeyParsingError
Converts to this type from the input type.Source§impl From<Error> for KeyParsingError
Source§fn from(source: Error) -> KeyParsingError
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for KeyParsingError
§impl !RefUnwindSafe for KeyParsingError
§impl Send for KeyParsingError
§impl Sync for KeyParsingError
§impl Unpin for KeyParsingError
§impl !UnwindSafe for KeyParsingError
Blanket Implementations§
Trait Implementations§
§impl Debug for KeyParsingError
§impl Display for KeyParsingError
§impl Error for KeyParsingError
§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()§impl From<DecodeError> for KeyParsingError
§fn from(source: DecodeError) -> KeyParsingError
Converts to this type from the input type.§impl From<Error> for KeyParsingError
§fn from(source: Error) -> KeyParsingError
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for KeyParsingError
§impl !RefUnwindSafe for KeyParsingError
§impl Send for KeyParsingError
§impl Sync for KeyParsingError
§impl Unpin for KeyParsingError
§impl !UnwindSafe for KeyParsingError
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/3217/docs/iroh/metrics/struct.RelayMetrics.html b/pr/3217/docs/iroh/metrics/struct.RelayMetrics.html
index 83ae1acdcc..6f22d04f93 100644
--- a/pr/3217/docs/iroh/metrics/struct.RelayMetrics.html
+++ b/pr/3217/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/3217/docs/iroh/node_info/constant.IROH_TXT_NAME.html b/pr/3217/docs/iroh/node_info/constant.IROH_TXT_NAME.html
index c78d056a1f..0c1e657fb3 100644
--- a/pr/3217/docs/iroh/node_info/constant.IROH_TXT_NAME.html
+++ b/pr/3217/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/3217/docs/iroh/node_info/index.html b/pr/3217/docs/iroh/node_info/index.html
index 9884414f78..5130358fc8 100644
--- a/pr/3217/docs/iroh/node_info/index.html
+++ b/pr/3217/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/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html b/pr/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html
index 2f1c9b7234..33cd3a33fc 100644
--- a/pr/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html
+++ b/pr/3217/docs/iroh/node_info/struct.MaxLengthExceededError.html
@@ -1,5 +1,5 @@
-MaxLengthExceededError in iroh::node_info - Rust