wasm_browser only.Expand description
DNS endpoint discovery for iroh
+Module dns
wasm_browser only.Expand description
DNS endpoint discovery for iroh
Structs§
- DnsAddress
Lookup - DNS endpoint discovery
- DnsAddress
Lookup Builder - Builder for
DnsAddressLookup.
Constants§
- N0_
DNS_ ENDPOINT_ ORIGIN_ PROD - The n0 address lookup DNS origin, for production.
- N0_
DNS_ ENDPOINT_ ORIGIN_ STAGING - The n0 address lookup DNS origin, for testing.
The DNS resolver defaults to using the nameservers configured on the host system, but can be changed
with crate::endpoint::Builder::dns_resolver.
Implementations§
Source§impl DnsAddressLookup
impl DnsAddressLookup
Sourcepub fn builder(origin_domain: String) -> DnsAddressLookupBuilder
pub fn builder(origin_domain: String) -> DnsAddressLookupBuilder
Creates a DnsAddressLookupBuilder that implements AddressLookupBuilder.
Sourcepub fn n0_dns() -> DnsAddressLookupBuilder
pub fn n0_dns() -> DnsAddressLookupBuilder
Creates a new DNS discovery using the iroh.link domain.
Implementations§
Source§impl DnsAddressLookup
impl DnsAddressLookup
Sourcepub fn builder(origin_domain: String) -> DnsAddressLookupBuilder
pub fn builder(origin_domain: String) -> DnsAddressLookupBuilder
Creates a DnsAddressLookupBuilder that implements AddressLookupBuilder.
Sourcepub fn n0_dns() -> DnsAddressLookupBuilder
pub fn n0_dns() -> DnsAddressLookupBuilder
Creates a new DNS address lookup using the iroh.link domain.
This uses the N0_DNS_ENDPOINT_ORIGIN_PROD domain.
§Usage during tests
-For testing it is possible to use the N0_DNS_ENDPOINT_ORIGIN_STAGING domain
-with DnsAddressLookup::builder. This would then use a hosted staging discovery
-service for testing purposes.
Trait Implementations§
Source§impl AddressLookup for DnsAddressLookup
impl AddressLookup for DnsAddressLookup
Source§fn resolve(
+
When running with the environment variable IROH_FORCE_STAGING_RELAYS
+set to any non empty value the N0_DNS_ENDPOINT_ORIGIN_STAGING domain
+is used instead.
+
fn resolve( +
When running with the environment variable IROH_FORCE_STAGING_RELAYS
+set to any non empty value the N0_DNS_ENDPOINT_ORIGIN_STAGING domain
+is used instead.
Trait Implementations§
Source§impl AddressLookup for DnsAddressLookup
impl AddressLookup for DnsAddressLookup
Source§fn resolve(
&self,
endpoint_id: EndpointId,
) -> Option<BoxStream<Result<AddressLookupItem, AddressLookupError>>>
fn resolve( &self, endpoint_id: EndpointId, ) -> Option<BoxStream<Result<AddressLookupItem, AddressLookupError>>>
Source§fn publish(&self, _data: &EndpointData)
fn publish(&self, _data: &EndpointData)
EndpointData to the Address Lookup mechanism. Read moreAuto Trait Implementations§
impl Freeze for DnsAddressLookup
impl !RefUnwindSafe for DnsAddressLookup
impl Send for DnsAddressLookup
impl Sync for DnsAddressLookup
impl Unpin for DnsAddressLookup
impl !UnwindSafe for DnsAddressLookup
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
diff --git a/pr/4036/docs/iroh/address_lookup/dns/struct.DnsAddressLookupBuilder.html b/pr/4036/docs/iroh/address_lookup/dns/struct.DnsAddressLookupBuilder.html
index a433686831..40aa0b221c 100644
--- a/pr/4036/docs/iroh/address_lookup/dns/struct.DnsAddressLookupBuilder.html
+++ b/pr/4036/docs/iroh/address_lookup/dns/struct.DnsAddressLookupBuilder.html
@@ -2,7 +2,7 @@
impl<T> AddressLookupBuilder for Twhere
diff --git a/pr/4036/docs/iroh/address_lookup/dns/struct.DnsAddressLookupBuilder.html b/pr/4036/docs/iroh/address_lookup/dns/struct.DnsAddressLookupBuilder.html
index a433686831..40aa0b221c 100644
--- a/pr/4036/docs/iroh/address_lookup/dns/struct.DnsAddressLookupBuilder.html
+++ b/pr/4036/docs/iroh/address_lookup/dns/struct.DnsAddressLookupBuilder.html
@@ -2,7 +2,7 @@
Implementations§
Source§impl DnsAddressLookupBuilder
impl DnsAddressLookupBuilder
Sourcepub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self
pub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self
Sets the DNS resolver to use.
Sourcepub fn build(self) -> DnsAddressLookup
pub fn build(self) -> DnsAddressLookup
Builds a DnsAddressLookup with the passed DnsResolver.
Trait Implementations§
Trait Implementations§
Source§impl AddressLookupBuilder for DnsAddressLookupBuilder
impl AddressLookupBuilder for DnsAddressLookupBuilder
Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
) -> Result<impl AddressLookup, AddressLookupBuilderError>
fn into_address_lookup( self, endpoint: &Endpoint, ) -> Result<impl AddressLookup, AddressLookupBuilderError>
AddressLookup. Read moreAuto Trait Implementations§
impl Freeze for DnsAddressLookupBuilder
impl !RefUnwindSafe for DnsAddressLookupBuilder
impl Send for DnsAddressLookupBuilder
impl Sync for DnsAddressLookupBuilder
impl Unpin for DnsAddressLookupBuilder
impl !UnwindSafe for DnsAddressLookupBuilder
Blanket Implementations§
Source§impl<T> Any for Twhere
diff --git a/pr/4036/docs/iroh/address_lookup/index.html b/pr/4036/docs/iroh/address_lookup/index.html
index cbef5f5fbd..032f4526c7 100644
--- a/pr/4036/docs/iroh/address_lookup/index.html
+++ b/pr/4036/docs/iroh/address_lookup/index.html
@@ -1,9 +1,9 @@
iroh::address_lookup - Rust Module address_lookup
Expand description
Lookup the address of an Endpoint ID.
To connect to an iroh endpoint a EndpointAddr is needed, which may contain a
RelayUrl or one or more direct addresses in addition to the EndpointId.
-Since there is a conversion from EndpointId to EndpointAddr, you can also use
+
Since there is a conversion from EndpointId to EndpointAddr, you can also
connect directly with a EndpointId.
-For this to work however, the endpoint has to get the addressing information by
+
For this to work however, the endpoint has to get the addressing information by
other means.
AddressLookup is an automated system for an Endpoint to retrieve this addressing
information. Each iroh endpoint will automatically publish their own addressing
@@ -42,16 +42,16 @@ using HTTP.
mDNS-based and Mainline-DHT-based Address Lookup services live in
separate crates: iroh-mdns-address-lookup and
iroh-mainline-address-lookup.
-To use multiple Address Lookup’ssimultaneously you can call Builder::address_lookup.
+
To use multiple Address Lookups simultaneously you can call Builder::address_lookup.
This will use AddressLookupServices under the hood, which performs lookups to all
-Address Lookupsystems at the same time.
+Address Lookup systems at the same time.
Builder::address_lookup takes any type that implements AddressLookupBuilder. You can
implement that trait on a builder struct if your Address Lookup needs information
from the endpoint it is mounted on. After endpoint construction, your Address Lookup
is built by calling AddressLookupBuilder::into_address_lookup, passing the finished Endpoint to your
builder.
-If your Address Lookupdoes not need any information from its endpoint, you can
-pass the Address Lookupservice directly to Builder::address_lookup: All types that
+
If your Address Lookup does not need any information from its endpoint, you can
+pass the Address Lookup service directly to Builder::address_lookup: All types that
implement AddressLookup also have a blanket implementation of AddressLookupBuilder.
§Examples
A very common setup is to enable DNS Address Lookup, which needs to be done in two parts as a
@@ -69,4 +69,4 @@ implement await?;
Re-exports§
Modules§
- dns
Non-wasm_browser - DNS endpoint discovery for iroh
- memory
- An in-memory address lookup system to manually add endpoint addressing information.
- pkarr
- An address lookup service which publishes and resolves endpoint information using a pkarr relay.
Structs§
- Addr
Filter - A filter and/or reordering function applied to transport addresses,
-typically used by AddressLookup services in iroh before publishing.
- Address
LookupServices - Registry for address lookup services for an
Endpoint. - Endpoint
Data - Data about an endpoint that may be published to and resolved from discovery services.
- Endpoint
Info - Information about an endpoint that may be published to and resolved from discovery services.
- Error
- Error returned by address lookup services when failing to perform the lookup.
- Filtered
AddressLookup - An
AddressLookup wrapper that filters addresses before publishing. - Item
- Address lookup results from
AddressLookups. - User
Data - Under the hood this is a UTF-8 String is no longer than
UserData::MAX_LENGTH bytes.
Enums§
- Address
LookupBuilderError AddressLookupBuilder errors- Address
LookupFailed AddressLookup errors- Parse
Error
Traits§
- Address
Lookup - AddressLookup system for
super::Endpoint. - Address
LookupBuilder - Trait for structs that can be converted into
AddressLookups.
\ No newline at end of file
+typically used by AddressLookup services in iroh before publishing.AddressLookupServices Registry for address lookup services for an Endpoint. EndpointData Data about an endpoint that may be published to and resolved from discovery services. EndpointInfo Information about an endpoint that may be published to and resolved from discovery services. Error Error returned by address lookup services when failing to perform the lookup. FilteredAddressLookup An AddressLookup wrapper that filters addresses before publishing. Item Address lookup results from AddressLookups. UserData User-defined data that can be published and resolved through endpoint discovery. Enums§
- Address
LookupBuilderError AddressLookupBuilder errors- Address
LookupFailed AddressLookup errors- Parse
Error
Traits§
- Address
Lookup - AddressLookup system for
super::Endpoint. - Address
LookupBuilder - Trait for structs that can be converted into
AddressLookups.
impl<T> Any for Twhere
diff --git a/pr/4036/docs/iroh/address_lookup/index.html b/pr/4036/docs/iroh/address_lookup/index.html
index cbef5f5fbd..032f4526c7 100644
--- a/pr/4036/docs/iroh/address_lookup/index.html
+++ b/pr/4036/docs/iroh/address_lookup/index.html
@@ -1,9 +1,9 @@
iroh::address_lookup - Rust Module address_lookup
Expand description
Lookup the address of an Endpoint ID.
To connect to an iroh endpoint a EndpointAddr is needed, which may contain a
RelayUrl or one or more direct addresses in addition to the EndpointId.
-Since there is a conversion from EndpointId to EndpointAddr, you can also use
+
Since there is a conversion from EndpointId to EndpointAddr, you can also
connect directly with a EndpointId.
-For this to work however, the endpoint has to get the addressing information by
+
For this to work however, the endpoint has to get the addressing information by
other means.
AddressLookup is an automated system for an Endpoint to retrieve this addressing
information. Each iroh endpoint will automatically publish their own addressing
@@ -42,16 +42,16 @@ using HTTP.
mDNS-based and Mainline-DHT-based Address Lookup services live in
separate crates: iroh-mdns-address-lookup and
iroh-mainline-address-lookup.
-To use multiple Address Lookup’ssimultaneously you can call Builder::address_lookup.
+
To use multiple Address Lookups simultaneously you can call Builder::address_lookup.
This will use AddressLookupServices under the hood, which performs lookups to all
-Address Lookupsystems at the same time.
+Address Lookup systems at the same time.
Builder::address_lookup takes any type that implements AddressLookupBuilder. You can
implement that trait on a builder struct if your Address Lookup needs information
from the endpoint it is mounted on. After endpoint construction, your Address Lookup
is built by calling AddressLookupBuilder::into_address_lookup, passing the finished Endpoint to your
builder.
-If your Address Lookupdoes not need any information from its endpoint, you can
-pass the Address Lookupservice directly to Builder::address_lookup: All types that
+
If your Address Lookup does not need any information from its endpoint, you can
+pass the Address Lookup service directly to Builder::address_lookup: All types that
implement AddressLookup also have a blanket implementation of AddressLookupBuilder.
§Examples
A very common setup is to enable DNS Address Lookup, which needs to be done in two parts as a
@@ -69,4 +69,4 @@ implement await?;
Re-exports§
Modules§
- dns
Non-wasm_browser - DNS endpoint discovery for iroh
- memory
- An in-memory address lookup system to manually add endpoint addressing information.
- pkarr
- An address lookup service which publishes and resolves endpoint information using a pkarr relay.
Structs§
- Addr
Filter - A filter and/or reordering function applied to transport addresses,
-typically used by AddressLookup services in iroh before publishing.
- Address
LookupServices - Registry for address lookup services for an
Endpoint. - Endpoint
Data - Data about an endpoint that may be published to and resolved from discovery services.
- Endpoint
Info - Information about an endpoint that may be published to and resolved from discovery services.
- Error
- Error returned by address lookup services when failing to perform the lookup.
- Filtered
AddressLookup - An
AddressLookup wrapper that filters addresses before publishing. - Item
- Address lookup results from
AddressLookups. - User
Data - Under the hood this is a UTF-8 String is no longer than
UserData::MAX_LENGTH bytes.
Enums§
- Address
LookupBuilderError AddressLookupBuilder errors- Address
LookupFailed AddressLookup errors- Parse
Error
Traits§
- Address
Lookup - AddressLookup system for
super::Endpoint. - Address
LookupBuilder - Trait for structs that can be converted into
AddressLookups.
\ No newline at end of file
+typically used by AddressLookup services in iroh before publishing.AddressLookupServices Registry for address lookup services for an Endpoint. EndpointData Data about an endpoint that may be published to and resolved from discovery services. EndpointInfo Information about an endpoint that may be published to and resolved from discovery services. Error Error returned by address lookup services when failing to perform the lookup. FilteredAddressLookup An AddressLookup wrapper that filters addresses before publishing. Item Address lookup results from AddressLookups. UserData User-defined data that can be published and resolved through endpoint discovery. Enums§
- Address
LookupBuilderError AddressLookupBuilder errors- Address
LookupFailed AddressLookup errors- Parse
Error
Traits§
- Address
Lookup - AddressLookup system for
super::Endpoint. - Address
LookupBuilder - Trait for structs that can be converted into
AddressLookups.
Module address_lookup
Expand description
Lookup the address of an Endpoint ID.
To connect to an iroh endpoint a EndpointAddr is needed, which may contain a
RelayUrl or one or more direct addresses in addition to the EndpointId.
Since there is a conversion from EndpointId to EndpointAddr, you can also use
+
Since there is a conversion from EndpointId to EndpointAddr, you can also
connect directly with a EndpointId.
For this to work however, the endpoint has to get the addressing information by +
For this to work however, the endpoint has to get the addressing information by other means.
AddressLookup is an automated system for an Endpoint to retrieve this addressing
information. Each iroh endpoint will automatically publish their own addressing
@@ -42,16 +42,16 @@ using HTTP.
mDNS-based and Mainline-DHT-based Address Lookup services live in
separate crates: iroh-mdns-address-lookup and
iroh-mainline-address-lookup.
To use multiple Address Lookup’ssimultaneously you can call Builder::address_lookup.
+
To use multiple Address Lookups simultaneously you can call Builder::address_lookup.
This will use AddressLookupServices under the hood, which performs lookups to all
-Address Lookupsystems at the same time.
Builder::address_lookup takes any type that implements AddressLookupBuilder. You can
implement that trait on a builder struct if your Address Lookup needs information
from the endpoint it is mounted on. After endpoint construction, your Address Lookup
is built by calling AddressLookupBuilder::into_address_lookup, passing the finished Endpoint to your
builder.
If your Address Lookupdoes not need any information from its endpoint, you can
-pass the Address Lookupservice directly to Builder::address_lookup: All types that
+
If your Address Lookup does not need any information from its endpoint, you can
+pass the Address Lookup service directly to Builder::address_lookup: All types that
implement AddressLookup also have a blanket implementation of AddressLookupBuilder.
§Examples
A very common setup is to enable DNS Address Lookup, which needs to be done in two parts as a @@ -69,4 +69,4 @@ implement await?;
Re-exports§
Modules§
- dns
Non- wasm_browser - DNS endpoint discovery for iroh
- memory
- An in-memory address lookup system to manually add endpoint addressing information.
- pkarr
- An address lookup service which publishes and resolves endpoint information using a pkarr relay.
Structs§
- Addr
Filter - A filter and/or reordering function applied to transport addresses, -typically used by AddressLookup services in iroh before publishing.
- Address
Lookup Services - Registry for address lookup services for an
Endpoint. - Endpoint
Data - Data about an endpoint that may be published to and resolved from discovery services.
- Endpoint
Info - Information about an endpoint that may be published to and resolved from discovery services.
- Error
- Error returned by address lookup services when failing to perform the lookup.
- Filtered
Address Lookup - An
AddressLookupwrapper that filters addresses before publishing. - Item
- Address lookup results from
AddressLookups. - User
Data - Under the hood this is a UTF-8 String is no longer than
UserData::MAX_LENGTHbytes.
Enums§
- Address
Lookup Builder Error AddressLookupBuildererrors- Address
Lookup Failed AddressLookuperrors- Parse
Error
Traits§
- Address
Lookup - AddressLookup system for
super::Endpoint. - Address
Lookup Builder - Trait for structs that can be converted into
AddressLookups.
Endpoint.AddressLookup wrapper that filters addresses before publishing.AddressLookups.AddressLookupBuilder errorsAddressLookup errorssuper::Endpoint.AddressLookups.Module memory
Expand description
An in-memory address lookup system to manually add endpoint addressing information.
+Module memory
Expand description
An in-memory address lookup system to manually add endpoint addressing information.
Often an application might get endpoint addressing information out-of-band in an
application-specific way. EndpointTicket’s are one common way used to achieve this.
This addressing information is often only usable for a limited time so needs to
-be able to be removed again once know it is no longer useful.
This is where the MemoryLookup is useful: it allows applications to add and
retract endpoint addressing information that is otherwise out-of-band to iroh.
Structs§
- Memory
Lookup - An in-memory address lookup system to manually add endpoint addressing information.
MemoryLookup
pub struct MemoryLookup { /* private fields */ }Expand description
An in-memory address lookup system to manually add endpoint addressing information.
+MemoryLookup
pub struct MemoryLookup { /* private fields */ }Expand description
An in-memory address lookup system to manually add endpoint addressing information.
Often an application might get endpoint addressing information out-of-band in an
application-specific way. EndpointTicket’s are one common way used to achieve this.
This addressing information is often only usable for a limited time so needs to
-be able to be removed again once know it is no longer useful.
This is where the MemoryLookup is useful: it allows applications to add and
retract endpoint addressing information that is otherwise out-of-band to iroh.
§Examples
@@ -29,15 +29,15 @@ retract endpoint addressing information that is otherwise out-of-band to iroh. .into_iter() .collect(), }); -Implementations§
Source§impl MemoryLookup
impl MemoryLookup
Sourcepub const PROVENANCE: &'static str = "memory_lookup"
pub const PROVENANCE: &'static str = "memory_lookup"
The provenance string for this Address Lookup implementation.
+Implementations§
Source§impl MemoryLookup
impl MemoryLookup
Sourcepub const PROVENANCE: &'static str = "memory_lookup"
pub const PROVENANCE: &'static str = "memory_lookup"
The provenance string for this Address Lookup implementation.
This is mostly used for debugging information and allows understanding the origin of
addressing information used by an iroh Endpoint.
Sourcepub fn with_provenance(provenance: &'static str) -> Self
pub fn with_provenance(provenance: &'static str) -> Self
Creates a new Memory Lookup instance with the provided provenance.
Sourcepub fn with_provenance(provenance: &'static str) -> Self
pub fn with_provenance(provenance: &'static str) -> Self
Creates a new Memory Lookup instance with the provided provenance.
The provenance is part of address_lookup::Items returned from Self::resolve.
It is mostly used for debugging information and allows understanding the origin of
addressing information used by an iroh Endpoint.
Sourcepub fn from_endpoint_info(
+
pub fn from_endpoint_info( +
Sourcepub fn from_endpoint_info(
infos: impl IntoIterator<Item = impl Into<EndpointInfo>>,
) -> Self
pub fn from_endpoint_info( infos: impl IntoIterator<Item = impl Into<EndpointInfo>>, ) -> Self
Creates a Memory Lookup instance from endpoint addresses.
§Examples
@@ -54,27 +54,27 @@ addressing information used by an iroh let endpoint = Endpoint::builder(presets::N0) .address_lookup(address_lookup) .bind() - .await?;Sourcepub fn set_endpoint_info(
+ .await?;
pub fn set_endpoint_info( + .await?;
Sourcepub fn set_endpoint_info(
&self,
endpoint_info: impl Into<EndpointInfo>,
) -> Option<EndpointData>
pub fn set_endpoint_info( &self, endpoint_info: impl Into<EndpointInfo>, ) -> Option<EndpointData>
Sets endpoint addressing information for the given endpoint ID.
This will completely overwrite any existing info for the endpoint.
Returns the EndpointData of the previous entry, or None if there was no previous
entry for this endpoint ID.
Sourcepub fn add_endpoint_info(&self, endpoint_info: impl Into<EndpointInfo>)
pub fn add_endpoint_info(&self, endpoint_info: impl Into<EndpointInfo>)
Augments endpoint addressing information for the given endpoint ID.
+Sourcepub fn add_endpoint_info(&self, endpoint_info: impl Into<EndpointInfo>)
pub fn add_endpoint_info(&self, endpoint_info: impl Into<EndpointInfo>)
Augments endpoint addressing information for the given endpoint ID.
The provided addressing information is combined with the existing info in the memory lookup. Any new direct addresses are added to those already present while the relay URL is overwritten.
-Sourcepub fn get_endpoint_info(&self, endpoint_id: EndpointId) -> Option<EndpointInfo>
pub fn get_endpoint_info(&self, endpoint_id: EndpointId) -> Option<EndpointInfo>
Returns endpoint addressing information for the given endpoint ID.
-Sourcepub fn remove_endpoint_info(
+
pub fn remove_endpoint_info( +
Sourcepub fn get_endpoint_info(&self, endpoint_id: EndpointId) -> Option<EndpointInfo>
pub fn get_endpoint_info(&self, endpoint_id: EndpointId) -> Option<EndpointInfo>
Returns endpoint addressing information for the given endpoint ID.
+Sourcepub fn remove_endpoint_info(
&self,
endpoint_id: EndpointId,
) -> Option<EndpointInfo>
pub fn remove_endpoint_info( &self, endpoint_id: EndpointId, ) -> Option<EndpointInfo>
Removes all endpoint addressing information for the given endpoint ID.
Any removed information is returned.
-Trait Implementations§
Source§impl AddressLookup for MemoryLookup
impl AddressLookup for MemoryLookup
Source§fn publish(&self, _data: &EndpointData)
fn publish(&self, _data: &EndpointData)
EndpointData to the Address Lookup mechanism. Read moreTrait Implementations§
Source§impl AddressLookup for MemoryLookup
impl AddressLookup for MemoryLookup
Source§fn publish(&self, _data: &EndpointData)
fn publish(&self, _data: &EndpointData)
EndpointData to the Address Lookup mechanism. Read moreSource§impl Clone for MemoryLookup
impl Clone for MemoryLookup
Source§fn clone(&self) -> MemoryLookup
fn clone(&self) -> MemoryLookup
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MemoryLookup
impl Debug for MemoryLookup
Auto Trait Implementations§
impl Freeze for MemoryLookup
impl RefUnwindSafe for MemoryLookup
impl Send for MemoryLookup
impl Sync for MemoryLookup
impl Unpin for MemoryLookup
impl UnwindSafe for MemoryLookup
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for T
impl<T> AddressLookupBuilder for T
Source§impl Clone for MemoryLookup
impl Clone for MemoryLookup
Source§fn clone(&self) -> MemoryLookup
fn clone(&self) -> MemoryLookup
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MemoryLookup
impl Debug for MemoryLookup
Auto Trait Implementations§
impl Freeze for MemoryLookup
impl RefUnwindSafe for MemoryLookup
impl Send for MemoryLookup
impl Sync for MemoryLookup
impl Unpin for MemoryLookup
impl UnwindSafe for MemoryLookup
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
T: AddressLookup,
impl<T> AddressLookupBuilder for Twhere
T: AddressLookup,
Source§fn into_address_lookup(
self,
_endpoint: &Endpoint,
diff --git a/pr/4036/docs/iroh/address_lookup/pkarr/index.html b/pr/4036/docs/iroh/address_lookup/pkarr/index.html
index 25f896e3a3..38c973b4c9 100644
--- a/pr/4036/docs/iroh/address_lookup/pkarr/index.html
+++ b/pr/4036/docs/iroh/address_lookup/pkarr/index.html
@@ -1,4 +1,4 @@
-iroh::address_lookup::pkarr - Rust Module pkarr
Expand description
An address lookup service which publishes and resolves endpoint information using a pkarr relay.
+iroh::address_lookup::pkarr - Rust Module pkarr
Expand description
An address lookup service which publishes and resolves endpoint information using a pkarr relay.
Public-Key Addressable Resource Records, pkarr, is a system which allows publishing
DNS Resource Records owned by a particular SecretKey under a name derived from its
corresponding PublicKey, also known as the EndpointId. Additionally this pkarr
diff --git a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html
index 0244bdd3e4..10f952f4f3 100644
--- a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html
+++ b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html
@@ -1,28 +1,30 @@
-
PkarrPublisher in iroh::address_lookup::pkarr - Rust PkarrPublisher
pub struct PkarrPublisher { /* private fields */ }
Expand description
Publisher of address lookup information to a pkarr relay.
+PkarrPublisher in iroh::address_lookup::pkarr - Rust PkarrPublisher
pub struct PkarrPublisher { /* private fields */ }
Expand description
Publisher of address lookup information to a pkarr relay.
This publisher uses HTTP to publish address lookup information to a pkarr relay
server, see the module docs for details.
This implements the AddressLookup trait to be used as an address lookup service. Note
that it only publishes address lookup information, for the corresponding resolver use
the PkarrResolver together with AddressLookupServices.
-This publisher will only publish the RelayUrl if it is set, otherwise the direct addresses are published instead.
-Implementations§
Source§impl PkarrPublisher
Sourcepub fn builder(pkarr_relay: Url) -> PkarrPublisherBuilder
Returns a PkarrPublisherBuilder that publishes endpoint info to a pkarr relay at pkarr_relay.
-If no further options are set, the pkarr publisher will use DEFAULT_PKARR_TTL as the
+
By default this publisher only publishes the RelayUrl, to avoid leaking IP addresses to
+the public pkarr server. Which addresses are published is controlled by the AddrFilter
+set via PkarrPublisherBuilder::addr_filter.
+Implementations§
Source§impl PkarrPublisher
Sourcepub fn builder(pkarr_relay: Url) -> PkarrPublisherBuilder
Returns a PkarrPublisherBuilder that publishes endpoint info to a pkarr relay at pkarr_relay.
+If no further options are set, the pkarr publisher will use DEFAULT_PKARR_TTL as the
time-to-live value for the published packets, and it will republish Address Lookup information
every DEFAULT_REPUBLISH_INTERVAL, even if the information is unchanged.
PkarrPublisherBuilder implements AddressLookupBuilder, so it can be passed to address_lookup.
It will then use the endpoint’s secret key to sign published packets.
-Sourcepub fn n0_dns() -> PkarrPublisherBuilder
Creates a pkarr publisher which uses the number 0 pkarr relay server.
+Sourcepub fn n0_dns() -> PkarrPublisherBuilder
Creates a pkarr publisher which uses the number 0 pkarr relay server.
This uses the pkarr relay server operated by number 0, at
N0_DNS_PKARR_RELAY_PROD.
When running with the environment variable
IROH_FORCE_STAGING_RELAYS set to any non empty value N0_DNS_PKARR_RELAY_STAGING
server is used instead.
-Sourcepub fn update_endpoint_data(&self, data: &EndpointData)
Publishes the addressing information about this endpoint to a pkarr relay.
+Sourcepub fn update_endpoint_data(&self, data: &EndpointData)
Publishes the addressing information about this endpoint to a pkarr relay.
This is a nonblocking function, the actual update is performed in the background.
-Trait Implementations§
Source§impl AddressLookup for PkarrPublisher
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreTrait Implementations§
Source§impl AddressLookup for PkarrPublisher
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreSource§impl Clone for PkarrPublisher
Source§fn clone(&self) -> PkarrPublisher
Returns a duplicate 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 PkarrPublisher
§impl !RefUnwindSafe for PkarrPublisher
§impl Send for PkarrPublisher
§impl Sync for PkarrPublisher
§impl Unpin for PkarrPublisher
§impl !UnwindSafe for PkarrPublisher
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for T
Source§impl Clone for PkarrPublisher
Source§fn clone(&self) -> PkarrPublisher
Returns a duplicate 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 PkarrPublisher
§impl !RefUnwindSafe for PkarrPublisher
§impl Send for PkarrPublisher
§impl Sync for PkarrPublisher
§impl Unpin for PkarrPublisher
§impl !UnwindSafe for PkarrPublisher
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
T: AddressLookup,
Source§fn into_address_lookup(
self,
_endpoint: &Endpoint,
diff --git a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
index aca2855501..bdab189c43 100644
--- a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
+++ b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
@@ -1,18 +1,18 @@
-PkarrRelayClient in iroh::address_lookup::pkarr - Rust PkarrRelayClient
pub struct PkarrRelayClient { /* private fields */ }
Expand description
A pkarr client to publish SignedPackets to a pkarr relay.
-Implementations§
Source§impl PkarrRelayClient
Sourcepub fn new(
+PkarrRelayClient in iroh::address_lookup::pkarr - Rust PkarrRelayClient
pub struct PkarrRelayClient { /* private fields */ }
Expand description
A pkarr client to publish SignedPackets to a pkarr relay.
+Implementations§
Source§impl PkarrRelayClient
Sourcepub fn new(
pkarr_relay_url: Url,
tls_config: ClientConfig,
dns_resolver: DnsResolver,
) -> Self
Available on non-wasm_browser only.
Creates a PkarrRelayClient.
-Sourcepub async fn resolve(
&self,
endpoint_id: EndpointId,
) -> Result<SignedPacket, AddressLookupError>
Resolves a SignedPacket for the given EndpointId.
-Sourcepub async fn publish(
&self,
signed_packet: &SignedPacket,
) -> Result<(), PkarrError>
Publishes a SignedPacket.
-
Trait Implementations§
Source§impl Clone for PkarrRelayClient
Source§fn clone(&self) -> PkarrRelayClient
Returns a duplicate 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 PkarrRelayClient
§impl !RefUnwindSafe for PkarrRelayClient
§impl Send for PkarrRelayClient
§impl Sync for PkarrRelayClient
§impl Unpin for PkarrRelayClient
§impl !UnwindSafe for PkarrRelayClient
Blanket Implementations§
Trait Implementations§
Source§impl Clone for PkarrRelayClient
Source§fn clone(&self) -> PkarrRelayClient
Returns a duplicate 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 PkarrRelayClient
§impl !RefUnwindSafe for PkarrRelayClient
§impl Send for PkarrRelayClient
§impl Sync for PkarrRelayClient
§impl Unpin for PkarrRelayClient
§impl !UnwindSafe for PkarrRelayClient
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/4036/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
index 79d8b2e2a8..0c08b03913 100644
--- a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
+++ b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
@@ -1,6 +1,6 @@
-PkarrRelayClientBuilder in iroh::address_lookup::pkarr - Rust PkarrRelayClientBuilder
pub struct PkarrRelayClientBuilder { /* private fields */ }
Expand description
A builder for the PkarrRelayClient
-Implementations§
Source§impl PkarrRelayClientBuilder
Sourcepub fn build(self) -> PkarrRelayClient
Build a PkarrRelayClient.
-Trait Implementations§
Source§impl Clone for PkarrRelayClientBuilder
Source§fn clone(&self) -> PkarrRelayClientBuilder
Returns a duplicate 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 PkarrRelayClientBuilder
§impl !RefUnwindSafe for PkarrRelayClientBuilder
§impl Send for PkarrRelayClientBuilder
§impl Sync for PkarrRelayClientBuilder
§impl Unpin for PkarrRelayClientBuilder
§impl !UnwindSafe for PkarrRelayClientBuilder
Blanket Implementations§
Source§impl<T> Any for Twhere
+PkarrRelayClientBuilder in iroh::address_lookup::pkarr - Rust PkarrRelayClientBuilder
pub struct PkarrRelayClientBuilder { /* private fields */ }
Expand description
A builder for the PkarrRelayClient
+Implementations§
Source§impl PkarrRelayClientBuilder
Sourcepub fn build(self) -> PkarrRelayClient
Build a PkarrRelayClient.
+Trait Implementations§
Source§impl Clone for PkarrRelayClientBuilder
Source§fn clone(&self) -> PkarrRelayClientBuilder
Returns a duplicate 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 PkarrRelayClientBuilder
§impl !RefUnwindSafe for PkarrRelayClientBuilder
§impl Send for PkarrRelayClientBuilder
§impl Sync for PkarrRelayClientBuilder
§impl Unpin for PkarrRelayClientBuilder
§impl !UnwindSafe for PkarrRelayClientBuilder
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/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
index 13e12a4b01..1f7723299d 100644
--- a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
+++ b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
@@ -1,21 +1,21 @@
-PkarrResolver in iroh::address_lookup::pkarr - Rust PkarrResolver
pub struct PkarrResolver { /* private fields */ }
Expand description
Resolver of address lookup information from a pkarr relay.
+PkarrResolver in iroh::address_lookup::pkarr - Rust PkarrResolver
pub struct PkarrResolver { /* private fields */ }
Expand description
Resolver of address lookup information from a pkarr relay.
The resolver uses HTTP to query address lookup information from a pkarr relay server,
see the module docs for details.
This implements the AddressLookup trait to be used as an address lookup service. Note
that it only resolves address lookup information, for the corresponding publisher use
the PkarrPublisher together with AddressLookupServices.
-Implementations§
Source§impl PkarrResolver
Sourcepub fn builder(pkarr_relay: Url) -> PkarrResolverBuilder
Creates a new resolver builder using the pkarr relay server at the URL.
+Implementations§
Source§impl PkarrResolver
Sourcepub fn builder(pkarr_relay: Url) -> PkarrResolverBuilder
Creates a new resolver builder using the pkarr relay server at the URL.
The builder implements AddressLookupBuilder.
-Sourcepub fn n0_dns() -> PkarrResolverBuilder
Creates a pkarr resolver builder which uses the number 0 pkarr relay server.
+Sourcepub fn n0_dns() -> PkarrResolverBuilder
Creates a pkarr resolver builder which uses the number 0 pkarr relay server.
This uses the pkarr relay server operated by number 0 at
N0_DNS_PKARR_RELAY_PROD.
When running with the environment variable IROH_FORCE_STAGING_RELAYS
set to any non empty value N0_DNS_PKARR_RELAY_STAGING
server is used instead.
-Trait Implementations§
Source§impl AddressLookup for PkarrResolver
Trait Implementations§
Source§impl AddressLookup for PkarrResolver
Source§fn resolve(
&self,
endpoint_id: EndpointId,
-) -> Option<BoxStream<Result<AddressLookupItem, AddressLookupError>>>
Source§fn publish(&self, _data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreSource§impl Clone for PkarrResolver
Source§fn clone(&self) -> PkarrResolver
Returns a duplicate 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 PkarrResolver
§impl !RefUnwindSafe for PkarrResolver
§impl Send for PkarrResolver
§impl Sync for PkarrResolver
§impl Unpin for PkarrResolver
§impl !UnwindSafe for PkarrResolver
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
+) -> Option<BoxStream<Result<AddressLookupItem, AddressLookupError>>>Source§fn publish(&self, _data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read more
Source§impl Clone for PkarrResolver
Source§fn clone(&self) -> PkarrResolver
Returns a duplicate 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 PkarrResolver
§impl !RefUnwindSafe for PkarrResolver
§impl Send for PkarrResolver
§impl Sync for PkarrResolver
§impl Unpin for PkarrResolver
§impl !UnwindSafe for PkarrResolver
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
T: AddressLookup,
Source§fn into_address_lookup(
self,
_endpoint: &Endpoint,
diff --git a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
index cfd47f28e6..e549ec9d07 100644
--- a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
+++ b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
@@ -1,11 +1,11 @@
-PkarrResolverBuilder in iroh::address_lookup::pkarr - Rust PkarrResolverBuilder
pub struct PkarrResolverBuilder { /* private fields */ }
Expand description
Builder for PkarrResolver.
+PkarrResolverBuilder in iroh::address_lookup::pkarr - Rust PkarrResolverBuilder
pub struct PkarrResolverBuilder { /* private fields */ }
Expand description
Builder for PkarrResolver.
-Implementations§
Source§impl PkarrResolverBuilder
Sourcepub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self
Available on non-wasm_browser only.
Sets the DNS resolver to use for resolving the pkarr relay URL.
-Sourcepub fn build(self, tls_config: ClientConfig) -> PkarrResolver
Creates a PkarrResolver from this builder.
-Trait Implementations§
Implementations§
Source§impl PkarrResolverBuilder
Sourcepub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self
Available on non-wasm_browser only.
Sets the DNS resolver to use for resolving the pkarr relay URL.
+Sourcepub fn build(self, tls_config: ClientConfig) -> PkarrResolver
Creates a PkarrResolver from this builder.
+Trait Implementations§
Source§impl AddressLookupBuilder for PkarrResolverBuilder
Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this builder into a ready-to-use AddressLookup. Read moreAuto Trait Implementations§
§impl Freeze for PkarrResolverBuilder
§impl !RefUnwindSafe for PkarrResolverBuilder
§impl Send for PkarrResolverBuilder
§impl Sync for PkarrResolverBuilder
§impl Unpin for PkarrResolverBuilder
§impl !UnwindSafe for PkarrResolverBuilder
Blanket Implementations§
Source§impl<T> Any for Twhere
+) -> Result<impl AddressLookup, AddressLookupBuilderError>Turns this builder into a ready-to-use AddressLookup. Read more
Auto Trait Implementations§
§impl Freeze for PkarrResolverBuilder
§impl !RefUnwindSafe for PkarrResolverBuilder
§impl Send for PkarrResolverBuilder
§impl Sync for PkarrResolverBuilder
§impl Unpin for PkarrResolverBuilder
§impl !UnwindSafe for PkarrResolverBuilder
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/4036/docs/iroh/address_lookup/struct.EndpointData.html b/pr/4036/docs/iroh/address_lookup/struct.EndpointData.html
index 1ea4773718..7de6a2dd89 100644
--- a/pr/4036/docs/iroh/address_lookup/struct.EndpointData.html
+++ b/pr/4036/docs/iroh/address_lookup/struct.EndpointData.html
@@ -13,15 +13,15 @@ services, should they not fit into e.g. a single DNS packet otherwise.
See also Self::set_user_data.
Sourcepub fn add_relay_url(&mut self, relay_url: RelayUrl)
Adds the relay URL to the end of the endpoint data, unless it already existed.
Sourcepub fn add_ip_addrs(&mut self, addresses: Vec<SocketAddr>)
Adds addresses in order with duplicates or already existing addresses filtered out.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Adds addresses to the endpoint data in the given ordered, but with duplicates filtered.
-Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data and returns the updated endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Adds addresses to the endpoint data in the given order, but with duplicates filtered.
+Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data.
Sourcepub fn clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn clear_relay_urls(&mut self)
Removes all relay URLs from the endpoint data.
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses.
+Sourcepub fn filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
Returns a vec to allow re-ordering of addresses.
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
diff --git a/pr/4036/docs/iroh/address_lookup/struct.Item.html b/pr/4036/docs/iroh/address_lookup/struct.Item.html
index 9e63b37130..28d59f6feb 100644
--- a/pr/4036/docs/iroh/address_lookup/struct.Item.html
+++ b/pr/4036/docs/iroh/address_lookup/struct.Item.html
@@ -16,14 +16,14 @@ directly from Sourcepub fn last_updated(&self) -> Option<u64>
Returns the optional timestamp when this endpoint info was last updated.
The value is microseconds since the unix epoch.
-Sourcepub fn to_endpoint_addr(&self) -> EndpointAddr
Converts into a EndpointAddr by cloning the needed fields.
-Sourcepub fn into_endpoint_addr(self) -> EndpointAddr
Converts into a EndpointAddr without cloning.
+Sourcepub fn to_endpoint_addr(&self) -> EndpointAddr
Returns an EndpointAddr by cloning the needed fields.
+Sourcepub fn into_endpoint_addr(self) -> EndpointAddr
Converts into an EndpointAddr without cloning.
Methods from Deref<Target = EndpointData>§
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses.
+Sourcepub fn filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
Returns a vec to allow re-ordering of addresses.
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
diff --git a/pr/4036/docs/iroh/address_lookup/struct.UserData.html b/pr/4036/docs/iroh/address_lookup/struct.UserData.html
index 49c2183d40..5ae8665e57 100644
--- a/pr/4036/docs/iroh/address_lookup/struct.UserData.html
+++ b/pr/4036/docs/iroh/address_lookup/struct.UserData.html
@@ -1,4 +1,5 @@
-UserData in iroh::address_lookup - Rust 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.
+UserData in iroh::address_lookup - Rust UserData
pub struct UserData(/* private fields */);
Expand description
User-defined data that can be published and resolved through endpoint discovery.
+Under the hood this is a UTF-8 string 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.
diff --git a/pr/4036/docs/iroh/address_lookup/trait.AddressLookup.html b/pr/4036/docs/iroh/address_lookup/trait.AddressLookup.html
index 1be6efa3e6..79a8044def 100644
--- a/pr/4036/docs/iroh/address_lookup/trait.AddressLookup.html
+++ b/pr/4036/docs/iroh/address_lookup/trait.AddressLookup.html
@@ -22,7 +22,7 @@ Address Lookup information changes. If an Address Lookup mechanism requires a pe
refresh, it should start its own task.
Provided Methods§
Sourcefn publish(&self, _data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism.
This is fire and forget, since the Endpoint can not wait for successful
-publishing. If publishing is async, the implementation should start it’s own task.
+publishing. If publishing is async, the implementation should start its own task.
This will be called from a tokio task, so it is safe to spawn new tasks.
These tasks will be run on the runtime of the super::Endpoint.
Implementations on Foreign Types§
Source§impl<T: AddressLookup> AddressLookup for Arc<T>
Implementors§
Source§impl AddressLookup for DnsAddressLookup
Available on non-wasm_browser only. Source§impl AddressLookup for MemoryLookup
Source§impl AddressLookup for PkarrPublisher
Source§impl AddressLookup for PkarrResolver
Source§impl<T: AddressLookup> AddressLookup for FilteredAddressLookup<T>
\ No newline at end of file
+) -> Option<BoxStream<Result<Item, Error>>>Implementors§
Source§impl AddressLookup for DnsAddressLookup
Available on non-wasm_browser only. Source§impl AddressLookup for MemoryLookup
Source§impl AddressLookup for PkarrPublisher
Source§impl AddressLookup for PkarrResolver
Source§impl<T: AddressLookup> AddressLookup for FilteredAddressLookup<T>
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/address_lookup/trait.AddressLookupBuilder.html b/pr/4036/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
index 35aadc4338..edc4dff899 100644
--- a/pr/4036/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
+++ b/pr/4036/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
@@ -20,5 +20,5 @@ endpoint to Endpoint,
) -> Result<impl AddressLookup, AddressLookupBuilderError>Turns this builder into a ready-to-use AddressLookup.
If an error is returned, building the endpoint will fail with this error.
-Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
Source§impl AddressLookupBuilder for DnsAddressLookupBuilder
Available on non-wasm_browser only. Source§impl AddressLookupBuilder for PkarrPublisherBuilder
Source§impl AddressLookupBuilder for PkarrResolverBuilder
Source§impl<T: AddressLookup> AddressLookupBuilder for T
Blanket no-op impl of AddressLookupBuilder for T: AddressLookup.
+ Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
Source§impl AddressLookupBuilder for DnsAddressLookupBuilder
Available on non-wasm_browser only. Source§impl AddressLookupBuilder for PkarrPublisherBuilder
Source§impl AddressLookupBuilder for PkarrResolverBuilder
Source§impl<T: AddressLookup> AddressLookupBuilder for T
Blanket no-op impl of AddressLookupBuilder for T: AddressLookup.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/defaults/prod/fn.default_ap_relay.html b/pr/4036/docs/iroh/defaults/prod/fn.default_ap_relay.html
index 5961b7d1ab..3a67b98b91 100644
--- a/pr/4036/docs/iroh/defaults/prod/fn.default_ap_relay.html
+++ b/pr/4036/docs/iroh/defaults/prod/fn.default_ap_relay.html
@@ -1,2 +1,2 @@
-default_ap_relay in iroh::defaults::prod - Rust default_ap_relay
pub fn default_ap_relay() -> RelayConfig
Expand description
Get the default RelayConfig for Asia-Pacific
+default_ap_relay in iroh::defaults::prod - Rust default_ap_relay
pub fn default_ap_relay() -> RelayConfig
Expand description
Get the default RelayConfig for Asia-Pacific.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/defaults/prod/index.html b/pr/4036/docs/iroh/defaults/prod/index.html
index 8981fb6be4..b076bc3ce3 100644
--- a/pr/4036/docs/iroh/defaults/prod/index.html
+++ b/pr/4036/docs/iroh/defaults/prod/index.html
@@ -1,2 +1,2 @@
iroh::defaults::prod - Rust Module prod
Expand description
Production configuration.
-Constants§
- AP_
RELAY_HOSTNAME - Hostname of the default Asia-Pacific relay.
- EU_
RELAY_HOSTNAME - Hostname of the default EU relay.
- NA_
EAST_RELAY_HOSTNAME - Hostname of the default NA east relay.
- NA_
WEST_RELAY_HOSTNAME - Hostname of the default NA west relay.
Functions§
- default_
ap_relay - Get the default
RelayConfig for Asia-Pacific - default_
eu_relay - Get the default
RelayConfig for EU. - default_
na_east_relay - Get the default
RelayConfig for NA east. - default_
na_west_relay - Get the default
RelayConfig for NA west. - default_
relay_map - Get the default
RelayMap.
\ No newline at end of file
+Constants§
- AP_
RELAY_HOSTNAME - Hostname of the default Asia-Pacific relay.
- EU_
RELAY_HOSTNAME - Hostname of the default EU relay.
- NA_
EAST_RELAY_HOSTNAME - Hostname of the default NA east relay.
- NA_
WEST_RELAY_HOSTNAME - Hostname of the default NA west relay.
Functions§
- default_
ap_relay - Get the default
RelayConfig for Asia-Pacific. - default_
eu_relay - Get the default
RelayConfig for EU. - default_
na_east_relay - Get the default
RelayConfig for NA east. - default_
na_west_relay - Get the default
RelayConfig for NA west. - default_
relay_map - Get the default
RelayMap.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/dns/struct.DnsResolver.html b/pr/4036/docs/iroh/dns/struct.DnsResolver.html
index 754fa26465..3f8c6e27b6 100644
--- a/pr/4036/docs/iroh/dns/struct.DnsResolver.html
+++ b/pr/4036/docs/iroh/dns/struct.DnsResolver.html
@@ -15,7 +15,7 @@ public DNS.
Implementations§
Source§impl DnsResolver
Sourcepub fn new() -> DnsResolver
Creates 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.
+to the default ResolverConfig which uses e.g. Google’s 8.8.8.8 or 8.8.4.4.
Sourcepub fn with_nameserver(nameserver: SocketAddr) -> DnsResolver
Creates a new DNS resolver configured with a single UDP DNS nameserver.
Sourcepub fn custom(resolver: impl Resolver) -> DnsResolver
Creates a new DnsResolver from a struct that implements Resolver.
diff --git a/pr/4036/docs/iroh/dns/trait.Resolver.html b/pr/4036/docs/iroh/dns/trait.Resolver.html
index 4aaa7642fd..3ebf87a01f 100644
--- a/pr/4036/docs/iroh/dns/trait.Resolver.html
+++ b/pr/4036/docs/iroh/dns/trait.Resolver.html
@@ -38,13 +38,13 @@ atomic swap. Build a new instance with re-bound sockets and re-read nameserver
configuration rather than mutating in place. Must not perform IO: defer DNS
queries and socket binds until the new resolver is first used. May be called
concurrently, in which case all but one allocated replacement is dropped unused.
-Implementations on Foreign Types§
Implementations on Foreign Types§
Source§impl Resolver for Arc<SimpleDnsResolver>
Source§fn lookup_ipv4(
&self,
host: String,
-) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = Ipv4Addr> + Send>, DnsError>> + Send>>
Source§fn lookup_ipv6(
+) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = Ipv4Addr> + Send>, DnsError>> + Send>>
Source§fn lookup_ipv6(
&self,
host: String,
-) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = Ipv6Addr> + Send>, DnsError>> + Send>>
Source§fn lookup_txt(
+) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = Ipv6Addr> + Send>, DnsError>> + Send>>
Source§fn lookup_txt(
&self,
host: String,
-) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = TxtRecordData> + Send>, DnsError>> + Send>>
Source§fn clear_cache(&self)
Source§fn reset(&self) -> Box<dyn Resolver>
Implementors§
\ No newline at end of file
+) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = TxtRecordData> + Send>, DnsError>> + Send>>Source§fn clear_cache(&self)
Source§fn reset(&self) -> Box<dyn Resolver>
Implementors§
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html b/pr/4036/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html
index 0a8e0c05eb..cc00fac5e1 100644
--- a/pr/4036/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html
+++ b/pr/4036/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html
@@ -1,2 +1,2 @@
-ENV_FORCE_STAGING_RELAYS in iroh::endpoint - Rust ENV_FORCE_STAGING_RELAYS
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 ENV_FORCE_STAGING_RELAYS
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint/enum.RelayMode.html b/pr/4036/docs/iroh/endpoint/enum.RelayMode.html
index 326aae7405..0d7b755897 100644
--- a/pr/4036/docs/iroh/endpoint/enum.RelayMode.html
+++ b/pr/4036/docs/iroh/endpoint/enum.RelayMode.html
@@ -1,4 +1,4 @@
-RelayMode in iroh::endpoint - Rust RelayMode
pub enum RelayMode {
+RelayMode in iroh::endpoint - Rust RelayMode
pub enum RelayMode {
Disabled,
Default,
Staging,
@@ -10,14 +10,14 @@ This means that neither listening nor dialing relays will be available.
See crate::defaults::prod for the severs used.
§Staging
Use the staging relay servers from n0.
§Custom(RelayMap)
Use a custom relay map.
-
Implementations§
Source§impl RelayMode
Sourcepub fn custom(map: impl IntoIterator<Item = RelayUrl>) -> Self
Create a custom relay mode from a list of RelayUrls.
+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§
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/4036/docs/iroh/endpoint/fn.default_relay_mode.html b/pr/4036/docs/iroh/endpoint/fn.default_relay_mode.html
index d716677abc..98ff3579ee 100644
--- a/pr/4036/docs/iroh/endpoint/fn.default_relay_mode.html
+++ b/pr/4036/docs/iroh/endpoint/fn.default_relay_mode.html
@@ -1,4 +1,4 @@
-default_relay_mode in iroh::endpoint - Rust default_relay_mode
pub fn default_relay_mode() -> RelayMode
Expand description
Returns the default relay mode.
+default_relay_mode in iroh::endpoint - Rust default_relay_mode
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint/fn.force_staging_infra.html b/pr/4036/docs/iroh/endpoint/fn.force_staging_infra.html
index ff8dda7e69..b444491b3e 100644
--- a/pr/4036/docs/iroh/endpoint/fn.force_staging_infra.html
+++ b/pr/4036/docs/iroh/endpoint/fn.force_staging_infra.html
@@ -1,2 +1,2 @@
-force_staging_infra in iroh::endpoint - Rust force_staging_infra
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 force_staging_infra
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint/index.html b/pr/4036/docs/iroh/endpoint/index.html
index 2efb803d4c..f3a98d45f2 100644
--- a/pr/4036/docs/iroh/endpoint/index.html
+++ b/pr/4036/docs/iroh/endpoint/index.html
@@ -1,4 +1,4 @@
-iroh::endpoint - Rust Module endpoint
Expand description
The Endpoint allows establishing connections to other iroh endpoints.
+iroh::endpoint - Rust Module endpoint
Expand description
The Endpoint allows establishing connections to other iroh endpoints.
The Endpoint is the main API interface to manage a local iroh endpoint. It allows
connecting to and accepting connections from other endpoints. See the module docs for
more details on how iroh connections work.
diff --git a/pr/4036/docs/iroh/endpoint/presets/index.html b/pr/4036/docs/iroh/endpoint/presets/index.html
index 37b792c03d..a454626701 100644
--- a/pr/4036/docs/iroh/endpoint/presets/index.html
+++ b/pr/4036/docs/iroh/endpoint/presets/index.html
@@ -2,4 +2,4 @@
§Example
use iroh::{Endpoint, RelayMode, Watcher, endpoint::presets};
-let endpoint = Endpoint::builder(presets::N0).bind().await?;
Structs§
- Empty
- An empty preset that doesn’t set anything on the builder.
- Minimal
with_crypto_provider - A preset that is almost empty, besides setting mandatory options.
- N0
with_crypto_provider - Configures the endpoint to use the n0 defaults
- N0Disable
Relay with_crypto_provider - Configures the endpoint to use the n0 defaults, but with relay mode disabled.
Traits§
- Preset
- Defines a preset
\ No newline at end of file
+let endpoint = Endpoint::builder(presets::N0).bind().await?;Structs§
- Empty
- An empty preset that doesn’t set anything on the builder.
- Minimal
with_crypto_provider - A preset that is almost empty, besides setting mandatory options.
- N0
with_crypto_provider - Configures the endpoint to use the n0 defaults
- N0Disable
Relay with_crypto_provider - Configures the endpoint to use the n0 defaults, but with relay mode disabled.
Traits§
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint/presets/struct.N0.html b/pr/4036/docs/iroh/endpoint/presets/struct.N0.html
index 41c532b301..cf9fb0156e 100644
--- a/pr/4036/docs/iroh/endpoint/presets/struct.N0.html
+++ b/pr/4036/docs/iroh/endpoint/presets/struct.N0.html
@@ -6,8 +6,8 @@
setting the [rustls::crypto::CryptoProvider] to ring or aws-lc-rs, depending
on which feature is enabled in iroh (preferring ring if both are enabled).
-Due to the last point, this preset is only available with the ring or
-aws-lc-rs preset installed.
+
Due to the last point, this preset is only available with the tls-ring or
+tls-aws-lc-rs feature enabled.
If you want to set your own crypto provider, we recommend copying the
implementation of this preset into your own and setting the appropriate crypto
provider there.
diff --git a/pr/4036/docs/iroh/endpoint/presets/struct.N0DisableRelay.html b/pr/4036/docs/iroh/endpoint/presets/struct.N0DisableRelay.html
index dd14c88ba9..29795833c9 100644
--- a/pr/4036/docs/iroh/endpoint/presets/struct.N0DisableRelay.html
+++ b/pr/4036/docs/iroh/endpoint/presets/struct.N0DisableRelay.html
@@ -7,8 +7,8 @@ relay urls.
setting the [rustls::crypto::CryptoProvider] to ring or aws-lc-rs, depending
on which feature is enabled in iroh (preferring ring if both are enabled).
-Due to the last point, this preset is only available with the ring or
-aws-lc-rs preset installed.
+
Due to the last point, this preset is only available with the tls-ring or
+tls-aws-lc-rs feature enabled.
If you want to set your own crypto provider, we recommend copying the
implementation of this preset into your own and setting the appropriate crypto
provider there.
diff --git a/pr/4036/docs/iroh/endpoint/presets/trait.Preset.html b/pr/4036/docs/iroh/endpoint/presets/trait.Preset.html
index 59a71a95da..7e6f4bbcac 100644
--- a/pr/4036/docs/iroh/endpoint/presets/trait.Preset.html
+++ b/pr/4036/docs/iroh/endpoint/presets/trait.Preset.html
@@ -1,7 +1,7 @@
-Preset in iroh::endpoint::presets - Rust Preset
pub trait Preset {
+Preset in iroh::endpoint::presets - Rust Preset
pub trait Preset {
// Required method
fn apply(self, builder: Builder) -> Builder;
-}
Expand description
Defines a preset
+}Expand description
A reusable bundle of endpoint Builder configuration.
Required Methods§
Implementations on Foreign Types§
Source§impl Preset for Arc<TestTransport>
Available on crate feature unstable-custom-transports and (crate features test-utils) only.
Source§fn apply(self, builder: Builder) -> Builder
Configures the builder with this transport and the network’s address lookup.
§Example
diff --git a/pr/4036/docs/iroh/endpoint/struct.Builder.html b/pr/4036/docs/iroh/endpoint/struct.Builder.html
index 79894b8924..7cbb050d5e 100644
--- a/pr/4036/docs/iroh/endpoint/struct.Builder.html
+++ b/pr/4036/docs/iroh/endpoint/struct.Builder.html
@@ -92,7 +92,7 @@ is set to false explicitly.
destination addresses. It is valid to configure this, but no more than one such
socket should be bound or the routing will be non-deterministic.
To use a subnet with a non-zero prefix length as the default route in addition to
-being routed when its prefix matches, use `BindOpts::set_is_default_route.
+being routed when its prefix matches, use BindOpts::set_is_default_route.
Subnets with a prefix length of zero are always marked as default routes.
Finally note that most outgoing datagrams are part of an existing network flow. That
is, they are in response to an incoming datagram. In this case the outgoing datagram
@@ -142,7 +142,7 @@ direct addresses or relay URLs will fail.
Sourcepub fn addr_filter(self, filter: AddrFilter) -> Self
Sets the address filter applied to all address data before publishing.
This filter is applied once, at the AddressLookupServices level, before
distributing data to any individual address lookup service. This ensures
-consistent filtering regardless of how the services configured.
+consistent filtering regardless of how the services are configured.
Sourcepub fn clear_addr_filter(self) -> Self
Clears the address filter, allowing all addresses to be published.
This removes any filter previously set via Self::addr_filter, including
filters set by presets.
diff --git a/pr/4036/docs/iroh/endpoint/struct.ConnectOptions.html b/pr/4036/docs/iroh/endpoint/struct.ConnectOptions.html
index 30bf2e329e..3834b0244e 100644
--- a/pr/4036/docs/iroh/endpoint/struct.ConnectOptions.html
+++ b/pr/4036/docs/iroh/endpoint/struct.ConnectOptions.html
@@ -1,12 +1,12 @@
-ConnectOptions in iroh::endpoint - Rust ConnectOptions
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 ConnectOptions
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 QuicTransportConfig.
-Sourcepub fn with_transport_config(
+
Sourcepub fn with_transport_config(
self,
transport_config: QuicTransportConfig,
) -> Self
Sets the QUIC transport config options for this connection.
-Sourcepub fn with_additional_alpns(self, alpns: Vec<Vec<u8>>) -> Self
Sets ALPN identifiers that should be signaled as supported on connection, in
+
Sourcepub fn with_additional_alpns(self, alpns: Vec<Vec<u8>>) -> Self
Sets ALPN identifiers that should be signaled as supported on connection, in
addition to the main ALPN identifier used in Endpoint::connect_with_opts.
This allows connecting to servers that may only support older versions of your
protocol. In this case, you would add the older ALPN identifiers with this
@@ -20,7 +20,7 @@ list or the main ALPN identifiers on the accept side, see the endpoint
builder’s Builder::alpns function.
-Trait Implementations§
Source§impl Clone for ConnectOptions
Source§fn clone(&self) -> ConnectOptions
Returns a duplicate 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 duplicate 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/4036/docs/iroh/endpoint/struct.Connection.html b/pr/4036/docs/iroh/endpoint/struct.Connection.html
index ffc93497ee..74f53832af 100644
--- a/pr/4036/docs/iroh/endpoint/struct.Connection.html
+++ b/pr/4036/docs/iroh/endpoint/struct.Connection.html
@@ -8,7 +8,7 @@ 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<T: ConnectionState> Connection<T>
Implementations§
Source§impl<T: ConnectionState> Connection<T>
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.
@@ -18,13 +18,13 @@ consequence, the peer won’t be notified that a stream has been opened until th
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_bi(&self) -> AcceptBi<'_> ⓘ
Accepts 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 async fn closed(&self) -> ConnectionError
Waits 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.
@@ -97,17 +97,18 @@ strong and pseudorandom, and are suitable for use as keying material.
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)
See [noq_proto::TransportConfig::receive_window].
-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)
Sets the connection-level flow control receive window.
+See [noq_proto::TransportConfig::receive_window].
+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.
-Source§impl Connection<HandshakeCompleted>
Sourcepub fn remote_id(&self) -> EndpointId
Returns the EndpointId from the peer’s TLS certificate.
+Source§impl Connection<HandshakeCompleted>
Sourcepub fn remote_id(&self) -> EndpointId
Returns the EndpointId from the peer’s TLS certificate.
The PublicKey of an endpoint is also known as an EndpointId. This PublicKey is
included in the TLS certificate presented during the handshake when connecting.
This function allows you to get the EndpointId of the remote endpoint of this
connection.
-Sourcepub fn paths(&self) -> PathList<'_>
Returns the currently open network paths for this connection.
+Sourcepub fn paths(&self) -> PathList<'_>
Returns the currently open network paths for this connection.
A connection typically has one path via the relay server and,
once holepunching succeeds, a direct path. The returned
PathList is a snapshot taken at call time: it does not
@@ -116,14 +117,14 @@ already closed.
To observe changes over time, see Connection::paths_stream
for a stream of PathList snapshots and
Connection::path_events for individual PathEvents.
-Sourcepub fn paths_stream(&self) -> PathListStream<'_>
Returns a stream of PathList snapshots for this connection.
+Sourcepub fn paths_stream(&self) -> PathListStream<'_>
Returns a stream of PathList snapshots for this connection.
Yields the current snapshot on the first poll, and a fresh
snapshot whenever the open paths or the selected path change.
Ends when the connection closes.
The stream borrows this Connection. To consume it from a
spawned task, move a Connection clone into the task and
call this method inside.
-Sourcepub fn path_events(&self) -> PathEventStream
Returns a stream of PathEvents for this connection.
+Sourcepub fn path_events(&self) -> PathEventStream
Returns a stream of PathEvents for this connection.
Each event reports one of: a path opened, a path closed (with
final per-path statistics), the selected transmission path
changed, or the consumer fell behind. The stream ends when the
@@ -133,14 +134,14 @@ may be moved into a spawned task.
single PathEvent::Lagged; the current state of the open
paths and the selected path remains recoverable via
Connection::paths.
-Sourcepub fn weak_handle(&self) -> WeakConnectionHandle
Returns a WeakConnectionHandle for this connection.
+Sourcepub fn weak_handle(&self) -> WeakConnectionHandle
Returns a WeakConnectionHandle for this connection.
A WeakConnectionHandle does not keep the connection alive. It can be used to
wait for the connection to be closed via WeakConnectionHandle::closed and to
attempt to upgrade back to a strong Connection via
WeakConnectionHandle::upgrade.
-Source§impl Connection<IncomingZeroRtt>
Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
-Sourcepub async fn handshake_completed(&self) -> Result<Connection, ConnectingError>
Waits until the full handshake occurs and then returns a Connection.
+Source§impl Connection<IncomingZeroRtt>
Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
+Sourcepub async fn handshake_completed(&self) -> Result<Connection, ConnectingError>
Waits until the full handshake occurs and then returns a Connection.
This may fail with ConnectingError::ConnectionError, if there was
some general failure with the connection, such as a network timeout since
we accepted the connection.
@@ -149,18 +150,18 @@ doesn’t use the right TLS authentication, which usually every iroh endpoint
uses and requires.
Thus, those errors should only occur if someone connects to you with a
modified iroh endpoint or with a plain QUIC client.
-Sourcepub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError>
Returns the EndpointId from the peer’s TLS certificate.
+Sourcepub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError>
Returns the EndpointId from the peer’s TLS certificate.
The PublicKey of an endpoint is also known as an EndpointId. This PublicKey is
included in the TLS certificate presented during the handshake when connecting.
This function allows you to get the EndpointId of the remote endpoint of this
connection.
-Source§impl Connection<OutgoingZeroRtt>
Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
+Sourcepub async fn handshake_completed(
&self,
) -> Result<ZeroRttStatus, ConnectingError>
Waits until the full handshake occurs and returns a ZeroRttStatus.
-If ZeroRttStatus::Accepted is returned, than any streams created before
+
If ZeroRttStatus::Accepted is returned, then any streams created before
the handshake has completed can still be used.
-If ZeroRttStatus::Rejected is returned, than any streams created before
+
If ZeroRttStatus::Rejected is returned, then any streams created before
the handshake will error and any data sent should be re-sent on a
new stream.
This may fail with ConnectingError::ConnectionError, if there was
@@ -171,7 +172,7 @@ doesn’t use the right TLS authentication, which usually every iroh endpoint
uses and requires.
Thus, those errors should only occur if someone connects to you with a
modified iroh endpoint or with a plain QUIC client.
-Sourcepub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError>
Returns the EndpointId from the peer’s TLS certificate.
+Sourcepub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError>
Returns the EndpointId from the peer’s TLS certificate.
The PublicKey of an endpoint is also known as an EndpointId. This PublicKey is
included in the TLS certificate presented during the handshake when connecting.
This function allows you to get the EndpointId of the remote endpoint of this
diff --git a/pr/4036/docs/iroh/endpoint/struct.Endpoint.html b/pr/4036/docs/iroh/endpoint/struct.Endpoint.html
index cfd63c979e..0c6c2630b7 100644
--- a/pr/4036/docs/iroh/endpoint/struct.Endpoint.html
+++ b/pr/4036/docs/iroh/endpoint/struct.Endpoint.html
@@ -13,7 +13,7 @@ behaviour.
Endpoint::connect and Endpoint::accept methods. Once established, the
Connection gives access to most QUIC features. Individual streams to send data to
the peer are created using the Connection::open_bi, Connection::accept_bi,
-Connection::open_uni and Connection::open_bi functions.
+Connection::open_uni and Connection::accept_uni 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.
§Usage on Android
@@ -22,7 +22,7 @@ through JNI, which needs a JVM context published to DnsResolver for the supported
initialization paths.
-Implementations§
Source§impl Endpoint
Implementations§
Source§impl Endpoint
Sourcepub fn set_alpns(&self, alpns: Vec<Vec<u8>>)
Sets the list of accepted ALPN protocols.
This will only affect new incoming connections.
@@ -117,8 +117,8 @@ changes.
understand if the endpoint has ever been considered “online”. But after
that initial call to Endpoint::online, to understand if your
endpoint is no longer able to be connected to by endpoints outside
-of the private or local network, watch for changes in it’s EndpointAddr.
-If there are no addrsin the EndpointAddr, you may not be dialable by other endpoints
+of the private or local network, watch for changes in its EndpointAddr.
+If there are no addrs in the EndpointAddr, you may not be dialable by other endpoints
on the internet.
The EndpointAddr will change as:
@@ -146,7 +146,7 @@ tokio::spawn(endpoint_closed.run_until(async move {
}));
// Do fancy things, then close the endpoint.
// Our task above will stop even if there are still clones of `Endpoint` alive somewhere.
-endpoint.close().await;
Sourcepub async fn online(&self)
A convenience method that waits for the endpoint to be considered “online”.
This currently means at least one relay server has completed its
connection handshake (i.e. the endpoint is registered and reachable
via that relay). Merely selecting a relay URL is not sufficient.
@@ -167,49 +167,45 @@ entirely.
The online method does not interact with crate::address_lookup::AddressLookup
services, which means that any Address Lookup that relies on a WAN
connection is independent of the endpoint’s online status.
-§Examples
use iroh::Endpoint;
-
-#[tokio::main]
-async fn main() {
-// After this await returns, the endpoint is bound to a local socket.
-// It can be dialed, but almost certainly hasn't finished picking a
+§Examples
+// After this await returns, the endpoint is bound to a local socket.
+// It can be dialed, but almost certainly hasn't finished picking a
// relay.
-let endpoint = Endpoint::bind().await;
+let endpoint = Endpoint::bind(presets::N0).await?;
-// After this await returns we have a connection to at least one relay
+// After this await returns we have a connection to at least one relay
// and holepunching should work as expected.
-endpoint.online().await;
-}
Sourcepub fn home_relay_status(
+endpoint.online().await;
Sourcepub fn home_relay_status(
&self,
) -> impl Watcher<Value = Vec<RelayStatus>> + use<>
Returns a Watcher over the connection status of the endpoint’s home relays.
The watched value has one entry per home relay whose URL is known,
and is empty when no relays are configured or before the endpoint has
-selected one the home relay from the list of configured relays.
+selected a home relay from the list of configured relays.
The watcher updates whenever any home relay’s connection status changes.
See RelayStatus for the information available on each entry.
The returned watcher only becomes disconnected once the last clone of
the Endpoint is dropped. Closing the endpoint does not disconnect
the watcher. To stop a task once the endpoint stops, combine with
Self::closed.
-Sourcepub fn bound_sockets(&self) -> Vec<SocketAddr>
Available on non-wasm_browser only.
Returns the local socket addresses on which the underlying sockets are bound.
+Sourcepub fn bound_sockets(&self) -> Vec<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 dns_resolver(&self) -> Result<&DnsResolver, EndpointError>
Available on non-wasm_browser only.
Returns the DNS resolver used in this Endpoint.
+Sourcepub fn dns_resolver(&self) -> Result<&DnsResolver, EndpointError>
Available on non-wasm_browser only.
Sourcepub fn tls_config(&self) -> &ClientConfig
Returns the [rustls::ClientConfig] used by the endpoint for connecting to external services.
+Sourcepub fn tls_config(&self) -> &ClientConfig
Returns the [rustls::ClientConfig] used by the endpoint for connecting to external services.
This might be useful for address lookup services or other functions
that want to use the same trust anchors as iroh does for verifying the
validity of TLS certificates presented by external services.
Note that this TLS config is unrelated to how iroh validates the authenticity
of iroh connections itself.
The config is based on the trust anchors set via Builder::ca_tls_config.
-Sourcepub fn address_lookup(&self) -> Result<&AddressLookupServices, EndpointError>
Returns the Address Lookup service, if configured.
+Sourcepub fn address_lookup(&self) -> Result<&AddressLookupServices, EndpointError>
Returns the Address Lookup service, if configured.
§Errors
Returns a EndpointError::Closed error if the endpoint is closed.
-Sourcepub fn metrics(&self) -> &EndpointMetrics
Available on crate feature metrics only.
Returns metrics collected for this endpoint.
+Sourcepub fn metrics(&self) -> &EndpointMetrics
Available on crate feature metrics only.
Returns metrics collected for this endpoint.
The endpoint internally collects various metrics about its operation.
The returned EndpointMetrics struct contains all of these metrics.
You can access individual metrics directly by using the public fields:
@@ -275,13 +271,13 @@ registry.write().unwrap().register_all(endpoint.metrics());
.std_context("text")?;
assert!(res.contains(r#"TYPE socket_recv_datagrams counter"#));
-assert!(res.contains(r#"socket_recv_datagrams_total 0"#));Sourcepub async fn remote_info(&self, endpoint_id: EndpointId) -> Option<RemoteInfo>
Returns addressing information about a recently used remote endpoint.
+assert!(res.contains(r#"socket_recv_datagrams_total 0"#));Sourcepub async fn remote_info(&self, endpoint_id: EndpointId) -> Option<RemoteInfo>
Returns addressing information about a recently used remote endpoint.
The returned RemoteInfo contains a list of all transport addresses for the remote
that we know about. This is a snapshot in time and not a watcher.
Returns None if the endpoint doesn’t have information about the remote or if the endpoint is closed.
When remote endpoints are no longer used, our endpoint will keep information around
for a little while, and then drop it. Afterwards, this will return None.
-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
@@ -290,14 +286,14 @@ 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.
If the endpoint is closed, this method will log a warning and ignore the request.
-Sourcepub fn set_user_data_for_address_lookup(&self, user_data: Option<UserData>)
Sets the initial user-defined data to be published in Address Lookups for this endpoint.
+Sourcepub fn set_user_data_for_address_lookup(&self, user_data: Option<UserData>)
Sets the initial user-defined data to be published in Address Lookups for this endpoint.
If the user-defined data passed to this function is different to the previous one,
the endpoint will republish its endpoint info to the configured Address Lookups.
See also Builder::user_data_for_address_lookup for setting an initial value when
building the endpoint.
If the endpoint is closed, this method will log a warning and ignore the
request.
-Sourcepub async fn close(&self)
Closes the QUIC endpoint and the 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.
@@ -322,9 +318,9 @@ sockets. This is due to QUIC and its acknowledgments being implemented in user-l
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.
-Sourcepub fn closed(&self) -> EndpointClosed ⓘ
Returns a future that resolves once the endpoint closes.
+the respective Endpoint are dropped.
+Sourcepub fn closed(&self) -> EndpointClosed ⓘ
Returns a future that resolves once the endpoint closes.
The returned future does not contain a clone or reference to the Endpoint,
so keeping the returned future alive does not prevent the endpoint from being dropped.
To run a task and stop it once the endpoint closes, you can use
@@ -333,7 +329,7 @@ so keeping the returned future alive does not prevent the endpoint from being dr
let endpoint = Endpoint::bind(presets::N0).await?;
tokio::spawn(endpoint.closed().run_until(async move {
// the future will be aborted once the endpoint closes.
-}));
Sourcepub fn create_server_config_builder(
+}));
Sourcepub fn create_server_config_builder(
&self,
alpns: Vec<Vec<u8>>,
) -> ServerConfigBuilder
Create a ServerConfigBuilder for this endpoint that includes the given alpns.
diff --git a/pr/4036/docs/iroh/endpoint/struct.EndpointClosed.html b/pr/4036/docs/iroh/endpoint/struct.EndpointClosed.html
index 85b8fd921b..1a2b9e3683 100644
--- a/pr/4036/docs/iroh/endpoint/struct.EndpointClosed.html
+++ b/pr/4036/docs/iroh/endpoint/struct.EndpointClosed.html
@@ -1,9 +1,9 @@
-EndpointClosed in iroh::endpoint - Rust EndpointClosed
pub struct EndpointClosed { /* private fields */ }
Expand description
Future returned from Endpoint::closed.
-Implementations§
Source§impl EndpointClosed
Sourcepub async fn run_until<F: Future>(self, fut: F) -> Option<F::Output>
Runs a future to completion, or until the Endpoint is closed.
+EndpointClosed in iroh::endpoint - Rust EndpointClosed
pub struct EndpointClosed { /* private fields */ }
Expand description
Future returned from Endpoint::closed.
+Implementations§
Trait Implementations§
Source§impl Debug for EndpointClosed
Source§impl Future for EndpointClosed
Source§impl<'pin> Unpin for EndpointClosedwhere
+
Trait Implementations§
Source§impl Debug for EndpointClosed
Source§impl Future for EndpointClosed
Source§impl<'pin> Unpin for EndpointClosedwhere
PinnedFieldsOf<__EndpointClosed<'pin>>: Unpin,
Auto Trait Implementations§
§impl !Freeze for EndpointClosed
§impl !RefUnwindSafe for EndpointClosed
§impl Send for EndpointClosed
§impl Sync for EndpointClosed
§impl !UnwindSafe for EndpointClosed
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/4036/docs/iroh/endpoint/struct.Incoming.html b/pr/4036/docs/iroh/endpoint/struct.Incoming.html
index d0a2c29af8..eca1097eca 100644
--- a/pr/4036/docs/iroh/endpoint/struct.Incoming.html
+++ b/pr/4036/docs/iroh/endpoint/struct.Incoming.html
@@ -24,7 +24,7 @@ to customize a Sourcepub fn remote_addr_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_addr().
-Sourcepub fn decrypt(&self) -> Option<DecryptedInitial>
Decrypt the Initial packet payload
+Sourcepub fn decrypt(&self) -> Option<DecryptedInitial>
Decrypts the Initial packet payload.
This clones and decrypts the packet payload (~1200 bytes).
Can be used to extract information from the TLS ClientHello without completing the handshake.
Trait Implementations§
Source§impl IntoFuture for Incoming
Source§type Output = Result<Connection, ConnectingError>
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§
Source§impl<T> Any for Twhere
diff --git a/pr/4036/docs/iroh/endpoint/struct.QuicTransportConfigBuilder.html b/pr/4036/docs/iroh/endpoint/struct.QuicTransportConfigBuilder.html
index 3a193bd40a..5189f21509 100644
--- a/pr/4036/docs/iroh/endpoint/struct.QuicTransportConfigBuilder.html
+++ b/pr/4036/docs/iroh/endpoint/struct.QuicTransportConfigBuilder.html
@@ -136,7 +136,7 @@ enable multipath as well.
If the path is idle for this long the path will be abandoned. Bear in mind this will
interact with the QuicTransportConfigBuilder::max_idle_timeout, if the last path is
abandoned the entire connection will be closed.
-Note: values higher than [PATH_MAX_IDLE_TIMEOUT] are clamped and a warning is logged.
+Note: values higher than PATH_MAX_IDLE_TIMEOUT (15 seconds) are clamped and a warning is logged.
Sourcepub fn default_path_keep_alive_interval(self, interval: Duration) -> Self
Sets a default per-path keep alive interval.
Note that this does not interact with the connection-wide
QuicTransportConfigBuilder::keep_alive_interval. This setting will keep this path active,
diff --git a/pr/4036/docs/iroh/endpoint/struct.RelayStatus.html b/pr/4036/docs/iroh/endpoint/struct.RelayStatus.html
index 175b637f76..a1abba7e98 100644
--- a/pr/4036/docs/iroh/endpoint/struct.RelayStatus.html
+++ b/pr/4036/docs/iroh/endpoint/struct.RelayStatus.html
@@ -1,13 +1,13 @@
-
RelayStatus in iroh::endpoint - Rust RelayStatus
pub struct RelayStatus { /* private fields */ }
Expand description
Connection status of a single home relay.
+RelayStatus in iroh::endpoint - Rust RelayStatus
pub struct RelayStatus { /* private fields */ }
Expand description
Connection status of a single home relay.
Observed via Endpoint::home_relay_status.
-Implementations§
Source§impl RelayStatus
Sourcepub fn is_connected(&self) -> bool
Returns true if the endpoint is connected to the relay.
-Sourcepub fn last_error(&self) -> Option<&AnyError>
Returns the most recent connection error, if the relay is currently
+
Implementations§
Source§impl RelayStatus
Sourcepub fn is_connected(&self) -> bool
Returns true if the endpoint is connected to the relay.
+Sourcepub fn last_error(&self) -> Option<&AnyError>
Returns the most recent connection error, if the relay is currently
disconnected.
Returns None when the relay is connected, or when the endpoint has
not yet observed a failed connection attempt.
-Trait Implementations§
Source§impl Clone for RelayStatus
Source§fn clone(&self) -> RelayStatus
Returns a duplicate 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 RelayStatus
Source§impl PartialEq for RelayStatus
Source§impl Eq for RelayStatus
Source§impl StructuralPartialEq for RelayStatus
Auto Trait Implementations§
§impl Freeze for RelayStatus
§impl !RefUnwindSafe for RelayStatus
§impl Send for RelayStatus
§impl Sync for RelayStatus
§impl Unpin for RelayStatus
§impl !UnwindSafe for RelayStatus
Blanket Implementations§
Trait Implementations§
Source§impl Clone for RelayStatus
Source§fn clone(&self) -> RelayStatus
Returns a duplicate 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 RelayStatus
Source§impl PartialEq for RelayStatus
Source§impl Eq for RelayStatus
Source§impl StructuralPartialEq for RelayStatus
Auto Trait Implementations§
§impl Freeze for RelayStatus
§impl !RefUnwindSafe for RelayStatus
§impl Send for RelayStatus
§impl Sync for RelayStatus
§impl Unpin for RelayStatus
§impl !UnwindSafe for RelayStatus
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/4036/docs/iroh/endpoint/struct.VarInt.html b/pr/4036/docs/iroh/endpoint/struct.VarInt.html
index 0acf99654d..007540d1af 100644
--- a/pr/4036/docs/iroh/endpoint/struct.VarInt.html
+++ b/pr/4036/docs/iroh/endpoint/struct.VarInt.html
@@ -13,7 +13,7 @@ An integer less than 2^62
of overflowing.
Trait Implementations§
§impl From<VarInt> for IdleTimeout
§fn from(inner: VarInt) -> IdleTimeout
Converts to this type from the input type.§impl From<VarInt> for IdleTimeout
§fn from(inner: VarInt) -> IdleTimeout
Converts to this type from the input type.§impl Ord for VarInt
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
diff --git a/pr/4036/docs/iroh/endpoint/struct.WeakConnectionHandle.html b/pr/4036/docs/iroh/endpoint/struct.WeakConnectionHandle.html
index 47f6c23610..07bad208d7 100644
--- a/pr/4036/docs/iroh/endpoint/struct.WeakConnectionHandle.html
+++ b/pr/4036/docs/iroh/endpoint/struct.WeakConnectionHandle.html
@@ -1,18 +1,18 @@
-WeakConnectionHandle in iroh::endpoint - Rust WeakConnectionHandle
pub struct WeakConnectionHandle { /* private fields */ }
Expand description
A weak handle to a Connection.
+WeakConnectionHandle in iroh::endpoint - Rust WeakConnectionHandle
pub struct WeakConnectionHandle { /* private fields */ }
Expand description
A weak handle to a Connection.
A WeakConnectionHandle does not keep the connection alive: holding one will not
prevent the connection from being closed when the last Connection handle is dropped.
Use upgrade to obtain a strong Connection, and closed to wait for the
connection to be closed without keeping it alive.
-Implementations§
Source§impl WeakConnectionHandle
Sourcepub fn upgrade(&self) -> Option<Connection>
Attempts to upgrade this weak handle to a strong Connection.
+Implementations§
Source§impl WeakConnectionHandle
Sourcepub fn upgrade(&self) -> Option<Connection>
Attempts to upgrade this weak handle to a strong Connection.
Returns None if the connection has already been dropped.
-Sourcepub fn closed(&self) -> impl Future<Output = Option<Closed>> + Send + 'static
Returns a future that resolves once the connection has been closed.
+Sourcepub fn closed(&self) -> impl Future<Output = Option<Closed>> + Send + 'static
Returns a future that resolves once the connection has been closed.
If no strong references to the Connection exist at the time this is called,
the future resolves to None. If at least one strong reference still exists at
the time of this call, the returned future is guaranteed to receive the close
event with the close reason and final connection statistics, even if all strong
references are dropped before the future is awaited.
The future does not keep the connection alive.
-Trait Implementations§
Source§impl Clone for WeakConnectionHandle
Source§fn clone(&self) -> WeakConnectionHandle
Returns a duplicate 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 WeakConnectionHandle
§impl !RefUnwindSafe for WeakConnectionHandle
§impl Send for WeakConnectionHandle
§impl Sync for WeakConnectionHandle
§impl Unpin for WeakConnectionHandle
§impl !UnwindSafe for WeakConnectionHandle
Blanket Implementations§
Trait Implementations§
Source§impl Clone for WeakConnectionHandle
Source§fn clone(&self) -> WeakConnectionHandle
Returns a duplicate 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 WeakConnectionHandle
§impl !RefUnwindSafe for WeakConnectionHandle
§impl Send for WeakConnectionHandle
§impl Sync for WeakConnectionHandle
§impl Unpin for WeakConnectionHandle
§impl !UnwindSafe for WeakConnectionHandle
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/4036/docs/iroh/endpoint/trait.EndpointHooks.html b/pr/4036/docs/iroh/endpoint/trait.EndpointHooks.html
index 2ac883dd5d..90c7ff04fc 100644
--- a/pr/4036/docs/iroh/endpoint/trait.EndpointHooks.html
+++ b/pr/4036/docs/iroh/endpoint/trait.EndpointHooks.html
@@ -17,7 +17,7 @@
For each hook, all installed hooks are invoked in the order they were installed on
the endpoint builder. If a hook returns Accept, processing continues with the next
hook. If a hook returns Reject, processing is aborted and further hooks
-are not invoked for this hook.
+are not invoked for this hook point.
§Notes to implementers
As hooks are stored on the endpoint, you must make sure to never store an Endpoint
on the hook struct itself, as this would create reference counting loop and cause the
diff --git a/pr/4036/docs/iroh/endpoint_info/index.html b/pr/4036/docs/iroh/endpoint_info/index.html
index f27fe3b898..4a60b9fd8f 100644
--- a/pr/4036/docs/iroh/endpoint_info/index.html
+++ b/pr/4036/docs/iroh/endpoint_info/index.html
@@ -1,11 +1,11 @@
iroh::endpoint_info - Rust Module endpoint_info
Expand description
Support for handling DNS resource records for dialing by EndpointId.
Dialing by EndpointId is supported by iroh endpoints publishing Pkarr records to DNS
servers or the Mainline DHT. This module supports creating and parsing these records.
-EndpointInfo combines an iroh_base::EndpointId with EndpointData —
+
EndpointInfo combines an iroh_base::EndpointId with EndpointData:
the addressing and metadata that discovery services publish and resolve.
Discovery services use AddrFilter to control which addresses are published.
This module also provides serialization to and from pkarr signed packets and
-DNS TXT records. See the [crate::attrs] module for the on-the-wire format.
+DNS TXT records.
DNS records are published under the following names:
_iroh.<z32-endpoint-id>.<origin-domain> TXT
@@ -36,4 +36,4 @@ Each address is an IPv4 or IPv6 address with a port.
Structs§
- Addr
Filter - A filter and/or reordering function applied to transport addresses,
-typically used by AddressLookup services in iroh before publishing.
- Endpoint
Data - Data about an endpoint that may be published to and resolved from discovery services.
- Endpoint
Info - Information about an endpoint that may be published to and resolved from discovery services.
- MaxLength
ExceededError - Error returned when an input value is too long for
UserData. - User
Data - Under the hood this is a UTF-8 String is no longer than
UserData::MAX_LENGTH bytes.
\ No newline at end of file
+typically used by AddressLookup services in iroh before publishing.EndpointData Data about an endpoint that may be published to and resolved from discovery services. EndpointInfo Information about an endpoint that may be published to and resolved from discovery services. MaxLengthExceededError Error returned when an input value is too long for UserData. UserData User-defined data that can be published and resolved through endpoint discovery.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint_info/struct.EndpointData.html b/pr/4036/docs/iroh/endpoint_info/struct.EndpointData.html
index eaf2725892..2c818ea5b4 100644
--- a/pr/4036/docs/iroh/endpoint_info/struct.EndpointData.html
+++ b/pr/4036/docs/iroh/endpoint_info/struct.EndpointData.html
@@ -13,15 +13,15 @@ services, should they not fit into e.g. a single DNS packet otherwise.
See also Self::set_user_data.
Sourcepub fn add_relay_url(&mut self, relay_url: RelayUrl)
Adds the relay URL to the end of the endpoint data, unless it already existed.
Sourcepub fn add_ip_addrs(&mut self, addresses: Vec<SocketAddr>)
Adds addresses in order with duplicates or already existing addresses filtered out.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Adds addresses to the endpoint data in the given ordered, but with duplicates filtered.
-Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data and returns the updated endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Adds addresses to the endpoint data in the given order, but with duplicates filtered.
+Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data.
Sourcepub fn clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn clear_relay_urls(&mut self)
Removes all relay URLs from the endpoint data.
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses.
+Sourcepub fn filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
Returns a vec to allow re-ordering of addresses.
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
diff --git a/pr/4036/docs/iroh/endpoint_info/struct.UserData.html b/pr/4036/docs/iroh/endpoint_info/struct.UserData.html
index 3352480631..e73207e05e 100644
--- a/pr/4036/docs/iroh/endpoint_info/struct.UserData.html
+++ b/pr/4036/docs/iroh/endpoint_info/struct.UserData.html
@@ -1,4 +1,5 @@
-UserData in iroh::endpoint_info - Rust 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.
+UserData in iroh::endpoint_info - Rust UserData
pub struct UserData(/* private fields */);
Expand description
User-defined data that can be published and resolved through endpoint discovery.
+Under the hood this is a UTF-8 string 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.
diff --git a/pr/4036/docs/iroh/enum.KeyParsingError.html b/pr/4036/docs/iroh/enum.KeyParsingError.html
index 765ac27ad2..146ec05698 100644
--- a/pr/4036/docs/iroh/enum.KeyParsingError.html
+++ b/pr/4036/docs/iroh/enum.KeyParsingError.html
@@ -1,4 +1,4 @@
-KeyParsingError in iroh - Rust KeyParsingError
#[non_exhaustive]pub enum KeyParsingError {
+KeyParsingError in iroh - Rust KeyParsingError
#[non_exhaustive]pub enum KeyParsingError {
FailedToDecodeHex {
meta: Meta,
},
@@ -11,14 +11,14 @@
InvalidKeyData {
meta: Meta,
},
-}
Expand description
Error when deserialising a PublicKey or a SecretKey.
+}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§FailedToDecodeHex
The input string could not be decoded as hex.
Fields
§meta: MetaCaptured call-site metadata
§FailedToDecodeBase32
The input string could not be decoded as base32.
Fields
§meta: MetaCaptured call-site metadata
§InvalidLength
The input has invalid length.
Fields
§meta: MetaCaptured call-site metadata
-§InvalidKeyData
The decoded data is not a valid Ed25591 public key.
+§InvalidKeyData
The decoded data is not a valid Ed25519 public key.
Fields
§meta: MetaCaptured call-site metadata
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<KeyParsingError> for ParseError
Source§fn from(source: KeyParsingError) -> ParseError
Converts to this type from the input type.Source§impl StackError for KeyParsingError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<KeyParsingError>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Returns the next source in the chain, if any.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.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
diff --git a/pr/4036/docs/iroh/enum.TransportAddr.html b/pr/4036/docs/iroh/enum.TransportAddr.html
index df614a51ee..0e5f31d772 100644
--- a/pr/4036/docs/iroh/enum.TransportAddr.html
+++ b/pr/4036/docs/iroh/enum.TransportAddr.html
@@ -3,8 +3,8 @@
Ip(SocketAddr),
Custom(CustomAddr),
}Expand description
Available address types.
-Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§Relay(RelayUrl)
Relays
-§Ip(SocketAddr)
IP based addresses
+Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§Relay(RelayUrl)
A relay server address.
+§Ip(SocketAddr)
An IP based address.
§Custom(CustomAddr)
Custom transport address
Implementations§
Source§impl TransportAddr
Sourcepub fn is_ip(&self) -> bool
Whether this is an IP transport address.
diff --git a/pr/4036/docs/iroh/index.html b/pr/4036/docs/iroh/index.html
index a2ddd5617a..8c7bddcb16 100644
--- a/pr/4036/docs/iroh/index.html
+++ b/pr/4036/docs/iroh/index.html
@@ -1,5 +1,5 @@
iroh - Rust Crate iroh
Expand description
Peer-to-peer QUIC connections.
-iroh is a library to establish direct connectivity between peers. It exposes an
+
iroh is a library to establish direct connectivity between peers. It exposes an
interface to QUIC connections and streams to the user, while implementing direct
connectivity using hole punching complemented by relay servers under the hood.
An iroh endpoint is created and controlled by the Endpoint, e.g. connecting to
@@ -44,7 +44,7 @@ punching if needed. Once the direct connection is established the relay ser
longer involved in the connection.
If one of the iroh endpoints can be reached directly, connectivity can also be
established without involving a Relay server. This is done by using the endpoint’s
-listening addresses in the connection establishement instead of the RelayUrl which
+listening addresses in the connection establishment instead of the RelayUrl which
is used to identify a Relay server. Of course it is also possible to use both a
RelayUrl and direct addresses at the same time to connect.
§Encryption
@@ -179,4 +179,4 @@ connecting using only the Ok(())
}
Please see the examples directory for more nuanced examples.
-Re-exports§
Modules§
- address_
lookup - Lookup the address of an Endpoint ID.
- defaults
- Default values used in
iroh - dns
Non-wasm_browser - Configurable DNS resolver.
- endpoint
- The
Endpoint allows establishing connections to other iroh endpoints. - endpoint_
info - Support for handling DNS resource records for dialing by
EndpointId. - metrics
- Co-locating all of the iroh metrics structs
- protocol
- Tools for spawning an accept loop that routes incoming requests to the right protocol.
- test_
utils test-utils - Internal utilities to support testing.
- tls
- TLS configuration for iroh.
Structs§
- Endpoint
Addr - Network-level addressing information for an iroh endpoint.
- NetReport
- A net_report report.
- NetReport
Config - Configuration for the net report component.
- Public
Key - A public key.
- Relay
Config - Information on a specific relay server.
- Relay
Map - List of relay server configurations to be used in an iroh endpoint.
- Relay
Url - A URL identifying a relay server.
- Relay
UrlParseError - Can occur when parsing a string into a
RelayUrl. - Secret
Key - A secret key.
- Signature
- Ed25519 signature.
- Signature
Error - Verification of a signature failed.
Enums§
- KeyParsing
Error - Error when deserialising a
PublicKey or a SecretKey. - Transport
Addr - Available address types.
Constants§
- NET_
REPORT_TIMEOUT - The maximum amount of time, in seconds, the net_report will spend gathering a single report.
Traits§
- Watcher
- A handle to a value that’s represented by one or more underlying [
Watchable]s.
Type Aliases§
- Endpoint
Id - The identifier for an endpoint in the (iroh) network.
\ No newline at end of file
+Re-exports§
Modules§
- address_
lookup - Lookup the address of an Endpoint ID.
- defaults
- Default values used in
iroh - dns
Non-wasm_browser - Configurable DNS resolver.
- endpoint
- The
Endpoint allows establishing connections to other iroh endpoints. - endpoint_
info - Support for handling DNS resource records for dialing by
EndpointId. - metrics
- Co-locating all of the iroh metrics structs
- protocol
- Tools for spawning an accept loop that routes incoming requests to the right protocol.
- test_
utils test-utils - Internal utilities to support testing.
- tls
- TLS configuration for iroh.
Structs§
- Endpoint
Addr - Network-level addressing information for an iroh endpoint.
- NetReport
- A net_report report.
- NetReport
Config - Configuration for the net report component.
- Public
Key - A public key.
- Relay
Config - Information on a specific relay server.
- Relay
Map - List of relay server configurations to be used in an iroh endpoint.
- Relay
Url - A URL identifying a relay server.
- Relay
UrlParseError - Can occur when parsing a string into a
RelayUrl. - Secret
Key - A secret key.
- Signature
- Ed25519 signature.
- Signature
Error - Verification of a signature failed.
Enums§
- KeyParsing
Error - Error returned when parsing a
PublicKey or a SecretKey. - Transport
Addr - Available address types.
Constants§
- NET_
REPORT_TIMEOUT - The maximum amount of time, in seconds, the net_report will spend gathering a single report.
Traits§
- Watcher
- A handle to a value that’s represented by one or more underlying [
Watchable]s.
Type Aliases§
- Endpoint
Id - The identifier for an endpoint in the (iroh) network.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/metrics/index.html b/pr/4036/docs/iroh/metrics/index.html
index da53db7d6a..00f2275127 100644
--- a/pr/4036/docs/iroh/metrics/index.html
+++ b/pr/4036/docs/iroh/metrics/index.html
@@ -1,2 +1,2 @@
iroh::metrics - Rust Module metrics
Expand description
Co-locating all of the iroh metrics structs
-Structs§
- Endpoint
Metrics - Metrics collected by an
crate::endpoint::Endpoint. - NetReport
Metrics - Enum of metrics for the module
- Relay
Metrics test-utils - Metrics tracked for the relay server
- Socket
Metrics - Enum of metrics for the module
\ No newline at end of file
+Structs§
- Endpoint
Metrics - Metrics collected by an
crate::endpoint::Endpoint. - NetReport
Metrics - Enum of metrics for the module
- Relay
Metrics test-utils - Metrics tracked for the relay server
- Socket
Metrics - Metrics collected by the iroh socket.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/metrics/struct.RelayMetrics.html b/pr/4036/docs/iroh/metrics/struct.RelayMetrics.html
index f8768e50a1..da2588f738 100644
--- a/pr/4036/docs/iroh/metrics/struct.RelayMetrics.html
+++ b/pr/4036/docs/iroh/metrics/struct.RelayMetrics.html
@@ -26,21 +26,26 @@
pub http_connections_closed: Counter,
pub http_connections_errored: Counter,
}Available on crate feature test-utils only.Expand description
Metrics tracked for the relay server
-Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.§bytes_sent: CounterBytes sent from a FrameType::SendPacket
-§bytes_recv: CounterBytes received from a FrameType::SendPacket
-§send_packets_sent: CounterFrameType::SendPacket sent
-§send_packets_recv: CounterFrameType::SendPacket received
-§send_packets_dropped: CounterFrameType::SendPacket dropped
-§other_packets_sent: CounterPackets of other FrameTypes sent
-§other_packets_recv: CounterPackets of other FrameTypes received
-§other_packets_dropped: CounterPackets of other FrameTypes dropped
-§got_ping: CounterNumber of FrameType::Pings received
-§sent_pong: CounterNumber of FrameType::Pongs sent
-§unknown_frames: CounterNumber of FrameType::Unknown received
+Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.§bytes_sent: CounterBytes sent to a client in RelayToClientDatagram or RelayToClientDatagramBatch frames.
+§bytes_recv: CounterBytes received from a client in ClientToRelayDatagram or ClientToRelayDatagramBatch frames.
+§send_packets_sent: CounterRelayToClientDatagram or RelayToClientDatagramBatch frames sent to a client.
+§send_packets_recv: CounterClientToRelayDatagram or ClientToRelayDatagramBatch frames received from a client.
+§send_packets_dropped: CounterRelayToClientDatagram or RelayToClientDatagramBatch frames dropped instead of being
+delivered to a client, because the recipient is not connected or writing to its stream failed.
+Note that frames dropped because the recipient’s send queue is full or closed are not counted
+here.
+§other_packets_sent: CounterIntended to count sent frames other than datagrams, but currently unused (never incremented).
+§other_packets_recv: CounterIntended to count received frames other than datagrams, but currently unused (never incremented).
+§other_packets_dropped: CounterIntended to count dropped frames other than datagrams, but currently unused (never incremented).
+§got_ping: CounterNumber of FrameType::Ping frames received from a client.
+§sent_pong: CounterNumber of FrameType::Pong frames sent to a client.
+§unknown_frames: CounterIntended to count received frames with an unrecognized FrameType,
+but currently unused (never incremented).
§bytes_rx_ratelimited_total: CounterNumber of bytes received from client connection which have been rate-limited.
§conns_rx_ratelimited_total: CounterNumber of client connections which have had any frames rate-limited.
§accepts: CounterNumber of times this server has accepted a connection.
-§disconnects: CounterNumber of connections we have removed because of an error
+§disconnects: CounterNumber of times a client connection was disconnected.
+Incremented once per connection, paired with Self::accepts.
§unique_client_keys: CounterNumber of unique client keys per day
§clients_inactive_added: CounterNumber of times a client was moved into the inactive state.
A client becomes inactive when a new client connects with the same endpoint id. An inactive
diff --git a/pr/4036/docs/iroh/metrics/struct.SocketMetrics.html b/pr/4036/docs/iroh/metrics/struct.SocketMetrics.html
index 2291657920..f61d3786bb 100644
--- a/pr/4036/docs/iroh/metrics/struct.SocketMetrics.html
+++ b/pr/4036/docs/iroh/metrics/struct.SocketMetrics.html
@@ -1,4 +1,4 @@
-
SocketMetrics in iroh::metrics - Rust SocketMetrics
#[non_exhaustive]pub struct SocketMetrics {Show 31 fields
+SocketMetrics in iroh::metrics - Rust SocketMetrics
#[non_exhaustive]pub struct SocketMetrics {Show 31 fields
pub update_direct_addrs: Counter,
pub send_ipv4: Counter,
pub send_ipv6: Counter,
@@ -30,10 +30,23 @@
pub actor_tick_direct_addr_heartbeat: Counter,
pub actor_link_change: Counter,
pub actor_tick_other: Counter,
-}
Expand description
Enum of metrics for the module
-Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.§update_direct_addrs: Counter§send_ipv4: Counter§send_ipv6: Counter§send_relay: Counter§recv_data_relay: Counter§recv_data_custom: Counter§recv_data_ipv4: Counter§recv_data_ipv6: Counter§recv_datagrams: CounterNumber of QUIC datagrams received.
-§recv_gro_datagrams: CounterNumber of datagrams received using GRO
-§relay_home_change: Counter§holepunch_attempts: CounterThe number of times holepunching is initiated on a connection.
+}Expand description
Metrics collected by the iroh socket.
+Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.§update_direct_addrs: CounterIntended to count updates to the local direct address set, but currently unused
+(never incremented).
+§send_ipv4: CounterNumber of bytes sent over IPv4.
+§send_ipv6: CounterNumber of bytes sent over IPv6.
+§send_relay: CounterNumber of bytes sent over the relay transport.
+§recv_data_relay: CounterNumber of data bytes received over the relay transport.
+§recv_data_custom: CounterNumber of data bytes received over any custom transport.
+§recv_data_ipv4: CounterNumber of data bytes received over IPv4.
+§recv_data_ipv6: CounterNumber of data bytes received over IPv6.
+§recv_datagrams: CounterNumber of QUIC datagrams received.
+§recv_gro_datagrams: CounterNumber of receive events that used GRO (coalesced datagram batches).
+This counts batches, not the individual datagrams within them. See
+Self::recv_datagrams for the datagram count.
+§relay_home_change: CounterNumber of times the home relay changed to a different relay.
+This includes the initial assignment from no home relay to a home relay.
+§holepunch_attempts: CounterThe number of times holepunching is initiated on a connection.
This can be incremented multiple times for a single connection. Note that only the
client-side of a connection will increment this counter.
§paths_direct: CounterThe number of network paths to peers that are direct.
@@ -53,8 +66,15 @@ the number of opened connections.
§transport_relay_paths_removed: CounterNumber of relay transport paths closed.
§transport_custom_paths_added: CounterNumber of custom transport paths opened.
§transport_custom_paths_removed: CounterNumber of custom transport paths closed.
-§actor_tick_main: Counter§actor_tick_msg: Counter§actor_tick_re_stun: Counter§actor_tick_portmap_changed: Counter§actor_tick_direct_addr_heartbeat: Counter§actor_link_change: Counter§actor_tick_other: CounterTrait Implementations§
Source§impl<'de> Deserialize<'de> for Metrics
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Iterable for Metrics
Source§fn metric_field_count(&self) -> usize
Returns the number of metric fields in the struct.Source§fn metric_field_ref(&self, n: usize) -> Option<MetricItem<'_>>
Returns the metric field at the given index.§fn family_field_count(&self) -> usize
Returns the number of Family fields in the struct.§fn family_field_ref(&self, _n: usize) -> Option<FamilyItem<'_>>
Returns the Family field at the given index.Source§impl Serialize for Metrics
Source§fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where
+§actor_tick_main: CounterNumber of iterations of the main socket actor loop.
+§actor_tick_msg: CounterNumber of actor messages processed by the socket actor loop.
+§actor_tick_re_stun: CounterNumber of periodic re-STUN timer ticks handled by the socket actor loop.
+§actor_tick_portmap_changed: CounterNumber of port-mapping change events handled by the socket actor loop.
+§actor_tick_direct_addr_heartbeat: CounterIntended to count direct address heartbeat ticks, but currently unused (never incremented).
+§actor_link_change: CounterNumber of local network interface (link) change events handled by the socket actor loop.
+§actor_tick_other: CounterNumber of times an input watcher or receiver closed in the socket actor loop.
+Trait Implementations§
Source§impl<'de> Deserialize<'de> for Metrics
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Iterable for Metrics
Source§fn metric_field_count(&self) -> usize
Returns the number of metric fields in the struct.Source§fn metric_field_ref(&self, n: usize) -> Option<MetricItem<'_>>
Returns the metric field at the given index.§fn family_field_count(&self) -> usize
Returns the number of Family fields in the struct.§fn family_field_ref(&self, _n: usize) -> Option<FamilyItem<'_>>
Returns the Family field at the given index.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
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/4036/docs/iroh/protocol/enum.IncomingFilterOutcome.html b/pr/4036/docs/iroh/protocol/enum.IncomingFilterOutcome.html
index e11345eddc..4577fe8eaf 100644
--- a/pr/4036/docs/iroh/protocol/enum.IncomingFilterOutcome.html
+++ b/pr/4036/docs/iroh/protocol/enum.IncomingFilterOutcome.html
@@ -11,7 +11,7 @@ the source address, actively refuse the connection, or silently drop it.
What this does depends on the connection type:
-
-
Direct (UDP) connections : this is QUIC source address
+
Direct (UDP) connections: this is QUIC source address
validation. If the socket address was spoofed, the retry token is
sent to the spoofed address, so we never hear from the attacker
again. If the address was real, the client repeats the connection
@@ -20,7 +20,7 @@ attempt with the token, and the next
-
-
Relay connections : there is no source address to validate
+
Relay connections: there is no source address to validate
(the relay already vouches for the packet origin), so the
“validation” itself has no security meaning. However, the retry
still imposes a real cost on the client: an extra round trip
diff --git a/pr/4036/docs/iroh/protocol/struct.RouterBuilder.html b/pr/4036/docs/iroh/protocol/struct.RouterBuilder.html
index dfc8969679..06b2f59fad 100644
--- a/pr/4036/docs/iroh/protocol/struct.RouterBuilder.html
+++ b/pr/4036/docs/iroh/protocol/struct.RouterBuilder.html
@@ -16,7 +16,7 @@ cheaper signals (e.g. remote address) first.
with this alpn.
handler can either be a type that implements ProtocolHandler or a
Box<dyn DynProtocolHandler>.
-
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for RouterBuilder
§impl !RefUnwindSafe for RouterBuilder
§impl Send for RouterBuilder
§impl Sync for RouterBuilder
§impl Unpin for RouterBuilder
§impl !UnwindSafe for RouterBuilder
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/4036/docs/iroh/struct.EndpointAddr.html b/pr/4036/docs/iroh/struct.EndpointAddr.html
index 0aa53df633..867818d655 100644
--- a/pr/4036/docs/iroh/struct.EndpointAddr.html
+++ b/pr/4036/docs/iroh/struct.EndpointAddr.html
@@ -5,7 +5,7 @@
This combines an endpoint’s identifier with network-level addressing information of how to
contact the endpoint.
To establish a network connection to an endpoint both the EndpointId and one or more network
-paths are needed. The network paths can come from various sources, current sources can come from
+paths are needed. The network paths can come from various sources:
-
An Address Lookup service which can provide routing information for a given EndpointId.
@@ -24,7 +24,7 @@ connection without the help of a Fields§§id: PublicKeyThe endpoint’s identifier.
-§addrs: BTreeSet<TransportAddr>The endpoint’s addresses
+§addrs: BTreeSet<TransportAddr>The endpoint’s addresses.
Implementations§
Source§impl EndpointAddr
Sourcepub fn new(id: PublicKey) -> EndpointAddr
Creates a new EndpointAddr with no network level addresses.
This still is usable with e.g. an address lookup service to establish a connection,
depending on the situation.
@@ -38,9 +38,9 @@ depending on the situation.
self,
addrs: impl IntoIterator<Item = TransportAddr>,
) -> EndpointAddrAdds a list of addresses.
-Sourcepub fn is_empty(&self) -> bool
Returns true, if only a EndpointId is present.
-Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns a list of IP addresses of this peer.
-Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns a list of relay urls of this peer.
+Sourcepub fn is_empty(&self) -> bool
Returns true if only an EndpointId is present.
+Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns an iterator over the IP addresses of this endpoint address.
+Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns an iterator over the relay URLs of this endpoint address.
In practice this is expected to be zero or one home relay for all known cases currently.
Trait Implementations§
Source§impl Clone for EndpointAddr
Source§fn clone(&self) -> EndpointAddr
Returns a duplicate 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 EndpointAddr
Source§impl<'de> Deserialize<'de> for EndpointAddr
Source§fn deserialize<__D>(
__deserializer: __D,
diff --git a/pr/4036/docs/iroh/struct.NetReport.html b/pr/4036/docs/iroh/struct.NetReport.html
index 693c855529..8b8ec1aed1 100644
--- a/pr/4036/docs/iroh/struct.NetReport.html
+++ b/pr/4036/docs/iroh/struct.NetReport.html
@@ -1,4 +1,4 @@
-NetReport in iroh - Rust NetReport
pub struct NetReport {
+NetReport in iroh - Rust NetReport
pub struct NetReport {
pub udp_v4: bool,
pub udp_v6: bool,
pub mapping_varies_by_dest_ipv4: Option<bool>,
@@ -13,17 +13,16 @@
§udp_v6: boolA QAD IPv6 round trip completed.
§mapping_varies_by_dest_ipv4: Option<bool>Whether the reported public address differs when probing different servers (on IPv4).
§mapping_varies_by_dest_ipv6: Option<bool>Whether the reported public address differs when probing different servers (on IPv6).
-§preferred_relay: Option<RelayUrl>Probe indicating the presence of port mapping protocols on the LAN.
-None for unknown
-§relay_latency: RelayLatencieskeyed by relay Url
-§global_v4: Option<SocketAddrV4>ip:port of global IPv4
-§global_v6: Option<SocketAddrV6>[ip]:port of global IPv6
+§preferred_relay: Option<RelayUrl>The relay server with the lowest latency, if any.
+§relay_latency: RelayLatenciesThe measured latency to each relay, keyed by relay URL.
+§global_v4: Option<SocketAddrV4>The discovered global IPv4 address and port, if any.
+§global_v6: Option<SocketAddrV6>The discovered global IPv6 address and port, if any.
§captive_portal: Option<bool>CaptivePortal is set when we think there’s a captive portal that is
intercepting HTTP traffic.
-Implementations§
Source§impl Report
Sourcepub fn mapping_varies_by_dest(&self) -> Option<bool>
Whether the reported public address differs when probing different servers.
+Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Report
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl PartialEq for Report
Source§impl Eq for Report
Source§impl StructuralPartialEq for Report
Auto Trait Implementations§
§impl Freeze for Report
§impl RefUnwindSafe for Report
§impl Send for Report
§impl Sync for Report
§impl Unpin for Report
§impl UnwindSafe for Report
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/4036/docs/iroh/struct.PublicKey.html b/pr/4036/docs/iroh/struct.PublicKey.html
index f8fb4c5ae2..b725772ddc 100644
--- a/pr/4036/docs/iroh/struct.PublicKey.html
+++ b/pr/4036/docs/iroh/struct.PublicKey.html
@@ -1,5 +1,5 @@
PublicKey in iroh - Rust PublicKey
pub struct PublicKey(/* private fields */);
Expand description
A public key.
-The key itself is stored as the CompressedEdwards y coordinate of the public key
+
The key itself is stored as the CompressedEdwards y-coordinate of the public key.
It is verified to decompress into a valid key when created.
Implementations§
Source§impl PublicKey
Sourcepub fn as_bytes(&self) -> &[u8; 32]
Get this public key as a byte array.
@@ -12,7 +12,7 @@ See [VerifyingKey::from_bytes] for details.
&self,
message: &[u8],
signature: &Signature,
-) -> Result<(), SignatureError>Verify a signature on a message with this secret key’s public key.
+) -> Result<(), SignatureError>Verify a signature on a message with this public key.
§Return
Returns Ok(()) if the signature is valid, and Err otherwise.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PublicKey
Source§fn deserialize<D>(
deserializer: D,
) -> Result<PublicKey, <D as Deserializer<'de>>::Error>where
- D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl From<PublicKey> for EndpointAddr
Source§fn from(endpoint_id: PublicKey) -> EndpointAddr
Converts to this type from the input type.Source§impl From<PublicKey> for EndpointAddr
Source§fn from(endpoint_id: PublicKey) -> EndpointAddr
Converts to this type from the input type.Source§impl FromStr for PublicKey
Parses a PublicKey from its hex or base32 encoding.
+
Display produces the hex encoding.
Source§impl Hash for PublicKey
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
H: Hasher,
diff --git a/pr/4036/docs/iroh/tls/index.html b/pr/4036/docs/iroh/tls/index.html
index 3c1d92cf2a..16f63b088e 100644
--- a/pr/4036/docs/iroh/tls/index.html
+++ b/pr/4036/docs/iroh/tls/index.html
@@ -1,5 +1,5 @@
iroh::tls - Rust Module tls
Expand description
TLS configuration for iroh.
-Currently there is one mechanisms available
+Currently there is one mechanism available:
- Raw Public Keys, using the TLS extension described in RFC 7250
diff --git a/pr/4036/docs/iroh_base/enum.KeyParsingError.html b/pr/4036/docs/iroh_base/enum.KeyParsingError.html
index d0668a511c..7c849cddf2 100644
--- a/pr/4036/docs/iroh_base/enum.KeyParsingError.html
+++ b/pr/4036/docs/iroh_base/enum.KeyParsingError.html
@@ -1,4 +1,4 @@
-KeyParsingError in iroh_base - Rust KeyParsingError
#[non_exhaustive]pub enum KeyParsingError {
+KeyParsingError in iroh_base - Rust KeyParsingError
#[non_exhaustive]pub enum KeyParsingError {
FailedToDecodeHex {
meta: Meta,
},
@@ -11,14 +11,14 @@
InvalidKeyData {
meta: Meta,
},
-}
Available on crate feature key only.Expand description
Error when deserialising a PublicKey or a SecretKey.
+}Available on crate feature key only.Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§FailedToDecodeHex
The input string could not be decoded as hex.
Fields
§meta: MetaCaptured call-site metadata
§FailedToDecodeBase32
The input string could not be decoded as base32.
Fields
§meta: MetaCaptured call-site metadata
§InvalidLength
The input has invalid length.
Fields
§meta: MetaCaptured call-site metadata
-§InvalidKeyData
The decoded data is not a valid Ed25591 public key.
+§InvalidKeyData
The decoded data is not a valid Ed25519 public key.
Fields
§meta: MetaCaptured call-site metadata
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<KeyParsingError> for AnyError
Source§fn from(value: KeyParsingError) -> AnyError
Converts to this type from the input type.Source§impl StackError for KeyParsingError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
Returns the next source in the chain, if any.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.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§
Source§impl<T> Borrow<T> for Twhere
diff --git a/pr/4036/docs/iroh_base/enum.TransportAddr.html b/pr/4036/docs/iroh_base/enum.TransportAddr.html
index ec9989aea4..a55428eb22 100644
--- a/pr/4036/docs/iroh_base/enum.TransportAddr.html
+++ b/pr/4036/docs/iroh_base/enum.TransportAddr.html
@@ -3,8 +3,8 @@
Ip(SocketAddr),
Custom(CustomAddr),
}Available on crate feature key only.Expand description
Available address types.
-Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§Relay(RelayUrl)
Relays
-§Ip(SocketAddr)
IP based addresses
+Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§Relay(RelayUrl)
A relay server address.
+§Ip(SocketAddr)
An IP based address.
§Custom(CustomAddr)
Custom transport address
Implementations§
Source§impl TransportAddr
fn into_address_lookup(
self,
_endpoint: &Endpoint,
diff --git a/pr/4036/docs/iroh/address_lookup/pkarr/index.html b/pr/4036/docs/iroh/address_lookup/pkarr/index.html
index 25f896e3a3..38c973b4c9 100644
--- a/pr/4036/docs/iroh/address_lookup/pkarr/index.html
+++ b/pr/4036/docs/iroh/address_lookup/pkarr/index.html
@@ -1,4 +1,4 @@
-iroh::address_lookup::pkarr - Rust Module pkarr
Expand description
An address lookup service which publishes and resolves endpoint information using a pkarr relay.
+iroh::address_lookup::pkarr - Rust Module pkarr
Expand description
An address lookup service which publishes and resolves endpoint information using a pkarr relay.
Public-Key Addressable Resource Records, pkarr, is a system which allows publishing
DNS Resource Records owned by a particular SecretKey under a name derived from its
corresponding PublicKey, also known as the EndpointId. Additionally this pkarr
diff --git a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html
index 0244bdd3e4..10f952f4f3 100644
--- a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html
+++ b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html
@@ -1,28 +1,30 @@
-
PkarrPublisher in iroh::address_lookup::pkarr - Rust PkarrPublisher
pub struct PkarrPublisher { /* private fields */ }
Expand description
Publisher of address lookup information to a pkarr relay.
+PkarrPublisher in iroh::address_lookup::pkarr - Rust PkarrPublisher
pub struct PkarrPublisher { /* private fields */ }
Expand description
Publisher of address lookup information to a pkarr relay.
This publisher uses HTTP to publish address lookup information to a pkarr relay
server, see the module docs for details.
This implements the AddressLookup trait to be used as an address lookup service. Note
that it only publishes address lookup information, for the corresponding resolver use
the PkarrResolver together with AddressLookupServices.
-This publisher will only publish the RelayUrl if it is set, otherwise the direct addresses are published instead.
-Implementations§
Source§impl PkarrPublisher
Sourcepub fn builder(pkarr_relay: Url) -> PkarrPublisherBuilder
Returns a PkarrPublisherBuilder that publishes endpoint info to a pkarr relay at pkarr_relay.
-If no further options are set, the pkarr publisher will use DEFAULT_PKARR_TTL as the
+
By default this publisher only publishes the RelayUrl, to avoid leaking IP addresses to
+the public pkarr server. Which addresses are published is controlled by the AddrFilter
+set via PkarrPublisherBuilder::addr_filter.
+Implementations§
Source§impl PkarrPublisher
Sourcepub fn builder(pkarr_relay: Url) -> PkarrPublisherBuilder
Returns a PkarrPublisherBuilder that publishes endpoint info to a pkarr relay at pkarr_relay.
+If no further options are set, the pkarr publisher will use DEFAULT_PKARR_TTL as the
time-to-live value for the published packets, and it will republish Address Lookup information
every DEFAULT_REPUBLISH_INTERVAL, even if the information is unchanged.
PkarrPublisherBuilder implements AddressLookupBuilder, so it can be passed to address_lookup.
It will then use the endpoint’s secret key to sign published packets.
-Sourcepub fn n0_dns() -> PkarrPublisherBuilder
Creates a pkarr publisher which uses the number 0 pkarr relay server.
+Sourcepub fn n0_dns() -> PkarrPublisherBuilder
Creates a pkarr publisher which uses the number 0 pkarr relay server.
This uses the pkarr relay server operated by number 0, at
N0_DNS_PKARR_RELAY_PROD.
When running with the environment variable
IROH_FORCE_STAGING_RELAYS set to any non empty value N0_DNS_PKARR_RELAY_STAGING
server is used instead.
-Sourcepub fn update_endpoint_data(&self, data: &EndpointData)
Publishes the addressing information about this endpoint to a pkarr relay.
+Sourcepub fn update_endpoint_data(&self, data: &EndpointData)
Publishes the addressing information about this endpoint to a pkarr relay.
This is a nonblocking function, the actual update is performed in the background.
-Trait Implementations§
Source§impl AddressLookup for PkarrPublisher
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreTrait Implementations§
Source§impl AddressLookup for PkarrPublisher
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreSource§impl Clone for PkarrPublisher
Source§fn clone(&self) -> PkarrPublisher
Returns a duplicate 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 PkarrPublisher
§impl !RefUnwindSafe for PkarrPublisher
§impl Send for PkarrPublisher
§impl Sync for PkarrPublisher
§impl Unpin for PkarrPublisher
§impl !UnwindSafe for PkarrPublisher
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for T
Source§impl Clone for PkarrPublisher
Source§fn clone(&self) -> PkarrPublisher
Returns a duplicate 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 PkarrPublisher
§impl !RefUnwindSafe for PkarrPublisher
§impl Send for PkarrPublisher
§impl Sync for PkarrPublisher
§impl Unpin for PkarrPublisher
§impl !UnwindSafe for PkarrPublisher
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
T: AddressLookup,
Source§fn into_address_lookup(
self,
_endpoint: &Endpoint,
diff --git a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
index aca2855501..bdab189c43 100644
--- a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
+++ b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
@@ -1,18 +1,18 @@
-PkarrRelayClient in iroh::address_lookup::pkarr - Rust PkarrRelayClient
pub struct PkarrRelayClient { /* private fields */ }
Expand description
A pkarr client to publish SignedPackets to a pkarr relay.
-Implementations§
Source§impl PkarrRelayClient
Sourcepub fn new(
+PkarrRelayClient in iroh::address_lookup::pkarr - Rust PkarrRelayClient
pub struct PkarrRelayClient { /* private fields */ }
Expand description
A pkarr client to publish SignedPackets to a pkarr relay.
+Implementations§
Source§impl PkarrRelayClient
Sourcepub fn new(
pkarr_relay_url: Url,
tls_config: ClientConfig,
dns_resolver: DnsResolver,
) -> Self
Available on non-wasm_browser only.
Creates a PkarrRelayClient.
-Sourcepub async fn resolve(
&self,
endpoint_id: EndpointId,
) -> Result<SignedPacket, AddressLookupError>
Resolves a SignedPacket for the given EndpointId.
-Sourcepub async fn publish(
&self,
signed_packet: &SignedPacket,
) -> Result<(), PkarrError>
Publishes a SignedPacket.
-
Trait Implementations§
Source§impl Clone for PkarrRelayClient
Source§fn clone(&self) -> PkarrRelayClient
Returns a duplicate 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 PkarrRelayClient
§impl !RefUnwindSafe for PkarrRelayClient
§impl Send for PkarrRelayClient
§impl Sync for PkarrRelayClient
§impl Unpin for PkarrRelayClient
§impl !UnwindSafe for PkarrRelayClient
Blanket Implementations§
Trait Implementations§
Source§impl Clone for PkarrRelayClient
Source§fn clone(&self) -> PkarrRelayClient
Returns a duplicate 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 PkarrRelayClient
§impl !RefUnwindSafe for PkarrRelayClient
§impl Send for PkarrRelayClient
§impl Sync for PkarrRelayClient
§impl Unpin for PkarrRelayClient
§impl !UnwindSafe for PkarrRelayClient
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/4036/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
index 79d8b2e2a8..0c08b03913 100644
--- a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
+++ b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
@@ -1,6 +1,6 @@
-PkarrRelayClientBuilder in iroh::address_lookup::pkarr - Rust PkarrRelayClientBuilder
pub struct PkarrRelayClientBuilder { /* private fields */ }
Expand description
A builder for the PkarrRelayClient
-Implementations§
Source§impl PkarrRelayClientBuilder
Sourcepub fn build(self) -> PkarrRelayClient
Build a PkarrRelayClient.
-Trait Implementations§
Source§impl Clone for PkarrRelayClientBuilder
Source§fn clone(&self) -> PkarrRelayClientBuilder
Returns a duplicate 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 PkarrRelayClientBuilder
§impl !RefUnwindSafe for PkarrRelayClientBuilder
§impl Send for PkarrRelayClientBuilder
§impl Sync for PkarrRelayClientBuilder
§impl Unpin for PkarrRelayClientBuilder
§impl !UnwindSafe for PkarrRelayClientBuilder
Blanket Implementations§
Source§impl<T> Any for Twhere
+PkarrRelayClientBuilder in iroh::address_lookup::pkarr - Rust PkarrRelayClientBuilder
pub struct PkarrRelayClientBuilder { /* private fields */ }
Expand description
A builder for the PkarrRelayClient
+Implementations§
Source§impl PkarrRelayClientBuilder
Sourcepub fn build(self) -> PkarrRelayClient
Build a PkarrRelayClient.
+Trait Implementations§
Source§impl Clone for PkarrRelayClientBuilder
Source§fn clone(&self) -> PkarrRelayClientBuilder
Returns a duplicate 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 PkarrRelayClientBuilder
§impl !RefUnwindSafe for PkarrRelayClientBuilder
§impl Send for PkarrRelayClientBuilder
§impl Sync for PkarrRelayClientBuilder
§impl Unpin for PkarrRelayClientBuilder
§impl !UnwindSafe for PkarrRelayClientBuilder
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/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
index 13e12a4b01..1f7723299d 100644
--- a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
+++ b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
@@ -1,21 +1,21 @@
-PkarrResolver in iroh::address_lookup::pkarr - Rust PkarrResolver
pub struct PkarrResolver { /* private fields */ }
Expand description
Resolver of address lookup information from a pkarr relay.
+PkarrResolver in iroh::address_lookup::pkarr - Rust PkarrResolver
pub struct PkarrResolver { /* private fields */ }
Expand description
Resolver of address lookup information from a pkarr relay.
The resolver uses HTTP to query address lookup information from a pkarr relay server,
see the module docs for details.
This implements the AddressLookup trait to be used as an address lookup service. Note
that it only resolves address lookup information, for the corresponding publisher use
the PkarrPublisher together with AddressLookupServices.
-Implementations§
Source§impl PkarrResolver
Sourcepub fn builder(pkarr_relay: Url) -> PkarrResolverBuilder
Creates a new resolver builder using the pkarr relay server at the URL.
+Implementations§
Source§impl PkarrResolver
Sourcepub fn builder(pkarr_relay: Url) -> PkarrResolverBuilder
Creates a new resolver builder using the pkarr relay server at the URL.
The builder implements AddressLookupBuilder.
-Sourcepub fn n0_dns() -> PkarrResolverBuilder
Creates a pkarr resolver builder which uses the number 0 pkarr relay server.
+Sourcepub fn n0_dns() -> PkarrResolverBuilder
Creates a pkarr resolver builder which uses the number 0 pkarr relay server.
This uses the pkarr relay server operated by number 0 at
N0_DNS_PKARR_RELAY_PROD.
When running with the environment variable IROH_FORCE_STAGING_RELAYS
set to any non empty value N0_DNS_PKARR_RELAY_STAGING
server is used instead.
-Trait Implementations§
Source§impl AddressLookup for PkarrResolver
Trait Implementations§
Source§impl AddressLookup for PkarrResolver
Source§fn resolve(
&self,
endpoint_id: EndpointId,
-) -> Option<BoxStream<Result<AddressLookupItem, AddressLookupError>>>
Source§fn publish(&self, _data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreSource§impl Clone for PkarrResolver
Source§fn clone(&self) -> PkarrResolver
Returns a duplicate 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 PkarrResolver
§impl !RefUnwindSafe for PkarrResolver
§impl Send for PkarrResolver
§impl Sync for PkarrResolver
§impl Unpin for PkarrResolver
§impl !UnwindSafe for PkarrResolver
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
+) -> Option<BoxStream<Result<AddressLookupItem, AddressLookupError>>>Source§fn publish(&self, _data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read more
Source§impl Clone for PkarrResolver
Source§fn clone(&self) -> PkarrResolver
Returns a duplicate 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 PkarrResolver
§impl !RefUnwindSafe for PkarrResolver
§impl Send for PkarrResolver
§impl Sync for PkarrResolver
§impl Unpin for PkarrResolver
§impl !UnwindSafe for PkarrResolver
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
T: AddressLookup,
Source§fn into_address_lookup(
self,
_endpoint: &Endpoint,
diff --git a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
index cfd47f28e6..e549ec9d07 100644
--- a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
+++ b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
@@ -1,11 +1,11 @@
-PkarrResolverBuilder in iroh::address_lookup::pkarr - Rust PkarrResolverBuilder
pub struct PkarrResolverBuilder { /* private fields */ }
Expand description
Builder for PkarrResolver.
+PkarrResolverBuilder in iroh::address_lookup::pkarr - Rust PkarrResolverBuilder
pub struct PkarrResolverBuilder { /* private fields */ }
Expand description
Builder for PkarrResolver.
-Implementations§
Source§impl PkarrResolverBuilder
Sourcepub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self
Available on non-wasm_browser only.
Sets the DNS resolver to use for resolving the pkarr relay URL.
-Sourcepub fn build(self, tls_config: ClientConfig) -> PkarrResolver
Creates a PkarrResolver from this builder.
-Trait Implementations§
Implementations§
Source§impl PkarrResolverBuilder
Sourcepub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self
Available on non-wasm_browser only.
Sets the DNS resolver to use for resolving the pkarr relay URL.
+Sourcepub fn build(self, tls_config: ClientConfig) -> PkarrResolver
Creates a PkarrResolver from this builder.
+Trait Implementations§
Source§impl AddressLookupBuilder for PkarrResolverBuilder
Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this builder into a ready-to-use AddressLookup. Read moreAuto Trait Implementations§
§impl Freeze for PkarrResolverBuilder
§impl !RefUnwindSafe for PkarrResolverBuilder
§impl Send for PkarrResolverBuilder
§impl Sync for PkarrResolverBuilder
§impl Unpin for PkarrResolverBuilder
§impl !UnwindSafe for PkarrResolverBuilder
Blanket Implementations§
Source§impl<T> Any for Twhere
+) -> Result<impl AddressLookup, AddressLookupBuilderError>Turns this builder into a ready-to-use AddressLookup. Read more
Auto Trait Implementations§
§impl Freeze for PkarrResolverBuilder
§impl !RefUnwindSafe for PkarrResolverBuilder
§impl Send for PkarrResolverBuilder
§impl Sync for PkarrResolverBuilder
§impl Unpin for PkarrResolverBuilder
§impl !UnwindSafe for PkarrResolverBuilder
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/4036/docs/iroh/address_lookup/struct.EndpointData.html b/pr/4036/docs/iroh/address_lookup/struct.EndpointData.html
index 1ea4773718..7de6a2dd89 100644
--- a/pr/4036/docs/iroh/address_lookup/struct.EndpointData.html
+++ b/pr/4036/docs/iroh/address_lookup/struct.EndpointData.html
@@ -13,15 +13,15 @@ services, should they not fit into e.g. a single DNS packet otherwise.
See also Self::set_user_data.
Sourcepub fn add_relay_url(&mut self, relay_url: RelayUrl)
Adds the relay URL to the end of the endpoint data, unless it already existed.
Sourcepub fn add_ip_addrs(&mut self, addresses: Vec<SocketAddr>)
Adds addresses in order with duplicates or already existing addresses filtered out.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Adds addresses to the endpoint data in the given ordered, but with duplicates filtered.
-Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data and returns the updated endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Adds addresses to the endpoint data in the given order, but with duplicates filtered.
+Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data.
Sourcepub fn clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn clear_relay_urls(&mut self)
Removes all relay URLs from the endpoint data.
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses.
+Sourcepub fn filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
Returns a vec to allow re-ordering of addresses.
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
diff --git a/pr/4036/docs/iroh/address_lookup/struct.Item.html b/pr/4036/docs/iroh/address_lookup/struct.Item.html
index 9e63b37130..28d59f6feb 100644
--- a/pr/4036/docs/iroh/address_lookup/struct.Item.html
+++ b/pr/4036/docs/iroh/address_lookup/struct.Item.html
@@ -16,14 +16,14 @@ directly from Sourcepub fn last_updated(&self) -> Option<u64>
Returns the optional timestamp when this endpoint info was last updated.
The value is microseconds since the unix epoch.
-Sourcepub fn to_endpoint_addr(&self) -> EndpointAddr
Converts into a EndpointAddr by cloning the needed fields.
-Sourcepub fn into_endpoint_addr(self) -> EndpointAddr
Converts into a EndpointAddr without cloning.
+Sourcepub fn to_endpoint_addr(&self) -> EndpointAddr
Returns an EndpointAddr by cloning the needed fields.
+Sourcepub fn into_endpoint_addr(self) -> EndpointAddr
Converts into an EndpointAddr without cloning.
Methods from Deref<Target = EndpointData>§
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses.
+Sourcepub fn filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
Returns a vec to allow re-ordering of addresses.
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
diff --git a/pr/4036/docs/iroh/address_lookup/struct.UserData.html b/pr/4036/docs/iroh/address_lookup/struct.UserData.html
index 49c2183d40..5ae8665e57 100644
--- a/pr/4036/docs/iroh/address_lookup/struct.UserData.html
+++ b/pr/4036/docs/iroh/address_lookup/struct.UserData.html
@@ -1,4 +1,5 @@
-UserData in iroh::address_lookup - Rust 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.
+UserData in iroh::address_lookup - Rust UserData
pub struct UserData(/* private fields */);
Expand description
User-defined data that can be published and resolved through endpoint discovery.
+Under the hood this is a UTF-8 string 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.
diff --git a/pr/4036/docs/iroh/address_lookup/trait.AddressLookup.html b/pr/4036/docs/iroh/address_lookup/trait.AddressLookup.html
index 1be6efa3e6..79a8044def 100644
--- a/pr/4036/docs/iroh/address_lookup/trait.AddressLookup.html
+++ b/pr/4036/docs/iroh/address_lookup/trait.AddressLookup.html
@@ -22,7 +22,7 @@ Address Lookup information changes. If an Address Lookup mechanism requires a pe
refresh, it should start its own task.
Provided Methods§
Sourcefn publish(&self, _data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism.
This is fire and forget, since the Endpoint can not wait for successful
-publishing. If publishing is async, the implementation should start it’s own task.
+publishing. If publishing is async, the implementation should start its own task.
This will be called from a tokio task, so it is safe to spawn new tasks.
These tasks will be run on the runtime of the super::Endpoint.
Implementations on Foreign Types§
Source§impl<T: AddressLookup> AddressLookup for Arc<T>
Implementors§
Source§impl AddressLookup for DnsAddressLookup
Available on non-wasm_browser only. Source§impl AddressLookup for MemoryLookup
Source§impl AddressLookup for PkarrPublisher
Source§impl AddressLookup for PkarrResolver
Source§impl<T: AddressLookup> AddressLookup for FilteredAddressLookup<T>
\ No newline at end of file
+) -> Option<BoxStream<Result<Item, Error>>>Implementors§
Source§impl AddressLookup for DnsAddressLookup
Available on non-wasm_browser only. Source§impl AddressLookup for MemoryLookup
Source§impl AddressLookup for PkarrPublisher
Source§impl AddressLookup for PkarrResolver
Source§impl<T: AddressLookup> AddressLookup for FilteredAddressLookup<T>
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/address_lookup/trait.AddressLookupBuilder.html b/pr/4036/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
index 35aadc4338..edc4dff899 100644
--- a/pr/4036/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
+++ b/pr/4036/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
@@ -20,5 +20,5 @@ endpoint to Endpoint,
) -> Result<impl AddressLookup, AddressLookupBuilderError>Turns this builder into a ready-to-use AddressLookup.
If an error is returned, building the endpoint will fail with this error.
-Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
Source§impl AddressLookupBuilder for DnsAddressLookupBuilder
Available on non-wasm_browser only. Source§impl AddressLookupBuilder for PkarrPublisherBuilder
Source§impl AddressLookupBuilder for PkarrResolverBuilder
Source§impl<T: AddressLookup> AddressLookupBuilder for T
Blanket no-op impl of AddressLookupBuilder for T: AddressLookup.
+ Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
Source§impl AddressLookupBuilder for DnsAddressLookupBuilder
Available on non-wasm_browser only. Source§impl AddressLookupBuilder for PkarrPublisherBuilder
Source§impl AddressLookupBuilder for PkarrResolverBuilder
Source§impl<T: AddressLookup> AddressLookupBuilder for T
Blanket no-op impl of AddressLookupBuilder for T: AddressLookup.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/defaults/prod/fn.default_ap_relay.html b/pr/4036/docs/iroh/defaults/prod/fn.default_ap_relay.html
index 5961b7d1ab..3a67b98b91 100644
--- a/pr/4036/docs/iroh/defaults/prod/fn.default_ap_relay.html
+++ b/pr/4036/docs/iroh/defaults/prod/fn.default_ap_relay.html
@@ -1,2 +1,2 @@
-default_ap_relay in iroh::defaults::prod - Rust default_ap_relay
pub fn default_ap_relay() -> RelayConfig
Expand description
Get the default RelayConfig for Asia-Pacific
+default_ap_relay in iroh::defaults::prod - Rust default_ap_relay
pub fn default_ap_relay() -> RelayConfig
Expand description
Get the default RelayConfig for Asia-Pacific.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/defaults/prod/index.html b/pr/4036/docs/iroh/defaults/prod/index.html
index 8981fb6be4..b076bc3ce3 100644
--- a/pr/4036/docs/iroh/defaults/prod/index.html
+++ b/pr/4036/docs/iroh/defaults/prod/index.html
@@ -1,2 +1,2 @@
iroh::defaults::prod - Rust Module prod
Expand description
Production configuration.
-Constants§
- AP_
RELAY_HOSTNAME - Hostname of the default Asia-Pacific relay.
- EU_
RELAY_HOSTNAME - Hostname of the default EU relay.
- NA_
EAST_RELAY_HOSTNAME - Hostname of the default NA east relay.
- NA_
WEST_RELAY_HOSTNAME - Hostname of the default NA west relay.
Functions§
- default_
ap_relay - Get the default
RelayConfig for Asia-Pacific - default_
eu_relay - Get the default
RelayConfig for EU. - default_
na_east_relay - Get the default
RelayConfig for NA east. - default_
na_west_relay - Get the default
RelayConfig for NA west. - default_
relay_map - Get the default
RelayMap.
\ No newline at end of file
+Constants§
- AP_
RELAY_HOSTNAME - Hostname of the default Asia-Pacific relay.
- EU_
RELAY_HOSTNAME - Hostname of the default EU relay.
- NA_
EAST_RELAY_HOSTNAME - Hostname of the default NA east relay.
- NA_
WEST_RELAY_HOSTNAME - Hostname of the default NA west relay.
Functions§
- default_
ap_relay - Get the default
RelayConfig for Asia-Pacific. - default_
eu_relay - Get the default
RelayConfig for EU. - default_
na_east_relay - Get the default
RelayConfig for NA east. - default_
na_west_relay - Get the default
RelayConfig for NA west. - default_
relay_map - Get the default
RelayMap.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/dns/struct.DnsResolver.html b/pr/4036/docs/iroh/dns/struct.DnsResolver.html
index 754fa26465..3f8c6e27b6 100644
--- a/pr/4036/docs/iroh/dns/struct.DnsResolver.html
+++ b/pr/4036/docs/iroh/dns/struct.DnsResolver.html
@@ -15,7 +15,7 @@ public DNS.
Implementations§
Source§impl DnsResolver
Sourcepub fn new() -> DnsResolver
Creates 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.
+to the default ResolverConfig which uses e.g. Google’s 8.8.8.8 or 8.8.4.4.
Sourcepub fn with_nameserver(nameserver: SocketAddr) -> DnsResolver
Creates a new DNS resolver configured with a single UDP DNS nameserver.
Sourcepub fn custom(resolver: impl Resolver) -> DnsResolver
Creates a new DnsResolver from a struct that implements Resolver.
diff --git a/pr/4036/docs/iroh/dns/trait.Resolver.html b/pr/4036/docs/iroh/dns/trait.Resolver.html
index 4aaa7642fd..3ebf87a01f 100644
--- a/pr/4036/docs/iroh/dns/trait.Resolver.html
+++ b/pr/4036/docs/iroh/dns/trait.Resolver.html
@@ -38,13 +38,13 @@ atomic swap. Build a new instance with re-bound sockets and re-read nameserver
configuration rather than mutating in place. Must not perform IO: defer DNS
queries and socket binds until the new resolver is first used. May be called
concurrently, in which case all but one allocated replacement is dropped unused.
-Implementations on Foreign Types§
Implementations on Foreign Types§
Source§impl Resolver for Arc<SimpleDnsResolver>
Source§fn lookup_ipv4(
&self,
host: String,
-) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = Ipv4Addr> + Send>, DnsError>> + Send>>
Source§fn lookup_ipv6(
+) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = Ipv4Addr> + Send>, DnsError>> + Send>>
Source§fn lookup_ipv6(
&self,
host: String,
-) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = Ipv6Addr> + Send>, DnsError>> + Send>>
Source§fn lookup_txt(
+) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = Ipv6Addr> + Send>, DnsError>> + Send>>
Source§fn lookup_txt(
&self,
host: String,
-) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = TxtRecordData> + Send>, DnsError>> + Send>>
Source§fn clear_cache(&self)
Source§fn reset(&self) -> Box<dyn Resolver>
Implementors§
\ No newline at end of file
+) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = TxtRecordData> + Send>, DnsError>> + Send>>Source§fn clear_cache(&self)
Source§fn reset(&self) -> Box<dyn Resolver>
Implementors§
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html b/pr/4036/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html
index 0a8e0c05eb..cc00fac5e1 100644
--- a/pr/4036/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html
+++ b/pr/4036/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html
@@ -1,2 +1,2 @@
-ENV_FORCE_STAGING_RELAYS in iroh::endpoint - Rust ENV_FORCE_STAGING_RELAYS
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 ENV_FORCE_STAGING_RELAYS
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint/enum.RelayMode.html b/pr/4036/docs/iroh/endpoint/enum.RelayMode.html
index 326aae7405..0d7b755897 100644
--- a/pr/4036/docs/iroh/endpoint/enum.RelayMode.html
+++ b/pr/4036/docs/iroh/endpoint/enum.RelayMode.html
@@ -1,4 +1,4 @@
-RelayMode in iroh::endpoint - Rust RelayMode
pub enum RelayMode {
+RelayMode in iroh::endpoint - Rust RelayMode
pub enum RelayMode {
Disabled,
Default,
Staging,
@@ -10,14 +10,14 @@ This means that neither listening nor dialing relays will be available.
See crate::defaults::prod for the severs used.
§Staging
Use the staging relay servers from n0.
§Custom(RelayMap)
Use a custom relay map.
-
Implementations§
Source§impl RelayMode
Sourcepub fn custom(map: impl IntoIterator<Item = RelayUrl>) -> Self
Create a custom relay mode from a list of RelayUrls.
+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§
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/4036/docs/iroh/endpoint/fn.default_relay_mode.html b/pr/4036/docs/iroh/endpoint/fn.default_relay_mode.html
index d716677abc..98ff3579ee 100644
--- a/pr/4036/docs/iroh/endpoint/fn.default_relay_mode.html
+++ b/pr/4036/docs/iroh/endpoint/fn.default_relay_mode.html
@@ -1,4 +1,4 @@
-default_relay_mode in iroh::endpoint - Rust default_relay_mode
pub fn default_relay_mode() -> RelayMode
Expand description
Returns the default relay mode.
+default_relay_mode in iroh::endpoint - Rust default_relay_mode
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint/fn.force_staging_infra.html b/pr/4036/docs/iroh/endpoint/fn.force_staging_infra.html
index ff8dda7e69..b444491b3e 100644
--- a/pr/4036/docs/iroh/endpoint/fn.force_staging_infra.html
+++ b/pr/4036/docs/iroh/endpoint/fn.force_staging_infra.html
@@ -1,2 +1,2 @@
-force_staging_infra in iroh::endpoint - Rust force_staging_infra
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 force_staging_infra
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint/index.html b/pr/4036/docs/iroh/endpoint/index.html
index 2efb803d4c..f3a98d45f2 100644
--- a/pr/4036/docs/iroh/endpoint/index.html
+++ b/pr/4036/docs/iroh/endpoint/index.html
@@ -1,4 +1,4 @@
-iroh::endpoint - Rust Module endpoint
Expand description
The Endpoint allows establishing connections to other iroh endpoints.
+iroh::endpoint - Rust Module endpoint
Expand description
The Endpoint allows establishing connections to other iroh endpoints.
The Endpoint is the main API interface to manage a local iroh endpoint. It allows
connecting to and accepting connections from other endpoints. See the module docs for
more details on how iroh connections work.
diff --git a/pr/4036/docs/iroh/endpoint/presets/index.html b/pr/4036/docs/iroh/endpoint/presets/index.html
index 37b792c03d..a454626701 100644
--- a/pr/4036/docs/iroh/endpoint/presets/index.html
+++ b/pr/4036/docs/iroh/endpoint/presets/index.html
@@ -2,4 +2,4 @@
§Example
use iroh::{Endpoint, RelayMode, Watcher, endpoint::presets};
-let endpoint = Endpoint::builder(presets::N0).bind().await?;
Structs§
- Empty
- An empty preset that doesn’t set anything on the builder.
- Minimal
with_crypto_provider - A preset that is almost empty, besides setting mandatory options.
- N0
with_crypto_provider - Configures the endpoint to use the n0 defaults
- N0Disable
Relay with_crypto_provider - Configures the endpoint to use the n0 defaults, but with relay mode disabled.
Traits§
- Preset
- Defines a preset
\ No newline at end of file
+let endpoint = Endpoint::builder(presets::N0).bind().await?;Structs§
- Empty
- An empty preset that doesn’t set anything on the builder.
- Minimal
with_crypto_provider - A preset that is almost empty, besides setting mandatory options.
- N0
with_crypto_provider - Configures the endpoint to use the n0 defaults
- N0Disable
Relay with_crypto_provider - Configures the endpoint to use the n0 defaults, but with relay mode disabled.
Traits§
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint/presets/struct.N0.html b/pr/4036/docs/iroh/endpoint/presets/struct.N0.html
index 41c532b301..cf9fb0156e 100644
--- a/pr/4036/docs/iroh/endpoint/presets/struct.N0.html
+++ b/pr/4036/docs/iroh/endpoint/presets/struct.N0.html
@@ -6,8 +6,8 @@
setting the [rustls::crypto::CryptoProvider] to ring or aws-lc-rs, depending
on which feature is enabled in iroh (preferring ring if both are enabled).
-Due to the last point, this preset is only available with the ring or
-aws-lc-rs preset installed.
+
Due to the last point, this preset is only available with the tls-ring or
+tls-aws-lc-rs feature enabled.
If you want to set your own crypto provider, we recommend copying the
implementation of this preset into your own and setting the appropriate crypto
provider there.
diff --git a/pr/4036/docs/iroh/endpoint/presets/struct.N0DisableRelay.html b/pr/4036/docs/iroh/endpoint/presets/struct.N0DisableRelay.html
index dd14c88ba9..29795833c9 100644
--- a/pr/4036/docs/iroh/endpoint/presets/struct.N0DisableRelay.html
+++ b/pr/4036/docs/iroh/endpoint/presets/struct.N0DisableRelay.html
@@ -7,8 +7,8 @@ relay urls.
setting the [rustls::crypto::CryptoProvider] to ring or aws-lc-rs, depending
on which feature is enabled in iroh (preferring ring if both are enabled).
-Due to the last point, this preset is only available with the ring or
-aws-lc-rs preset installed.
+
Due to the last point, this preset is only available with the tls-ring or
+tls-aws-lc-rs feature enabled.
If you want to set your own crypto provider, we recommend copying the
implementation of this preset into your own and setting the appropriate crypto
provider there.
diff --git a/pr/4036/docs/iroh/endpoint/presets/trait.Preset.html b/pr/4036/docs/iroh/endpoint/presets/trait.Preset.html
index 59a71a95da..7e6f4bbcac 100644
--- a/pr/4036/docs/iroh/endpoint/presets/trait.Preset.html
+++ b/pr/4036/docs/iroh/endpoint/presets/trait.Preset.html
@@ -1,7 +1,7 @@
-Preset in iroh::endpoint::presets - Rust Preset
pub trait Preset {
+Preset in iroh::endpoint::presets - Rust Preset
pub trait Preset {
// Required method
fn apply(self, builder: Builder) -> Builder;
-}
Expand description
Defines a preset
+}Expand description
A reusable bundle of endpoint Builder configuration.
Required Methods§
Implementations on Foreign Types§
Source§impl Preset for Arc<TestTransport>
Available on crate feature unstable-custom-transports and (crate features test-utils) only.
Source§fn apply(self, builder: Builder) -> Builder
Configures the builder with this transport and the network’s address lookup.
§Example
diff --git a/pr/4036/docs/iroh/endpoint/struct.Builder.html b/pr/4036/docs/iroh/endpoint/struct.Builder.html
index 79894b8924..7cbb050d5e 100644
--- a/pr/4036/docs/iroh/endpoint/struct.Builder.html
+++ b/pr/4036/docs/iroh/endpoint/struct.Builder.html
@@ -92,7 +92,7 @@ is set to false explicitly.
destination addresses. It is valid to configure this, but no more than one such
socket should be bound or the routing will be non-deterministic.
To use a subnet with a non-zero prefix length as the default route in addition to
-being routed when its prefix matches, use `BindOpts::set_is_default_route.
+being routed when its prefix matches, use BindOpts::set_is_default_route.
Subnets with a prefix length of zero are always marked as default routes.
Finally note that most outgoing datagrams are part of an existing network flow. That
is, they are in response to an incoming datagram. In this case the outgoing datagram
@@ -142,7 +142,7 @@ direct addresses or relay URLs will fail.
Sourcepub fn addr_filter(self, filter: AddrFilter) -> Self
Sets the address filter applied to all address data before publishing.
This filter is applied once, at the AddressLookupServices level, before
distributing data to any individual address lookup service. This ensures
-consistent filtering regardless of how the services configured.
+consistent filtering regardless of how the services are configured.
Sourcepub fn clear_addr_filter(self) -> Self
Clears the address filter, allowing all addresses to be published.
This removes any filter previously set via Self::addr_filter, including
filters set by presets.
diff --git a/pr/4036/docs/iroh/endpoint/struct.ConnectOptions.html b/pr/4036/docs/iroh/endpoint/struct.ConnectOptions.html
index 30bf2e329e..3834b0244e 100644
--- a/pr/4036/docs/iroh/endpoint/struct.ConnectOptions.html
+++ b/pr/4036/docs/iroh/endpoint/struct.ConnectOptions.html
@@ -1,12 +1,12 @@
-ConnectOptions in iroh::endpoint - Rust ConnectOptions
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 ConnectOptions
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 QuicTransportConfig.
-Sourcepub fn with_transport_config(
+
Sourcepub fn with_transport_config(
self,
transport_config: QuicTransportConfig,
) -> Self
Sets the QUIC transport config options for this connection.
-Sourcepub fn with_additional_alpns(self, alpns: Vec<Vec<u8>>) -> Self
Sets ALPN identifiers that should be signaled as supported on connection, in
+
Sourcepub fn with_additional_alpns(self, alpns: Vec<Vec<u8>>) -> Self
Sets ALPN identifiers that should be signaled as supported on connection, in
addition to the main ALPN identifier used in Endpoint::connect_with_opts.
This allows connecting to servers that may only support older versions of your
protocol. In this case, you would add the older ALPN identifiers with this
@@ -20,7 +20,7 @@ list or the main ALPN identifiers on the accept side, see the endpoint
builder’s Builder::alpns function.
-Trait Implementations§
Source§impl Clone for ConnectOptions
Source§fn clone(&self) -> ConnectOptions
Returns a duplicate 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 duplicate 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/4036/docs/iroh/endpoint/struct.Connection.html b/pr/4036/docs/iroh/endpoint/struct.Connection.html
index ffc93497ee..74f53832af 100644
--- a/pr/4036/docs/iroh/endpoint/struct.Connection.html
+++ b/pr/4036/docs/iroh/endpoint/struct.Connection.html
@@ -8,7 +8,7 @@ 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<T: ConnectionState> Connection<T>
Implementations§
Source§impl<T: ConnectionState> Connection<T>
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.
@@ -18,13 +18,13 @@ consequence, the peer won’t be notified that a stream has been opened until th
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_bi(&self) -> AcceptBi<'_> ⓘ
Accepts 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 async fn closed(&self) -> ConnectionError
Waits 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.
@@ -97,17 +97,18 @@ strong and pseudorandom, and are suitable for use as keying material.
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)
See [noq_proto::TransportConfig::receive_window].
-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)
Sets the connection-level flow control receive window.
+See [noq_proto::TransportConfig::receive_window].
+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.
-Source§impl Connection<HandshakeCompleted>
Sourcepub fn remote_id(&self) -> EndpointId
Returns the EndpointId from the peer’s TLS certificate.
+Source§impl Connection<HandshakeCompleted>
Sourcepub fn remote_id(&self) -> EndpointId
Returns the EndpointId from the peer’s TLS certificate.
The PublicKey of an endpoint is also known as an EndpointId. This PublicKey is
included in the TLS certificate presented during the handshake when connecting.
This function allows you to get the EndpointId of the remote endpoint of this
connection.
-Sourcepub fn paths(&self) -> PathList<'_>
Returns the currently open network paths for this connection.
+Sourcepub fn paths(&self) -> PathList<'_>
Returns the currently open network paths for this connection.
A connection typically has one path via the relay server and,
once holepunching succeeds, a direct path. The returned
PathList is a snapshot taken at call time: it does not
@@ -116,14 +117,14 @@ already closed.
To observe changes over time, see Connection::paths_stream
for a stream of PathList snapshots and
Connection::path_events for individual PathEvents.
-Sourcepub fn paths_stream(&self) -> PathListStream<'_>
Returns a stream of PathList snapshots for this connection.
+Sourcepub fn paths_stream(&self) -> PathListStream<'_>
Returns a stream of PathList snapshots for this connection.
Yields the current snapshot on the first poll, and a fresh
snapshot whenever the open paths or the selected path change.
Ends when the connection closes.
The stream borrows this Connection. To consume it from a
spawned task, move a Connection clone into the task and
call this method inside.
-Sourcepub fn path_events(&self) -> PathEventStream
Returns a stream of PathEvents for this connection.
+Sourcepub fn path_events(&self) -> PathEventStream
Returns a stream of PathEvents for this connection.
Each event reports one of: a path opened, a path closed (with
final per-path statistics), the selected transmission path
changed, or the consumer fell behind. The stream ends when the
@@ -133,14 +134,14 @@ may be moved into a spawned task.
single PathEvent::Lagged; the current state of the open
paths and the selected path remains recoverable via
Connection::paths.
-Sourcepub fn weak_handle(&self) -> WeakConnectionHandle
Returns a WeakConnectionHandle for this connection.
+Sourcepub fn weak_handle(&self) -> WeakConnectionHandle
Returns a WeakConnectionHandle for this connection.
A WeakConnectionHandle does not keep the connection alive. It can be used to
wait for the connection to be closed via WeakConnectionHandle::closed and to
attempt to upgrade back to a strong Connection via
WeakConnectionHandle::upgrade.
-Source§impl Connection<IncomingZeroRtt>
Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
-Sourcepub async fn handshake_completed(&self) -> Result<Connection, ConnectingError>
Waits until the full handshake occurs and then returns a Connection.
+Source§impl Connection<IncomingZeroRtt>
Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
+Sourcepub async fn handshake_completed(&self) -> Result<Connection, ConnectingError>
Waits until the full handshake occurs and then returns a Connection.
This may fail with ConnectingError::ConnectionError, if there was
some general failure with the connection, such as a network timeout since
we accepted the connection.
@@ -149,18 +150,18 @@ doesn’t use the right TLS authentication, which usually every iroh endpoint
uses and requires.
Thus, those errors should only occur if someone connects to you with a
modified iroh endpoint or with a plain QUIC client.
-Sourcepub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError>
Returns the EndpointId from the peer’s TLS certificate.
+Sourcepub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError>
Returns the EndpointId from the peer’s TLS certificate.
The PublicKey of an endpoint is also known as an EndpointId. This PublicKey is
included in the TLS certificate presented during the handshake when connecting.
This function allows you to get the EndpointId of the remote endpoint of this
connection.
-Source§impl Connection<OutgoingZeroRtt>
Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
+Sourcepub async fn handshake_completed(
&self,
) -> Result<ZeroRttStatus, ConnectingError>
Waits until the full handshake occurs and returns a ZeroRttStatus.
-If ZeroRttStatus::Accepted is returned, than any streams created before
+
If ZeroRttStatus::Accepted is returned, then any streams created before
the handshake has completed can still be used.
-If ZeroRttStatus::Rejected is returned, than any streams created before
+
If ZeroRttStatus::Rejected is returned, then any streams created before
the handshake will error and any data sent should be re-sent on a
new stream.
This may fail with ConnectingError::ConnectionError, if there was
@@ -171,7 +172,7 @@ doesn’t use the right TLS authentication, which usually every iroh endpoint
uses and requires.
Thus, those errors should only occur if someone connects to you with a
modified iroh endpoint or with a plain QUIC client.
-Sourcepub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError>
Returns the EndpointId from the peer’s TLS certificate.
+Sourcepub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError>
Returns the EndpointId from the peer’s TLS certificate.
The PublicKey of an endpoint is also known as an EndpointId. This PublicKey is
included in the TLS certificate presented during the handshake when connecting.
This function allows you to get the EndpointId of the remote endpoint of this
diff --git a/pr/4036/docs/iroh/endpoint/struct.Endpoint.html b/pr/4036/docs/iroh/endpoint/struct.Endpoint.html
index cfd63c979e..0c6c2630b7 100644
--- a/pr/4036/docs/iroh/endpoint/struct.Endpoint.html
+++ b/pr/4036/docs/iroh/endpoint/struct.Endpoint.html
@@ -13,7 +13,7 @@ behaviour.
Endpoint::connect and Endpoint::accept methods. Once established, the
Connection gives access to most QUIC features. Individual streams to send data to
the peer are created using the Connection::open_bi, Connection::accept_bi,
-Connection::open_uni and Connection::open_bi functions.
+Connection::open_uni and Connection::accept_uni 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.
§Usage on Android
@@ -22,7 +22,7 @@ through JNI, which needs a JVM context published to DnsResolver for the supported
initialization paths.
-Implementations§
Source§impl Endpoint
Implementations§
Source§impl Endpoint
Sourcepub fn set_alpns(&self, alpns: Vec<Vec<u8>>)
Sets the list of accepted ALPN protocols.
This will only affect new incoming connections.
@@ -117,8 +117,8 @@ changes.
understand if the endpoint has ever been considered “online”. But after
that initial call to Endpoint::online, to understand if your
endpoint is no longer able to be connected to by endpoints outside
-of the private or local network, watch for changes in it’s EndpointAddr.
-If there are no addrsin the EndpointAddr, you may not be dialable by other endpoints
+of the private or local network, watch for changes in its EndpointAddr.
+If there are no addrs in the EndpointAddr, you may not be dialable by other endpoints
on the internet.
The EndpointAddr will change as:
@@ -146,7 +146,7 @@ tokio::spawn(endpoint_closed.run_until(async move {
}));
// Do fancy things, then close the endpoint.
// Our task above will stop even if there are still clones of `Endpoint` alive somewhere.
-endpoint.close().await;
Sourcepub async fn online(&self)
A convenience method that waits for the endpoint to be considered “online”.
This currently means at least one relay server has completed its
connection handshake (i.e. the endpoint is registered and reachable
via that relay). Merely selecting a relay URL is not sufficient.
@@ -167,49 +167,45 @@ entirely.
The online method does not interact with crate::address_lookup::AddressLookup
services, which means that any Address Lookup that relies on a WAN
connection is independent of the endpoint’s online status.
-§Examples
use iroh::Endpoint;
-
-#[tokio::main]
-async fn main() {
-// After this await returns, the endpoint is bound to a local socket.
-// It can be dialed, but almost certainly hasn't finished picking a
+§Examples
+// After this await returns, the endpoint is bound to a local socket.
+// It can be dialed, but almost certainly hasn't finished picking a
// relay.
-let endpoint = Endpoint::bind().await;
+let endpoint = Endpoint::bind(presets::N0).await?;
-// After this await returns we have a connection to at least one relay
+// After this await returns we have a connection to at least one relay
// and holepunching should work as expected.
-endpoint.online().await;
-}
Sourcepub fn home_relay_status(
+endpoint.online().await;
Sourcepub fn home_relay_status(
&self,
) -> impl Watcher<Value = Vec<RelayStatus>> + use<>
Returns a Watcher over the connection status of the endpoint’s home relays.
The watched value has one entry per home relay whose URL is known,
and is empty when no relays are configured or before the endpoint has
-selected one the home relay from the list of configured relays.
+selected a home relay from the list of configured relays.
The watcher updates whenever any home relay’s connection status changes.
See RelayStatus for the information available on each entry.
The returned watcher only becomes disconnected once the last clone of
the Endpoint is dropped. Closing the endpoint does not disconnect
the watcher. To stop a task once the endpoint stops, combine with
Self::closed.
-Sourcepub fn bound_sockets(&self) -> Vec<SocketAddr>
Available on non-wasm_browser only.
Returns the local socket addresses on which the underlying sockets are bound.
+Sourcepub fn bound_sockets(&self) -> Vec<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 dns_resolver(&self) -> Result<&DnsResolver, EndpointError>
Available on non-wasm_browser only.
Returns the DNS resolver used in this Endpoint.
+Sourcepub fn dns_resolver(&self) -> Result<&DnsResolver, EndpointError>
Available on non-wasm_browser only.
Sourcepub fn tls_config(&self) -> &ClientConfig
Returns the [rustls::ClientConfig] used by the endpoint for connecting to external services.
+Sourcepub fn tls_config(&self) -> &ClientConfig
Returns the [rustls::ClientConfig] used by the endpoint for connecting to external services.
This might be useful for address lookup services or other functions
that want to use the same trust anchors as iroh does for verifying the
validity of TLS certificates presented by external services.
Note that this TLS config is unrelated to how iroh validates the authenticity
of iroh connections itself.
The config is based on the trust anchors set via Builder::ca_tls_config.
-Sourcepub fn address_lookup(&self) -> Result<&AddressLookupServices, EndpointError>
Returns the Address Lookup service, if configured.
+Sourcepub fn address_lookup(&self) -> Result<&AddressLookupServices, EndpointError>
Returns the Address Lookup service, if configured.
§Errors
Returns a EndpointError::Closed error if the endpoint is closed.
-Sourcepub fn metrics(&self) -> &EndpointMetrics
Available on crate feature metrics only.
Returns metrics collected for this endpoint.
+Sourcepub fn metrics(&self) -> &EndpointMetrics
Available on crate feature metrics only.
Returns metrics collected for this endpoint.
The endpoint internally collects various metrics about its operation.
The returned EndpointMetrics struct contains all of these metrics.
You can access individual metrics directly by using the public fields:
@@ -275,13 +271,13 @@ registry.write().unwrap().register_all(endpoint.metrics());
.std_context("text")?;
assert!(res.contains(r#"TYPE socket_recv_datagrams counter"#));
-assert!(res.contains(r#"socket_recv_datagrams_total 0"#));Sourcepub async fn remote_info(&self, endpoint_id: EndpointId) -> Option<RemoteInfo>
Returns addressing information about a recently used remote endpoint.
+assert!(res.contains(r#"socket_recv_datagrams_total 0"#));Sourcepub async fn remote_info(&self, endpoint_id: EndpointId) -> Option<RemoteInfo>
Returns addressing information about a recently used remote endpoint.
The returned RemoteInfo contains a list of all transport addresses for the remote
that we know about. This is a snapshot in time and not a watcher.
Returns None if the endpoint doesn’t have information about the remote or if the endpoint is closed.
When remote endpoints are no longer used, our endpoint will keep information around
for a little while, and then drop it. Afterwards, this will return None.
-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
@@ -290,14 +286,14 @@ 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.
If the endpoint is closed, this method will log a warning and ignore the request.
-Sourcepub fn set_user_data_for_address_lookup(&self, user_data: Option<UserData>)
Sets the initial user-defined data to be published in Address Lookups for this endpoint.
+Sourcepub fn set_user_data_for_address_lookup(&self, user_data: Option<UserData>)
Sets the initial user-defined data to be published in Address Lookups for this endpoint.
If the user-defined data passed to this function is different to the previous one,
the endpoint will republish its endpoint info to the configured Address Lookups.
See also Builder::user_data_for_address_lookup for setting an initial value when
building the endpoint.
If the endpoint is closed, this method will log a warning and ignore the
request.
-Sourcepub async fn close(&self)
Closes the QUIC endpoint and the 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.
@@ -322,9 +318,9 @@ sockets. This is due to QUIC and its acknowledgments being implemented in user-l
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.
-Sourcepub fn closed(&self) -> EndpointClosed ⓘ
Returns a future that resolves once the endpoint closes.
+the respective Endpoint are dropped.
+Sourcepub fn closed(&self) -> EndpointClosed ⓘ
Returns a future that resolves once the endpoint closes.
The returned future does not contain a clone or reference to the Endpoint,
so keeping the returned future alive does not prevent the endpoint from being dropped.
To run a task and stop it once the endpoint closes, you can use
@@ -333,7 +329,7 @@ so keeping the returned future alive does not prevent the endpoint from being dr
let endpoint = Endpoint::bind(presets::N0).await?;
tokio::spawn(endpoint.closed().run_until(async move {
// the future will be aborted once the endpoint closes.
-}));
Sourcepub fn create_server_config_builder(
+}));
Sourcepub fn create_server_config_builder(
&self,
alpns: Vec<Vec<u8>>,
) -> ServerConfigBuilder
Create a ServerConfigBuilder for this endpoint that includes the given alpns.
diff --git a/pr/4036/docs/iroh/endpoint/struct.EndpointClosed.html b/pr/4036/docs/iroh/endpoint/struct.EndpointClosed.html
index 85b8fd921b..1a2b9e3683 100644
--- a/pr/4036/docs/iroh/endpoint/struct.EndpointClosed.html
+++ b/pr/4036/docs/iroh/endpoint/struct.EndpointClosed.html
@@ -1,9 +1,9 @@
-EndpointClosed in iroh::endpoint - Rust EndpointClosed
pub struct EndpointClosed { /* private fields */ }
Expand description
Future returned from Endpoint::closed.
-Implementations§
Source§impl EndpointClosed
Sourcepub async fn run_until<F: Future>(self, fut: F) -> Option<F::Output>
Runs a future to completion, or until the Endpoint is closed.
+EndpointClosed in iroh::endpoint - Rust EndpointClosed
pub struct EndpointClosed { /* private fields */ }
Expand description
Future returned from Endpoint::closed.
+Implementations§
Trait Implementations§
Source§impl Debug for EndpointClosed
Source§impl Future for EndpointClosed
Source§impl<'pin> Unpin for EndpointClosedwhere
+
Trait Implementations§
Source§impl Debug for EndpointClosed
Source§impl Future for EndpointClosed
Source§impl<'pin> Unpin for EndpointClosedwhere
PinnedFieldsOf<__EndpointClosed<'pin>>: Unpin,
Auto Trait Implementations§
§impl !Freeze for EndpointClosed
§impl !RefUnwindSafe for EndpointClosed
§impl Send for EndpointClosed
§impl Sync for EndpointClosed
§impl !UnwindSafe for EndpointClosed
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/4036/docs/iroh/endpoint/struct.Incoming.html b/pr/4036/docs/iroh/endpoint/struct.Incoming.html
index d0a2c29af8..eca1097eca 100644
--- a/pr/4036/docs/iroh/endpoint/struct.Incoming.html
+++ b/pr/4036/docs/iroh/endpoint/struct.Incoming.html
@@ -24,7 +24,7 @@ to customize a Sourcepub fn remote_addr_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_addr().
-Sourcepub fn decrypt(&self) -> Option<DecryptedInitial>
Decrypt the Initial packet payload
+Sourcepub fn decrypt(&self) -> Option<DecryptedInitial>
Decrypts the Initial packet payload.
This clones and decrypts the packet payload (~1200 bytes).
Can be used to extract information from the TLS ClientHello without completing the handshake.
Trait Implementations§
Source§impl IntoFuture for Incoming
Source§type Output = Result<Connection, ConnectingError>
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§
Source§impl<T> Any for Twhere
diff --git a/pr/4036/docs/iroh/endpoint/struct.QuicTransportConfigBuilder.html b/pr/4036/docs/iroh/endpoint/struct.QuicTransportConfigBuilder.html
index 3a193bd40a..5189f21509 100644
--- a/pr/4036/docs/iroh/endpoint/struct.QuicTransportConfigBuilder.html
+++ b/pr/4036/docs/iroh/endpoint/struct.QuicTransportConfigBuilder.html
@@ -136,7 +136,7 @@ enable multipath as well.
If the path is idle for this long the path will be abandoned. Bear in mind this will
interact with the QuicTransportConfigBuilder::max_idle_timeout, if the last path is
abandoned the entire connection will be closed.
-Note: values higher than [PATH_MAX_IDLE_TIMEOUT] are clamped and a warning is logged.
+Note: values higher than PATH_MAX_IDLE_TIMEOUT (15 seconds) are clamped and a warning is logged.
Sourcepub fn default_path_keep_alive_interval(self, interval: Duration) -> Self
Sets a default per-path keep alive interval.
Note that this does not interact with the connection-wide
QuicTransportConfigBuilder::keep_alive_interval. This setting will keep this path active,
diff --git a/pr/4036/docs/iroh/endpoint/struct.RelayStatus.html b/pr/4036/docs/iroh/endpoint/struct.RelayStatus.html
index 175b637f76..a1abba7e98 100644
--- a/pr/4036/docs/iroh/endpoint/struct.RelayStatus.html
+++ b/pr/4036/docs/iroh/endpoint/struct.RelayStatus.html
@@ -1,13 +1,13 @@
-
RelayStatus in iroh::endpoint - Rust RelayStatus
pub struct RelayStatus { /* private fields */ }
Expand description
Connection status of a single home relay.
+RelayStatus in iroh::endpoint - Rust RelayStatus
pub struct RelayStatus { /* private fields */ }
Expand description
Connection status of a single home relay.
Observed via Endpoint::home_relay_status.
-Implementations§
Source§impl RelayStatus
Sourcepub fn is_connected(&self) -> bool
Returns true if the endpoint is connected to the relay.
-Sourcepub fn last_error(&self) -> Option<&AnyError>
Returns the most recent connection error, if the relay is currently
+
Implementations§
Source§impl RelayStatus
Sourcepub fn is_connected(&self) -> bool
Returns true if the endpoint is connected to the relay.
+Sourcepub fn last_error(&self) -> Option<&AnyError>
Returns the most recent connection error, if the relay is currently
disconnected.
Returns None when the relay is connected, or when the endpoint has
not yet observed a failed connection attempt.
-Trait Implementations§
Source§impl Clone for RelayStatus
Source§fn clone(&self) -> RelayStatus
Returns a duplicate 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 RelayStatus
Source§impl PartialEq for RelayStatus
Source§impl Eq for RelayStatus
Source§impl StructuralPartialEq for RelayStatus
Auto Trait Implementations§
§impl Freeze for RelayStatus
§impl !RefUnwindSafe for RelayStatus
§impl Send for RelayStatus
§impl Sync for RelayStatus
§impl Unpin for RelayStatus
§impl !UnwindSafe for RelayStatus
Blanket Implementations§
Trait Implementations§
Source§impl Clone for RelayStatus
Source§fn clone(&self) -> RelayStatus
Returns a duplicate 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 RelayStatus
Source§impl PartialEq for RelayStatus
Source§impl Eq for RelayStatus
Source§impl StructuralPartialEq for RelayStatus
Auto Trait Implementations§
§impl Freeze for RelayStatus
§impl !RefUnwindSafe for RelayStatus
§impl Send for RelayStatus
§impl Sync for RelayStatus
§impl Unpin for RelayStatus
§impl !UnwindSafe for RelayStatus
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/4036/docs/iroh/endpoint/struct.VarInt.html b/pr/4036/docs/iroh/endpoint/struct.VarInt.html
index 0acf99654d..007540d1af 100644
--- a/pr/4036/docs/iroh/endpoint/struct.VarInt.html
+++ b/pr/4036/docs/iroh/endpoint/struct.VarInt.html
@@ -13,7 +13,7 @@ An integer less than 2^62
of overflowing.
Trait Implementations§
§impl From<VarInt> for IdleTimeout
§fn from(inner: VarInt) -> IdleTimeout
Converts to this type from the input type.§impl From<VarInt> for IdleTimeout
§fn from(inner: VarInt) -> IdleTimeout
Converts to this type from the input type.§impl Ord for VarInt
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
diff --git a/pr/4036/docs/iroh/endpoint/struct.WeakConnectionHandle.html b/pr/4036/docs/iroh/endpoint/struct.WeakConnectionHandle.html
index 47f6c23610..07bad208d7 100644
--- a/pr/4036/docs/iroh/endpoint/struct.WeakConnectionHandle.html
+++ b/pr/4036/docs/iroh/endpoint/struct.WeakConnectionHandle.html
@@ -1,18 +1,18 @@
-WeakConnectionHandle in iroh::endpoint - Rust WeakConnectionHandle
pub struct WeakConnectionHandle { /* private fields */ }
Expand description
A weak handle to a Connection.
+WeakConnectionHandle in iroh::endpoint - Rust WeakConnectionHandle
pub struct WeakConnectionHandle { /* private fields */ }
Expand description
A weak handle to a Connection.
A WeakConnectionHandle does not keep the connection alive: holding one will not
prevent the connection from being closed when the last Connection handle is dropped.
Use upgrade to obtain a strong Connection, and closed to wait for the
connection to be closed without keeping it alive.
-Implementations§
Source§impl WeakConnectionHandle
Sourcepub fn upgrade(&self) -> Option<Connection>
Attempts to upgrade this weak handle to a strong Connection.
+Implementations§
Source§impl WeakConnectionHandle
Sourcepub fn upgrade(&self) -> Option<Connection>
Attempts to upgrade this weak handle to a strong Connection.
Returns None if the connection has already been dropped.
-Sourcepub fn closed(&self) -> impl Future<Output = Option<Closed>> + Send + 'static
Returns a future that resolves once the connection has been closed.
+Sourcepub fn closed(&self) -> impl Future<Output = Option<Closed>> + Send + 'static
Returns a future that resolves once the connection has been closed.
If no strong references to the Connection exist at the time this is called,
the future resolves to None. If at least one strong reference still exists at
the time of this call, the returned future is guaranteed to receive the close
event with the close reason and final connection statistics, even if all strong
references are dropped before the future is awaited.
The future does not keep the connection alive.
-Trait Implementations§
Source§impl Clone for WeakConnectionHandle
Source§fn clone(&self) -> WeakConnectionHandle
Returns a duplicate 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 WeakConnectionHandle
§impl !RefUnwindSafe for WeakConnectionHandle
§impl Send for WeakConnectionHandle
§impl Sync for WeakConnectionHandle
§impl Unpin for WeakConnectionHandle
§impl !UnwindSafe for WeakConnectionHandle
Blanket Implementations§
Trait Implementations§
Source§impl Clone for WeakConnectionHandle
Source§fn clone(&self) -> WeakConnectionHandle
Returns a duplicate 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 WeakConnectionHandle
§impl !RefUnwindSafe for WeakConnectionHandle
§impl Send for WeakConnectionHandle
§impl Sync for WeakConnectionHandle
§impl Unpin for WeakConnectionHandle
§impl !UnwindSafe for WeakConnectionHandle
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/4036/docs/iroh/endpoint/trait.EndpointHooks.html b/pr/4036/docs/iroh/endpoint/trait.EndpointHooks.html
index 2ac883dd5d..90c7ff04fc 100644
--- a/pr/4036/docs/iroh/endpoint/trait.EndpointHooks.html
+++ b/pr/4036/docs/iroh/endpoint/trait.EndpointHooks.html
@@ -17,7 +17,7 @@
For each hook, all installed hooks are invoked in the order they were installed on
the endpoint builder. If a hook returns Accept, processing continues with the next
hook. If a hook returns Reject, processing is aborted and further hooks
-are not invoked for this hook.
+are not invoked for this hook point.
§Notes to implementers
As hooks are stored on the endpoint, you must make sure to never store an Endpoint
on the hook struct itself, as this would create reference counting loop and cause the
diff --git a/pr/4036/docs/iroh/endpoint_info/index.html b/pr/4036/docs/iroh/endpoint_info/index.html
index f27fe3b898..4a60b9fd8f 100644
--- a/pr/4036/docs/iroh/endpoint_info/index.html
+++ b/pr/4036/docs/iroh/endpoint_info/index.html
@@ -1,11 +1,11 @@
iroh::endpoint_info - Rust Module endpoint_info
Expand description
Support for handling DNS resource records for dialing by EndpointId.
Dialing by EndpointId is supported by iroh endpoints publishing Pkarr records to DNS
servers or the Mainline DHT. This module supports creating and parsing these records.
-EndpointInfo combines an iroh_base::EndpointId with EndpointData —
+
EndpointInfo combines an iroh_base::EndpointId with EndpointData:
the addressing and metadata that discovery services publish and resolve.
Discovery services use AddrFilter to control which addresses are published.
This module also provides serialization to and from pkarr signed packets and
-DNS TXT records. See the [crate::attrs] module for the on-the-wire format.
+DNS TXT records.
DNS records are published under the following names:
_iroh.<z32-endpoint-id>.<origin-domain> TXT
@@ -36,4 +36,4 @@ Each address is an IPv4 or IPv6 address with a port.
Structs§
- Addr
Filter - A filter and/or reordering function applied to transport addresses,
-typically used by AddressLookup services in iroh before publishing.
- Endpoint
Data - Data about an endpoint that may be published to and resolved from discovery services.
- Endpoint
Info - Information about an endpoint that may be published to and resolved from discovery services.
- MaxLength
ExceededError - Error returned when an input value is too long for
UserData. - User
Data - Under the hood this is a UTF-8 String is no longer than
UserData::MAX_LENGTH bytes.
\ No newline at end of file
+typically used by AddressLookup services in iroh before publishing.EndpointData Data about an endpoint that may be published to and resolved from discovery services. EndpointInfo Information about an endpoint that may be published to and resolved from discovery services. MaxLengthExceededError Error returned when an input value is too long for UserData. UserData User-defined data that can be published and resolved through endpoint discovery.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint_info/struct.EndpointData.html b/pr/4036/docs/iroh/endpoint_info/struct.EndpointData.html
index eaf2725892..2c818ea5b4 100644
--- a/pr/4036/docs/iroh/endpoint_info/struct.EndpointData.html
+++ b/pr/4036/docs/iroh/endpoint_info/struct.EndpointData.html
@@ -13,15 +13,15 @@ services, should they not fit into e.g. a single DNS packet otherwise.
See also Self::set_user_data.
Sourcepub fn add_relay_url(&mut self, relay_url: RelayUrl)
Adds the relay URL to the end of the endpoint data, unless it already existed.
Sourcepub fn add_ip_addrs(&mut self, addresses: Vec<SocketAddr>)
Adds addresses in order with duplicates or already existing addresses filtered out.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Adds addresses to the endpoint data in the given ordered, but with duplicates filtered.
-Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data and returns the updated endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Adds addresses to the endpoint data in the given order, but with duplicates filtered.
+Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data.
Sourcepub fn clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn clear_relay_urls(&mut self)
Removes all relay URLs from the endpoint data.
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses.
+Sourcepub fn filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
Returns a vec to allow re-ordering of addresses.
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
diff --git a/pr/4036/docs/iroh/endpoint_info/struct.UserData.html b/pr/4036/docs/iroh/endpoint_info/struct.UserData.html
index 3352480631..e73207e05e 100644
--- a/pr/4036/docs/iroh/endpoint_info/struct.UserData.html
+++ b/pr/4036/docs/iroh/endpoint_info/struct.UserData.html
@@ -1,4 +1,5 @@
-UserData in iroh::endpoint_info - Rust 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.
+UserData in iroh::endpoint_info - Rust UserData
pub struct UserData(/* private fields */);
Expand description
User-defined data that can be published and resolved through endpoint discovery.
+Under the hood this is a UTF-8 string 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.
diff --git a/pr/4036/docs/iroh/enum.KeyParsingError.html b/pr/4036/docs/iroh/enum.KeyParsingError.html
index 765ac27ad2..146ec05698 100644
--- a/pr/4036/docs/iroh/enum.KeyParsingError.html
+++ b/pr/4036/docs/iroh/enum.KeyParsingError.html
@@ -1,4 +1,4 @@
-KeyParsingError in iroh - Rust KeyParsingError
#[non_exhaustive]pub enum KeyParsingError {
+KeyParsingError in iroh - Rust KeyParsingError
#[non_exhaustive]pub enum KeyParsingError {
FailedToDecodeHex {
meta: Meta,
},
@@ -11,14 +11,14 @@
InvalidKeyData {
meta: Meta,
},
-}
Expand description
Error when deserialising a PublicKey or a SecretKey.
+}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§FailedToDecodeHex
The input string could not be decoded as hex.
Fields
§meta: MetaCaptured call-site metadata
§FailedToDecodeBase32
The input string could not be decoded as base32.
Fields
§meta: MetaCaptured call-site metadata
§InvalidLength
The input has invalid length.
Fields
§meta: MetaCaptured call-site metadata
-§InvalidKeyData
The decoded data is not a valid Ed25591 public key.
+§InvalidKeyData
The decoded data is not a valid Ed25519 public key.
Fields
§meta: MetaCaptured call-site metadata
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<KeyParsingError> for ParseError
Source§fn from(source: KeyParsingError) -> ParseError
Converts to this type from the input type.Source§impl StackError for KeyParsingError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<KeyParsingError>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Returns the next source in the chain, if any.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.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
diff --git a/pr/4036/docs/iroh/enum.TransportAddr.html b/pr/4036/docs/iroh/enum.TransportAddr.html
index df614a51ee..0e5f31d772 100644
--- a/pr/4036/docs/iroh/enum.TransportAddr.html
+++ b/pr/4036/docs/iroh/enum.TransportAddr.html
@@ -3,8 +3,8 @@
Ip(SocketAddr),
Custom(CustomAddr),
}Expand description
Available address types.
-Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§Relay(RelayUrl)
Relays
-§Ip(SocketAddr)
IP based addresses
+Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§Relay(RelayUrl)
A relay server address.
+§Ip(SocketAddr)
An IP based address.
§Custom(CustomAddr)
Custom transport address
Implementations§
Source§impl TransportAddr
Sourcepub fn is_ip(&self) -> bool
Whether this is an IP transport address.
diff --git a/pr/4036/docs/iroh/index.html b/pr/4036/docs/iroh/index.html
index a2ddd5617a..8c7bddcb16 100644
--- a/pr/4036/docs/iroh/index.html
+++ b/pr/4036/docs/iroh/index.html
@@ -1,5 +1,5 @@
iroh - Rust Crate iroh
Expand description
Peer-to-peer QUIC connections.
-iroh is a library to establish direct connectivity between peers. It exposes an
+
iroh is a library to establish direct connectivity between peers. It exposes an
interface to QUIC connections and streams to the user, while implementing direct
connectivity using hole punching complemented by relay servers under the hood.
An iroh endpoint is created and controlled by the Endpoint, e.g. connecting to
@@ -44,7 +44,7 @@ punching if needed. Once the direct connection is established the relay ser
longer involved in the connection.
If one of the iroh endpoints can be reached directly, connectivity can also be
established without involving a Relay server. This is done by using the endpoint’s
-listening addresses in the connection establishement instead of the RelayUrl which
+listening addresses in the connection establishment instead of the RelayUrl which
is used to identify a Relay server. Of course it is also possible to use both a
RelayUrl and direct addresses at the same time to connect.
§Encryption
@@ -179,4 +179,4 @@ connecting using only the Ok(())
}
Please see the examples directory for more nuanced examples.
-Re-exports§
Modules§
- address_
lookup - Lookup the address of an Endpoint ID.
- defaults
- Default values used in
iroh - dns
Non-wasm_browser - Configurable DNS resolver.
- endpoint
- The
Endpoint allows establishing connections to other iroh endpoints. - endpoint_
info - Support for handling DNS resource records for dialing by
EndpointId. - metrics
- Co-locating all of the iroh metrics structs
- protocol
- Tools for spawning an accept loop that routes incoming requests to the right protocol.
- test_
utils test-utils - Internal utilities to support testing.
- tls
- TLS configuration for iroh.
Structs§
- Endpoint
Addr - Network-level addressing information for an iroh endpoint.
- NetReport
- A net_report report.
- NetReport
Config - Configuration for the net report component.
- Public
Key - A public key.
- Relay
Config - Information on a specific relay server.
- Relay
Map - List of relay server configurations to be used in an iroh endpoint.
- Relay
Url - A URL identifying a relay server.
- Relay
UrlParseError - Can occur when parsing a string into a
RelayUrl. - Secret
Key - A secret key.
- Signature
- Ed25519 signature.
- Signature
Error - Verification of a signature failed.
Enums§
- KeyParsing
Error - Error when deserialising a
PublicKey or a SecretKey. - Transport
Addr - Available address types.
Constants§
- NET_
REPORT_TIMEOUT - The maximum amount of time, in seconds, the net_report will spend gathering a single report.
Traits§
- Watcher
- A handle to a value that’s represented by one or more underlying [
Watchable]s.
Type Aliases§
- Endpoint
Id - The identifier for an endpoint in the (iroh) network.
\ No newline at end of file
+Re-exports§
Modules§
- address_
lookup - Lookup the address of an Endpoint ID.
- defaults
- Default values used in
iroh - dns
Non-wasm_browser - Configurable DNS resolver.
- endpoint
- The
Endpoint allows establishing connections to other iroh endpoints. - endpoint_
info - Support for handling DNS resource records for dialing by
EndpointId. - metrics
- Co-locating all of the iroh metrics structs
- protocol
- Tools for spawning an accept loop that routes incoming requests to the right protocol.
- test_
utils test-utils - Internal utilities to support testing.
- tls
- TLS configuration for iroh.
Structs§
- Endpoint
Addr - Network-level addressing information for an iroh endpoint.
- NetReport
- A net_report report.
- NetReport
Config - Configuration for the net report component.
- Public
Key - A public key.
- Relay
Config - Information on a specific relay server.
- Relay
Map - List of relay server configurations to be used in an iroh endpoint.
- Relay
Url - A URL identifying a relay server.
- Relay
UrlParseError - Can occur when parsing a string into a
RelayUrl. - Secret
Key - A secret key.
- Signature
- Ed25519 signature.
- Signature
Error - Verification of a signature failed.
Enums§
- KeyParsing
Error - Error returned when parsing a
PublicKey or a SecretKey. - Transport
Addr - Available address types.
Constants§
- NET_
REPORT_TIMEOUT - The maximum amount of time, in seconds, the net_report will spend gathering a single report.
Traits§
- Watcher
- A handle to a value that’s represented by one or more underlying [
Watchable]s.
Type Aliases§
- Endpoint
Id - The identifier for an endpoint in the (iroh) network.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/metrics/index.html b/pr/4036/docs/iroh/metrics/index.html
index da53db7d6a..00f2275127 100644
--- a/pr/4036/docs/iroh/metrics/index.html
+++ b/pr/4036/docs/iroh/metrics/index.html
@@ -1,2 +1,2 @@
iroh::metrics - Rust Module metrics
Expand description
Co-locating all of the iroh metrics structs
-Structs§
- Endpoint
Metrics - Metrics collected by an
crate::endpoint::Endpoint. - NetReport
Metrics - Enum of metrics for the module
- Relay
Metrics test-utils - Metrics tracked for the relay server
- Socket
Metrics - Enum of metrics for the module
\ No newline at end of file
+Structs§
- Endpoint
Metrics - Metrics collected by an
crate::endpoint::Endpoint. - NetReport
Metrics - Enum of metrics for the module
- Relay
Metrics test-utils - Metrics tracked for the relay server
- Socket
Metrics - Metrics collected by the iroh socket.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/metrics/struct.RelayMetrics.html b/pr/4036/docs/iroh/metrics/struct.RelayMetrics.html
index f8768e50a1..da2588f738 100644
--- a/pr/4036/docs/iroh/metrics/struct.RelayMetrics.html
+++ b/pr/4036/docs/iroh/metrics/struct.RelayMetrics.html
@@ -26,21 +26,26 @@
pub http_connections_closed: Counter,
pub http_connections_errored: Counter,
}Available on crate feature test-utils only.Expand description
Metrics tracked for the relay server
-Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.§bytes_sent: CounterBytes sent from a FrameType::SendPacket
-§bytes_recv: CounterBytes received from a FrameType::SendPacket
-§send_packets_sent: CounterFrameType::SendPacket sent
-§send_packets_recv: CounterFrameType::SendPacket received
-§send_packets_dropped: CounterFrameType::SendPacket dropped
-§other_packets_sent: CounterPackets of other FrameTypes sent
-§other_packets_recv: CounterPackets of other FrameTypes received
-§other_packets_dropped: CounterPackets of other FrameTypes dropped
-§got_ping: CounterNumber of FrameType::Pings received
-§sent_pong: CounterNumber of FrameType::Pongs sent
-§unknown_frames: CounterNumber of FrameType::Unknown received
+Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.§bytes_sent: CounterBytes sent to a client in RelayToClientDatagram or RelayToClientDatagramBatch frames.
+§bytes_recv: CounterBytes received from a client in ClientToRelayDatagram or ClientToRelayDatagramBatch frames.
+§send_packets_sent: CounterRelayToClientDatagram or RelayToClientDatagramBatch frames sent to a client.
+§send_packets_recv: CounterClientToRelayDatagram or ClientToRelayDatagramBatch frames received from a client.
+§send_packets_dropped: CounterRelayToClientDatagram or RelayToClientDatagramBatch frames dropped instead of being
+delivered to a client, because the recipient is not connected or writing to its stream failed.
+Note that frames dropped because the recipient’s send queue is full or closed are not counted
+here.
+§other_packets_sent: CounterIntended to count sent frames other than datagrams, but currently unused (never incremented).
+§other_packets_recv: CounterIntended to count received frames other than datagrams, but currently unused (never incremented).
+§other_packets_dropped: CounterIntended to count dropped frames other than datagrams, but currently unused (never incremented).
+§got_ping: CounterNumber of FrameType::Ping frames received from a client.
+§sent_pong: CounterNumber of FrameType::Pong frames sent to a client.
+§unknown_frames: CounterIntended to count received frames with an unrecognized FrameType,
+but currently unused (never incremented).
§bytes_rx_ratelimited_total: CounterNumber of bytes received from client connection which have been rate-limited.
§conns_rx_ratelimited_total: CounterNumber of client connections which have had any frames rate-limited.
§accepts: CounterNumber of times this server has accepted a connection.
-§disconnects: CounterNumber of connections we have removed because of an error
+§disconnects: CounterNumber of times a client connection was disconnected.
+Incremented once per connection, paired with Self::accepts.
§unique_client_keys: CounterNumber of unique client keys per day
§clients_inactive_added: CounterNumber of times a client was moved into the inactive state.
A client becomes inactive when a new client connects with the same endpoint id. An inactive
diff --git a/pr/4036/docs/iroh/metrics/struct.SocketMetrics.html b/pr/4036/docs/iroh/metrics/struct.SocketMetrics.html
index 2291657920..f61d3786bb 100644
--- a/pr/4036/docs/iroh/metrics/struct.SocketMetrics.html
+++ b/pr/4036/docs/iroh/metrics/struct.SocketMetrics.html
@@ -1,4 +1,4 @@
-
SocketMetrics in iroh::metrics - Rust SocketMetrics
#[non_exhaustive]pub struct SocketMetrics {Show 31 fields
+SocketMetrics in iroh::metrics - Rust SocketMetrics
#[non_exhaustive]pub struct SocketMetrics {Show 31 fields
pub update_direct_addrs: Counter,
pub send_ipv4: Counter,
pub send_ipv6: Counter,
@@ -30,10 +30,23 @@
pub actor_tick_direct_addr_heartbeat: Counter,
pub actor_link_change: Counter,
pub actor_tick_other: Counter,
-}
Expand description
Enum of metrics for the module
-Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.§update_direct_addrs: Counter§send_ipv4: Counter§send_ipv6: Counter§send_relay: Counter§recv_data_relay: Counter§recv_data_custom: Counter§recv_data_ipv4: Counter§recv_data_ipv6: Counter§recv_datagrams: CounterNumber of QUIC datagrams received.
-§recv_gro_datagrams: CounterNumber of datagrams received using GRO
-§relay_home_change: Counter§holepunch_attempts: CounterThe number of times holepunching is initiated on a connection.
+}Expand description
Metrics collected by the iroh socket.
+Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.§update_direct_addrs: CounterIntended to count updates to the local direct address set, but currently unused
+(never incremented).
+§send_ipv4: CounterNumber of bytes sent over IPv4.
+§send_ipv6: CounterNumber of bytes sent over IPv6.
+§send_relay: CounterNumber of bytes sent over the relay transport.
+§recv_data_relay: CounterNumber of data bytes received over the relay transport.
+§recv_data_custom: CounterNumber of data bytes received over any custom transport.
+§recv_data_ipv4: CounterNumber of data bytes received over IPv4.
+§recv_data_ipv6: CounterNumber of data bytes received over IPv6.
+§recv_datagrams: CounterNumber of QUIC datagrams received.
+§recv_gro_datagrams: CounterNumber of receive events that used GRO (coalesced datagram batches).
+This counts batches, not the individual datagrams within them. See
+Self::recv_datagrams for the datagram count.
+§relay_home_change: CounterNumber of times the home relay changed to a different relay.
+This includes the initial assignment from no home relay to a home relay.
+§holepunch_attempts: CounterThe number of times holepunching is initiated on a connection.
This can be incremented multiple times for a single connection. Note that only the
client-side of a connection will increment this counter.
§paths_direct: CounterThe number of network paths to peers that are direct.
@@ -53,8 +66,15 @@ the number of opened connections.
§transport_relay_paths_removed: CounterNumber of relay transport paths closed.
§transport_custom_paths_added: CounterNumber of custom transport paths opened.
§transport_custom_paths_removed: CounterNumber of custom transport paths closed.
-§actor_tick_main: Counter§actor_tick_msg: Counter§actor_tick_re_stun: Counter§actor_tick_portmap_changed: Counter§actor_tick_direct_addr_heartbeat: Counter§actor_link_change: Counter§actor_tick_other: CounterTrait Implementations§
Source§impl<'de> Deserialize<'de> for Metrics
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Iterable for Metrics
Source§fn metric_field_count(&self) -> usize
Returns the number of metric fields in the struct.Source§fn metric_field_ref(&self, n: usize) -> Option<MetricItem<'_>>
Returns the metric field at the given index.§fn family_field_count(&self) -> usize
Returns the number of Family fields in the struct.§fn family_field_ref(&self, _n: usize) -> Option<FamilyItem<'_>>
Returns the Family field at the given index.Source§impl Serialize for Metrics
Source§fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where
+§actor_tick_main: CounterNumber of iterations of the main socket actor loop.
+§actor_tick_msg: CounterNumber of actor messages processed by the socket actor loop.
+§actor_tick_re_stun: CounterNumber of periodic re-STUN timer ticks handled by the socket actor loop.
+§actor_tick_portmap_changed: CounterNumber of port-mapping change events handled by the socket actor loop.
+§actor_tick_direct_addr_heartbeat: CounterIntended to count direct address heartbeat ticks, but currently unused (never incremented).
+§actor_link_change: CounterNumber of local network interface (link) change events handled by the socket actor loop.
+§actor_tick_other: CounterNumber of times an input watcher or receiver closed in the socket actor loop.
+Trait Implementations§
Source§impl<'de> Deserialize<'de> for Metrics
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Iterable for Metrics
Source§fn metric_field_count(&self) -> usize
Returns the number of metric fields in the struct.Source§fn metric_field_ref(&self, n: usize) -> Option<MetricItem<'_>>
Returns the metric field at the given index.§fn family_field_count(&self) -> usize
Returns the number of Family fields in the struct.§fn family_field_ref(&self, _n: usize) -> Option<FamilyItem<'_>>
Returns the Family field at the given index.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
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/4036/docs/iroh/protocol/enum.IncomingFilterOutcome.html b/pr/4036/docs/iroh/protocol/enum.IncomingFilterOutcome.html
index e11345eddc..4577fe8eaf 100644
--- a/pr/4036/docs/iroh/protocol/enum.IncomingFilterOutcome.html
+++ b/pr/4036/docs/iroh/protocol/enum.IncomingFilterOutcome.html
@@ -11,7 +11,7 @@ the source address, actively refuse the connection, or silently drop it.
What this does depends on the connection type:
-
-
Direct (UDP) connections : this is QUIC source address
+
Direct (UDP) connections: this is QUIC source address
validation. If the socket address was spoofed, the retry token is
sent to the spoofed address, so we never hear from the attacker
again. If the address was real, the client repeats the connection
@@ -20,7 +20,7 @@ attempt with the token, and the next
-
-
Relay connections : there is no source address to validate
+
Relay connections: there is no source address to validate
(the relay already vouches for the packet origin), so the
“validation” itself has no security meaning. However, the retry
still imposes a real cost on the client: an extra round trip
diff --git a/pr/4036/docs/iroh/protocol/struct.RouterBuilder.html b/pr/4036/docs/iroh/protocol/struct.RouterBuilder.html
index dfc8969679..06b2f59fad 100644
--- a/pr/4036/docs/iroh/protocol/struct.RouterBuilder.html
+++ b/pr/4036/docs/iroh/protocol/struct.RouterBuilder.html
@@ -16,7 +16,7 @@ cheaper signals (e.g. remote address) first.
with this alpn.
handler can either be a type that implements ProtocolHandler or a
Box<dyn DynProtocolHandler>.
-
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for RouterBuilder
§impl !RefUnwindSafe for RouterBuilder
§impl Send for RouterBuilder
§impl Sync for RouterBuilder
§impl Unpin for RouterBuilder
§impl !UnwindSafe for RouterBuilder
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/4036/docs/iroh/struct.EndpointAddr.html b/pr/4036/docs/iroh/struct.EndpointAddr.html
index 0aa53df633..867818d655 100644
--- a/pr/4036/docs/iroh/struct.EndpointAddr.html
+++ b/pr/4036/docs/iroh/struct.EndpointAddr.html
@@ -5,7 +5,7 @@
This combines an endpoint’s identifier with network-level addressing information of how to
contact the endpoint.
To establish a network connection to an endpoint both the EndpointId and one or more network
-paths are needed. The network paths can come from various sources, current sources can come from
+paths are needed. The network paths can come from various sources:
-
An Address Lookup service which can provide routing information for a given EndpointId.
@@ -24,7 +24,7 @@ connection without the help of a Fields§§id: PublicKeyThe endpoint’s identifier.
-§addrs: BTreeSet<TransportAddr>The endpoint’s addresses
+§addrs: BTreeSet<TransportAddr>The endpoint’s addresses.
Implementations§
Source§impl EndpointAddr
Sourcepub fn new(id: PublicKey) -> EndpointAddr
Creates a new EndpointAddr with no network level addresses.
This still is usable with e.g. an address lookup service to establish a connection,
depending on the situation.
@@ -38,9 +38,9 @@ depending on the situation.
self,
addrs: impl IntoIterator<Item = TransportAddr>,
) -> EndpointAddrAdds a list of addresses.
-Sourcepub fn is_empty(&self) -> bool
Returns true, if only a EndpointId is present.
-Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns a list of IP addresses of this peer.
-Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns a list of relay urls of this peer.
+Sourcepub fn is_empty(&self) -> bool
Returns true if only an EndpointId is present.
+Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns an iterator over the IP addresses of this endpoint address.
+Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns an iterator over the relay URLs of this endpoint address.
In practice this is expected to be zero or one home relay for all known cases currently.
Trait Implementations§
Source§impl Clone for EndpointAddr
Source§fn clone(&self) -> EndpointAddr
Returns a duplicate 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 EndpointAddr
Source§impl<'de> Deserialize<'de> for EndpointAddr
Source§fn deserialize<__D>(
__deserializer: __D,
diff --git a/pr/4036/docs/iroh/struct.NetReport.html b/pr/4036/docs/iroh/struct.NetReport.html
index 693c855529..8b8ec1aed1 100644
--- a/pr/4036/docs/iroh/struct.NetReport.html
+++ b/pr/4036/docs/iroh/struct.NetReport.html
@@ -1,4 +1,4 @@
-NetReport in iroh - Rust NetReport
pub struct NetReport {
+NetReport in iroh - Rust NetReport
pub struct NetReport {
pub udp_v4: bool,
pub udp_v6: bool,
pub mapping_varies_by_dest_ipv4: Option<bool>,
@@ -13,17 +13,16 @@
§udp_v6: boolA QAD IPv6 round trip completed.
§mapping_varies_by_dest_ipv4: Option<bool>Whether the reported public address differs when probing different servers (on IPv4).
§mapping_varies_by_dest_ipv6: Option<bool>Whether the reported public address differs when probing different servers (on IPv6).
-§preferred_relay: Option<RelayUrl>Probe indicating the presence of port mapping protocols on the LAN.
-None for unknown
-§relay_latency: RelayLatencieskeyed by relay Url
-§global_v4: Option<SocketAddrV4>ip:port of global IPv4
-§global_v6: Option<SocketAddrV6>[ip]:port of global IPv6
+§preferred_relay: Option<RelayUrl>The relay server with the lowest latency, if any.
+§relay_latency: RelayLatenciesThe measured latency to each relay, keyed by relay URL.
+§global_v4: Option<SocketAddrV4>The discovered global IPv4 address and port, if any.
+§global_v6: Option<SocketAddrV6>The discovered global IPv6 address and port, if any.
§captive_portal: Option<bool>CaptivePortal is set when we think there’s a captive portal that is
intercepting HTTP traffic.
-Implementations§
Source§impl Report
Sourcepub fn mapping_varies_by_dest(&self) -> Option<bool>
Whether the reported public address differs when probing different servers.
+Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Report
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl PartialEq for Report
Source§impl Eq for Report
Source§impl StructuralPartialEq for Report
Auto Trait Implementations§
§impl Freeze for Report
§impl RefUnwindSafe for Report
§impl Send for Report
§impl Sync for Report
§impl Unpin for Report
§impl UnwindSafe for Report
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/4036/docs/iroh/struct.PublicKey.html b/pr/4036/docs/iroh/struct.PublicKey.html
index f8fb4c5ae2..b725772ddc 100644
--- a/pr/4036/docs/iroh/struct.PublicKey.html
+++ b/pr/4036/docs/iroh/struct.PublicKey.html
@@ -1,5 +1,5 @@
PublicKey in iroh - Rust PublicKey
pub struct PublicKey(/* private fields */);
Expand description
A public key.
-The key itself is stored as the CompressedEdwards y coordinate of the public key
+
The key itself is stored as the CompressedEdwards y-coordinate of the public key.
It is verified to decompress into a valid key when created.
Implementations§
Source§impl PublicKey
Sourcepub fn as_bytes(&self) -> &[u8; 32]
Get this public key as a byte array.
@@ -12,7 +12,7 @@ See [VerifyingKey::from_bytes] for details.
&self,
message: &[u8],
signature: &Signature,
-) -> Result<(), SignatureError>Verify a signature on a message with this secret key’s public key.
+) -> Result<(), SignatureError>Verify a signature on a message with this public key.
§Return
Returns Ok(()) if the signature is valid, and Err otherwise.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PublicKey
Source§fn deserialize<D>(
deserializer: D,
) -> Result<PublicKey, <D as Deserializer<'de>>::Error>where
- D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl From<PublicKey> for EndpointAddr
Source§fn from(endpoint_id: PublicKey) -> EndpointAddr
Converts to this type from the input type.Source§impl From<PublicKey> for EndpointAddr
Source§fn from(endpoint_id: PublicKey) -> EndpointAddr
Converts to this type from the input type.Source§impl FromStr for PublicKey
Parses a PublicKey from its hex or base32 encoding.
+
Display produces the hex encoding.
Source§impl Hash for PublicKey
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
H: Hasher,
diff --git a/pr/4036/docs/iroh/tls/index.html b/pr/4036/docs/iroh/tls/index.html
index 3c1d92cf2a..16f63b088e 100644
--- a/pr/4036/docs/iroh/tls/index.html
+++ b/pr/4036/docs/iroh/tls/index.html
@@ -1,5 +1,5 @@
iroh::tls - Rust Module tls
Expand description
TLS configuration for iroh.
-Currently there is one mechanisms available
+Currently there is one mechanism available:
- Raw Public Keys, using the TLS extension described in RFC 7250
diff --git a/pr/4036/docs/iroh_base/enum.KeyParsingError.html b/pr/4036/docs/iroh_base/enum.KeyParsingError.html
index d0668a511c..7c849cddf2 100644
--- a/pr/4036/docs/iroh_base/enum.KeyParsingError.html
+++ b/pr/4036/docs/iroh_base/enum.KeyParsingError.html
@@ -1,4 +1,4 @@
-KeyParsingError in iroh_base - Rust KeyParsingError
#[non_exhaustive]pub enum KeyParsingError {
+KeyParsingError in iroh_base - Rust KeyParsingError
#[non_exhaustive]pub enum KeyParsingError {
FailedToDecodeHex {
meta: Meta,
},
@@ -11,14 +11,14 @@
InvalidKeyData {
meta: Meta,
},
-}
Available on crate feature key only.Expand description
Error when deserialising a PublicKey or a SecretKey.
+}Available on crate feature key only.Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§FailedToDecodeHex
The input string could not be decoded as hex.
Fields
§meta: MetaCaptured call-site metadata
§FailedToDecodeBase32
The input string could not be decoded as base32.
Fields
§meta: MetaCaptured call-site metadata
§InvalidLength
The input has invalid length.
Fields
§meta: MetaCaptured call-site metadata
-§InvalidKeyData
The decoded data is not a valid Ed25591 public key.
+§InvalidKeyData
The decoded data is not a valid Ed25519 public key.
Fields
§meta: MetaCaptured call-site metadata
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<KeyParsingError> for AnyError
Source§fn from(value: KeyParsingError) -> AnyError
Converts to this type from the input type.Source§impl StackError for KeyParsingError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
Returns the next source in the chain, if any.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.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§
Source§impl<T> Borrow<T> for Twhere
diff --git a/pr/4036/docs/iroh_base/enum.TransportAddr.html b/pr/4036/docs/iroh_base/enum.TransportAddr.html
index ec9989aea4..a55428eb22 100644
--- a/pr/4036/docs/iroh_base/enum.TransportAddr.html
+++ b/pr/4036/docs/iroh_base/enum.TransportAddr.html
@@ -3,8 +3,8 @@
Ip(SocketAddr),
Custom(CustomAddr),
}Available on crate feature key only.Expand description
Available address types.
-Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§Relay(RelayUrl)
Relays
-§Ip(SocketAddr)
IP based addresses
+Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§Relay(RelayUrl)
A relay server address.
+§Ip(SocketAddr)
An IP based address.
§Custom(CustomAddr)
Custom transport address
Implementations§
Source§impl TransportAddr
Module pkarr
Expand description
An address lookup service which publishes and resolves endpoint information using a pkarr relay.
+Module pkarr
Expand description
An address lookup service which publishes and resolves endpoint information using a pkarr relay.
Public-Key Addressable Resource Records, pkarr, is a system which allows publishing
DNS Resource Records owned by a particular SecretKey under a name derived from its
corresponding PublicKey, also known as the EndpointId. Additionally this pkarr
diff --git a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html
index 0244bdd3e4..10f952f4f3 100644
--- a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html
+++ b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html
@@ -1,28 +1,30 @@
-
PkarrPublisher
pub struct PkarrPublisher { /* private fields */ }Expand description
Publisher of address lookup information to a pkarr relay.
+PkarrPublisher
pub struct PkarrPublisher { /* private fields */ }Expand description
Publisher of address lookup information to a pkarr relay.
This publisher uses HTTP to publish address lookup information to a pkarr relay server, see the module docs for details.
This implements the AddressLookup trait to be used as an address lookup service. Note
that it only publishes address lookup information, for the corresponding resolver use
the PkarrResolver together with AddressLookupServices.
This publisher will only publish the RelayUrl if it is set, otherwise the direct addresses are published instead.
Implementations§
Source§impl PkarrPublisher
impl PkarrPublisher
Sourcepub fn builder(pkarr_relay: Url) -> PkarrPublisherBuilder
pub fn builder(pkarr_relay: Url) -> PkarrPublisherBuilder
Returns a PkarrPublisherBuilder that publishes endpoint info to a pkarr relay at pkarr_relay.
If no further options are set, the pkarr publisher will use DEFAULT_PKARR_TTL as the
+
By default this publisher only publishes the RelayUrl, to avoid leaking IP addresses to
+the public pkarr server. Which addresses are published is controlled by the AddrFilter
+set via PkarrPublisherBuilder::addr_filter.
Implementations§
Source§impl PkarrPublisher
impl PkarrPublisher
Sourcepub fn builder(pkarr_relay: Url) -> PkarrPublisherBuilder
pub fn builder(pkarr_relay: Url) -> PkarrPublisherBuilder
Returns a PkarrPublisherBuilder that publishes endpoint info to a pkarr relay at pkarr_relay.
If no further options are set, the pkarr publisher will use DEFAULT_PKARR_TTL as the
time-to-live value for the published packets, and it will republish Address Lookup information
every DEFAULT_REPUBLISH_INTERVAL, even if the information is unchanged.
PkarrPublisherBuilder implements AddressLookupBuilder, so it can be passed to address_lookup.
It will then use the endpoint’s secret key to sign published packets.
Sourcepub fn n0_dns() -> PkarrPublisherBuilder
pub fn n0_dns() -> PkarrPublisherBuilder
Creates a pkarr publisher which uses the number 0 pkarr relay server.
+Sourcepub fn n0_dns() -> PkarrPublisherBuilder
pub fn n0_dns() -> PkarrPublisherBuilder
Creates a pkarr publisher which uses the number 0 pkarr relay server.
This uses the pkarr relay server operated by number 0, at
N0_DNS_PKARR_RELAY_PROD.
When running with the environment variable
IROH_FORCE_STAGING_RELAYS set to any non empty value N0_DNS_PKARR_RELAY_STAGING
server is used instead.
Sourcepub fn update_endpoint_data(&self, data: &EndpointData)
pub fn update_endpoint_data(&self, data: &EndpointData)
Publishes the addressing information about this endpoint to a pkarr relay.
+Sourcepub fn update_endpoint_data(&self, data: &EndpointData)
pub fn update_endpoint_data(&self, data: &EndpointData)
Publishes the addressing information about this endpoint to a pkarr relay.
This is a nonblocking function, the actual update is performed in the background.
-Trait Implementations§
Source§impl AddressLookup for PkarrPublisher
impl AddressLookup for PkarrPublisher
Source§fn publish(&self, data: &EndpointData)
fn publish(&self, data: &EndpointData)
EndpointData to the Address Lookup mechanism. Read moreTrait Implementations§
Source§impl AddressLookup for PkarrPublisher
impl AddressLookup for PkarrPublisher
Source§fn publish(&self, data: &EndpointData)
fn publish(&self, data: &EndpointData)
EndpointData to the Address Lookup mechanism. Read moreSource§impl Clone for PkarrPublisher
impl Clone for PkarrPublisher
Source§fn clone(&self) -> PkarrPublisher
fn clone(&self) -> PkarrPublisher
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 PkarrPublisher
impl !RefUnwindSafe for PkarrPublisher
impl Send for PkarrPublisher
impl Sync for PkarrPublisher
impl Unpin for PkarrPublisher
impl !UnwindSafe for PkarrPublisher
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for T
impl<T> AddressLookupBuilder for T
Source§impl Clone for PkarrPublisher
impl Clone for PkarrPublisher
Source§fn clone(&self) -> PkarrPublisher
fn clone(&self) -> PkarrPublisher
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 PkarrPublisher
impl !RefUnwindSafe for PkarrPublisher
impl Send for PkarrPublisher
impl Sync for PkarrPublisher
impl Unpin for PkarrPublisher
impl !UnwindSafe for PkarrPublisher
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
T: AddressLookup,
impl<T> AddressLookupBuilder for Twhere
T: AddressLookup,
Source§fn into_address_lookup(
self,
_endpoint: &Endpoint,
diff --git a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
index aca2855501..bdab189c43 100644
--- a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
+++ b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
@@ -1,18 +1,18 @@
-PkarrRelayClient in iroh::address_lookup::pkarr - Rust PkarrRelayClient
pub struct PkarrRelayClient { /* private fields */ }
Expand description
A pkarr client to publish SignedPackets to a pkarr relay.
-Implementations§
Source§impl PkarrRelayClient
Sourcepub fn new(
+PkarrRelayClient in iroh::address_lookup::pkarr - Rust PkarrRelayClient
pub struct PkarrRelayClient { /* private fields */ }
Expand description
A pkarr client to publish SignedPackets to a pkarr relay.
+Implementations§
Source§impl PkarrRelayClient
Sourcepub fn new(
pkarr_relay_url: Url,
tls_config: ClientConfig,
dns_resolver: DnsResolver,
) -> Self
Available on non-wasm_browser only.
Creates a PkarrRelayClient.
-Sourcepub async fn resolve(
&self,
endpoint_id: EndpointId,
) -> Result<SignedPacket, AddressLookupError>
Resolves a SignedPacket for the given EndpointId.
-Sourcepub async fn publish(
&self,
signed_packet: &SignedPacket,
) -> Result<(), PkarrError>
Publishes a SignedPacket.
-
Trait Implementations§
Source§impl Clone for PkarrRelayClient
Source§fn clone(&self) -> PkarrRelayClient
Returns a duplicate 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 PkarrRelayClient
§impl !RefUnwindSafe for PkarrRelayClient
§impl Send for PkarrRelayClient
§impl Sync for PkarrRelayClient
§impl Unpin for PkarrRelayClient
§impl !UnwindSafe for PkarrRelayClient
Blanket Implementations§
Trait Implementations§
Source§impl Clone for PkarrRelayClient
Source§fn clone(&self) -> PkarrRelayClient
Returns a duplicate 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 PkarrRelayClient
§impl !RefUnwindSafe for PkarrRelayClient
§impl Send for PkarrRelayClient
§impl Sync for PkarrRelayClient
§impl Unpin for PkarrRelayClient
§impl !UnwindSafe for PkarrRelayClient
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/4036/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
index 79d8b2e2a8..0c08b03913 100644
--- a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
+++ b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
@@ -1,6 +1,6 @@
-PkarrRelayClientBuilder in iroh::address_lookup::pkarr - Rust PkarrRelayClientBuilder
pub struct PkarrRelayClientBuilder { /* private fields */ }
Expand description
A builder for the PkarrRelayClient
-Implementations§
Source§impl PkarrRelayClientBuilder
Sourcepub fn build(self) -> PkarrRelayClient
Build a PkarrRelayClient.
-Trait Implementations§
Source§impl Clone for PkarrRelayClientBuilder
Source§fn clone(&self) -> PkarrRelayClientBuilder
Returns a duplicate 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 PkarrRelayClientBuilder
§impl !RefUnwindSafe for PkarrRelayClientBuilder
§impl Send for PkarrRelayClientBuilder
§impl Sync for PkarrRelayClientBuilder
§impl Unpin for PkarrRelayClientBuilder
§impl !UnwindSafe for PkarrRelayClientBuilder
Blanket Implementations§
Source§impl<T> Any for Twhere
+PkarrRelayClientBuilder in iroh::address_lookup::pkarr - Rust PkarrRelayClientBuilder
pub struct PkarrRelayClientBuilder { /* private fields */ }
Expand description
A builder for the PkarrRelayClient
+Implementations§
Source§impl PkarrRelayClientBuilder
Sourcepub fn build(self) -> PkarrRelayClient
Build a PkarrRelayClient.
+Trait Implementations§
Source§impl Clone for PkarrRelayClientBuilder
Source§fn clone(&self) -> PkarrRelayClientBuilder
Returns a duplicate 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 PkarrRelayClientBuilder
§impl !RefUnwindSafe for PkarrRelayClientBuilder
§impl Send for PkarrRelayClientBuilder
§impl Sync for PkarrRelayClientBuilder
§impl Unpin for PkarrRelayClientBuilder
§impl !UnwindSafe for PkarrRelayClientBuilder
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/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
index 13e12a4b01..1f7723299d 100644
--- a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
+++ b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
@@ -1,21 +1,21 @@
-PkarrResolver in iroh::address_lookup::pkarr - Rust PkarrResolver
pub struct PkarrResolver { /* private fields */ }
Expand description
Resolver of address lookup information from a pkarr relay.
+PkarrResolver in iroh::address_lookup::pkarr - Rust PkarrResolver
pub struct PkarrResolver { /* private fields */ }
Expand description
Resolver of address lookup information from a pkarr relay.
The resolver uses HTTP to query address lookup information from a pkarr relay server,
see the module docs for details.
This implements the AddressLookup trait to be used as an address lookup service. Note
that it only resolves address lookup information, for the corresponding publisher use
the PkarrPublisher together with AddressLookupServices.
-Implementations§
Source§impl PkarrResolver
Sourcepub fn builder(pkarr_relay: Url) -> PkarrResolverBuilder
Creates a new resolver builder using the pkarr relay server at the URL.
+Implementations§
Source§impl PkarrResolver
Sourcepub fn builder(pkarr_relay: Url) -> PkarrResolverBuilder
Creates a new resolver builder using the pkarr relay server at the URL.
The builder implements AddressLookupBuilder.
-Sourcepub fn n0_dns() -> PkarrResolverBuilder
Creates a pkarr resolver builder which uses the number 0 pkarr relay server.
+Sourcepub fn n0_dns() -> PkarrResolverBuilder
Creates a pkarr resolver builder which uses the number 0 pkarr relay server.
This uses the pkarr relay server operated by number 0 at
N0_DNS_PKARR_RELAY_PROD.
When running with the environment variable IROH_FORCE_STAGING_RELAYS
set to any non empty value N0_DNS_PKARR_RELAY_STAGING
server is used instead.
-Trait Implementations§
Source§impl AddressLookup for PkarrResolver
Trait Implementations§
Source§impl AddressLookup for PkarrResolver
Source§fn resolve(
&self,
endpoint_id: EndpointId,
-) -> Option<BoxStream<Result<AddressLookupItem, AddressLookupError>>>
Source§fn publish(&self, _data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreSource§impl Clone for PkarrResolver
Source§fn clone(&self) -> PkarrResolver
Returns a duplicate 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 PkarrResolver
§impl !RefUnwindSafe for PkarrResolver
§impl Send for PkarrResolver
§impl Sync for PkarrResolver
§impl Unpin for PkarrResolver
§impl !UnwindSafe for PkarrResolver
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
+) -> Option<BoxStream<Result<AddressLookupItem, AddressLookupError>>>Source§fn publish(&self, _data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read more
Source§impl Clone for PkarrResolver
Source§fn clone(&self) -> PkarrResolver
Returns a duplicate 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 PkarrResolver
§impl !RefUnwindSafe for PkarrResolver
§impl Send for PkarrResolver
§impl Sync for PkarrResolver
§impl Unpin for PkarrResolver
§impl !UnwindSafe for PkarrResolver
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
T: AddressLookup,
Source§fn into_address_lookup(
self,
_endpoint: &Endpoint,
diff --git a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
index cfd47f28e6..e549ec9d07 100644
--- a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
+++ b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
@@ -1,11 +1,11 @@
-PkarrResolverBuilder in iroh::address_lookup::pkarr - Rust PkarrResolverBuilder
pub struct PkarrResolverBuilder { /* private fields */ }
Expand description
Builder for PkarrResolver.
+PkarrResolverBuilder in iroh::address_lookup::pkarr - Rust PkarrResolverBuilder
pub struct PkarrResolverBuilder { /* private fields */ }
Expand description
Builder for PkarrResolver.
-Implementations§
Source§impl PkarrResolverBuilder
Sourcepub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self
Available on non-wasm_browser only.
Sets the DNS resolver to use for resolving the pkarr relay URL.
-Sourcepub fn build(self, tls_config: ClientConfig) -> PkarrResolver
Creates a PkarrResolver from this builder.
-Trait Implementations§
Implementations§
Source§impl PkarrResolverBuilder
Sourcepub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self
Available on non-wasm_browser only.
Sets the DNS resolver to use for resolving the pkarr relay URL.
+Sourcepub fn build(self, tls_config: ClientConfig) -> PkarrResolver
Creates a PkarrResolver from this builder.
+Trait Implementations§
Source§impl AddressLookupBuilder for PkarrResolverBuilder
Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this builder into a ready-to-use AddressLookup. Read moreAuto Trait Implementations§
§impl Freeze for PkarrResolverBuilder
§impl !RefUnwindSafe for PkarrResolverBuilder
§impl Send for PkarrResolverBuilder
§impl Sync for PkarrResolverBuilder
§impl Unpin for PkarrResolverBuilder
§impl !UnwindSafe for PkarrResolverBuilder
Blanket Implementations§
Source§impl<T> Any for Twhere
+) -> Result<impl AddressLookup, AddressLookupBuilderError>Turns this builder into a ready-to-use AddressLookup. Read more
Auto Trait Implementations§
§impl Freeze for PkarrResolverBuilder
§impl !RefUnwindSafe for PkarrResolverBuilder
§impl Send for PkarrResolverBuilder
§impl Sync for PkarrResolverBuilder
§impl Unpin for PkarrResolverBuilder
§impl !UnwindSafe for PkarrResolverBuilder
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/4036/docs/iroh/address_lookup/struct.EndpointData.html b/pr/4036/docs/iroh/address_lookup/struct.EndpointData.html
index 1ea4773718..7de6a2dd89 100644
--- a/pr/4036/docs/iroh/address_lookup/struct.EndpointData.html
+++ b/pr/4036/docs/iroh/address_lookup/struct.EndpointData.html
@@ -13,15 +13,15 @@ services, should they not fit into e.g. a single DNS packet otherwise.
See also Self::set_user_data.
Sourcepub fn add_relay_url(&mut self, relay_url: RelayUrl)
Adds the relay URL to the end of the endpoint data, unless it already existed.
Sourcepub fn add_ip_addrs(&mut self, addresses: Vec<SocketAddr>)
Adds addresses in order with duplicates or already existing addresses filtered out.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Adds addresses to the endpoint data in the given ordered, but with duplicates filtered.
-Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data and returns the updated endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Adds addresses to the endpoint data in the given order, but with duplicates filtered.
+Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data.
Sourcepub fn clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn clear_relay_urls(&mut self)
Removes all relay URLs from the endpoint data.
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses.
+Sourcepub fn filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
Returns a vec to allow re-ordering of addresses.
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
diff --git a/pr/4036/docs/iroh/address_lookup/struct.Item.html b/pr/4036/docs/iroh/address_lookup/struct.Item.html
index 9e63b37130..28d59f6feb 100644
--- a/pr/4036/docs/iroh/address_lookup/struct.Item.html
+++ b/pr/4036/docs/iroh/address_lookup/struct.Item.html
@@ -16,14 +16,14 @@ directly from Sourcepub fn last_updated(&self) -> Option<u64>
Returns the optional timestamp when this endpoint info was last updated.
The value is microseconds since the unix epoch.
-Sourcepub fn to_endpoint_addr(&self) -> EndpointAddr
Converts into a EndpointAddr by cloning the needed fields.
-Sourcepub fn into_endpoint_addr(self) -> EndpointAddr
Converts into a EndpointAddr without cloning.
+Sourcepub fn to_endpoint_addr(&self) -> EndpointAddr
Returns an EndpointAddr by cloning the needed fields.
+Sourcepub fn into_endpoint_addr(self) -> EndpointAddr
Converts into an EndpointAddr without cloning.
Methods from Deref<Target = EndpointData>§
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses.
+Sourcepub fn filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
Returns a vec to allow re-ordering of addresses.
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
diff --git a/pr/4036/docs/iroh/address_lookup/struct.UserData.html b/pr/4036/docs/iroh/address_lookup/struct.UserData.html
index 49c2183d40..5ae8665e57 100644
--- a/pr/4036/docs/iroh/address_lookup/struct.UserData.html
+++ b/pr/4036/docs/iroh/address_lookup/struct.UserData.html
@@ -1,4 +1,5 @@
-UserData in iroh::address_lookup - Rust 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.
+UserData in iroh::address_lookup - Rust UserData
pub struct UserData(/* private fields */);
Expand description
User-defined data that can be published and resolved through endpoint discovery.
+Under the hood this is a UTF-8 string 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.
diff --git a/pr/4036/docs/iroh/address_lookup/trait.AddressLookup.html b/pr/4036/docs/iroh/address_lookup/trait.AddressLookup.html
index 1be6efa3e6..79a8044def 100644
--- a/pr/4036/docs/iroh/address_lookup/trait.AddressLookup.html
+++ b/pr/4036/docs/iroh/address_lookup/trait.AddressLookup.html
@@ -22,7 +22,7 @@ Address Lookup information changes. If an Address Lookup mechanism requires a pe
refresh, it should start its own task.
Provided Methods§
Sourcefn publish(&self, _data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism.
This is fire and forget, since the Endpoint can not wait for successful
-publishing. If publishing is async, the implementation should start it’s own task.
+publishing. If publishing is async, the implementation should start its own task.
This will be called from a tokio task, so it is safe to spawn new tasks.
These tasks will be run on the runtime of the super::Endpoint.
Implementations on Foreign Types§
Source§impl<T: AddressLookup> AddressLookup for Arc<T>
Implementors§
Source§impl AddressLookup for DnsAddressLookup
Available on non-wasm_browser only. Source§impl AddressLookup for MemoryLookup
Source§impl AddressLookup for PkarrPublisher
Source§impl AddressLookup for PkarrResolver
Source§impl<T: AddressLookup> AddressLookup for FilteredAddressLookup<T>
\ No newline at end of file
+) -> Option<BoxStream<Result<Item, Error>>>Implementors§
Source§impl AddressLookup for DnsAddressLookup
Available on non-wasm_browser only. Source§impl AddressLookup for MemoryLookup
Source§impl AddressLookup for PkarrPublisher
Source§impl AddressLookup for PkarrResolver
Source§impl<T: AddressLookup> AddressLookup for FilteredAddressLookup<T>
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/address_lookup/trait.AddressLookupBuilder.html b/pr/4036/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
index 35aadc4338..edc4dff899 100644
--- a/pr/4036/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
+++ b/pr/4036/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
@@ -20,5 +20,5 @@ endpoint to Endpoint,
) -> Result<impl AddressLookup, AddressLookupBuilderError>Turns this builder into a ready-to-use AddressLookup.
If an error is returned, building the endpoint will fail with this error.
-Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
Source§impl AddressLookupBuilder for DnsAddressLookupBuilder
Available on non-wasm_browser only. Source§impl AddressLookupBuilder for PkarrPublisherBuilder
Source§impl AddressLookupBuilder for PkarrResolverBuilder
Source§impl<T: AddressLookup> AddressLookupBuilder for T
Blanket no-op impl of AddressLookupBuilder for T: AddressLookup.
+ Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
Source§impl AddressLookupBuilder for DnsAddressLookupBuilder
Available on non-wasm_browser only. Source§impl AddressLookupBuilder for PkarrPublisherBuilder
Source§impl AddressLookupBuilder for PkarrResolverBuilder
Source§impl<T: AddressLookup> AddressLookupBuilder for T
Blanket no-op impl of AddressLookupBuilder for T: AddressLookup.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/defaults/prod/fn.default_ap_relay.html b/pr/4036/docs/iroh/defaults/prod/fn.default_ap_relay.html
index 5961b7d1ab..3a67b98b91 100644
--- a/pr/4036/docs/iroh/defaults/prod/fn.default_ap_relay.html
+++ b/pr/4036/docs/iroh/defaults/prod/fn.default_ap_relay.html
@@ -1,2 +1,2 @@
-default_ap_relay in iroh::defaults::prod - Rust default_ap_relay
pub fn default_ap_relay() -> RelayConfig
Expand description
Get the default RelayConfig for Asia-Pacific
+default_ap_relay in iroh::defaults::prod - Rust default_ap_relay
pub fn default_ap_relay() -> RelayConfig
Expand description
Get the default RelayConfig for Asia-Pacific.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/defaults/prod/index.html b/pr/4036/docs/iroh/defaults/prod/index.html
index 8981fb6be4..b076bc3ce3 100644
--- a/pr/4036/docs/iroh/defaults/prod/index.html
+++ b/pr/4036/docs/iroh/defaults/prod/index.html
@@ -1,2 +1,2 @@
iroh::defaults::prod - Rust Module prod
Expand description
Production configuration.
-Constants§
- AP_
RELAY_HOSTNAME - Hostname of the default Asia-Pacific relay.
- EU_
RELAY_HOSTNAME - Hostname of the default EU relay.
- NA_
EAST_RELAY_HOSTNAME - Hostname of the default NA east relay.
- NA_
WEST_RELAY_HOSTNAME - Hostname of the default NA west relay.
Functions§
- default_
ap_relay - Get the default
RelayConfig for Asia-Pacific - default_
eu_relay - Get the default
RelayConfig for EU. - default_
na_east_relay - Get the default
RelayConfig for NA east. - default_
na_west_relay - Get the default
RelayConfig for NA west. - default_
relay_map - Get the default
RelayMap.
\ No newline at end of file
+Constants§
- AP_
RELAY_HOSTNAME - Hostname of the default Asia-Pacific relay.
- EU_
RELAY_HOSTNAME - Hostname of the default EU relay.
- NA_
EAST_RELAY_HOSTNAME - Hostname of the default NA east relay.
- NA_
WEST_RELAY_HOSTNAME - Hostname of the default NA west relay.
Functions§
- default_
ap_relay - Get the default
RelayConfig for Asia-Pacific. - default_
eu_relay - Get the default
RelayConfig for EU. - default_
na_east_relay - Get the default
RelayConfig for NA east. - default_
na_west_relay - Get the default
RelayConfig for NA west. - default_
relay_map - Get the default
RelayMap.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/dns/struct.DnsResolver.html b/pr/4036/docs/iroh/dns/struct.DnsResolver.html
index 754fa26465..3f8c6e27b6 100644
--- a/pr/4036/docs/iroh/dns/struct.DnsResolver.html
+++ b/pr/4036/docs/iroh/dns/struct.DnsResolver.html
@@ -15,7 +15,7 @@ public DNS.
Implementations§
Source§impl DnsResolver
Sourcepub fn new() -> DnsResolver
Creates 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.
+to the default ResolverConfig which uses e.g. Google’s 8.8.8.8 or 8.8.4.4.
Sourcepub fn with_nameserver(nameserver: SocketAddr) -> DnsResolver
Creates a new DNS resolver configured with a single UDP DNS nameserver.
Sourcepub fn custom(resolver: impl Resolver) -> DnsResolver
Creates a new DnsResolver from a struct that implements Resolver.
diff --git a/pr/4036/docs/iroh/dns/trait.Resolver.html b/pr/4036/docs/iroh/dns/trait.Resolver.html
index 4aaa7642fd..3ebf87a01f 100644
--- a/pr/4036/docs/iroh/dns/trait.Resolver.html
+++ b/pr/4036/docs/iroh/dns/trait.Resolver.html
@@ -38,13 +38,13 @@ atomic swap. Build a new instance with re-bound sockets and re-read nameserver
configuration rather than mutating in place. Must not perform IO: defer DNS
queries and socket binds until the new resolver is first used. May be called
concurrently, in which case all but one allocated replacement is dropped unused.
-Implementations on Foreign Types§
Implementations on Foreign Types§
Source§impl Resolver for Arc<SimpleDnsResolver>
Source§fn lookup_ipv4(
&self,
host: String,
-) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = Ipv4Addr> + Send>, DnsError>> + Send>>
Source§fn lookup_ipv6(
+) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = Ipv4Addr> + Send>, DnsError>> + Send>>
Source§fn lookup_ipv6(
&self,
host: String,
-) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = Ipv6Addr> + Send>, DnsError>> + Send>>
Source§fn lookup_txt(
+) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = Ipv6Addr> + Send>, DnsError>> + Send>>
Source§fn lookup_txt(
&self,
host: String,
-) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = TxtRecordData> + Send>, DnsError>> + Send>>
Source§fn clear_cache(&self)
Source§fn reset(&self) -> Box<dyn Resolver>
Implementors§
\ No newline at end of file
+) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = TxtRecordData> + Send>, DnsError>> + Send>>Source§fn clear_cache(&self)
Source§fn reset(&self) -> Box<dyn Resolver>
Implementors§
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html b/pr/4036/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html
index 0a8e0c05eb..cc00fac5e1 100644
--- a/pr/4036/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html
+++ b/pr/4036/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html
@@ -1,2 +1,2 @@
-ENV_FORCE_STAGING_RELAYS in iroh::endpoint - Rust ENV_FORCE_STAGING_RELAYS
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 ENV_FORCE_STAGING_RELAYS
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint/enum.RelayMode.html b/pr/4036/docs/iroh/endpoint/enum.RelayMode.html
index 326aae7405..0d7b755897 100644
--- a/pr/4036/docs/iroh/endpoint/enum.RelayMode.html
+++ b/pr/4036/docs/iroh/endpoint/enum.RelayMode.html
@@ -1,4 +1,4 @@
-RelayMode in iroh::endpoint - Rust RelayMode
pub enum RelayMode {
+RelayMode in iroh::endpoint - Rust RelayMode
pub enum RelayMode {
Disabled,
Default,
Staging,
@@ -10,14 +10,14 @@ This means that neither listening nor dialing relays will be available.
See crate::defaults::prod for the severs used.
§Staging
Use the staging relay servers from n0.
§Custom(RelayMap)
Use a custom relay map.
-
Implementations§
Source§impl RelayMode
Sourcepub fn custom(map: impl IntoIterator<Item = RelayUrl>) -> Self
Create a custom relay mode from a list of RelayUrls.
+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§
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/4036/docs/iroh/endpoint/fn.default_relay_mode.html b/pr/4036/docs/iroh/endpoint/fn.default_relay_mode.html
index d716677abc..98ff3579ee 100644
--- a/pr/4036/docs/iroh/endpoint/fn.default_relay_mode.html
+++ b/pr/4036/docs/iroh/endpoint/fn.default_relay_mode.html
@@ -1,4 +1,4 @@
-default_relay_mode in iroh::endpoint - Rust default_relay_mode
pub fn default_relay_mode() -> RelayMode
Expand description
Returns the default relay mode.
+default_relay_mode in iroh::endpoint - Rust default_relay_mode
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint/fn.force_staging_infra.html b/pr/4036/docs/iroh/endpoint/fn.force_staging_infra.html
index ff8dda7e69..b444491b3e 100644
--- a/pr/4036/docs/iroh/endpoint/fn.force_staging_infra.html
+++ b/pr/4036/docs/iroh/endpoint/fn.force_staging_infra.html
@@ -1,2 +1,2 @@
-force_staging_infra in iroh::endpoint - Rust force_staging_infra
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 force_staging_infra
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint/index.html b/pr/4036/docs/iroh/endpoint/index.html
index 2efb803d4c..f3a98d45f2 100644
--- a/pr/4036/docs/iroh/endpoint/index.html
+++ b/pr/4036/docs/iroh/endpoint/index.html
@@ -1,4 +1,4 @@
-iroh::endpoint - Rust Module endpoint
Expand description
The Endpoint allows establishing connections to other iroh endpoints.
+iroh::endpoint - Rust Module endpoint
Expand description
The Endpoint allows establishing connections to other iroh endpoints.
The Endpoint is the main API interface to manage a local iroh endpoint. It allows
connecting to and accepting connections from other endpoints. See the module docs for
more details on how iroh connections work.
diff --git a/pr/4036/docs/iroh/endpoint/presets/index.html b/pr/4036/docs/iroh/endpoint/presets/index.html
index 37b792c03d..a454626701 100644
--- a/pr/4036/docs/iroh/endpoint/presets/index.html
+++ b/pr/4036/docs/iroh/endpoint/presets/index.html
@@ -2,4 +2,4 @@
§Example
use iroh::{Endpoint, RelayMode, Watcher, endpoint::presets};
-let endpoint = Endpoint::builder(presets::N0).bind().await?;
Structs§
- Empty
- An empty preset that doesn’t set anything on the builder.
- Minimal
with_crypto_provider - A preset that is almost empty, besides setting mandatory options.
- N0
with_crypto_provider - Configures the endpoint to use the n0 defaults
- N0Disable
Relay with_crypto_provider - Configures the endpoint to use the n0 defaults, but with relay mode disabled.
Traits§
- Preset
- Defines a preset
\ No newline at end of file
+let endpoint = Endpoint::builder(presets::N0).bind().await?;Structs§
- Empty
- An empty preset that doesn’t set anything on the builder.
- Minimal
with_crypto_provider - A preset that is almost empty, besides setting mandatory options.
- N0
with_crypto_provider - Configures the endpoint to use the n0 defaults
- N0Disable
Relay with_crypto_provider - Configures the endpoint to use the n0 defaults, but with relay mode disabled.
Traits§
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint/presets/struct.N0.html b/pr/4036/docs/iroh/endpoint/presets/struct.N0.html
index 41c532b301..cf9fb0156e 100644
--- a/pr/4036/docs/iroh/endpoint/presets/struct.N0.html
+++ b/pr/4036/docs/iroh/endpoint/presets/struct.N0.html
@@ -6,8 +6,8 @@
setting the [rustls::crypto::CryptoProvider] to ring or aws-lc-rs, depending
on which feature is enabled in iroh (preferring ring if both are enabled).
-Due to the last point, this preset is only available with the ring or
-aws-lc-rs preset installed.
+
Due to the last point, this preset is only available with the tls-ring or
+tls-aws-lc-rs feature enabled.
If you want to set your own crypto provider, we recommend copying the
implementation of this preset into your own and setting the appropriate crypto
provider there.
diff --git a/pr/4036/docs/iroh/endpoint/presets/struct.N0DisableRelay.html b/pr/4036/docs/iroh/endpoint/presets/struct.N0DisableRelay.html
index dd14c88ba9..29795833c9 100644
--- a/pr/4036/docs/iroh/endpoint/presets/struct.N0DisableRelay.html
+++ b/pr/4036/docs/iroh/endpoint/presets/struct.N0DisableRelay.html
@@ -7,8 +7,8 @@ relay urls.
setting the [rustls::crypto::CryptoProvider] to ring or aws-lc-rs, depending
on which feature is enabled in iroh (preferring ring if both are enabled).
-Due to the last point, this preset is only available with the ring or
-aws-lc-rs preset installed.
+
Due to the last point, this preset is only available with the tls-ring or
+tls-aws-lc-rs feature enabled.
If you want to set your own crypto provider, we recommend copying the
implementation of this preset into your own and setting the appropriate crypto
provider there.
diff --git a/pr/4036/docs/iroh/endpoint/presets/trait.Preset.html b/pr/4036/docs/iroh/endpoint/presets/trait.Preset.html
index 59a71a95da..7e6f4bbcac 100644
--- a/pr/4036/docs/iroh/endpoint/presets/trait.Preset.html
+++ b/pr/4036/docs/iroh/endpoint/presets/trait.Preset.html
@@ -1,7 +1,7 @@
-Preset in iroh::endpoint::presets - Rust Preset
pub trait Preset {
+Preset in iroh::endpoint::presets - Rust Preset
pub trait Preset {
// Required method
fn apply(self, builder: Builder) -> Builder;
-}
Expand description
Defines a preset
+}Expand description
A reusable bundle of endpoint Builder configuration.
Required Methods§
Implementations on Foreign Types§
Source§impl Preset for Arc<TestTransport>
Available on crate feature unstable-custom-transports and (crate features test-utils) only.
Source§fn apply(self, builder: Builder) -> Builder
Configures the builder with this transport and the network’s address lookup.
§Example
diff --git a/pr/4036/docs/iroh/endpoint/struct.Builder.html b/pr/4036/docs/iroh/endpoint/struct.Builder.html
index 79894b8924..7cbb050d5e 100644
--- a/pr/4036/docs/iroh/endpoint/struct.Builder.html
+++ b/pr/4036/docs/iroh/endpoint/struct.Builder.html
@@ -92,7 +92,7 @@ is set to false explicitly.
destination addresses. It is valid to configure this, but no more than one such
socket should be bound or the routing will be non-deterministic.
To use a subnet with a non-zero prefix length as the default route in addition to
-being routed when its prefix matches, use `BindOpts::set_is_default_route.
+being routed when its prefix matches, use BindOpts::set_is_default_route.
Subnets with a prefix length of zero are always marked as default routes.
Finally note that most outgoing datagrams are part of an existing network flow. That
is, they are in response to an incoming datagram. In this case the outgoing datagram
@@ -142,7 +142,7 @@ direct addresses or relay URLs will fail.
Sourcepub fn addr_filter(self, filter: AddrFilter) -> Self
Sets the address filter applied to all address data before publishing.
This filter is applied once, at the AddressLookupServices level, before
distributing data to any individual address lookup service. This ensures
-consistent filtering regardless of how the services configured.
+consistent filtering regardless of how the services are configured.
Sourcepub fn clear_addr_filter(self) -> Self
Clears the address filter, allowing all addresses to be published.
This removes any filter previously set via Self::addr_filter, including
filters set by presets.
diff --git a/pr/4036/docs/iroh/endpoint/struct.ConnectOptions.html b/pr/4036/docs/iroh/endpoint/struct.ConnectOptions.html
index 30bf2e329e..3834b0244e 100644
--- a/pr/4036/docs/iroh/endpoint/struct.ConnectOptions.html
+++ b/pr/4036/docs/iroh/endpoint/struct.ConnectOptions.html
@@ -1,12 +1,12 @@
-ConnectOptions in iroh::endpoint - Rust ConnectOptions
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 ConnectOptions
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 QuicTransportConfig.
-Sourcepub fn with_transport_config(
+
Sourcepub fn with_transport_config(
self,
transport_config: QuicTransportConfig,
) -> Self
Sets the QUIC transport config options for this connection.
-Sourcepub fn with_additional_alpns(self, alpns: Vec<Vec<u8>>) -> Self
Sets ALPN identifiers that should be signaled as supported on connection, in
+
Sourcepub fn with_additional_alpns(self, alpns: Vec<Vec<u8>>) -> Self
Sets ALPN identifiers that should be signaled as supported on connection, in
addition to the main ALPN identifier used in Endpoint::connect_with_opts.
This allows connecting to servers that may only support older versions of your
protocol. In this case, you would add the older ALPN identifiers with this
@@ -20,7 +20,7 @@ list or the main ALPN identifiers on the accept side, see the endpoint
builder’s Builder::alpns function.
-Trait Implementations§
Source§impl Clone for ConnectOptions
Source§fn clone(&self) -> ConnectOptions
Returns a duplicate 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 duplicate 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/4036/docs/iroh/endpoint/struct.Connection.html b/pr/4036/docs/iroh/endpoint/struct.Connection.html
index ffc93497ee..74f53832af 100644
--- a/pr/4036/docs/iroh/endpoint/struct.Connection.html
+++ b/pr/4036/docs/iroh/endpoint/struct.Connection.html
@@ -8,7 +8,7 @@ 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<T: ConnectionState> Connection<T>
Implementations§
Source§impl<T: ConnectionState> Connection<T>
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.
@@ -18,13 +18,13 @@ consequence, the peer won’t be notified that a stream has been opened until th
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_bi(&self) -> AcceptBi<'_> ⓘ
Accepts 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 async fn closed(&self) -> ConnectionError
Waits 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.
@@ -97,17 +97,18 @@ strong and pseudorandom, and are suitable for use as keying material.
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)
See [noq_proto::TransportConfig::receive_window].
-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)
Sets the connection-level flow control receive window.
+See [noq_proto::TransportConfig::receive_window].
+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.
-Source§impl Connection<HandshakeCompleted>
Sourcepub fn remote_id(&self) -> EndpointId
Returns the EndpointId from the peer’s TLS certificate.
+Source§impl Connection<HandshakeCompleted>
Sourcepub fn remote_id(&self) -> EndpointId
Returns the EndpointId from the peer’s TLS certificate.
The PublicKey of an endpoint is also known as an EndpointId. This PublicKey is
included in the TLS certificate presented during the handshake when connecting.
This function allows you to get the EndpointId of the remote endpoint of this
connection.
-Sourcepub fn paths(&self) -> PathList<'_>
Returns the currently open network paths for this connection.
+Sourcepub fn paths(&self) -> PathList<'_>
Returns the currently open network paths for this connection.
A connection typically has one path via the relay server and,
once holepunching succeeds, a direct path. The returned
PathList is a snapshot taken at call time: it does not
@@ -116,14 +117,14 @@ already closed.
To observe changes over time, see Connection::paths_stream
for a stream of PathList snapshots and
Connection::path_events for individual PathEvents.
-Sourcepub fn paths_stream(&self) -> PathListStream<'_>
Returns a stream of PathList snapshots for this connection.
+Sourcepub fn paths_stream(&self) -> PathListStream<'_>
Returns a stream of PathList snapshots for this connection.
Yields the current snapshot on the first poll, and a fresh
snapshot whenever the open paths or the selected path change.
Ends when the connection closes.
The stream borrows this Connection. To consume it from a
spawned task, move a Connection clone into the task and
call this method inside.
-Sourcepub fn path_events(&self) -> PathEventStream
Returns a stream of PathEvents for this connection.
+Sourcepub fn path_events(&self) -> PathEventStream
Returns a stream of PathEvents for this connection.
Each event reports one of: a path opened, a path closed (with
final per-path statistics), the selected transmission path
changed, or the consumer fell behind. The stream ends when the
@@ -133,14 +134,14 @@ may be moved into a spawned task.
single PathEvent::Lagged; the current state of the open
paths and the selected path remains recoverable via
Connection::paths.
-Sourcepub fn weak_handle(&self) -> WeakConnectionHandle
Returns a WeakConnectionHandle for this connection.
+Sourcepub fn weak_handle(&self) -> WeakConnectionHandle
Returns a WeakConnectionHandle for this connection.
A WeakConnectionHandle does not keep the connection alive. It can be used to
wait for the connection to be closed via WeakConnectionHandle::closed and to
attempt to upgrade back to a strong Connection via
WeakConnectionHandle::upgrade.
-Source§impl Connection<IncomingZeroRtt>
Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
-Sourcepub async fn handshake_completed(&self) -> Result<Connection, ConnectingError>
Waits until the full handshake occurs and then returns a Connection.
+Source§impl Connection<IncomingZeroRtt>
Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
+Sourcepub async fn handshake_completed(&self) -> Result<Connection, ConnectingError>
Waits until the full handshake occurs and then returns a Connection.
This may fail with ConnectingError::ConnectionError, if there was
some general failure with the connection, such as a network timeout since
we accepted the connection.
@@ -149,18 +150,18 @@ doesn’t use the right TLS authentication, which usually every iroh endpoint
uses and requires.
Thus, those errors should only occur if someone connects to you with a
modified iroh endpoint or with a plain QUIC client.
-Sourcepub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError>
Returns the EndpointId from the peer’s TLS certificate.
+Sourcepub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError>
Returns the EndpointId from the peer’s TLS certificate.
The PublicKey of an endpoint is also known as an EndpointId. This PublicKey is
included in the TLS certificate presented during the handshake when connecting.
This function allows you to get the EndpointId of the remote endpoint of this
connection.
-Source§impl Connection<OutgoingZeroRtt>
Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
+Sourcepub async fn handshake_completed(
&self,
) -> Result<ZeroRttStatus, ConnectingError>
Waits until the full handshake occurs and returns a ZeroRttStatus.
-If ZeroRttStatus::Accepted is returned, than any streams created before
+
If ZeroRttStatus::Accepted is returned, then any streams created before
the handshake has completed can still be used.
-If ZeroRttStatus::Rejected is returned, than any streams created before
+
If ZeroRttStatus::Rejected is returned, then any streams created before
the handshake will error and any data sent should be re-sent on a
new stream.
This may fail with ConnectingError::ConnectionError, if there was
@@ -171,7 +172,7 @@ doesn’t use the right TLS authentication, which usually every iroh endpoint
uses and requires.
Thus, those errors should only occur if someone connects to you with a
modified iroh endpoint or with a plain QUIC client.
-Sourcepub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError>
Returns the EndpointId from the peer’s TLS certificate.
+Sourcepub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError>
Returns the EndpointId from the peer’s TLS certificate.
The PublicKey of an endpoint is also known as an EndpointId. This PublicKey is
included in the TLS certificate presented during the handshake when connecting.
This function allows you to get the EndpointId of the remote endpoint of this
diff --git a/pr/4036/docs/iroh/endpoint/struct.Endpoint.html b/pr/4036/docs/iroh/endpoint/struct.Endpoint.html
index cfd63c979e..0c6c2630b7 100644
--- a/pr/4036/docs/iroh/endpoint/struct.Endpoint.html
+++ b/pr/4036/docs/iroh/endpoint/struct.Endpoint.html
@@ -13,7 +13,7 @@ behaviour.
Endpoint::connect and Endpoint::accept methods. Once established, the
Connection gives access to most QUIC features. Individual streams to send data to
the peer are created using the Connection::open_bi, Connection::accept_bi,
-Connection::open_uni and Connection::open_bi functions.
+Connection::open_uni and Connection::accept_uni 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.
§Usage on Android
@@ -22,7 +22,7 @@ through JNI, which needs a JVM context published to DnsResolver for the supported
initialization paths.
-Implementations§
Source§impl Endpoint
Implementations§
Source§impl Endpoint
Sourcepub fn set_alpns(&self, alpns: Vec<Vec<u8>>)
Sets the list of accepted ALPN protocols.
This will only affect new incoming connections.
@@ -117,8 +117,8 @@ changes.
understand if the endpoint has ever been considered “online”. But after
that initial call to Endpoint::online, to understand if your
endpoint is no longer able to be connected to by endpoints outside
-of the private or local network, watch for changes in it’s EndpointAddr.
-If there are no addrsin the EndpointAddr, you may not be dialable by other endpoints
+of the private or local network, watch for changes in its EndpointAddr.
+If there are no addrs in the EndpointAddr, you may not be dialable by other endpoints
on the internet.
The EndpointAddr will change as:
@@ -146,7 +146,7 @@ tokio::spawn(endpoint_closed.run_until(async move {
}));
// Do fancy things, then close the endpoint.
// Our task above will stop even if there are still clones of `Endpoint` alive somewhere.
-endpoint.close().await;
Sourcepub async fn online(&self)
A convenience method that waits for the endpoint to be considered “online”.
This currently means at least one relay server has completed its
connection handshake (i.e. the endpoint is registered and reachable
via that relay). Merely selecting a relay URL is not sufficient.
@@ -167,49 +167,45 @@ entirely.
The online method does not interact with crate::address_lookup::AddressLookup
services, which means that any Address Lookup that relies on a WAN
connection is independent of the endpoint’s online status.
-§Examples
use iroh::Endpoint;
-
-#[tokio::main]
-async fn main() {
-// After this await returns, the endpoint is bound to a local socket.
-// It can be dialed, but almost certainly hasn't finished picking a
+§Examples
+// After this await returns, the endpoint is bound to a local socket.
+// It can be dialed, but almost certainly hasn't finished picking a
// relay.
-let endpoint = Endpoint::bind().await;
+let endpoint = Endpoint::bind(presets::N0).await?;
-// After this await returns we have a connection to at least one relay
+// After this await returns we have a connection to at least one relay
// and holepunching should work as expected.
-endpoint.online().await;
-}
Sourcepub fn home_relay_status(
+endpoint.online().await;
Sourcepub fn home_relay_status(
&self,
) -> impl Watcher<Value = Vec<RelayStatus>> + use<>
Returns a Watcher over the connection status of the endpoint’s home relays.
The watched value has one entry per home relay whose URL is known,
and is empty when no relays are configured or before the endpoint has
-selected one the home relay from the list of configured relays.
+selected a home relay from the list of configured relays.
The watcher updates whenever any home relay’s connection status changes.
See RelayStatus for the information available on each entry.
The returned watcher only becomes disconnected once the last clone of
the Endpoint is dropped. Closing the endpoint does not disconnect
the watcher. To stop a task once the endpoint stops, combine with
Self::closed.
-Sourcepub fn bound_sockets(&self) -> Vec<SocketAddr>
Available on non-wasm_browser only.
Returns the local socket addresses on which the underlying sockets are bound.
+Sourcepub fn bound_sockets(&self) -> Vec<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 dns_resolver(&self) -> Result<&DnsResolver, EndpointError>
Available on non-wasm_browser only.
Returns the DNS resolver used in this Endpoint.
+Sourcepub fn dns_resolver(&self) -> Result<&DnsResolver, EndpointError>
Available on non-wasm_browser only.
Sourcepub fn tls_config(&self) -> &ClientConfig
Returns the [rustls::ClientConfig] used by the endpoint for connecting to external services.
+Sourcepub fn tls_config(&self) -> &ClientConfig
Returns the [rustls::ClientConfig] used by the endpoint for connecting to external services.
This might be useful for address lookup services or other functions
that want to use the same trust anchors as iroh does for verifying the
validity of TLS certificates presented by external services.
Note that this TLS config is unrelated to how iroh validates the authenticity
of iroh connections itself.
The config is based on the trust anchors set via Builder::ca_tls_config.
-Sourcepub fn address_lookup(&self) -> Result<&AddressLookupServices, EndpointError>
Returns the Address Lookup service, if configured.
+Sourcepub fn address_lookup(&self) -> Result<&AddressLookupServices, EndpointError>
Returns the Address Lookup service, if configured.
§Errors
Returns a EndpointError::Closed error if the endpoint is closed.
-Sourcepub fn metrics(&self) -> &EndpointMetrics
Available on crate feature metrics only.
Returns metrics collected for this endpoint.
+Sourcepub fn metrics(&self) -> &EndpointMetrics
Available on crate feature metrics only.
Returns metrics collected for this endpoint.
The endpoint internally collects various metrics about its operation.
The returned EndpointMetrics struct contains all of these metrics.
You can access individual metrics directly by using the public fields:
@@ -275,13 +271,13 @@ registry.write().unwrap().register_all(endpoint.metrics());
.std_context("text")?;
assert!(res.contains(r#"TYPE socket_recv_datagrams counter"#));
-assert!(res.contains(r#"socket_recv_datagrams_total 0"#));Sourcepub async fn remote_info(&self, endpoint_id: EndpointId) -> Option<RemoteInfo>
Returns addressing information about a recently used remote endpoint.
+assert!(res.contains(r#"socket_recv_datagrams_total 0"#));Sourcepub async fn remote_info(&self, endpoint_id: EndpointId) -> Option<RemoteInfo>
Returns addressing information about a recently used remote endpoint.
The returned RemoteInfo contains a list of all transport addresses for the remote
that we know about. This is a snapshot in time and not a watcher.
Returns None if the endpoint doesn’t have information about the remote or if the endpoint is closed.
When remote endpoints are no longer used, our endpoint will keep information around
for a little while, and then drop it. Afterwards, this will return None.
-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
@@ -290,14 +286,14 @@ 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.
If the endpoint is closed, this method will log a warning and ignore the request.
-Sourcepub fn set_user_data_for_address_lookup(&self, user_data: Option<UserData>)
Sets the initial user-defined data to be published in Address Lookups for this endpoint.
+Sourcepub fn set_user_data_for_address_lookup(&self, user_data: Option<UserData>)
Sets the initial user-defined data to be published in Address Lookups for this endpoint.
If the user-defined data passed to this function is different to the previous one,
the endpoint will republish its endpoint info to the configured Address Lookups.
See also Builder::user_data_for_address_lookup for setting an initial value when
building the endpoint.
If the endpoint is closed, this method will log a warning and ignore the
request.
-Sourcepub async fn close(&self)
Closes the QUIC endpoint and the 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.
@@ -322,9 +318,9 @@ sockets. This is due to QUIC and its acknowledgments being implemented in user-l
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.
-Sourcepub fn closed(&self) -> EndpointClosed ⓘ
Returns a future that resolves once the endpoint closes.
+the respective Endpoint are dropped.
+Sourcepub fn closed(&self) -> EndpointClosed ⓘ
Returns a future that resolves once the endpoint closes.
The returned future does not contain a clone or reference to the Endpoint,
so keeping the returned future alive does not prevent the endpoint from being dropped.
To run a task and stop it once the endpoint closes, you can use
@@ -333,7 +329,7 @@ so keeping the returned future alive does not prevent the endpoint from being dr
let endpoint = Endpoint::bind(presets::N0).await?;
tokio::spawn(endpoint.closed().run_until(async move {
// the future will be aborted once the endpoint closes.
-}));
Sourcepub fn create_server_config_builder(
+}));
Sourcepub fn create_server_config_builder(
&self,
alpns: Vec<Vec<u8>>,
) -> ServerConfigBuilder
Create a ServerConfigBuilder for this endpoint that includes the given alpns.
diff --git a/pr/4036/docs/iroh/endpoint/struct.EndpointClosed.html b/pr/4036/docs/iroh/endpoint/struct.EndpointClosed.html
index 85b8fd921b..1a2b9e3683 100644
--- a/pr/4036/docs/iroh/endpoint/struct.EndpointClosed.html
+++ b/pr/4036/docs/iroh/endpoint/struct.EndpointClosed.html
@@ -1,9 +1,9 @@
-EndpointClosed in iroh::endpoint - Rust EndpointClosed
pub struct EndpointClosed { /* private fields */ }
Expand description
Future returned from Endpoint::closed.
-Implementations§
Source§impl EndpointClosed
Sourcepub async fn run_until<F: Future>(self, fut: F) -> Option<F::Output>
Runs a future to completion, or until the Endpoint is closed.
+EndpointClosed in iroh::endpoint - Rust EndpointClosed
pub struct EndpointClosed { /* private fields */ }
Expand description
Future returned from Endpoint::closed.
+Implementations§
Trait Implementations§
Source§impl Debug for EndpointClosed
Source§impl Future for EndpointClosed
Source§impl<'pin> Unpin for EndpointClosedwhere
+
Trait Implementations§
Source§impl Debug for EndpointClosed
Source§impl Future for EndpointClosed
Source§impl<'pin> Unpin for EndpointClosedwhere
PinnedFieldsOf<__EndpointClosed<'pin>>: Unpin,
Auto Trait Implementations§
§impl !Freeze for EndpointClosed
§impl !RefUnwindSafe for EndpointClosed
§impl Send for EndpointClosed
§impl Sync for EndpointClosed
§impl !UnwindSafe for EndpointClosed
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/4036/docs/iroh/endpoint/struct.Incoming.html b/pr/4036/docs/iroh/endpoint/struct.Incoming.html
index d0a2c29af8..eca1097eca 100644
--- a/pr/4036/docs/iroh/endpoint/struct.Incoming.html
+++ b/pr/4036/docs/iroh/endpoint/struct.Incoming.html
@@ -24,7 +24,7 @@ to customize a Sourcepub fn remote_addr_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_addr().
-Sourcepub fn decrypt(&self) -> Option<DecryptedInitial>
Decrypt the Initial packet payload
+Sourcepub fn decrypt(&self) -> Option<DecryptedInitial>
Decrypts the Initial packet payload.
This clones and decrypts the packet payload (~1200 bytes).
Can be used to extract information from the TLS ClientHello without completing the handshake.
Trait Implementations§
Source§impl IntoFuture for Incoming
Source§type Output = Result<Connection, ConnectingError>
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§
Source§impl<T> Any for Twhere
diff --git a/pr/4036/docs/iroh/endpoint/struct.QuicTransportConfigBuilder.html b/pr/4036/docs/iroh/endpoint/struct.QuicTransportConfigBuilder.html
index 3a193bd40a..5189f21509 100644
--- a/pr/4036/docs/iroh/endpoint/struct.QuicTransportConfigBuilder.html
+++ b/pr/4036/docs/iroh/endpoint/struct.QuicTransportConfigBuilder.html
@@ -136,7 +136,7 @@ enable multipath as well.
If the path is idle for this long the path will be abandoned. Bear in mind this will
interact with the QuicTransportConfigBuilder::max_idle_timeout, if the last path is
abandoned the entire connection will be closed.
-Note: values higher than [PATH_MAX_IDLE_TIMEOUT] are clamped and a warning is logged.
+Note: values higher than PATH_MAX_IDLE_TIMEOUT (15 seconds) are clamped and a warning is logged.
Sourcepub fn default_path_keep_alive_interval(self, interval: Duration) -> Self
Sets a default per-path keep alive interval.
Note that this does not interact with the connection-wide
QuicTransportConfigBuilder::keep_alive_interval. This setting will keep this path active,
diff --git a/pr/4036/docs/iroh/endpoint/struct.RelayStatus.html b/pr/4036/docs/iroh/endpoint/struct.RelayStatus.html
index 175b637f76..a1abba7e98 100644
--- a/pr/4036/docs/iroh/endpoint/struct.RelayStatus.html
+++ b/pr/4036/docs/iroh/endpoint/struct.RelayStatus.html
@@ -1,13 +1,13 @@
-
RelayStatus in iroh::endpoint - Rust RelayStatus
pub struct RelayStatus { /* private fields */ }
Expand description
Connection status of a single home relay.
+RelayStatus in iroh::endpoint - Rust RelayStatus
pub struct RelayStatus { /* private fields */ }
Expand description
Connection status of a single home relay.
Observed via Endpoint::home_relay_status.
-Implementations§
Source§impl RelayStatus
Sourcepub fn is_connected(&self) -> bool
Returns true if the endpoint is connected to the relay.
-Sourcepub fn last_error(&self) -> Option<&AnyError>
Returns the most recent connection error, if the relay is currently
+
Implementations§
Source§impl RelayStatus
Sourcepub fn is_connected(&self) -> bool
Returns true if the endpoint is connected to the relay.
+Sourcepub fn last_error(&self) -> Option<&AnyError>
Returns the most recent connection error, if the relay is currently
disconnected.
Returns None when the relay is connected, or when the endpoint has
not yet observed a failed connection attempt.
-Trait Implementations§
Source§impl Clone for RelayStatus
Source§fn clone(&self) -> RelayStatus
Returns a duplicate 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 RelayStatus
Source§impl PartialEq for RelayStatus
Source§impl Eq for RelayStatus
Source§impl StructuralPartialEq for RelayStatus
Auto Trait Implementations§
§impl Freeze for RelayStatus
§impl !RefUnwindSafe for RelayStatus
§impl Send for RelayStatus
§impl Sync for RelayStatus
§impl Unpin for RelayStatus
§impl !UnwindSafe for RelayStatus
Blanket Implementations§
Trait Implementations§
Source§impl Clone for RelayStatus
Source§fn clone(&self) -> RelayStatus
Returns a duplicate 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 RelayStatus
Source§impl PartialEq for RelayStatus
Source§impl Eq for RelayStatus
Source§impl StructuralPartialEq for RelayStatus
Auto Trait Implementations§
§impl Freeze for RelayStatus
§impl !RefUnwindSafe for RelayStatus
§impl Send for RelayStatus
§impl Sync for RelayStatus
§impl Unpin for RelayStatus
§impl !UnwindSafe for RelayStatus
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/4036/docs/iroh/endpoint/struct.VarInt.html b/pr/4036/docs/iroh/endpoint/struct.VarInt.html
index 0acf99654d..007540d1af 100644
--- a/pr/4036/docs/iroh/endpoint/struct.VarInt.html
+++ b/pr/4036/docs/iroh/endpoint/struct.VarInt.html
@@ -13,7 +13,7 @@ An integer less than 2^62
of overflowing.
Trait Implementations§
§impl From<VarInt> for IdleTimeout
§fn from(inner: VarInt) -> IdleTimeout
Converts to this type from the input type.§impl From<VarInt> for IdleTimeout
§fn from(inner: VarInt) -> IdleTimeout
Converts to this type from the input type.§impl Ord for VarInt
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
diff --git a/pr/4036/docs/iroh/endpoint/struct.WeakConnectionHandle.html b/pr/4036/docs/iroh/endpoint/struct.WeakConnectionHandle.html
index 47f6c23610..07bad208d7 100644
--- a/pr/4036/docs/iroh/endpoint/struct.WeakConnectionHandle.html
+++ b/pr/4036/docs/iroh/endpoint/struct.WeakConnectionHandle.html
@@ -1,18 +1,18 @@
-WeakConnectionHandle in iroh::endpoint - Rust WeakConnectionHandle
pub struct WeakConnectionHandle { /* private fields */ }
Expand description
A weak handle to a Connection.
+WeakConnectionHandle in iroh::endpoint - Rust WeakConnectionHandle
pub struct WeakConnectionHandle { /* private fields */ }
Expand description
A weak handle to a Connection.
A WeakConnectionHandle does not keep the connection alive: holding one will not
prevent the connection from being closed when the last Connection handle is dropped.
Use upgrade to obtain a strong Connection, and closed to wait for the
connection to be closed without keeping it alive.
-Implementations§
Source§impl WeakConnectionHandle
Sourcepub fn upgrade(&self) -> Option<Connection>
Attempts to upgrade this weak handle to a strong Connection.
+Implementations§
Source§impl WeakConnectionHandle
Sourcepub fn upgrade(&self) -> Option<Connection>
Attempts to upgrade this weak handle to a strong Connection.
Returns None if the connection has already been dropped.
-Sourcepub fn closed(&self) -> impl Future<Output = Option<Closed>> + Send + 'static
Returns a future that resolves once the connection has been closed.
+Sourcepub fn closed(&self) -> impl Future<Output = Option<Closed>> + Send + 'static
Returns a future that resolves once the connection has been closed.
If no strong references to the Connection exist at the time this is called,
the future resolves to None. If at least one strong reference still exists at
the time of this call, the returned future is guaranteed to receive the close
event with the close reason and final connection statistics, even if all strong
references are dropped before the future is awaited.
The future does not keep the connection alive.
-Trait Implementations§
Source§impl Clone for WeakConnectionHandle
Source§fn clone(&self) -> WeakConnectionHandle
Returns a duplicate 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 WeakConnectionHandle
§impl !RefUnwindSafe for WeakConnectionHandle
§impl Send for WeakConnectionHandle
§impl Sync for WeakConnectionHandle
§impl Unpin for WeakConnectionHandle
§impl !UnwindSafe for WeakConnectionHandle
Blanket Implementations§
Trait Implementations§
Source§impl Clone for WeakConnectionHandle
Source§fn clone(&self) -> WeakConnectionHandle
Returns a duplicate 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 WeakConnectionHandle
§impl !RefUnwindSafe for WeakConnectionHandle
§impl Send for WeakConnectionHandle
§impl Sync for WeakConnectionHandle
§impl Unpin for WeakConnectionHandle
§impl !UnwindSafe for WeakConnectionHandle
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/4036/docs/iroh/endpoint/trait.EndpointHooks.html b/pr/4036/docs/iroh/endpoint/trait.EndpointHooks.html
index 2ac883dd5d..90c7ff04fc 100644
--- a/pr/4036/docs/iroh/endpoint/trait.EndpointHooks.html
+++ b/pr/4036/docs/iroh/endpoint/trait.EndpointHooks.html
@@ -17,7 +17,7 @@
For each hook, all installed hooks are invoked in the order they were installed on
the endpoint builder. If a hook returns Accept, processing continues with the next
hook. If a hook returns Reject, processing is aborted and further hooks
-are not invoked for this hook.
+are not invoked for this hook point.
§Notes to implementers
As hooks are stored on the endpoint, you must make sure to never store an Endpoint
on the hook struct itself, as this would create reference counting loop and cause the
diff --git a/pr/4036/docs/iroh/endpoint_info/index.html b/pr/4036/docs/iroh/endpoint_info/index.html
index f27fe3b898..4a60b9fd8f 100644
--- a/pr/4036/docs/iroh/endpoint_info/index.html
+++ b/pr/4036/docs/iroh/endpoint_info/index.html
@@ -1,11 +1,11 @@
iroh::endpoint_info - Rust Module endpoint_info
Expand description
Support for handling DNS resource records for dialing by EndpointId.
Dialing by EndpointId is supported by iroh endpoints publishing Pkarr records to DNS
servers or the Mainline DHT. This module supports creating and parsing these records.
-EndpointInfo combines an iroh_base::EndpointId with EndpointData —
+
EndpointInfo combines an iroh_base::EndpointId with EndpointData:
the addressing and metadata that discovery services publish and resolve.
Discovery services use AddrFilter to control which addresses are published.
This module also provides serialization to and from pkarr signed packets and
-DNS TXT records. See the [crate::attrs] module for the on-the-wire format.
+DNS TXT records.
DNS records are published under the following names:
_iroh.<z32-endpoint-id>.<origin-domain> TXT
@@ -36,4 +36,4 @@ Each address is an IPv4 or IPv6 address with a port.
Structs§
- Addr
Filter - A filter and/or reordering function applied to transport addresses,
-typically used by AddressLookup services in iroh before publishing.
- Endpoint
Data - Data about an endpoint that may be published to and resolved from discovery services.
- Endpoint
Info - Information about an endpoint that may be published to and resolved from discovery services.
- MaxLength
ExceededError - Error returned when an input value is too long for
UserData. - User
Data - Under the hood this is a UTF-8 String is no longer than
UserData::MAX_LENGTH bytes.
\ No newline at end of file
+typically used by AddressLookup services in iroh before publishing.EndpointData Data about an endpoint that may be published to and resolved from discovery services. EndpointInfo Information about an endpoint that may be published to and resolved from discovery services. MaxLengthExceededError Error returned when an input value is too long for UserData. UserData User-defined data that can be published and resolved through endpoint discovery.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint_info/struct.EndpointData.html b/pr/4036/docs/iroh/endpoint_info/struct.EndpointData.html
index eaf2725892..2c818ea5b4 100644
--- a/pr/4036/docs/iroh/endpoint_info/struct.EndpointData.html
+++ b/pr/4036/docs/iroh/endpoint_info/struct.EndpointData.html
@@ -13,15 +13,15 @@ services, should they not fit into e.g. a single DNS packet otherwise.
See also Self::set_user_data.
Sourcepub fn add_relay_url(&mut self, relay_url: RelayUrl)
Adds the relay URL to the end of the endpoint data, unless it already existed.
Sourcepub fn add_ip_addrs(&mut self, addresses: Vec<SocketAddr>)
Adds addresses in order with duplicates or already existing addresses filtered out.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Adds addresses to the endpoint data in the given ordered, but with duplicates filtered.
-Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data and returns the updated endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Adds addresses to the endpoint data in the given order, but with duplicates filtered.
+Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data.
Sourcepub fn clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn clear_relay_urls(&mut self)
Removes all relay URLs from the endpoint data.
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses.
+Sourcepub fn filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
Returns a vec to allow re-ordering of addresses.
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
diff --git a/pr/4036/docs/iroh/endpoint_info/struct.UserData.html b/pr/4036/docs/iroh/endpoint_info/struct.UserData.html
index 3352480631..e73207e05e 100644
--- a/pr/4036/docs/iroh/endpoint_info/struct.UserData.html
+++ b/pr/4036/docs/iroh/endpoint_info/struct.UserData.html
@@ -1,4 +1,5 @@
-UserData in iroh::endpoint_info - Rust 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.
+UserData in iroh::endpoint_info - Rust UserData
pub struct UserData(/* private fields */);
Expand description
User-defined data that can be published and resolved through endpoint discovery.
+Under the hood this is a UTF-8 string 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.
diff --git a/pr/4036/docs/iroh/enum.KeyParsingError.html b/pr/4036/docs/iroh/enum.KeyParsingError.html
index 765ac27ad2..146ec05698 100644
--- a/pr/4036/docs/iroh/enum.KeyParsingError.html
+++ b/pr/4036/docs/iroh/enum.KeyParsingError.html
@@ -1,4 +1,4 @@
-KeyParsingError in iroh - Rust KeyParsingError
#[non_exhaustive]pub enum KeyParsingError {
+KeyParsingError in iroh - Rust KeyParsingError
#[non_exhaustive]pub enum KeyParsingError {
FailedToDecodeHex {
meta: Meta,
},
@@ -11,14 +11,14 @@
InvalidKeyData {
meta: Meta,
},
-}
Expand description
Error when deserialising a PublicKey or a SecretKey.
+}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§FailedToDecodeHex
The input string could not be decoded as hex.
Fields
§meta: MetaCaptured call-site metadata
§FailedToDecodeBase32
The input string could not be decoded as base32.
Fields
§meta: MetaCaptured call-site metadata
§InvalidLength
The input has invalid length.
Fields
§meta: MetaCaptured call-site metadata
-§InvalidKeyData
The decoded data is not a valid Ed25591 public key.
+§InvalidKeyData
The decoded data is not a valid Ed25519 public key.
Fields
§meta: MetaCaptured call-site metadata
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<KeyParsingError> for ParseError
Source§fn from(source: KeyParsingError) -> ParseError
Converts to this type from the input type.Source§impl StackError for KeyParsingError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<KeyParsingError>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Returns the next source in the chain, if any.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.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
diff --git a/pr/4036/docs/iroh/enum.TransportAddr.html b/pr/4036/docs/iroh/enum.TransportAddr.html
index df614a51ee..0e5f31d772 100644
--- a/pr/4036/docs/iroh/enum.TransportAddr.html
+++ b/pr/4036/docs/iroh/enum.TransportAddr.html
@@ -3,8 +3,8 @@
Ip(SocketAddr),
Custom(CustomAddr),
}Expand description
Available address types.
-Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§Relay(RelayUrl)
Relays
-§Ip(SocketAddr)
IP based addresses
+Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§Relay(RelayUrl)
A relay server address.
+§Ip(SocketAddr)
An IP based address.
§Custom(CustomAddr)
Custom transport address
Implementations§
Source§impl TransportAddr
Sourcepub fn is_ip(&self) -> bool
Whether this is an IP transport address.
diff --git a/pr/4036/docs/iroh/index.html b/pr/4036/docs/iroh/index.html
index a2ddd5617a..8c7bddcb16 100644
--- a/pr/4036/docs/iroh/index.html
+++ b/pr/4036/docs/iroh/index.html
@@ -1,5 +1,5 @@
iroh - Rust Crate iroh
Expand description
Peer-to-peer QUIC connections.
-iroh is a library to establish direct connectivity between peers. It exposes an
+
iroh is a library to establish direct connectivity between peers. It exposes an
interface to QUIC connections and streams to the user, while implementing direct
connectivity using hole punching complemented by relay servers under the hood.
An iroh endpoint is created and controlled by the Endpoint, e.g. connecting to
@@ -44,7 +44,7 @@ punching if needed. Once the direct connection is established the relay ser
longer involved in the connection.
If one of the iroh endpoints can be reached directly, connectivity can also be
established without involving a Relay server. This is done by using the endpoint’s
-listening addresses in the connection establishement instead of the RelayUrl which
+listening addresses in the connection establishment instead of the RelayUrl which
is used to identify a Relay server. Of course it is also possible to use both a
RelayUrl and direct addresses at the same time to connect.
§Encryption
@@ -179,4 +179,4 @@ connecting using only the Ok(())
}
Please see the examples directory for more nuanced examples.
-Re-exports§
Modules§
- address_
lookup - Lookup the address of an Endpoint ID.
- defaults
- Default values used in
iroh - dns
Non-wasm_browser - Configurable DNS resolver.
- endpoint
- The
Endpoint allows establishing connections to other iroh endpoints. - endpoint_
info - Support for handling DNS resource records for dialing by
EndpointId. - metrics
- Co-locating all of the iroh metrics structs
- protocol
- Tools for spawning an accept loop that routes incoming requests to the right protocol.
- test_
utils test-utils - Internal utilities to support testing.
- tls
- TLS configuration for iroh.
Structs§
- Endpoint
Addr - Network-level addressing information for an iroh endpoint.
- NetReport
- A net_report report.
- NetReport
Config - Configuration for the net report component.
- Public
Key - A public key.
- Relay
Config - Information on a specific relay server.
- Relay
Map - List of relay server configurations to be used in an iroh endpoint.
- Relay
Url - A URL identifying a relay server.
- Relay
UrlParseError - Can occur when parsing a string into a
RelayUrl. - Secret
Key - A secret key.
- Signature
- Ed25519 signature.
- Signature
Error - Verification of a signature failed.
Enums§
- KeyParsing
Error - Error when deserialising a
PublicKey or a SecretKey. - Transport
Addr - Available address types.
Constants§
- NET_
REPORT_TIMEOUT - The maximum amount of time, in seconds, the net_report will spend gathering a single report.
Traits§
- Watcher
- A handle to a value that’s represented by one or more underlying [
Watchable]s.
Type Aliases§
- Endpoint
Id - The identifier for an endpoint in the (iroh) network.
\ No newline at end of file
+Re-exports§
Modules§
- address_
lookup - Lookup the address of an Endpoint ID.
- defaults
- Default values used in
iroh - dns
Non-wasm_browser - Configurable DNS resolver.
- endpoint
- The
Endpoint allows establishing connections to other iroh endpoints. - endpoint_
info - Support for handling DNS resource records for dialing by
EndpointId. - metrics
- Co-locating all of the iroh metrics structs
- protocol
- Tools for spawning an accept loop that routes incoming requests to the right protocol.
- test_
utils test-utils - Internal utilities to support testing.
- tls
- TLS configuration for iroh.
Structs§
- Endpoint
Addr - Network-level addressing information for an iroh endpoint.
- NetReport
- A net_report report.
- NetReport
Config - Configuration for the net report component.
- Public
Key - A public key.
- Relay
Config - Information on a specific relay server.
- Relay
Map - List of relay server configurations to be used in an iroh endpoint.
- Relay
Url - A URL identifying a relay server.
- Relay
UrlParseError - Can occur when parsing a string into a
RelayUrl. - Secret
Key - A secret key.
- Signature
- Ed25519 signature.
- Signature
Error - Verification of a signature failed.
Enums§
- KeyParsing
Error - Error returned when parsing a
PublicKey or a SecretKey. - Transport
Addr - Available address types.
Constants§
- NET_
REPORT_TIMEOUT - The maximum amount of time, in seconds, the net_report will spend gathering a single report.
Traits§
- Watcher
- A handle to a value that’s represented by one or more underlying [
Watchable]s.
Type Aliases§
- Endpoint
Id - The identifier for an endpoint in the (iroh) network.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/metrics/index.html b/pr/4036/docs/iroh/metrics/index.html
index da53db7d6a..00f2275127 100644
--- a/pr/4036/docs/iroh/metrics/index.html
+++ b/pr/4036/docs/iroh/metrics/index.html
@@ -1,2 +1,2 @@
iroh::metrics - Rust Module metrics
Expand description
Co-locating all of the iroh metrics structs
-Structs§
- Endpoint
Metrics - Metrics collected by an
crate::endpoint::Endpoint. - NetReport
Metrics - Enum of metrics for the module
- Relay
Metrics test-utils - Metrics tracked for the relay server
- Socket
Metrics - Enum of metrics for the module
\ No newline at end of file
+Structs§
- Endpoint
Metrics - Metrics collected by an
crate::endpoint::Endpoint. - NetReport
Metrics - Enum of metrics for the module
- Relay
Metrics test-utils - Metrics tracked for the relay server
- Socket
Metrics - Metrics collected by the iroh socket.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/metrics/struct.RelayMetrics.html b/pr/4036/docs/iroh/metrics/struct.RelayMetrics.html
index f8768e50a1..da2588f738 100644
--- a/pr/4036/docs/iroh/metrics/struct.RelayMetrics.html
+++ b/pr/4036/docs/iroh/metrics/struct.RelayMetrics.html
@@ -26,21 +26,26 @@
pub http_connections_closed: Counter,
pub http_connections_errored: Counter,
}Available on crate feature test-utils only.Expand description
Metrics tracked for the relay server
-Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.§bytes_sent: CounterBytes sent from a FrameType::SendPacket
-§bytes_recv: CounterBytes received from a FrameType::SendPacket
-§send_packets_sent: CounterFrameType::SendPacket sent
-§send_packets_recv: CounterFrameType::SendPacket received
-§send_packets_dropped: CounterFrameType::SendPacket dropped
-§other_packets_sent: CounterPackets of other FrameTypes sent
-§other_packets_recv: CounterPackets of other FrameTypes received
-§other_packets_dropped: CounterPackets of other FrameTypes dropped
-§got_ping: CounterNumber of FrameType::Pings received
-§sent_pong: CounterNumber of FrameType::Pongs sent
-§unknown_frames: CounterNumber of FrameType::Unknown received
+Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.§bytes_sent: CounterBytes sent to a client in RelayToClientDatagram or RelayToClientDatagramBatch frames.
+§bytes_recv: CounterBytes received from a client in ClientToRelayDatagram or ClientToRelayDatagramBatch frames.
+§send_packets_sent: CounterRelayToClientDatagram or RelayToClientDatagramBatch frames sent to a client.
+§send_packets_recv: CounterClientToRelayDatagram or ClientToRelayDatagramBatch frames received from a client.
+§send_packets_dropped: CounterRelayToClientDatagram or RelayToClientDatagramBatch frames dropped instead of being
+delivered to a client, because the recipient is not connected or writing to its stream failed.
+Note that frames dropped because the recipient’s send queue is full or closed are not counted
+here.
+§other_packets_sent: CounterIntended to count sent frames other than datagrams, but currently unused (never incremented).
+§other_packets_recv: CounterIntended to count received frames other than datagrams, but currently unused (never incremented).
+§other_packets_dropped: CounterIntended to count dropped frames other than datagrams, but currently unused (never incremented).
+§got_ping: CounterNumber of FrameType::Ping frames received from a client.
+§sent_pong: CounterNumber of FrameType::Pong frames sent to a client.
+§unknown_frames: CounterIntended to count received frames with an unrecognized FrameType,
+but currently unused (never incremented).
§bytes_rx_ratelimited_total: CounterNumber of bytes received from client connection which have been rate-limited.
§conns_rx_ratelimited_total: CounterNumber of client connections which have had any frames rate-limited.
§accepts: CounterNumber of times this server has accepted a connection.
-§disconnects: CounterNumber of connections we have removed because of an error
+§disconnects: CounterNumber of times a client connection was disconnected.
+Incremented once per connection, paired with Self::accepts.
§unique_client_keys: CounterNumber of unique client keys per day
§clients_inactive_added: CounterNumber of times a client was moved into the inactive state.
A client becomes inactive when a new client connects with the same endpoint id. An inactive
diff --git a/pr/4036/docs/iroh/metrics/struct.SocketMetrics.html b/pr/4036/docs/iroh/metrics/struct.SocketMetrics.html
index 2291657920..f61d3786bb 100644
--- a/pr/4036/docs/iroh/metrics/struct.SocketMetrics.html
+++ b/pr/4036/docs/iroh/metrics/struct.SocketMetrics.html
@@ -1,4 +1,4 @@
-
SocketMetrics in iroh::metrics - Rust SocketMetrics
#[non_exhaustive]pub struct SocketMetrics {Show 31 fields
+SocketMetrics in iroh::metrics - Rust SocketMetrics
#[non_exhaustive]pub struct SocketMetrics {Show 31 fields
pub update_direct_addrs: Counter,
pub send_ipv4: Counter,
pub send_ipv6: Counter,
@@ -30,10 +30,23 @@
pub actor_tick_direct_addr_heartbeat: Counter,
pub actor_link_change: Counter,
pub actor_tick_other: Counter,
-}
Expand description
Enum of metrics for the module
-Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.§update_direct_addrs: Counter§send_ipv4: Counter§send_ipv6: Counter§send_relay: Counter§recv_data_relay: Counter§recv_data_custom: Counter§recv_data_ipv4: Counter§recv_data_ipv6: Counter§recv_datagrams: CounterNumber of QUIC datagrams received.
-§recv_gro_datagrams: CounterNumber of datagrams received using GRO
-§relay_home_change: Counter§holepunch_attempts: CounterThe number of times holepunching is initiated on a connection.
+}Expand description
Metrics collected by the iroh socket.
+Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.§update_direct_addrs: CounterIntended to count updates to the local direct address set, but currently unused
+(never incremented).
+§send_ipv4: CounterNumber of bytes sent over IPv4.
+§send_ipv6: CounterNumber of bytes sent over IPv6.
+§send_relay: CounterNumber of bytes sent over the relay transport.
+§recv_data_relay: CounterNumber of data bytes received over the relay transport.
+§recv_data_custom: CounterNumber of data bytes received over any custom transport.
+§recv_data_ipv4: CounterNumber of data bytes received over IPv4.
+§recv_data_ipv6: CounterNumber of data bytes received over IPv6.
+§recv_datagrams: CounterNumber of QUIC datagrams received.
+§recv_gro_datagrams: CounterNumber of receive events that used GRO (coalesced datagram batches).
+This counts batches, not the individual datagrams within them. See
+Self::recv_datagrams for the datagram count.
+§relay_home_change: CounterNumber of times the home relay changed to a different relay.
+This includes the initial assignment from no home relay to a home relay.
+§holepunch_attempts: CounterThe number of times holepunching is initiated on a connection.
This can be incremented multiple times for a single connection. Note that only the
client-side of a connection will increment this counter.
§paths_direct: CounterThe number of network paths to peers that are direct.
@@ -53,8 +66,15 @@ the number of opened connections.
§transport_relay_paths_removed: CounterNumber of relay transport paths closed.
§transport_custom_paths_added: CounterNumber of custom transport paths opened.
§transport_custom_paths_removed: CounterNumber of custom transport paths closed.
-§actor_tick_main: Counter§actor_tick_msg: Counter§actor_tick_re_stun: Counter§actor_tick_portmap_changed: Counter§actor_tick_direct_addr_heartbeat: Counter§actor_link_change: Counter§actor_tick_other: CounterTrait Implementations§
Source§impl<'de> Deserialize<'de> for Metrics
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Iterable for Metrics
Source§fn metric_field_count(&self) -> usize
Returns the number of metric fields in the struct.Source§fn metric_field_ref(&self, n: usize) -> Option<MetricItem<'_>>
Returns the metric field at the given index.§fn family_field_count(&self) -> usize
Returns the number of Family fields in the struct.§fn family_field_ref(&self, _n: usize) -> Option<FamilyItem<'_>>
Returns the Family field at the given index.Source§impl Serialize for Metrics
Source§fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where
+§actor_tick_main: CounterNumber of iterations of the main socket actor loop.
+§actor_tick_msg: CounterNumber of actor messages processed by the socket actor loop.
+§actor_tick_re_stun: CounterNumber of periodic re-STUN timer ticks handled by the socket actor loop.
+§actor_tick_portmap_changed: CounterNumber of port-mapping change events handled by the socket actor loop.
+§actor_tick_direct_addr_heartbeat: CounterIntended to count direct address heartbeat ticks, but currently unused (never incremented).
+§actor_link_change: CounterNumber of local network interface (link) change events handled by the socket actor loop.
+§actor_tick_other: CounterNumber of times an input watcher or receiver closed in the socket actor loop.
+Trait Implementations§
Source§impl<'de> Deserialize<'de> for Metrics
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Iterable for Metrics
Source§fn metric_field_count(&self) -> usize
Returns the number of metric fields in the struct.Source§fn metric_field_ref(&self, n: usize) -> Option<MetricItem<'_>>
Returns the metric field at the given index.§fn family_field_count(&self) -> usize
Returns the number of Family fields in the struct.§fn family_field_ref(&self, _n: usize) -> Option<FamilyItem<'_>>
Returns the Family field at the given index.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
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/4036/docs/iroh/protocol/enum.IncomingFilterOutcome.html b/pr/4036/docs/iroh/protocol/enum.IncomingFilterOutcome.html
index e11345eddc..4577fe8eaf 100644
--- a/pr/4036/docs/iroh/protocol/enum.IncomingFilterOutcome.html
+++ b/pr/4036/docs/iroh/protocol/enum.IncomingFilterOutcome.html
@@ -11,7 +11,7 @@ the source address, actively refuse the connection, or silently drop it.
What this does depends on the connection type:
-
-
Direct (UDP) connections : this is QUIC source address
+
Direct (UDP) connections: this is QUIC source address
validation. If the socket address was spoofed, the retry token is
sent to the spoofed address, so we never hear from the attacker
again. If the address was real, the client repeats the connection
@@ -20,7 +20,7 @@ attempt with the token, and the next
-
-
Relay connections : there is no source address to validate
+
Relay connections: there is no source address to validate
(the relay already vouches for the packet origin), so the
“validation” itself has no security meaning. However, the retry
still imposes a real cost on the client: an extra round trip
diff --git a/pr/4036/docs/iroh/protocol/struct.RouterBuilder.html b/pr/4036/docs/iroh/protocol/struct.RouterBuilder.html
index dfc8969679..06b2f59fad 100644
--- a/pr/4036/docs/iroh/protocol/struct.RouterBuilder.html
+++ b/pr/4036/docs/iroh/protocol/struct.RouterBuilder.html
@@ -16,7 +16,7 @@ cheaper signals (e.g. remote address) first.
with this alpn.
handler can either be a type that implements ProtocolHandler or a
Box<dyn DynProtocolHandler>.
-
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for RouterBuilder
§impl !RefUnwindSafe for RouterBuilder
§impl Send for RouterBuilder
§impl Sync for RouterBuilder
§impl Unpin for RouterBuilder
§impl !UnwindSafe for RouterBuilder
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/4036/docs/iroh/struct.EndpointAddr.html b/pr/4036/docs/iroh/struct.EndpointAddr.html
index 0aa53df633..867818d655 100644
--- a/pr/4036/docs/iroh/struct.EndpointAddr.html
+++ b/pr/4036/docs/iroh/struct.EndpointAddr.html
@@ -5,7 +5,7 @@
This combines an endpoint’s identifier with network-level addressing information of how to
contact the endpoint.
To establish a network connection to an endpoint both the EndpointId and one or more network
-paths are needed. The network paths can come from various sources, current sources can come from
+paths are needed. The network paths can come from various sources:
-
An Address Lookup service which can provide routing information for a given EndpointId.
@@ -24,7 +24,7 @@ connection without the help of a Fields§§id: PublicKeyThe endpoint’s identifier.
-§addrs: BTreeSet<TransportAddr>The endpoint’s addresses
+§addrs: BTreeSet<TransportAddr>The endpoint’s addresses.
Implementations§
Source§impl EndpointAddr
Sourcepub fn new(id: PublicKey) -> EndpointAddr
Creates a new EndpointAddr with no network level addresses.
This still is usable with e.g. an address lookup service to establish a connection,
depending on the situation.
@@ -38,9 +38,9 @@ depending on the situation.
self,
addrs: impl IntoIterator<Item = TransportAddr>,
) -> EndpointAddrAdds a list of addresses.
-Sourcepub fn is_empty(&self) -> bool
Returns true, if only a EndpointId is present.
-Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns a list of IP addresses of this peer.
-Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns a list of relay urls of this peer.
+Sourcepub fn is_empty(&self) -> bool
Returns true if only an EndpointId is present.
+Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns an iterator over the IP addresses of this endpoint address.
+Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns an iterator over the relay URLs of this endpoint address.
In practice this is expected to be zero or one home relay for all known cases currently.
Trait Implementations§
Source§impl Clone for EndpointAddr
Source§fn clone(&self) -> EndpointAddr
Returns a duplicate 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 EndpointAddr
Source§impl<'de> Deserialize<'de> for EndpointAddr
Source§fn deserialize<__D>(
__deserializer: __D,
diff --git a/pr/4036/docs/iroh/struct.NetReport.html b/pr/4036/docs/iroh/struct.NetReport.html
index 693c855529..8b8ec1aed1 100644
--- a/pr/4036/docs/iroh/struct.NetReport.html
+++ b/pr/4036/docs/iroh/struct.NetReport.html
@@ -1,4 +1,4 @@
-NetReport in iroh - Rust NetReport
pub struct NetReport {
+NetReport in iroh - Rust NetReport
pub struct NetReport {
pub udp_v4: bool,
pub udp_v6: bool,
pub mapping_varies_by_dest_ipv4: Option<bool>,
@@ -13,17 +13,16 @@
§udp_v6: boolA QAD IPv6 round trip completed.
§mapping_varies_by_dest_ipv4: Option<bool>Whether the reported public address differs when probing different servers (on IPv4).
§mapping_varies_by_dest_ipv6: Option<bool>Whether the reported public address differs when probing different servers (on IPv6).
-§preferred_relay: Option<RelayUrl>Probe indicating the presence of port mapping protocols on the LAN.
-None for unknown
-§relay_latency: RelayLatencieskeyed by relay Url
-§global_v4: Option<SocketAddrV4>ip:port of global IPv4
-§global_v6: Option<SocketAddrV6>[ip]:port of global IPv6
+§preferred_relay: Option<RelayUrl>The relay server with the lowest latency, if any.
+§relay_latency: RelayLatenciesThe measured latency to each relay, keyed by relay URL.
+§global_v4: Option<SocketAddrV4>The discovered global IPv4 address and port, if any.
+§global_v6: Option<SocketAddrV6>The discovered global IPv6 address and port, if any.
§captive_portal: Option<bool>CaptivePortal is set when we think there’s a captive portal that is
intercepting HTTP traffic.
-Implementations§
Source§impl Report
Sourcepub fn mapping_varies_by_dest(&self) -> Option<bool>
Whether the reported public address differs when probing different servers.
+Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Report
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl PartialEq for Report
Source§impl Eq for Report
Source§impl StructuralPartialEq for Report
Auto Trait Implementations§
§impl Freeze for Report
§impl RefUnwindSafe for Report
§impl Send for Report
§impl Sync for Report
§impl Unpin for Report
§impl UnwindSafe for Report
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/4036/docs/iroh/struct.PublicKey.html b/pr/4036/docs/iroh/struct.PublicKey.html
index f8fb4c5ae2..b725772ddc 100644
--- a/pr/4036/docs/iroh/struct.PublicKey.html
+++ b/pr/4036/docs/iroh/struct.PublicKey.html
@@ -1,5 +1,5 @@
PublicKey in iroh - Rust PublicKey
pub struct PublicKey(/* private fields */);
Expand description
A public key.
-The key itself is stored as the CompressedEdwards y coordinate of the public key
+
The key itself is stored as the CompressedEdwards y-coordinate of the public key.
It is verified to decompress into a valid key when created.
Implementations§
Source§impl PublicKey
Sourcepub fn as_bytes(&self) -> &[u8; 32]
Get this public key as a byte array.
@@ -12,7 +12,7 @@ See [VerifyingKey::from_bytes] for details.
&self,
message: &[u8],
signature: &Signature,
-) -> Result<(), SignatureError>Verify a signature on a message with this secret key’s public key.
+) -> Result<(), SignatureError>Verify a signature on a message with this public key.
§Return
Returns Ok(()) if the signature is valid, and Err otherwise.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PublicKey
Source§fn deserialize<D>(
deserializer: D,
) -> Result<PublicKey, <D as Deserializer<'de>>::Error>where
- D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl From<PublicKey> for EndpointAddr
Source§fn from(endpoint_id: PublicKey) -> EndpointAddr
Converts to this type from the input type.Source§impl From<PublicKey> for EndpointAddr
Source§fn from(endpoint_id: PublicKey) -> EndpointAddr
Converts to this type from the input type.Source§impl FromStr for PublicKey
Parses a PublicKey from its hex or base32 encoding.
+
Display produces the hex encoding.
Source§impl Hash for PublicKey
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
H: Hasher,
diff --git a/pr/4036/docs/iroh/tls/index.html b/pr/4036/docs/iroh/tls/index.html
index 3c1d92cf2a..16f63b088e 100644
--- a/pr/4036/docs/iroh/tls/index.html
+++ b/pr/4036/docs/iroh/tls/index.html
@@ -1,5 +1,5 @@
iroh::tls - Rust Module tls
Expand description
TLS configuration for iroh.
-Currently there is one mechanisms available
+Currently there is one mechanism available:
- Raw Public Keys, using the TLS extension described in RFC 7250
diff --git a/pr/4036/docs/iroh_base/enum.KeyParsingError.html b/pr/4036/docs/iroh_base/enum.KeyParsingError.html
index d0668a511c..7c849cddf2 100644
--- a/pr/4036/docs/iroh_base/enum.KeyParsingError.html
+++ b/pr/4036/docs/iroh_base/enum.KeyParsingError.html
@@ -1,4 +1,4 @@
-KeyParsingError in iroh_base - Rust KeyParsingError
#[non_exhaustive]pub enum KeyParsingError {
+KeyParsingError in iroh_base - Rust KeyParsingError
#[non_exhaustive]pub enum KeyParsingError {
FailedToDecodeHex {
meta: Meta,
},
@@ -11,14 +11,14 @@
InvalidKeyData {
meta: Meta,
},
-}
Available on crate feature key only.Expand description
Error when deserialising a PublicKey or a SecretKey.
+}Available on crate feature key only.Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§FailedToDecodeHex
The input string could not be decoded as hex.
Fields
§meta: MetaCaptured call-site metadata
§FailedToDecodeBase32
The input string could not be decoded as base32.
Fields
§meta: MetaCaptured call-site metadata
§InvalidLength
The input has invalid length.
Fields
§meta: MetaCaptured call-site metadata
-§InvalidKeyData
The decoded data is not a valid Ed25591 public key.
+§InvalidKeyData
The decoded data is not a valid Ed25519 public key.
Fields
§meta: MetaCaptured call-site metadata
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<KeyParsingError> for AnyError
Source§fn from(value: KeyParsingError) -> AnyError
Converts to this type from the input type.Source§impl StackError for KeyParsingError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
Returns the next source in the chain, if any.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.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§
Source§impl<T> Borrow<T> for Twhere
diff --git a/pr/4036/docs/iroh_base/enum.TransportAddr.html b/pr/4036/docs/iroh_base/enum.TransportAddr.html
index ec9989aea4..a55428eb22 100644
--- a/pr/4036/docs/iroh_base/enum.TransportAddr.html
+++ b/pr/4036/docs/iroh_base/enum.TransportAddr.html
@@ -3,8 +3,8 @@
Ip(SocketAddr),
Custom(CustomAddr),
}Available on crate feature key only.Expand description
Available address types.
-Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§Relay(RelayUrl)
Relays
-§Ip(SocketAddr)
IP based addresses
+Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§Relay(RelayUrl)
A relay server address.
+§Ip(SocketAddr)
An IP based address.
§Custom(CustomAddr)
Custom transport address
Implementations§
Source§impl TransportAddr
fn into_address_lookup(
self,
_endpoint: &Endpoint,
diff --git a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
index aca2855501..bdab189c43 100644
--- a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
+++ b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
@@ -1,18 +1,18 @@
-PkarrRelayClient in iroh::address_lookup::pkarr - Rust PkarrRelayClient
pub struct PkarrRelayClient { /* private fields */ }
Expand description
A pkarr client to publish SignedPackets to a pkarr relay.
-Implementations§
Source§impl PkarrRelayClient
Sourcepub fn new(
+PkarrRelayClient in iroh::address_lookup::pkarr - Rust PkarrRelayClient
pub struct PkarrRelayClient { /* private fields */ }
Expand description
A pkarr client to publish SignedPackets to a pkarr relay.
+Implementations§
Source§impl PkarrRelayClient
Sourcepub fn new(
pkarr_relay_url: Url,
tls_config: ClientConfig,
dns_resolver: DnsResolver,
) -> Self
Available on non-wasm_browser only.
Creates a PkarrRelayClient.
-Sourcepub async fn resolve(
&self,
endpoint_id: EndpointId,
) -> Result<SignedPacket, AddressLookupError>
Resolves a SignedPacket for the given EndpointId.
-Sourcepub async fn publish(
&self,
signed_packet: &SignedPacket,
) -> Result<(), PkarrError>
Publishes a SignedPacket.
-
Trait Implementations§
Source§impl Clone for PkarrRelayClient
Source§fn clone(&self) -> PkarrRelayClient
Returns a duplicate 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 PkarrRelayClient
§impl !RefUnwindSafe for PkarrRelayClient
§impl Send for PkarrRelayClient
§impl Sync for PkarrRelayClient
§impl Unpin for PkarrRelayClient
§impl !UnwindSafe for PkarrRelayClient
Blanket Implementations§
Trait Implementations§
Source§impl Clone for PkarrRelayClient
Source§fn clone(&self) -> PkarrRelayClient
Returns a duplicate 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 PkarrRelayClient
§impl !RefUnwindSafe for PkarrRelayClient
§impl Send for PkarrRelayClient
§impl Sync for PkarrRelayClient
§impl Unpin for PkarrRelayClient
§impl !UnwindSafe for PkarrRelayClient
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/4036/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
index 79d8b2e2a8..0c08b03913 100644
--- a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
+++ b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
@@ -1,6 +1,6 @@
-PkarrRelayClientBuilder in iroh::address_lookup::pkarr - Rust PkarrRelayClientBuilder
pub struct PkarrRelayClientBuilder { /* private fields */ }
Expand description
A builder for the PkarrRelayClient
-Implementations§
Source§impl PkarrRelayClientBuilder
Sourcepub fn build(self) -> PkarrRelayClient
Build a PkarrRelayClient.
-Trait Implementations§
Source§impl Clone for PkarrRelayClientBuilder
Source§fn clone(&self) -> PkarrRelayClientBuilder
Returns a duplicate 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 PkarrRelayClientBuilder
§impl !RefUnwindSafe for PkarrRelayClientBuilder
§impl Send for PkarrRelayClientBuilder
§impl Sync for PkarrRelayClientBuilder
§impl Unpin for PkarrRelayClientBuilder
§impl !UnwindSafe for PkarrRelayClientBuilder
Blanket Implementations§
Source§impl<T> Any for Twhere
+PkarrRelayClientBuilder in iroh::address_lookup::pkarr - Rust PkarrRelayClientBuilder
pub struct PkarrRelayClientBuilder { /* private fields */ }
Expand description
A builder for the PkarrRelayClient
+Implementations§
Source§impl PkarrRelayClientBuilder
Sourcepub fn build(self) -> PkarrRelayClient
Build a PkarrRelayClient.
+Trait Implementations§
Source§impl Clone for PkarrRelayClientBuilder
Source§fn clone(&self) -> PkarrRelayClientBuilder
Returns a duplicate 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 PkarrRelayClientBuilder
§impl !RefUnwindSafe for PkarrRelayClientBuilder
§impl Send for PkarrRelayClientBuilder
§impl Sync for PkarrRelayClientBuilder
§impl Unpin for PkarrRelayClientBuilder
§impl !UnwindSafe for PkarrRelayClientBuilder
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/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
index 13e12a4b01..1f7723299d 100644
--- a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
+++ b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
@@ -1,21 +1,21 @@
-PkarrResolver in iroh::address_lookup::pkarr - Rust PkarrResolver
pub struct PkarrResolver { /* private fields */ }
Expand description
Resolver of address lookup information from a pkarr relay.
+PkarrResolver in iroh::address_lookup::pkarr - Rust PkarrResolver
pub struct PkarrResolver { /* private fields */ }
Expand description
Resolver of address lookup information from a pkarr relay.
The resolver uses HTTP to query address lookup information from a pkarr relay server,
see the module docs for details.
This implements the AddressLookup trait to be used as an address lookup service. Note
that it only resolves address lookup information, for the corresponding publisher use
the PkarrPublisher together with AddressLookupServices.
-Implementations§
Source§impl PkarrResolver
Sourcepub fn builder(pkarr_relay: Url) -> PkarrResolverBuilder
Creates a new resolver builder using the pkarr relay server at the URL.
+Implementations§
Source§impl PkarrResolver
Sourcepub fn builder(pkarr_relay: Url) -> PkarrResolverBuilder
Creates a new resolver builder using the pkarr relay server at the URL.
The builder implements AddressLookupBuilder.
-Sourcepub fn n0_dns() -> PkarrResolverBuilder
Creates a pkarr resolver builder which uses the number 0 pkarr relay server.
+Sourcepub fn n0_dns() -> PkarrResolverBuilder
Creates a pkarr resolver builder which uses the number 0 pkarr relay server.
This uses the pkarr relay server operated by number 0 at
N0_DNS_PKARR_RELAY_PROD.
When running with the environment variable IROH_FORCE_STAGING_RELAYS
set to any non empty value N0_DNS_PKARR_RELAY_STAGING
server is used instead.
-Trait Implementations§
Source§impl AddressLookup for PkarrResolver
Trait Implementations§
Source§impl AddressLookup for PkarrResolver
Source§fn resolve(
&self,
endpoint_id: EndpointId,
-) -> Option<BoxStream<Result<AddressLookupItem, AddressLookupError>>>
Source§fn publish(&self, _data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreSource§impl Clone for PkarrResolver
Source§fn clone(&self) -> PkarrResolver
Returns a duplicate 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 PkarrResolver
§impl !RefUnwindSafe for PkarrResolver
§impl Send for PkarrResolver
§impl Sync for PkarrResolver
§impl Unpin for PkarrResolver
§impl !UnwindSafe for PkarrResolver
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
+) -> Option<BoxStream<Result<AddressLookupItem, AddressLookupError>>>Source§fn publish(&self, _data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read more
Source§impl Clone for PkarrResolver
Source§fn clone(&self) -> PkarrResolver
Returns a duplicate 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 PkarrResolver
§impl !RefUnwindSafe for PkarrResolver
§impl Send for PkarrResolver
§impl Sync for PkarrResolver
§impl Unpin for PkarrResolver
§impl !UnwindSafe for PkarrResolver
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
T: AddressLookup,
Source§fn into_address_lookup(
self,
_endpoint: &Endpoint,
diff --git a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
index cfd47f28e6..e549ec9d07 100644
--- a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
+++ b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
@@ -1,11 +1,11 @@
-PkarrResolverBuilder in iroh::address_lookup::pkarr - Rust PkarrResolverBuilder
pub struct PkarrResolverBuilder { /* private fields */ }
Expand description
Builder for PkarrResolver.
+PkarrResolverBuilder in iroh::address_lookup::pkarr - Rust PkarrResolverBuilder
pub struct PkarrResolverBuilder { /* private fields */ }
Expand description
Builder for PkarrResolver.
-Implementations§
Source§impl PkarrResolverBuilder
Sourcepub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self
Available on non-wasm_browser only.
Sets the DNS resolver to use for resolving the pkarr relay URL.
-Sourcepub fn build(self, tls_config: ClientConfig) -> PkarrResolver
Creates a PkarrResolver from this builder.
-Trait Implementations§
Implementations§
Source§impl PkarrResolverBuilder
Sourcepub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self
Available on non-wasm_browser only.
Sets the DNS resolver to use for resolving the pkarr relay URL.
+Sourcepub fn build(self, tls_config: ClientConfig) -> PkarrResolver
Creates a PkarrResolver from this builder.
+Trait Implementations§
Source§impl AddressLookupBuilder for PkarrResolverBuilder
Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this builder into a ready-to-use AddressLookup. Read moreAuto Trait Implementations§
§impl Freeze for PkarrResolverBuilder
§impl !RefUnwindSafe for PkarrResolverBuilder
§impl Send for PkarrResolverBuilder
§impl Sync for PkarrResolverBuilder
§impl Unpin for PkarrResolverBuilder
§impl !UnwindSafe for PkarrResolverBuilder
Blanket Implementations§
Source§impl<T> Any for Twhere
+) -> Result<impl AddressLookup, AddressLookupBuilderError>Turns this builder into a ready-to-use AddressLookup. Read more
Auto Trait Implementations§
§impl Freeze for PkarrResolverBuilder
§impl !RefUnwindSafe for PkarrResolverBuilder
§impl Send for PkarrResolverBuilder
§impl Sync for PkarrResolverBuilder
§impl Unpin for PkarrResolverBuilder
§impl !UnwindSafe for PkarrResolverBuilder
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/4036/docs/iroh/address_lookup/struct.EndpointData.html b/pr/4036/docs/iroh/address_lookup/struct.EndpointData.html
index 1ea4773718..7de6a2dd89 100644
--- a/pr/4036/docs/iroh/address_lookup/struct.EndpointData.html
+++ b/pr/4036/docs/iroh/address_lookup/struct.EndpointData.html
@@ -13,15 +13,15 @@ services, should they not fit into e.g. a single DNS packet otherwise.
See also Self::set_user_data.
Sourcepub fn add_relay_url(&mut self, relay_url: RelayUrl)
Adds the relay URL to the end of the endpoint data, unless it already existed.
Sourcepub fn add_ip_addrs(&mut self, addresses: Vec<SocketAddr>)
Adds addresses in order with duplicates or already existing addresses filtered out.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Adds addresses to the endpoint data in the given ordered, but with duplicates filtered.
-Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data and returns the updated endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Adds addresses to the endpoint data in the given order, but with duplicates filtered.
+Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data.
Sourcepub fn clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn clear_relay_urls(&mut self)
Removes all relay URLs from the endpoint data.
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses.
+Sourcepub fn filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
Returns a vec to allow re-ordering of addresses.
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
diff --git a/pr/4036/docs/iroh/address_lookup/struct.Item.html b/pr/4036/docs/iroh/address_lookup/struct.Item.html
index 9e63b37130..28d59f6feb 100644
--- a/pr/4036/docs/iroh/address_lookup/struct.Item.html
+++ b/pr/4036/docs/iroh/address_lookup/struct.Item.html
@@ -16,14 +16,14 @@ directly from Sourcepub fn last_updated(&self) -> Option<u64>
Returns the optional timestamp when this endpoint info was last updated.
The value is microseconds since the unix epoch.
-Sourcepub fn to_endpoint_addr(&self) -> EndpointAddr
Converts into a EndpointAddr by cloning the needed fields.
-Sourcepub fn into_endpoint_addr(self) -> EndpointAddr
Converts into a EndpointAddr without cloning.
+Sourcepub fn to_endpoint_addr(&self) -> EndpointAddr
Returns an EndpointAddr by cloning the needed fields.
+Sourcepub fn into_endpoint_addr(self) -> EndpointAddr
Converts into an EndpointAddr without cloning.
Methods from Deref<Target = EndpointData>§
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses.
+Sourcepub fn filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
Returns a vec to allow re-ordering of addresses.
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
diff --git a/pr/4036/docs/iroh/address_lookup/struct.UserData.html b/pr/4036/docs/iroh/address_lookup/struct.UserData.html
index 49c2183d40..5ae8665e57 100644
--- a/pr/4036/docs/iroh/address_lookup/struct.UserData.html
+++ b/pr/4036/docs/iroh/address_lookup/struct.UserData.html
@@ -1,4 +1,5 @@
-UserData in iroh::address_lookup - Rust 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.
+UserData in iroh::address_lookup - Rust UserData
pub struct UserData(/* private fields */);
Expand description
User-defined data that can be published and resolved through endpoint discovery.
+Under the hood this is a UTF-8 string 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.
diff --git a/pr/4036/docs/iroh/address_lookup/trait.AddressLookup.html b/pr/4036/docs/iroh/address_lookup/trait.AddressLookup.html
index 1be6efa3e6..79a8044def 100644
--- a/pr/4036/docs/iroh/address_lookup/trait.AddressLookup.html
+++ b/pr/4036/docs/iroh/address_lookup/trait.AddressLookup.html
@@ -22,7 +22,7 @@ Address Lookup information changes. If an Address Lookup mechanism requires a pe
refresh, it should start its own task.
Provided Methods§
Sourcefn publish(&self, _data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism.
This is fire and forget, since the Endpoint can not wait for successful
-publishing. If publishing is async, the implementation should start it’s own task.
+publishing. If publishing is async, the implementation should start its own task.
This will be called from a tokio task, so it is safe to spawn new tasks.
These tasks will be run on the runtime of the super::Endpoint.
Implementations on Foreign Types§
Source§impl<T: AddressLookup> AddressLookup for Arc<T>
Implementors§
Source§impl AddressLookup for DnsAddressLookup
Available on non-wasm_browser only. Source§impl AddressLookup for MemoryLookup
Source§impl AddressLookup for PkarrPublisher
Source§impl AddressLookup for PkarrResolver
Source§impl<T: AddressLookup> AddressLookup for FilteredAddressLookup<T>
\ No newline at end of file
+) -> Option<BoxStream<Result<Item, Error>>>Implementors§
Source§impl AddressLookup for DnsAddressLookup
Available on non-wasm_browser only. Source§impl AddressLookup for MemoryLookup
Source§impl AddressLookup for PkarrPublisher
Source§impl AddressLookup for PkarrResolver
Source§impl<T: AddressLookup> AddressLookup for FilteredAddressLookup<T>
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/address_lookup/trait.AddressLookupBuilder.html b/pr/4036/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
index 35aadc4338..edc4dff899 100644
--- a/pr/4036/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
+++ b/pr/4036/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
@@ -20,5 +20,5 @@ endpoint to Endpoint,
) -> Result<impl AddressLookup, AddressLookupBuilderError>Turns this builder into a ready-to-use AddressLookup.
If an error is returned, building the endpoint will fail with this error.
-Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
Source§impl AddressLookupBuilder for DnsAddressLookupBuilder
Available on non-wasm_browser only. Source§impl AddressLookupBuilder for PkarrPublisherBuilder
Source§impl AddressLookupBuilder for PkarrResolverBuilder
Source§impl<T: AddressLookup> AddressLookupBuilder for T
Blanket no-op impl of AddressLookupBuilder for T: AddressLookup.
+ Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
Source§impl AddressLookupBuilder for DnsAddressLookupBuilder
Available on non-wasm_browser only. Source§impl AddressLookupBuilder for PkarrPublisherBuilder
Source§impl AddressLookupBuilder for PkarrResolverBuilder
Source§impl<T: AddressLookup> AddressLookupBuilder for T
Blanket no-op impl of AddressLookupBuilder for T: AddressLookup.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/defaults/prod/fn.default_ap_relay.html b/pr/4036/docs/iroh/defaults/prod/fn.default_ap_relay.html
index 5961b7d1ab..3a67b98b91 100644
--- a/pr/4036/docs/iroh/defaults/prod/fn.default_ap_relay.html
+++ b/pr/4036/docs/iroh/defaults/prod/fn.default_ap_relay.html
@@ -1,2 +1,2 @@
-default_ap_relay in iroh::defaults::prod - Rust default_ap_relay
pub fn default_ap_relay() -> RelayConfig
Expand description
Get the default RelayConfig for Asia-Pacific
+default_ap_relay in iroh::defaults::prod - Rust default_ap_relay
pub fn default_ap_relay() -> RelayConfig
Expand description
Get the default RelayConfig for Asia-Pacific.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/defaults/prod/index.html b/pr/4036/docs/iroh/defaults/prod/index.html
index 8981fb6be4..b076bc3ce3 100644
--- a/pr/4036/docs/iroh/defaults/prod/index.html
+++ b/pr/4036/docs/iroh/defaults/prod/index.html
@@ -1,2 +1,2 @@
iroh::defaults::prod - Rust Module prod
Expand description
Production configuration.
-Constants§
- AP_
RELAY_HOSTNAME - Hostname of the default Asia-Pacific relay.
- EU_
RELAY_HOSTNAME - Hostname of the default EU relay.
- NA_
EAST_RELAY_HOSTNAME - Hostname of the default NA east relay.
- NA_
WEST_RELAY_HOSTNAME - Hostname of the default NA west relay.
Functions§
- default_
ap_relay - Get the default
RelayConfig for Asia-Pacific - default_
eu_relay - Get the default
RelayConfig for EU. - default_
na_east_relay - Get the default
RelayConfig for NA east. - default_
na_west_relay - Get the default
RelayConfig for NA west. - default_
relay_map - Get the default
RelayMap.
\ No newline at end of file
+Constants§
- AP_
RELAY_HOSTNAME - Hostname of the default Asia-Pacific relay.
- EU_
RELAY_HOSTNAME - Hostname of the default EU relay.
- NA_
EAST_RELAY_HOSTNAME - Hostname of the default NA east relay.
- NA_
WEST_RELAY_HOSTNAME - Hostname of the default NA west relay.
Functions§
- default_
ap_relay - Get the default
RelayConfig for Asia-Pacific. - default_
eu_relay - Get the default
RelayConfig for EU. - default_
na_east_relay - Get the default
RelayConfig for NA east. - default_
na_west_relay - Get the default
RelayConfig for NA west. - default_
relay_map - Get the default
RelayMap.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/dns/struct.DnsResolver.html b/pr/4036/docs/iroh/dns/struct.DnsResolver.html
index 754fa26465..3f8c6e27b6 100644
--- a/pr/4036/docs/iroh/dns/struct.DnsResolver.html
+++ b/pr/4036/docs/iroh/dns/struct.DnsResolver.html
@@ -15,7 +15,7 @@ public DNS.
Implementations§
Source§impl DnsResolver
Sourcepub fn new() -> DnsResolver
Creates 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.
+to the default ResolverConfig which uses e.g. Google’s 8.8.8.8 or 8.8.4.4.
Sourcepub fn with_nameserver(nameserver: SocketAddr) -> DnsResolver
Creates a new DNS resolver configured with a single UDP DNS nameserver.
Sourcepub fn custom(resolver: impl Resolver) -> DnsResolver
Creates a new DnsResolver from a struct that implements Resolver.
diff --git a/pr/4036/docs/iroh/dns/trait.Resolver.html b/pr/4036/docs/iroh/dns/trait.Resolver.html
index 4aaa7642fd..3ebf87a01f 100644
--- a/pr/4036/docs/iroh/dns/trait.Resolver.html
+++ b/pr/4036/docs/iroh/dns/trait.Resolver.html
@@ -38,13 +38,13 @@ atomic swap. Build a new instance with re-bound sockets and re-read nameserver
configuration rather than mutating in place. Must not perform IO: defer DNS
queries and socket binds until the new resolver is first used. May be called
concurrently, in which case all but one allocated replacement is dropped unused.
-Implementations on Foreign Types§
Implementations on Foreign Types§
Source§impl Resolver for Arc<SimpleDnsResolver>
Source§fn lookup_ipv4(
&self,
host: String,
-) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = Ipv4Addr> + Send>, DnsError>> + Send>>
Source§fn lookup_ipv6(
+) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = Ipv4Addr> + Send>, DnsError>> + Send>>
Source§fn lookup_ipv6(
&self,
host: String,
-) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = Ipv6Addr> + Send>, DnsError>> + Send>>
Source§fn lookup_txt(
+) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = Ipv6Addr> + Send>, DnsError>> + Send>>
Source§fn lookup_txt(
&self,
host: String,
-) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = TxtRecordData> + Send>, DnsError>> + Send>>
Source§fn clear_cache(&self)
Source§fn reset(&self) -> Box<dyn Resolver>
Implementors§
\ No newline at end of file
+) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = TxtRecordData> + Send>, DnsError>> + Send>>Source§fn clear_cache(&self)
Source§fn reset(&self) -> Box<dyn Resolver>
Implementors§
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html b/pr/4036/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html
index 0a8e0c05eb..cc00fac5e1 100644
--- a/pr/4036/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html
+++ b/pr/4036/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html
@@ -1,2 +1,2 @@
-ENV_FORCE_STAGING_RELAYS in iroh::endpoint - Rust ENV_FORCE_STAGING_RELAYS
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 ENV_FORCE_STAGING_RELAYS
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint/enum.RelayMode.html b/pr/4036/docs/iroh/endpoint/enum.RelayMode.html
index 326aae7405..0d7b755897 100644
--- a/pr/4036/docs/iroh/endpoint/enum.RelayMode.html
+++ b/pr/4036/docs/iroh/endpoint/enum.RelayMode.html
@@ -1,4 +1,4 @@
-RelayMode in iroh::endpoint - Rust RelayMode
pub enum RelayMode {
+RelayMode in iroh::endpoint - Rust RelayMode
pub enum RelayMode {
Disabled,
Default,
Staging,
@@ -10,14 +10,14 @@ This means that neither listening nor dialing relays will be available.
See crate::defaults::prod for the severs used.
§Staging
Use the staging relay servers from n0.
§Custom(RelayMap)
Use a custom relay map.
-
Implementations§
Source§impl RelayMode
Sourcepub fn custom(map: impl IntoIterator<Item = RelayUrl>) -> Self
Create a custom relay mode from a list of RelayUrls.
+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§
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/4036/docs/iroh/endpoint/fn.default_relay_mode.html b/pr/4036/docs/iroh/endpoint/fn.default_relay_mode.html
index d716677abc..98ff3579ee 100644
--- a/pr/4036/docs/iroh/endpoint/fn.default_relay_mode.html
+++ b/pr/4036/docs/iroh/endpoint/fn.default_relay_mode.html
@@ -1,4 +1,4 @@
-default_relay_mode in iroh::endpoint - Rust default_relay_mode
pub fn default_relay_mode() -> RelayMode
Expand description
Returns the default relay mode.
+default_relay_mode in iroh::endpoint - Rust default_relay_mode
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint/fn.force_staging_infra.html b/pr/4036/docs/iroh/endpoint/fn.force_staging_infra.html
index ff8dda7e69..b444491b3e 100644
--- a/pr/4036/docs/iroh/endpoint/fn.force_staging_infra.html
+++ b/pr/4036/docs/iroh/endpoint/fn.force_staging_infra.html
@@ -1,2 +1,2 @@
-force_staging_infra in iroh::endpoint - Rust force_staging_infra
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 force_staging_infra
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint/index.html b/pr/4036/docs/iroh/endpoint/index.html
index 2efb803d4c..f3a98d45f2 100644
--- a/pr/4036/docs/iroh/endpoint/index.html
+++ b/pr/4036/docs/iroh/endpoint/index.html
@@ -1,4 +1,4 @@
-iroh::endpoint - Rust Module endpoint
Expand description
The Endpoint allows establishing connections to other iroh endpoints.
+iroh::endpoint - Rust Module endpoint
Expand description
The Endpoint allows establishing connections to other iroh endpoints.
The Endpoint is the main API interface to manage a local iroh endpoint. It allows
connecting to and accepting connections from other endpoints. See the module docs for
more details on how iroh connections work.
diff --git a/pr/4036/docs/iroh/endpoint/presets/index.html b/pr/4036/docs/iroh/endpoint/presets/index.html
index 37b792c03d..a454626701 100644
--- a/pr/4036/docs/iroh/endpoint/presets/index.html
+++ b/pr/4036/docs/iroh/endpoint/presets/index.html
@@ -2,4 +2,4 @@
§Example
use iroh::{Endpoint, RelayMode, Watcher, endpoint::presets};
-let endpoint = Endpoint::builder(presets::N0).bind().await?;
Structs§
- Empty
- An empty preset that doesn’t set anything on the builder.
- Minimal
with_crypto_provider - A preset that is almost empty, besides setting mandatory options.
- N0
with_crypto_provider - Configures the endpoint to use the n0 defaults
- N0Disable
Relay with_crypto_provider - Configures the endpoint to use the n0 defaults, but with relay mode disabled.
Traits§
- Preset
- Defines a preset
\ No newline at end of file
+let endpoint = Endpoint::builder(presets::N0).bind().await?;Structs§
- Empty
- An empty preset that doesn’t set anything on the builder.
- Minimal
with_crypto_provider - A preset that is almost empty, besides setting mandatory options.
- N0
with_crypto_provider - Configures the endpoint to use the n0 defaults
- N0Disable
Relay with_crypto_provider - Configures the endpoint to use the n0 defaults, but with relay mode disabled.
Traits§
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint/presets/struct.N0.html b/pr/4036/docs/iroh/endpoint/presets/struct.N0.html
index 41c532b301..cf9fb0156e 100644
--- a/pr/4036/docs/iroh/endpoint/presets/struct.N0.html
+++ b/pr/4036/docs/iroh/endpoint/presets/struct.N0.html
@@ -6,8 +6,8 @@
setting the [rustls::crypto::CryptoProvider] to ring or aws-lc-rs, depending
on which feature is enabled in iroh (preferring ring if both are enabled).
-Due to the last point, this preset is only available with the ring or
-aws-lc-rs preset installed.
+
Due to the last point, this preset is only available with the tls-ring or
+tls-aws-lc-rs feature enabled.
If you want to set your own crypto provider, we recommend copying the
implementation of this preset into your own and setting the appropriate crypto
provider there.
diff --git a/pr/4036/docs/iroh/endpoint/presets/struct.N0DisableRelay.html b/pr/4036/docs/iroh/endpoint/presets/struct.N0DisableRelay.html
index dd14c88ba9..29795833c9 100644
--- a/pr/4036/docs/iroh/endpoint/presets/struct.N0DisableRelay.html
+++ b/pr/4036/docs/iroh/endpoint/presets/struct.N0DisableRelay.html
@@ -7,8 +7,8 @@ relay urls.
setting the [rustls::crypto::CryptoProvider] to ring or aws-lc-rs, depending
on which feature is enabled in iroh (preferring ring if both are enabled).
-Due to the last point, this preset is only available with the ring or
-aws-lc-rs preset installed.
+
Due to the last point, this preset is only available with the tls-ring or
+tls-aws-lc-rs feature enabled.
If you want to set your own crypto provider, we recommend copying the
implementation of this preset into your own and setting the appropriate crypto
provider there.
diff --git a/pr/4036/docs/iroh/endpoint/presets/trait.Preset.html b/pr/4036/docs/iroh/endpoint/presets/trait.Preset.html
index 59a71a95da..7e6f4bbcac 100644
--- a/pr/4036/docs/iroh/endpoint/presets/trait.Preset.html
+++ b/pr/4036/docs/iroh/endpoint/presets/trait.Preset.html
@@ -1,7 +1,7 @@
-Preset in iroh::endpoint::presets - Rust Preset
pub trait Preset {
+Preset in iroh::endpoint::presets - Rust Preset
pub trait Preset {
// Required method
fn apply(self, builder: Builder) -> Builder;
-}
Expand description
Defines a preset
+}Expand description
A reusable bundle of endpoint Builder configuration.
Required Methods§
Implementations on Foreign Types§
Source§impl Preset for Arc<TestTransport>
Available on crate feature unstable-custom-transports and (crate features test-utils) only.
Source§fn apply(self, builder: Builder) -> Builder
Configures the builder with this transport and the network’s address lookup.
§Example
diff --git a/pr/4036/docs/iroh/endpoint/struct.Builder.html b/pr/4036/docs/iroh/endpoint/struct.Builder.html
index 79894b8924..7cbb050d5e 100644
--- a/pr/4036/docs/iroh/endpoint/struct.Builder.html
+++ b/pr/4036/docs/iroh/endpoint/struct.Builder.html
@@ -92,7 +92,7 @@ is set to false explicitly.
destination addresses. It is valid to configure this, but no more than one such
socket should be bound or the routing will be non-deterministic.
To use a subnet with a non-zero prefix length as the default route in addition to
-being routed when its prefix matches, use `BindOpts::set_is_default_route.
+being routed when its prefix matches, use BindOpts::set_is_default_route.
Subnets with a prefix length of zero are always marked as default routes.
Finally note that most outgoing datagrams are part of an existing network flow. That
is, they are in response to an incoming datagram. In this case the outgoing datagram
@@ -142,7 +142,7 @@ direct addresses or relay URLs will fail.
Sourcepub fn addr_filter(self, filter: AddrFilter) -> Self
Sets the address filter applied to all address data before publishing.
This filter is applied once, at the AddressLookupServices level, before
distributing data to any individual address lookup service. This ensures
-consistent filtering regardless of how the services configured.
+consistent filtering regardless of how the services are configured.
Sourcepub fn clear_addr_filter(self) -> Self
Clears the address filter, allowing all addresses to be published.
This removes any filter previously set via Self::addr_filter, including
filters set by presets.
diff --git a/pr/4036/docs/iroh/endpoint/struct.ConnectOptions.html b/pr/4036/docs/iroh/endpoint/struct.ConnectOptions.html
index 30bf2e329e..3834b0244e 100644
--- a/pr/4036/docs/iroh/endpoint/struct.ConnectOptions.html
+++ b/pr/4036/docs/iroh/endpoint/struct.ConnectOptions.html
@@ -1,12 +1,12 @@
-ConnectOptions in iroh::endpoint - Rust ConnectOptions
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 ConnectOptions
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 QuicTransportConfig.
-Sourcepub fn with_transport_config(
+
Sourcepub fn with_transport_config(
self,
transport_config: QuicTransportConfig,
) -> Self
Sets the QUIC transport config options for this connection.
-Sourcepub fn with_additional_alpns(self, alpns: Vec<Vec<u8>>) -> Self
Sets ALPN identifiers that should be signaled as supported on connection, in
+
Sourcepub fn with_additional_alpns(self, alpns: Vec<Vec<u8>>) -> Self
Sets ALPN identifiers that should be signaled as supported on connection, in
addition to the main ALPN identifier used in Endpoint::connect_with_opts.
This allows connecting to servers that may only support older versions of your
protocol. In this case, you would add the older ALPN identifiers with this
@@ -20,7 +20,7 @@ list or the main ALPN identifiers on the accept side, see the endpoint
builder’s Builder::alpns function.
-Trait Implementations§
Source§impl Clone for ConnectOptions
Source§fn clone(&self) -> ConnectOptions
Returns a duplicate 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 duplicate 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/4036/docs/iroh/endpoint/struct.Connection.html b/pr/4036/docs/iroh/endpoint/struct.Connection.html
index ffc93497ee..74f53832af 100644
--- a/pr/4036/docs/iroh/endpoint/struct.Connection.html
+++ b/pr/4036/docs/iroh/endpoint/struct.Connection.html
@@ -8,7 +8,7 @@ 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<T: ConnectionState> Connection<T>
Implementations§
Source§impl<T: ConnectionState> Connection<T>
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.
@@ -18,13 +18,13 @@ consequence, the peer won’t be notified that a stream has been opened until th
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_bi(&self) -> AcceptBi<'_> ⓘ
Accepts 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 async fn closed(&self) -> ConnectionError
Waits 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.
@@ -97,17 +97,18 @@ strong and pseudorandom, and are suitable for use as keying material.
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)
See [noq_proto::TransportConfig::receive_window].
-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)
Sets the connection-level flow control receive window.
+See [noq_proto::TransportConfig::receive_window].
+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.
-Source§impl Connection<HandshakeCompleted>
Sourcepub fn remote_id(&self) -> EndpointId
Returns the EndpointId from the peer’s TLS certificate.
+Source§impl Connection<HandshakeCompleted>
Sourcepub fn remote_id(&self) -> EndpointId
Returns the EndpointId from the peer’s TLS certificate.
The PublicKey of an endpoint is also known as an EndpointId. This PublicKey is
included in the TLS certificate presented during the handshake when connecting.
This function allows you to get the EndpointId of the remote endpoint of this
connection.
-Sourcepub fn paths(&self) -> PathList<'_>
Returns the currently open network paths for this connection.
+Sourcepub fn paths(&self) -> PathList<'_>
Returns the currently open network paths for this connection.
A connection typically has one path via the relay server and,
once holepunching succeeds, a direct path. The returned
PathList is a snapshot taken at call time: it does not
@@ -116,14 +117,14 @@ already closed.
To observe changes over time, see Connection::paths_stream
for a stream of PathList snapshots and
Connection::path_events for individual PathEvents.
-Sourcepub fn paths_stream(&self) -> PathListStream<'_>
Returns a stream of PathList snapshots for this connection.
+Sourcepub fn paths_stream(&self) -> PathListStream<'_>
Returns a stream of PathList snapshots for this connection.
Yields the current snapshot on the first poll, and a fresh
snapshot whenever the open paths or the selected path change.
Ends when the connection closes.
The stream borrows this Connection. To consume it from a
spawned task, move a Connection clone into the task and
call this method inside.
-Sourcepub fn path_events(&self) -> PathEventStream
Returns a stream of PathEvents for this connection.
+Sourcepub fn path_events(&self) -> PathEventStream
Returns a stream of PathEvents for this connection.
Each event reports one of: a path opened, a path closed (with
final per-path statistics), the selected transmission path
changed, or the consumer fell behind. The stream ends when the
@@ -133,14 +134,14 @@ may be moved into a spawned task.
single PathEvent::Lagged; the current state of the open
paths and the selected path remains recoverable via
Connection::paths.
-Sourcepub fn weak_handle(&self) -> WeakConnectionHandle
Returns a WeakConnectionHandle for this connection.
+Sourcepub fn weak_handle(&self) -> WeakConnectionHandle
Returns a WeakConnectionHandle for this connection.
A WeakConnectionHandle does not keep the connection alive. It can be used to
wait for the connection to be closed via WeakConnectionHandle::closed and to
attempt to upgrade back to a strong Connection via
WeakConnectionHandle::upgrade.
-Source§impl Connection<IncomingZeroRtt>
Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
-Sourcepub async fn handshake_completed(&self) -> Result<Connection, ConnectingError>
Waits until the full handshake occurs and then returns a Connection.
+Source§impl Connection<IncomingZeroRtt>
Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
+Sourcepub async fn handshake_completed(&self) -> Result<Connection, ConnectingError>
Waits until the full handshake occurs and then returns a Connection.
This may fail with ConnectingError::ConnectionError, if there was
some general failure with the connection, such as a network timeout since
we accepted the connection.
@@ -149,18 +150,18 @@ doesn’t use the right TLS authentication, which usually every iroh endpoint
uses and requires.
Thus, those errors should only occur if someone connects to you with a
modified iroh endpoint or with a plain QUIC client.
-Sourcepub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError>
Returns the EndpointId from the peer’s TLS certificate.
+Sourcepub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError>
Returns the EndpointId from the peer’s TLS certificate.
The PublicKey of an endpoint is also known as an EndpointId. This PublicKey is
included in the TLS certificate presented during the handshake when connecting.
This function allows you to get the EndpointId of the remote endpoint of this
connection.
-Source§impl Connection<OutgoingZeroRtt>
Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
+Sourcepub async fn handshake_completed(
&self,
) -> Result<ZeroRttStatus, ConnectingError>
Waits until the full handshake occurs and returns a ZeroRttStatus.
-If ZeroRttStatus::Accepted is returned, than any streams created before
+
If ZeroRttStatus::Accepted is returned, then any streams created before
the handshake has completed can still be used.
-If ZeroRttStatus::Rejected is returned, than any streams created before
+
If ZeroRttStatus::Rejected is returned, then any streams created before
the handshake will error and any data sent should be re-sent on a
new stream.
This may fail with ConnectingError::ConnectionError, if there was
@@ -171,7 +172,7 @@ doesn’t use the right TLS authentication, which usually every iroh endpoint
uses and requires.
Thus, those errors should only occur if someone connects to you with a
modified iroh endpoint or with a plain QUIC client.
-Sourcepub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError>
Returns the EndpointId from the peer’s TLS certificate.
+Sourcepub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError>
Returns the EndpointId from the peer’s TLS certificate.
The PublicKey of an endpoint is also known as an EndpointId. This PublicKey is
included in the TLS certificate presented during the handshake when connecting.
This function allows you to get the EndpointId of the remote endpoint of this
diff --git a/pr/4036/docs/iroh/endpoint/struct.Endpoint.html b/pr/4036/docs/iroh/endpoint/struct.Endpoint.html
index cfd63c979e..0c6c2630b7 100644
--- a/pr/4036/docs/iroh/endpoint/struct.Endpoint.html
+++ b/pr/4036/docs/iroh/endpoint/struct.Endpoint.html
@@ -13,7 +13,7 @@ behaviour.
Endpoint::connect and Endpoint::accept methods. Once established, the
Connection gives access to most QUIC features. Individual streams to send data to
the peer are created using the Connection::open_bi, Connection::accept_bi,
-Connection::open_uni and Connection::open_bi functions.
+Connection::open_uni and Connection::accept_uni 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.
§Usage on Android
@@ -22,7 +22,7 @@ through JNI, which needs a JVM context published to DnsResolver for the supported
initialization paths.
-Implementations§
Source§impl Endpoint
Implementations§
Source§impl Endpoint
Sourcepub fn set_alpns(&self, alpns: Vec<Vec<u8>>)
Sets the list of accepted ALPN protocols.
This will only affect new incoming connections.
@@ -117,8 +117,8 @@ changes.
understand if the endpoint has ever been considered “online”. But after
that initial call to Endpoint::online, to understand if your
endpoint is no longer able to be connected to by endpoints outside
-of the private or local network, watch for changes in it’s EndpointAddr.
-If there are no addrsin the EndpointAddr, you may not be dialable by other endpoints
+of the private or local network, watch for changes in its EndpointAddr.
+If there are no addrs in the EndpointAddr, you may not be dialable by other endpoints
on the internet.
The EndpointAddr will change as:
@@ -146,7 +146,7 @@ tokio::spawn(endpoint_closed.run_until(async move {
}));
// Do fancy things, then close the endpoint.
// Our task above will stop even if there are still clones of `Endpoint` alive somewhere.
-endpoint.close().await;
Sourcepub async fn online(&self)
A convenience method that waits for the endpoint to be considered “online”.
This currently means at least one relay server has completed its
connection handshake (i.e. the endpoint is registered and reachable
via that relay). Merely selecting a relay URL is not sufficient.
@@ -167,49 +167,45 @@ entirely.
The online method does not interact with crate::address_lookup::AddressLookup
services, which means that any Address Lookup that relies on a WAN
connection is independent of the endpoint’s online status.
-§Examples
use iroh::Endpoint;
-
-#[tokio::main]
-async fn main() {
-// After this await returns, the endpoint is bound to a local socket.
-// It can be dialed, but almost certainly hasn't finished picking a
+§Examples
+// After this await returns, the endpoint is bound to a local socket.
+// It can be dialed, but almost certainly hasn't finished picking a
// relay.
-let endpoint = Endpoint::bind().await;
+let endpoint = Endpoint::bind(presets::N0).await?;
-// After this await returns we have a connection to at least one relay
+// After this await returns we have a connection to at least one relay
// and holepunching should work as expected.
-endpoint.online().await;
-}
Sourcepub fn home_relay_status(
+endpoint.online().await;
Sourcepub fn home_relay_status(
&self,
) -> impl Watcher<Value = Vec<RelayStatus>> + use<>
Returns a Watcher over the connection status of the endpoint’s home relays.
The watched value has one entry per home relay whose URL is known,
and is empty when no relays are configured or before the endpoint has
-selected one the home relay from the list of configured relays.
+selected a home relay from the list of configured relays.
The watcher updates whenever any home relay’s connection status changes.
See RelayStatus for the information available on each entry.
The returned watcher only becomes disconnected once the last clone of
the Endpoint is dropped. Closing the endpoint does not disconnect
the watcher. To stop a task once the endpoint stops, combine with
Self::closed.
-Sourcepub fn bound_sockets(&self) -> Vec<SocketAddr>
Available on non-wasm_browser only.
Returns the local socket addresses on which the underlying sockets are bound.
+Sourcepub fn bound_sockets(&self) -> Vec<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 dns_resolver(&self) -> Result<&DnsResolver, EndpointError>
Available on non-wasm_browser only.
Returns the DNS resolver used in this Endpoint.
+Sourcepub fn dns_resolver(&self) -> Result<&DnsResolver, EndpointError>
Available on non-wasm_browser only.
Sourcepub fn tls_config(&self) -> &ClientConfig
Returns the [rustls::ClientConfig] used by the endpoint for connecting to external services.
+Sourcepub fn tls_config(&self) -> &ClientConfig
Returns the [rustls::ClientConfig] used by the endpoint for connecting to external services.
This might be useful for address lookup services or other functions
that want to use the same trust anchors as iroh does for verifying the
validity of TLS certificates presented by external services.
Note that this TLS config is unrelated to how iroh validates the authenticity
of iroh connections itself.
The config is based on the trust anchors set via Builder::ca_tls_config.
-Sourcepub fn address_lookup(&self) -> Result<&AddressLookupServices, EndpointError>
Returns the Address Lookup service, if configured.
+Sourcepub fn address_lookup(&self) -> Result<&AddressLookupServices, EndpointError>
Returns the Address Lookup service, if configured.
§Errors
Returns a EndpointError::Closed error if the endpoint is closed.
-Sourcepub fn metrics(&self) -> &EndpointMetrics
Available on crate feature metrics only.
Returns metrics collected for this endpoint.
+Sourcepub fn metrics(&self) -> &EndpointMetrics
Available on crate feature metrics only.
Returns metrics collected for this endpoint.
The endpoint internally collects various metrics about its operation.
The returned EndpointMetrics struct contains all of these metrics.
You can access individual metrics directly by using the public fields:
@@ -275,13 +271,13 @@ registry.write().unwrap().register_all(endpoint.metrics());
.std_context("text")?;
assert!(res.contains(r#"TYPE socket_recv_datagrams counter"#));
-assert!(res.contains(r#"socket_recv_datagrams_total 0"#));Sourcepub async fn remote_info(&self, endpoint_id: EndpointId) -> Option<RemoteInfo>
Returns addressing information about a recently used remote endpoint.
+assert!(res.contains(r#"socket_recv_datagrams_total 0"#));Sourcepub async fn remote_info(&self, endpoint_id: EndpointId) -> Option<RemoteInfo>
Returns addressing information about a recently used remote endpoint.
The returned RemoteInfo contains a list of all transport addresses for the remote
that we know about. This is a snapshot in time and not a watcher.
Returns None if the endpoint doesn’t have information about the remote or if the endpoint is closed.
When remote endpoints are no longer used, our endpoint will keep information around
for a little while, and then drop it. Afterwards, this will return None.
-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
@@ -290,14 +286,14 @@ 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.
If the endpoint is closed, this method will log a warning and ignore the request.
-Sourcepub fn set_user_data_for_address_lookup(&self, user_data: Option<UserData>)
Sets the initial user-defined data to be published in Address Lookups for this endpoint.
+Sourcepub fn set_user_data_for_address_lookup(&self, user_data: Option<UserData>)
Sets the initial user-defined data to be published in Address Lookups for this endpoint.
If the user-defined data passed to this function is different to the previous one,
the endpoint will republish its endpoint info to the configured Address Lookups.
See also Builder::user_data_for_address_lookup for setting an initial value when
building the endpoint.
If the endpoint is closed, this method will log a warning and ignore the
request.
-Sourcepub async fn close(&self)
Closes the QUIC endpoint and the 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.
@@ -322,9 +318,9 @@ sockets. This is due to QUIC and its acknowledgments being implemented in user-l
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.
-Sourcepub fn closed(&self) -> EndpointClosed ⓘ
Returns a future that resolves once the endpoint closes.
+the respective Endpoint are dropped.
+Sourcepub fn closed(&self) -> EndpointClosed ⓘ
Returns a future that resolves once the endpoint closes.
The returned future does not contain a clone or reference to the Endpoint,
so keeping the returned future alive does not prevent the endpoint from being dropped.
To run a task and stop it once the endpoint closes, you can use
@@ -333,7 +329,7 @@ so keeping the returned future alive does not prevent the endpoint from being dr
let endpoint = Endpoint::bind(presets::N0).await?;
tokio::spawn(endpoint.closed().run_until(async move {
// the future will be aborted once the endpoint closes.
-}));
Sourcepub fn create_server_config_builder(
+}));
Sourcepub fn create_server_config_builder(
&self,
alpns: Vec<Vec<u8>>,
) -> ServerConfigBuilder
Create a ServerConfigBuilder for this endpoint that includes the given alpns.
diff --git a/pr/4036/docs/iroh/endpoint/struct.EndpointClosed.html b/pr/4036/docs/iroh/endpoint/struct.EndpointClosed.html
index 85b8fd921b..1a2b9e3683 100644
--- a/pr/4036/docs/iroh/endpoint/struct.EndpointClosed.html
+++ b/pr/4036/docs/iroh/endpoint/struct.EndpointClosed.html
@@ -1,9 +1,9 @@
-EndpointClosed in iroh::endpoint - Rust EndpointClosed
pub struct EndpointClosed { /* private fields */ }
Expand description
Future returned from Endpoint::closed.
-Implementations§
Source§impl EndpointClosed
Sourcepub async fn run_until<F: Future>(self, fut: F) -> Option<F::Output>
Runs a future to completion, or until the Endpoint is closed.
+EndpointClosed in iroh::endpoint - Rust EndpointClosed
pub struct EndpointClosed { /* private fields */ }
Expand description
Future returned from Endpoint::closed.
+Implementations§
Trait Implementations§
Source§impl Debug for EndpointClosed
Source§impl Future for EndpointClosed
Source§impl<'pin> Unpin for EndpointClosedwhere
+
Trait Implementations§
Source§impl Debug for EndpointClosed
Source§impl Future for EndpointClosed
Source§impl<'pin> Unpin for EndpointClosedwhere
PinnedFieldsOf<__EndpointClosed<'pin>>: Unpin,
Auto Trait Implementations§
§impl !Freeze for EndpointClosed
§impl !RefUnwindSafe for EndpointClosed
§impl Send for EndpointClosed
§impl Sync for EndpointClosed
§impl !UnwindSafe for EndpointClosed
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/4036/docs/iroh/endpoint/struct.Incoming.html b/pr/4036/docs/iroh/endpoint/struct.Incoming.html
index d0a2c29af8..eca1097eca 100644
--- a/pr/4036/docs/iroh/endpoint/struct.Incoming.html
+++ b/pr/4036/docs/iroh/endpoint/struct.Incoming.html
@@ -24,7 +24,7 @@ to customize a Sourcepub fn remote_addr_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_addr().
-Sourcepub fn decrypt(&self) -> Option<DecryptedInitial>
Decrypt the Initial packet payload
+Sourcepub fn decrypt(&self) -> Option<DecryptedInitial>
Decrypts the Initial packet payload.
This clones and decrypts the packet payload (~1200 bytes).
Can be used to extract information from the TLS ClientHello without completing the handshake.
Trait Implementations§
Source§impl IntoFuture for Incoming
Source§type Output = Result<Connection, ConnectingError>
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§
Source§impl<T> Any for Twhere
diff --git a/pr/4036/docs/iroh/endpoint/struct.QuicTransportConfigBuilder.html b/pr/4036/docs/iroh/endpoint/struct.QuicTransportConfigBuilder.html
index 3a193bd40a..5189f21509 100644
--- a/pr/4036/docs/iroh/endpoint/struct.QuicTransportConfigBuilder.html
+++ b/pr/4036/docs/iroh/endpoint/struct.QuicTransportConfigBuilder.html
@@ -136,7 +136,7 @@ enable multipath as well.
If the path is idle for this long the path will be abandoned. Bear in mind this will
interact with the QuicTransportConfigBuilder::max_idle_timeout, if the last path is
abandoned the entire connection will be closed.
-Note: values higher than [PATH_MAX_IDLE_TIMEOUT] are clamped and a warning is logged.
+Note: values higher than PATH_MAX_IDLE_TIMEOUT (15 seconds) are clamped and a warning is logged.
Sourcepub fn default_path_keep_alive_interval(self, interval: Duration) -> Self
Sets a default per-path keep alive interval.
Note that this does not interact with the connection-wide
QuicTransportConfigBuilder::keep_alive_interval. This setting will keep this path active,
diff --git a/pr/4036/docs/iroh/endpoint/struct.RelayStatus.html b/pr/4036/docs/iroh/endpoint/struct.RelayStatus.html
index 175b637f76..a1abba7e98 100644
--- a/pr/4036/docs/iroh/endpoint/struct.RelayStatus.html
+++ b/pr/4036/docs/iroh/endpoint/struct.RelayStatus.html
@@ -1,13 +1,13 @@
-
RelayStatus in iroh::endpoint - Rust RelayStatus
pub struct RelayStatus { /* private fields */ }
Expand description
Connection status of a single home relay.
+RelayStatus in iroh::endpoint - Rust RelayStatus
pub struct RelayStatus { /* private fields */ }
Expand description
Connection status of a single home relay.
Observed via Endpoint::home_relay_status.
-Implementations§
Source§impl RelayStatus
Sourcepub fn is_connected(&self) -> bool
Returns true if the endpoint is connected to the relay.
-Sourcepub fn last_error(&self) -> Option<&AnyError>
Returns the most recent connection error, if the relay is currently
+
Implementations§
Source§impl RelayStatus
Sourcepub fn is_connected(&self) -> bool
Returns true if the endpoint is connected to the relay.
+Sourcepub fn last_error(&self) -> Option<&AnyError>
Returns the most recent connection error, if the relay is currently
disconnected.
Returns None when the relay is connected, or when the endpoint has
not yet observed a failed connection attempt.
-Trait Implementations§
Source§impl Clone for RelayStatus
Source§fn clone(&self) -> RelayStatus
Returns a duplicate 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 RelayStatus
Source§impl PartialEq for RelayStatus
Source§impl Eq for RelayStatus
Source§impl StructuralPartialEq for RelayStatus
Auto Trait Implementations§
§impl Freeze for RelayStatus
§impl !RefUnwindSafe for RelayStatus
§impl Send for RelayStatus
§impl Sync for RelayStatus
§impl Unpin for RelayStatus
§impl !UnwindSafe for RelayStatus
Blanket Implementations§
Trait Implementations§
Source§impl Clone for RelayStatus
Source§fn clone(&self) -> RelayStatus
Returns a duplicate 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 RelayStatus
Source§impl PartialEq for RelayStatus
Source§impl Eq for RelayStatus
Source§impl StructuralPartialEq for RelayStatus
Auto Trait Implementations§
§impl Freeze for RelayStatus
§impl !RefUnwindSafe for RelayStatus
§impl Send for RelayStatus
§impl Sync for RelayStatus
§impl Unpin for RelayStatus
§impl !UnwindSafe for RelayStatus
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/4036/docs/iroh/endpoint/struct.VarInt.html b/pr/4036/docs/iroh/endpoint/struct.VarInt.html
index 0acf99654d..007540d1af 100644
--- a/pr/4036/docs/iroh/endpoint/struct.VarInt.html
+++ b/pr/4036/docs/iroh/endpoint/struct.VarInt.html
@@ -13,7 +13,7 @@ An integer less than 2^62
of overflowing.
Trait Implementations§
§impl From<VarInt> for IdleTimeout
§fn from(inner: VarInt) -> IdleTimeout
Converts to this type from the input type.§impl From<VarInt> for IdleTimeout
§fn from(inner: VarInt) -> IdleTimeout
Converts to this type from the input type.§impl Ord for VarInt
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
diff --git a/pr/4036/docs/iroh/endpoint/struct.WeakConnectionHandle.html b/pr/4036/docs/iroh/endpoint/struct.WeakConnectionHandle.html
index 47f6c23610..07bad208d7 100644
--- a/pr/4036/docs/iroh/endpoint/struct.WeakConnectionHandle.html
+++ b/pr/4036/docs/iroh/endpoint/struct.WeakConnectionHandle.html
@@ -1,18 +1,18 @@
-WeakConnectionHandle in iroh::endpoint - Rust WeakConnectionHandle
pub struct WeakConnectionHandle { /* private fields */ }
Expand description
A weak handle to a Connection.
+WeakConnectionHandle in iroh::endpoint - Rust WeakConnectionHandle
pub struct WeakConnectionHandle { /* private fields */ }
Expand description
A weak handle to a Connection.
A WeakConnectionHandle does not keep the connection alive: holding one will not
prevent the connection from being closed when the last Connection handle is dropped.
Use upgrade to obtain a strong Connection, and closed to wait for the
connection to be closed without keeping it alive.
-Implementations§
Source§impl WeakConnectionHandle
Sourcepub fn upgrade(&self) -> Option<Connection>
Attempts to upgrade this weak handle to a strong Connection.
+Implementations§
Source§impl WeakConnectionHandle
Sourcepub fn upgrade(&self) -> Option<Connection>
Attempts to upgrade this weak handle to a strong Connection.
Returns None if the connection has already been dropped.
-Sourcepub fn closed(&self) -> impl Future<Output = Option<Closed>> + Send + 'static
Returns a future that resolves once the connection has been closed.
+Sourcepub fn closed(&self) -> impl Future<Output = Option<Closed>> + Send + 'static
Returns a future that resolves once the connection has been closed.
If no strong references to the Connection exist at the time this is called,
the future resolves to None. If at least one strong reference still exists at
the time of this call, the returned future is guaranteed to receive the close
event with the close reason and final connection statistics, even if all strong
references are dropped before the future is awaited.
The future does not keep the connection alive.
-Trait Implementations§
Source§impl Clone for WeakConnectionHandle
Source§fn clone(&self) -> WeakConnectionHandle
Returns a duplicate 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 WeakConnectionHandle
§impl !RefUnwindSafe for WeakConnectionHandle
§impl Send for WeakConnectionHandle
§impl Sync for WeakConnectionHandle
§impl Unpin for WeakConnectionHandle
§impl !UnwindSafe for WeakConnectionHandle
Blanket Implementations§
Trait Implementations§
Source§impl Clone for WeakConnectionHandle
Source§fn clone(&self) -> WeakConnectionHandle
Returns a duplicate 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 WeakConnectionHandle
§impl !RefUnwindSafe for WeakConnectionHandle
§impl Send for WeakConnectionHandle
§impl Sync for WeakConnectionHandle
§impl Unpin for WeakConnectionHandle
§impl !UnwindSafe for WeakConnectionHandle
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/4036/docs/iroh/endpoint/trait.EndpointHooks.html b/pr/4036/docs/iroh/endpoint/trait.EndpointHooks.html
index 2ac883dd5d..90c7ff04fc 100644
--- a/pr/4036/docs/iroh/endpoint/trait.EndpointHooks.html
+++ b/pr/4036/docs/iroh/endpoint/trait.EndpointHooks.html
@@ -17,7 +17,7 @@
For each hook, all installed hooks are invoked in the order they were installed on
the endpoint builder. If a hook returns Accept, processing continues with the next
hook. If a hook returns Reject, processing is aborted and further hooks
-are not invoked for this hook.
+are not invoked for this hook point.
§Notes to implementers
As hooks are stored on the endpoint, you must make sure to never store an Endpoint
on the hook struct itself, as this would create reference counting loop and cause the
diff --git a/pr/4036/docs/iroh/endpoint_info/index.html b/pr/4036/docs/iroh/endpoint_info/index.html
index f27fe3b898..4a60b9fd8f 100644
--- a/pr/4036/docs/iroh/endpoint_info/index.html
+++ b/pr/4036/docs/iroh/endpoint_info/index.html
@@ -1,11 +1,11 @@
iroh::endpoint_info - Rust Module endpoint_info
Expand description
Support for handling DNS resource records for dialing by EndpointId.
Dialing by EndpointId is supported by iroh endpoints publishing Pkarr records to DNS
servers or the Mainline DHT. This module supports creating and parsing these records.
-EndpointInfo combines an iroh_base::EndpointId with EndpointData —
+
EndpointInfo combines an iroh_base::EndpointId with EndpointData:
the addressing and metadata that discovery services publish and resolve.
Discovery services use AddrFilter to control which addresses are published.
This module also provides serialization to and from pkarr signed packets and
-DNS TXT records. See the [crate::attrs] module for the on-the-wire format.
+DNS TXT records.
DNS records are published under the following names:
_iroh.<z32-endpoint-id>.<origin-domain> TXT
@@ -36,4 +36,4 @@ Each address is an IPv4 or IPv6 address with a port.
Structs§
- Addr
Filter - A filter and/or reordering function applied to transport addresses,
-typically used by AddressLookup services in iroh before publishing.
- Endpoint
Data - Data about an endpoint that may be published to and resolved from discovery services.
- Endpoint
Info - Information about an endpoint that may be published to and resolved from discovery services.
- MaxLength
ExceededError - Error returned when an input value is too long for
UserData. - User
Data - Under the hood this is a UTF-8 String is no longer than
UserData::MAX_LENGTH bytes.
\ No newline at end of file
+typically used by AddressLookup services in iroh before publishing.EndpointData Data about an endpoint that may be published to and resolved from discovery services. EndpointInfo Information about an endpoint that may be published to and resolved from discovery services. MaxLengthExceededError Error returned when an input value is too long for UserData. UserData User-defined data that can be published and resolved through endpoint discovery.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint_info/struct.EndpointData.html b/pr/4036/docs/iroh/endpoint_info/struct.EndpointData.html
index eaf2725892..2c818ea5b4 100644
--- a/pr/4036/docs/iroh/endpoint_info/struct.EndpointData.html
+++ b/pr/4036/docs/iroh/endpoint_info/struct.EndpointData.html
@@ -13,15 +13,15 @@ services, should they not fit into e.g. a single DNS packet otherwise.
See also Self::set_user_data.
Sourcepub fn add_relay_url(&mut self, relay_url: RelayUrl)
Adds the relay URL to the end of the endpoint data, unless it already existed.
Sourcepub fn add_ip_addrs(&mut self, addresses: Vec<SocketAddr>)
Adds addresses in order with duplicates or already existing addresses filtered out.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Adds addresses to the endpoint data in the given ordered, but with duplicates filtered.
-Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data and returns the updated endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Adds addresses to the endpoint data in the given order, but with duplicates filtered.
+Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data.
Sourcepub fn clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn clear_relay_urls(&mut self)
Removes all relay URLs from the endpoint data.
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses.
+Sourcepub fn filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
Returns a vec to allow re-ordering of addresses.
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
diff --git a/pr/4036/docs/iroh/endpoint_info/struct.UserData.html b/pr/4036/docs/iroh/endpoint_info/struct.UserData.html
index 3352480631..e73207e05e 100644
--- a/pr/4036/docs/iroh/endpoint_info/struct.UserData.html
+++ b/pr/4036/docs/iroh/endpoint_info/struct.UserData.html
@@ -1,4 +1,5 @@
-UserData in iroh::endpoint_info - Rust 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.
+UserData in iroh::endpoint_info - Rust UserData
pub struct UserData(/* private fields */);
Expand description
User-defined data that can be published and resolved through endpoint discovery.
+Under the hood this is a UTF-8 string 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.
diff --git a/pr/4036/docs/iroh/enum.KeyParsingError.html b/pr/4036/docs/iroh/enum.KeyParsingError.html
index 765ac27ad2..146ec05698 100644
--- a/pr/4036/docs/iroh/enum.KeyParsingError.html
+++ b/pr/4036/docs/iroh/enum.KeyParsingError.html
@@ -1,4 +1,4 @@
-KeyParsingError in iroh - Rust KeyParsingError
#[non_exhaustive]pub enum KeyParsingError {
+KeyParsingError in iroh - Rust KeyParsingError
#[non_exhaustive]pub enum KeyParsingError {
FailedToDecodeHex {
meta: Meta,
},
@@ -11,14 +11,14 @@
InvalidKeyData {
meta: Meta,
},
-}
Expand description
Error when deserialising a PublicKey or a SecretKey.
+}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§FailedToDecodeHex
The input string could not be decoded as hex.
Fields
§meta: MetaCaptured call-site metadata
§FailedToDecodeBase32
The input string could not be decoded as base32.
Fields
§meta: MetaCaptured call-site metadata
§InvalidLength
The input has invalid length.
Fields
§meta: MetaCaptured call-site metadata
-§InvalidKeyData
The decoded data is not a valid Ed25591 public key.
+§InvalidKeyData
The decoded data is not a valid Ed25519 public key.
Fields
§meta: MetaCaptured call-site metadata
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<KeyParsingError> for ParseError
Source§fn from(source: KeyParsingError) -> ParseError
Converts to this type from the input type.Source§impl StackError for KeyParsingError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<KeyParsingError>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Returns the next source in the chain, if any.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.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
diff --git a/pr/4036/docs/iroh/enum.TransportAddr.html b/pr/4036/docs/iroh/enum.TransportAddr.html
index df614a51ee..0e5f31d772 100644
--- a/pr/4036/docs/iroh/enum.TransportAddr.html
+++ b/pr/4036/docs/iroh/enum.TransportAddr.html
@@ -3,8 +3,8 @@
Ip(SocketAddr),
Custom(CustomAddr),
}Expand description
Available address types.
-Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§Relay(RelayUrl)
Relays
-§Ip(SocketAddr)
IP based addresses
+Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§Relay(RelayUrl)
A relay server address.
+§Ip(SocketAddr)
An IP based address.
§Custom(CustomAddr)
Custom transport address
Implementations§
Source§impl TransportAddr
Sourcepub fn is_ip(&self) -> bool
Whether this is an IP transport address.
diff --git a/pr/4036/docs/iroh/index.html b/pr/4036/docs/iroh/index.html
index a2ddd5617a..8c7bddcb16 100644
--- a/pr/4036/docs/iroh/index.html
+++ b/pr/4036/docs/iroh/index.html
@@ -1,5 +1,5 @@
iroh - Rust Crate iroh
Expand description
Peer-to-peer QUIC connections.
-iroh is a library to establish direct connectivity between peers. It exposes an
+
iroh is a library to establish direct connectivity between peers. It exposes an
interface to QUIC connections and streams to the user, while implementing direct
connectivity using hole punching complemented by relay servers under the hood.
An iroh endpoint is created and controlled by the Endpoint, e.g. connecting to
@@ -44,7 +44,7 @@ punching if needed. Once the direct connection is established the relay ser
longer involved in the connection.
If one of the iroh endpoints can be reached directly, connectivity can also be
established without involving a Relay server. This is done by using the endpoint’s
-listening addresses in the connection establishement instead of the RelayUrl which
+listening addresses in the connection establishment instead of the RelayUrl which
is used to identify a Relay server. Of course it is also possible to use both a
RelayUrl and direct addresses at the same time to connect.
§Encryption
@@ -179,4 +179,4 @@ connecting using only the Ok(())
}
Please see the examples directory for more nuanced examples.
-Re-exports§
Modules§
- address_
lookup - Lookup the address of an Endpoint ID.
- defaults
- Default values used in
iroh - dns
Non-wasm_browser - Configurable DNS resolver.
- endpoint
- The
Endpoint allows establishing connections to other iroh endpoints. - endpoint_
info - Support for handling DNS resource records for dialing by
EndpointId. - metrics
- Co-locating all of the iroh metrics structs
- protocol
- Tools for spawning an accept loop that routes incoming requests to the right protocol.
- test_
utils test-utils - Internal utilities to support testing.
- tls
- TLS configuration for iroh.
Structs§
- Endpoint
Addr - Network-level addressing information for an iroh endpoint.
- NetReport
- A net_report report.
- NetReport
Config - Configuration for the net report component.
- Public
Key - A public key.
- Relay
Config - Information on a specific relay server.
- Relay
Map - List of relay server configurations to be used in an iroh endpoint.
- Relay
Url - A URL identifying a relay server.
- Relay
UrlParseError - Can occur when parsing a string into a
RelayUrl. - Secret
Key - A secret key.
- Signature
- Ed25519 signature.
- Signature
Error - Verification of a signature failed.
Enums§
- KeyParsing
Error - Error when deserialising a
PublicKey or a SecretKey. - Transport
Addr - Available address types.
Constants§
- NET_
REPORT_TIMEOUT - The maximum amount of time, in seconds, the net_report will spend gathering a single report.
Traits§
- Watcher
- A handle to a value that’s represented by one or more underlying [
Watchable]s.
Type Aliases§
- Endpoint
Id - The identifier for an endpoint in the (iroh) network.
\ No newline at end of file
+Re-exports§
Modules§
- address_
lookup - Lookup the address of an Endpoint ID.
- defaults
- Default values used in
iroh - dns
Non-wasm_browser - Configurable DNS resolver.
- endpoint
- The
Endpoint allows establishing connections to other iroh endpoints. - endpoint_
info - Support for handling DNS resource records for dialing by
EndpointId. - metrics
- Co-locating all of the iroh metrics structs
- protocol
- Tools for spawning an accept loop that routes incoming requests to the right protocol.
- test_
utils test-utils - Internal utilities to support testing.
- tls
- TLS configuration for iroh.
Structs§
- Endpoint
Addr - Network-level addressing information for an iroh endpoint.
- NetReport
- A net_report report.
- NetReport
Config - Configuration for the net report component.
- Public
Key - A public key.
- Relay
Config - Information on a specific relay server.
- Relay
Map - List of relay server configurations to be used in an iroh endpoint.
- Relay
Url - A URL identifying a relay server.
- Relay
UrlParseError - Can occur when parsing a string into a
RelayUrl. - Secret
Key - A secret key.
- Signature
- Ed25519 signature.
- Signature
Error - Verification of a signature failed.
Enums§
- KeyParsing
Error - Error returned when parsing a
PublicKey or a SecretKey. - Transport
Addr - Available address types.
Constants§
- NET_
REPORT_TIMEOUT - The maximum amount of time, in seconds, the net_report will spend gathering a single report.
Traits§
- Watcher
- A handle to a value that’s represented by one or more underlying [
Watchable]s.
Type Aliases§
- Endpoint
Id - The identifier for an endpoint in the (iroh) network.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/metrics/index.html b/pr/4036/docs/iroh/metrics/index.html
index da53db7d6a..00f2275127 100644
--- a/pr/4036/docs/iroh/metrics/index.html
+++ b/pr/4036/docs/iroh/metrics/index.html
@@ -1,2 +1,2 @@
iroh::metrics - Rust Module metrics
Expand description
Co-locating all of the iroh metrics structs
-Structs§
- Endpoint
Metrics - Metrics collected by an
crate::endpoint::Endpoint. - NetReport
Metrics - Enum of metrics for the module
- Relay
Metrics test-utils - Metrics tracked for the relay server
- Socket
Metrics - Enum of metrics for the module
\ No newline at end of file
+Structs§
- Endpoint
Metrics - Metrics collected by an
crate::endpoint::Endpoint. - NetReport
Metrics - Enum of metrics for the module
- Relay
Metrics test-utils - Metrics tracked for the relay server
- Socket
Metrics - Metrics collected by the iroh socket.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/metrics/struct.RelayMetrics.html b/pr/4036/docs/iroh/metrics/struct.RelayMetrics.html
index f8768e50a1..da2588f738 100644
--- a/pr/4036/docs/iroh/metrics/struct.RelayMetrics.html
+++ b/pr/4036/docs/iroh/metrics/struct.RelayMetrics.html
@@ -26,21 +26,26 @@
pub http_connections_closed: Counter,
pub http_connections_errored: Counter,
}Available on crate feature test-utils only.Expand description
Metrics tracked for the relay server
-Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.§bytes_sent: CounterBytes sent from a FrameType::SendPacket
-§bytes_recv: CounterBytes received from a FrameType::SendPacket
-§send_packets_sent: CounterFrameType::SendPacket sent
-§send_packets_recv: CounterFrameType::SendPacket received
-§send_packets_dropped: CounterFrameType::SendPacket dropped
-§other_packets_sent: CounterPackets of other FrameTypes sent
-§other_packets_recv: CounterPackets of other FrameTypes received
-§other_packets_dropped: CounterPackets of other FrameTypes dropped
-§got_ping: CounterNumber of FrameType::Pings received
-§sent_pong: CounterNumber of FrameType::Pongs sent
-§unknown_frames: CounterNumber of FrameType::Unknown received
+Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.§bytes_sent: CounterBytes sent to a client in RelayToClientDatagram or RelayToClientDatagramBatch frames.
+§bytes_recv: CounterBytes received from a client in ClientToRelayDatagram or ClientToRelayDatagramBatch frames.
+§send_packets_sent: CounterRelayToClientDatagram or RelayToClientDatagramBatch frames sent to a client.
+§send_packets_recv: CounterClientToRelayDatagram or ClientToRelayDatagramBatch frames received from a client.
+§send_packets_dropped: CounterRelayToClientDatagram or RelayToClientDatagramBatch frames dropped instead of being
+delivered to a client, because the recipient is not connected or writing to its stream failed.
+Note that frames dropped because the recipient’s send queue is full or closed are not counted
+here.
+§other_packets_sent: CounterIntended to count sent frames other than datagrams, but currently unused (never incremented).
+§other_packets_recv: CounterIntended to count received frames other than datagrams, but currently unused (never incremented).
+§other_packets_dropped: CounterIntended to count dropped frames other than datagrams, but currently unused (never incremented).
+§got_ping: CounterNumber of FrameType::Ping frames received from a client.
+§sent_pong: CounterNumber of FrameType::Pong frames sent to a client.
+§unknown_frames: CounterIntended to count received frames with an unrecognized FrameType,
+but currently unused (never incremented).
§bytes_rx_ratelimited_total: CounterNumber of bytes received from client connection which have been rate-limited.
§conns_rx_ratelimited_total: CounterNumber of client connections which have had any frames rate-limited.
§accepts: CounterNumber of times this server has accepted a connection.
-§disconnects: CounterNumber of connections we have removed because of an error
+§disconnects: CounterNumber of times a client connection was disconnected.
+Incremented once per connection, paired with Self::accepts.
§unique_client_keys: CounterNumber of unique client keys per day
§clients_inactive_added: CounterNumber of times a client was moved into the inactive state.
A client becomes inactive when a new client connects with the same endpoint id. An inactive
diff --git a/pr/4036/docs/iroh/metrics/struct.SocketMetrics.html b/pr/4036/docs/iroh/metrics/struct.SocketMetrics.html
index 2291657920..f61d3786bb 100644
--- a/pr/4036/docs/iroh/metrics/struct.SocketMetrics.html
+++ b/pr/4036/docs/iroh/metrics/struct.SocketMetrics.html
@@ -1,4 +1,4 @@
-
SocketMetrics in iroh::metrics - Rust SocketMetrics
#[non_exhaustive]pub struct SocketMetrics {Show 31 fields
+SocketMetrics in iroh::metrics - Rust SocketMetrics
#[non_exhaustive]pub struct SocketMetrics {Show 31 fields
pub update_direct_addrs: Counter,
pub send_ipv4: Counter,
pub send_ipv6: Counter,
@@ -30,10 +30,23 @@
pub actor_tick_direct_addr_heartbeat: Counter,
pub actor_link_change: Counter,
pub actor_tick_other: Counter,
-}
Expand description
Enum of metrics for the module
-Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.§update_direct_addrs: Counter§send_ipv4: Counter§send_ipv6: Counter§send_relay: Counter§recv_data_relay: Counter§recv_data_custom: Counter§recv_data_ipv4: Counter§recv_data_ipv6: Counter§recv_datagrams: CounterNumber of QUIC datagrams received.
-§recv_gro_datagrams: CounterNumber of datagrams received using GRO
-§relay_home_change: Counter§holepunch_attempts: CounterThe number of times holepunching is initiated on a connection.
+}Expand description
Metrics collected by the iroh socket.
+Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.§update_direct_addrs: CounterIntended to count updates to the local direct address set, but currently unused
+(never incremented).
+§send_ipv4: CounterNumber of bytes sent over IPv4.
+§send_ipv6: CounterNumber of bytes sent over IPv6.
+§send_relay: CounterNumber of bytes sent over the relay transport.
+§recv_data_relay: CounterNumber of data bytes received over the relay transport.
+§recv_data_custom: CounterNumber of data bytes received over any custom transport.
+§recv_data_ipv4: CounterNumber of data bytes received over IPv4.
+§recv_data_ipv6: CounterNumber of data bytes received over IPv6.
+§recv_datagrams: CounterNumber of QUIC datagrams received.
+§recv_gro_datagrams: CounterNumber of receive events that used GRO (coalesced datagram batches).
+This counts batches, not the individual datagrams within them. See
+Self::recv_datagrams for the datagram count.
+§relay_home_change: CounterNumber of times the home relay changed to a different relay.
+This includes the initial assignment from no home relay to a home relay.
+§holepunch_attempts: CounterThe number of times holepunching is initiated on a connection.
This can be incremented multiple times for a single connection. Note that only the
client-side of a connection will increment this counter.
§paths_direct: CounterThe number of network paths to peers that are direct.
@@ -53,8 +66,15 @@ the number of opened connections.
§transport_relay_paths_removed: CounterNumber of relay transport paths closed.
§transport_custom_paths_added: CounterNumber of custom transport paths opened.
§transport_custom_paths_removed: CounterNumber of custom transport paths closed.
-§actor_tick_main: Counter§actor_tick_msg: Counter§actor_tick_re_stun: Counter§actor_tick_portmap_changed: Counter§actor_tick_direct_addr_heartbeat: Counter§actor_link_change: Counter§actor_tick_other: CounterTrait Implementations§
Source§impl<'de> Deserialize<'de> for Metrics
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Iterable for Metrics
Source§fn metric_field_count(&self) -> usize
Returns the number of metric fields in the struct.Source§fn metric_field_ref(&self, n: usize) -> Option<MetricItem<'_>>
Returns the metric field at the given index.§fn family_field_count(&self) -> usize
Returns the number of Family fields in the struct.§fn family_field_ref(&self, _n: usize) -> Option<FamilyItem<'_>>
Returns the Family field at the given index.Source§impl Serialize for Metrics
Source§fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where
+§actor_tick_main: CounterNumber of iterations of the main socket actor loop.
+§actor_tick_msg: CounterNumber of actor messages processed by the socket actor loop.
+§actor_tick_re_stun: CounterNumber of periodic re-STUN timer ticks handled by the socket actor loop.
+§actor_tick_portmap_changed: CounterNumber of port-mapping change events handled by the socket actor loop.
+§actor_tick_direct_addr_heartbeat: CounterIntended to count direct address heartbeat ticks, but currently unused (never incremented).
+§actor_link_change: CounterNumber of local network interface (link) change events handled by the socket actor loop.
+§actor_tick_other: CounterNumber of times an input watcher or receiver closed in the socket actor loop.
+Trait Implementations§
Source§impl<'de> Deserialize<'de> for Metrics
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Iterable for Metrics
Source§fn metric_field_count(&self) -> usize
Returns the number of metric fields in the struct.Source§fn metric_field_ref(&self, n: usize) -> Option<MetricItem<'_>>
Returns the metric field at the given index.§fn family_field_count(&self) -> usize
Returns the number of Family fields in the struct.§fn family_field_ref(&self, _n: usize) -> Option<FamilyItem<'_>>
Returns the Family field at the given index.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
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/4036/docs/iroh/protocol/enum.IncomingFilterOutcome.html b/pr/4036/docs/iroh/protocol/enum.IncomingFilterOutcome.html
index e11345eddc..4577fe8eaf 100644
--- a/pr/4036/docs/iroh/protocol/enum.IncomingFilterOutcome.html
+++ b/pr/4036/docs/iroh/protocol/enum.IncomingFilterOutcome.html
@@ -11,7 +11,7 @@ the source address, actively refuse the connection, or silently drop it.
What this does depends on the connection type:
-
-
Direct (UDP) connections : this is QUIC source address
+
Direct (UDP) connections: this is QUIC source address
validation. If the socket address was spoofed, the retry token is
sent to the spoofed address, so we never hear from the attacker
again. If the address was real, the client repeats the connection
@@ -20,7 +20,7 @@ attempt with the token, and the next
-
-
Relay connections : there is no source address to validate
+
Relay connections: there is no source address to validate
(the relay already vouches for the packet origin), so the
“validation” itself has no security meaning. However, the retry
still imposes a real cost on the client: an extra round trip
diff --git a/pr/4036/docs/iroh/protocol/struct.RouterBuilder.html b/pr/4036/docs/iroh/protocol/struct.RouterBuilder.html
index dfc8969679..06b2f59fad 100644
--- a/pr/4036/docs/iroh/protocol/struct.RouterBuilder.html
+++ b/pr/4036/docs/iroh/protocol/struct.RouterBuilder.html
@@ -16,7 +16,7 @@ cheaper signals (e.g. remote address) first.
with this alpn.
handler can either be a type that implements ProtocolHandler or a
Box<dyn DynProtocolHandler>.
-
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for RouterBuilder
§impl !RefUnwindSafe for RouterBuilder
§impl Send for RouterBuilder
§impl Sync for RouterBuilder
§impl Unpin for RouterBuilder
§impl !UnwindSafe for RouterBuilder
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/4036/docs/iroh/struct.EndpointAddr.html b/pr/4036/docs/iroh/struct.EndpointAddr.html
index 0aa53df633..867818d655 100644
--- a/pr/4036/docs/iroh/struct.EndpointAddr.html
+++ b/pr/4036/docs/iroh/struct.EndpointAddr.html
@@ -5,7 +5,7 @@
This combines an endpoint’s identifier with network-level addressing information of how to
contact the endpoint.
To establish a network connection to an endpoint both the EndpointId and one or more network
-paths are needed. The network paths can come from various sources, current sources can come from
+paths are needed. The network paths can come from various sources:
-
An Address Lookup service which can provide routing information for a given EndpointId.
@@ -24,7 +24,7 @@ connection without the help of a Fields§§id: PublicKeyThe endpoint’s identifier.
-§addrs: BTreeSet<TransportAddr>The endpoint’s addresses
+§addrs: BTreeSet<TransportAddr>The endpoint’s addresses.
Implementations§
Source§impl EndpointAddr
Sourcepub fn new(id: PublicKey) -> EndpointAddr
Creates a new EndpointAddr with no network level addresses.
This still is usable with e.g. an address lookup service to establish a connection,
depending on the situation.
@@ -38,9 +38,9 @@ depending on the situation.
self,
addrs: impl IntoIterator<Item = TransportAddr>,
) -> EndpointAddrAdds a list of addresses.
-Sourcepub fn is_empty(&self) -> bool
Returns true, if only a EndpointId is present.
-Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns a list of IP addresses of this peer.
-Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns a list of relay urls of this peer.
+Sourcepub fn is_empty(&self) -> bool
Returns true if only an EndpointId is present.
+Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns an iterator over the IP addresses of this endpoint address.
+Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns an iterator over the relay URLs of this endpoint address.
In practice this is expected to be zero or one home relay for all known cases currently.
Trait Implementations§
Source§impl Clone for EndpointAddr
Source§fn clone(&self) -> EndpointAddr
Returns a duplicate 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 EndpointAddr
Source§impl<'de> Deserialize<'de> for EndpointAddr
Source§fn deserialize<__D>(
__deserializer: __D,
diff --git a/pr/4036/docs/iroh/struct.NetReport.html b/pr/4036/docs/iroh/struct.NetReport.html
index 693c855529..8b8ec1aed1 100644
--- a/pr/4036/docs/iroh/struct.NetReport.html
+++ b/pr/4036/docs/iroh/struct.NetReport.html
@@ -1,4 +1,4 @@
-NetReport in iroh - Rust NetReport
pub struct NetReport {
+NetReport in iroh - Rust NetReport
pub struct NetReport {
pub udp_v4: bool,
pub udp_v6: bool,
pub mapping_varies_by_dest_ipv4: Option<bool>,
@@ -13,17 +13,16 @@
§udp_v6: boolA QAD IPv6 round trip completed.
§mapping_varies_by_dest_ipv4: Option<bool>Whether the reported public address differs when probing different servers (on IPv4).
§mapping_varies_by_dest_ipv6: Option<bool>Whether the reported public address differs when probing different servers (on IPv6).
-§preferred_relay: Option<RelayUrl>Probe indicating the presence of port mapping protocols on the LAN.
-None for unknown
-§relay_latency: RelayLatencieskeyed by relay Url
-§global_v4: Option<SocketAddrV4>ip:port of global IPv4
-§global_v6: Option<SocketAddrV6>[ip]:port of global IPv6
+§preferred_relay: Option<RelayUrl>The relay server with the lowest latency, if any.
+§relay_latency: RelayLatenciesThe measured latency to each relay, keyed by relay URL.
+§global_v4: Option<SocketAddrV4>The discovered global IPv4 address and port, if any.
+§global_v6: Option<SocketAddrV6>The discovered global IPv6 address and port, if any.
§captive_portal: Option<bool>CaptivePortal is set when we think there’s a captive portal that is
intercepting HTTP traffic.
-Implementations§
Source§impl Report
Sourcepub fn mapping_varies_by_dest(&self) -> Option<bool>
Whether the reported public address differs when probing different servers.
+Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Report
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl PartialEq for Report
Source§impl Eq for Report
Source§impl StructuralPartialEq for Report
Auto Trait Implementations§
§impl Freeze for Report
§impl RefUnwindSafe for Report
§impl Send for Report
§impl Sync for Report
§impl Unpin for Report
§impl UnwindSafe for Report
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/4036/docs/iroh/struct.PublicKey.html b/pr/4036/docs/iroh/struct.PublicKey.html
index f8fb4c5ae2..b725772ddc 100644
--- a/pr/4036/docs/iroh/struct.PublicKey.html
+++ b/pr/4036/docs/iroh/struct.PublicKey.html
@@ -1,5 +1,5 @@
PublicKey in iroh - Rust PublicKey
pub struct PublicKey(/* private fields */);
Expand description
A public key.
-The key itself is stored as the CompressedEdwards y coordinate of the public key
+
The key itself is stored as the CompressedEdwards y-coordinate of the public key.
It is verified to decompress into a valid key when created.
Implementations§
Source§impl PublicKey
Sourcepub fn as_bytes(&self) -> &[u8; 32]
Get this public key as a byte array.
@@ -12,7 +12,7 @@ See [VerifyingKey::from_bytes] for details.
&self,
message: &[u8],
signature: &Signature,
-) -> Result<(), SignatureError>Verify a signature on a message with this secret key’s public key.
+) -> Result<(), SignatureError>Verify a signature on a message with this public key.
§Return
Returns Ok(()) if the signature is valid, and Err otherwise.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PublicKey
Source§fn deserialize<D>(
deserializer: D,
) -> Result<PublicKey, <D as Deserializer<'de>>::Error>where
- D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl From<PublicKey> for EndpointAddr
Source§fn from(endpoint_id: PublicKey) -> EndpointAddr
Converts to this type from the input type.Source§impl From<PublicKey> for EndpointAddr
Source§fn from(endpoint_id: PublicKey) -> EndpointAddr
Converts to this type from the input type.Source§impl FromStr for PublicKey
Parses a PublicKey from its hex or base32 encoding.
+
Display produces the hex encoding.
Source§impl Hash for PublicKey
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
H: Hasher,
diff --git a/pr/4036/docs/iroh/tls/index.html b/pr/4036/docs/iroh/tls/index.html
index 3c1d92cf2a..16f63b088e 100644
--- a/pr/4036/docs/iroh/tls/index.html
+++ b/pr/4036/docs/iroh/tls/index.html
@@ -1,5 +1,5 @@
iroh::tls - Rust Module tls
Expand description
TLS configuration for iroh.
-Currently there is one mechanisms available
+Currently there is one mechanism available:
- Raw Public Keys, using the TLS extension described in RFC 7250
diff --git a/pr/4036/docs/iroh_base/enum.KeyParsingError.html b/pr/4036/docs/iroh_base/enum.KeyParsingError.html
index d0668a511c..7c849cddf2 100644
--- a/pr/4036/docs/iroh_base/enum.KeyParsingError.html
+++ b/pr/4036/docs/iroh_base/enum.KeyParsingError.html
@@ -1,4 +1,4 @@
-KeyParsingError in iroh_base - Rust KeyParsingError
#[non_exhaustive]pub enum KeyParsingError {
+KeyParsingError in iroh_base - Rust KeyParsingError
#[non_exhaustive]pub enum KeyParsingError {
FailedToDecodeHex {
meta: Meta,
},
@@ -11,14 +11,14 @@
InvalidKeyData {
meta: Meta,
},
-}
Available on crate feature key only.Expand description
Error when deserialising a PublicKey or a SecretKey.
+}Available on crate feature key only.Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§FailedToDecodeHex
The input string could not be decoded as hex.
Fields
§meta: MetaCaptured call-site metadata
§FailedToDecodeBase32
The input string could not be decoded as base32.
Fields
§meta: MetaCaptured call-site metadata
§InvalidLength
The input has invalid length.
Fields
§meta: MetaCaptured call-site metadata
-§InvalidKeyData
The decoded data is not a valid Ed25591 public key.
+§InvalidKeyData
The decoded data is not a valid Ed25519 public key.
Fields
§meta: MetaCaptured call-site metadata
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<KeyParsingError> for AnyError
Source§fn from(value: KeyParsingError) -> AnyError
Converts to this type from the input type.Source§impl StackError for KeyParsingError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
Returns the next source in the chain, if any.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.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§
Source§impl<T> Borrow<T> for Twhere
diff --git a/pr/4036/docs/iroh_base/enum.TransportAddr.html b/pr/4036/docs/iroh_base/enum.TransportAddr.html
index ec9989aea4..a55428eb22 100644
--- a/pr/4036/docs/iroh_base/enum.TransportAddr.html
+++ b/pr/4036/docs/iroh_base/enum.TransportAddr.html
@@ -3,8 +3,8 @@
Ip(SocketAddr),
Custom(CustomAddr),
}Available on crate feature key only.Expand description
Available address types.
-Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§Relay(RelayUrl)
Relays
-§Ip(SocketAddr)
IP based addresses
+Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§Relay(RelayUrl)
A relay server address.
+§Ip(SocketAddr)
An IP based address.
§Custom(CustomAddr)
Custom transport address
Implementations§
Source§impl TransportAddr
PkarrRelayClient
pub struct PkarrRelayClient { /* private fields */ }Expand description
A pkarr client to publish SignedPackets to a pkarr relay.
Implementations§
Source§impl PkarrRelayClient
impl PkarrRelayClient
Sourcepub fn new(
+PkarrRelayClient in iroh::address_lookup::pkarr - Rust PkarrRelayClient
pub struct PkarrRelayClient { /* private fields */ }
Expand description
A pkarr client to publish SignedPackets to a pkarr relay.
+Implementations§
Source§impl PkarrRelayClient
Sourcepub fn new(
pkarr_relay_url: Url,
tls_config: ClientConfig,
dns_resolver: DnsResolver,
) -> Self
Available on non-wasm_browser only.
Creates a PkarrRelayClient.
-Sourcepub async fn resolve(
&self,
endpoint_id: EndpointId,
) -> Result<SignedPacket, AddressLookupError>
Resolves a SignedPacket for the given EndpointId.
-Sourcepub async fn publish(
&self,
signed_packet: &SignedPacket,
) -> Result<(), PkarrError>
Publishes a SignedPacket.
-
pub fn new(
+PkarrRelayClient in iroh::address_lookup::pkarr - Rust PkarrRelayClient
pub struct PkarrRelayClient { /* private fields */ }
Expand description
A pkarr client to publish SignedPackets to a pkarr relay.
+Implementations§
Source§impl PkarrRelayClient
Sourcepub fn new(
pkarr_relay_url: Url,
tls_config: ClientConfig,
dns_resolver: DnsResolver,
) -> Self
Available on non-wasm_browser only.
Creates a PkarrRelayClient.
-Sourcepub async fn resolve(
&self,
endpoint_id: EndpointId,
) -> Result<SignedPacket, AddressLookupError>
Resolves a SignedPacket for the given EndpointId.
-Sourcepub async fn publish(
&self,
signed_packet: &SignedPacket,
) -> Result<(), PkarrError>
Publishes a SignedPacket.
-
PkarrRelayClient
pub struct PkarrRelayClient { /* private fields */ }Expand description
A pkarr client to publish SignedPackets to a pkarr relay.
Implementations§
Source§impl PkarrRelayClient
impl PkarrRelayClient
Sourcepub fn new(
pkarr_relay_url: Url,
tls_config: ClientConfig,
dns_resolver: DnsResolver,
) -> Self
Available on non-wasm_browser only.
pub fn new( pkarr_relay_url: Url, tls_config: ClientConfig, dns_resolver: DnsResolver, ) -> Self
wasm_browser only.Creates a PkarrRelayClient.
Sourcepub async fn resolve(
&self,
endpoint_id: EndpointId,
) -> Result<SignedPacket, AddressLookupError>
pub async fn resolve( &self, endpoint_id: EndpointId, ) -> Result<SignedPacket, AddressLookupError>
Resolves a SignedPacket for the given EndpointId.
Sourcepub async fn publish(
&self,
signed_packet: &SignedPacket,
) -> Result<(), PkarrError>
pub async fn publish( &self, signed_packet: &SignedPacket, ) -> Result<(), PkarrError>
Publishes a SignedPacket.
Trait Implementations§
Source§impl Clone for PkarrRelayClient
impl Clone for PkarrRelayClient
Source§fn clone(&self) -> PkarrRelayClient
fn clone(&self) -> PkarrRelayClient
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 PkarrRelayClient
impl !RefUnwindSafe for PkarrRelayClient
impl Send for PkarrRelayClient
impl Sync for PkarrRelayClient
impl Unpin for PkarrRelayClient
impl !UnwindSafe for PkarrRelayClient
Blanket Implementations§
Trait Implementations§
Source§impl Clone for PkarrRelayClient
impl Clone for PkarrRelayClient
Source§fn clone(&self) -> PkarrRelayClient
fn clone(&self) -> PkarrRelayClient
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 PkarrRelayClient
impl !RefUnwindSafe for PkarrRelayClient
impl Send for PkarrRelayClient
impl Sync for PkarrRelayClient
impl Unpin for PkarrRelayClient
impl !UnwindSafe for PkarrRelayClient
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/4036/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
index 79d8b2e2a8..0c08b03913 100644
--- a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
+++ b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
@@ -1,6 +1,6 @@
-PkarrRelayClientBuilder in iroh::address_lookup::pkarr - Rust PkarrRelayClientBuilder
pub struct PkarrRelayClientBuilder { /* private fields */ }
Expand description
A builder for the PkarrRelayClient
-Implementations§
Source§impl PkarrRelayClientBuilder
Sourcepub fn build(self) -> PkarrRelayClient
Build a PkarrRelayClient.
-Trait Implementations§
Source§impl Clone for PkarrRelayClientBuilder
Source§fn clone(&self) -> PkarrRelayClientBuilder
Returns a duplicate 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 PkarrRelayClientBuilder
§impl !RefUnwindSafe for PkarrRelayClientBuilder
§impl Send for PkarrRelayClientBuilder
§impl Sync for PkarrRelayClientBuilder
§impl Unpin for PkarrRelayClientBuilder
§impl !UnwindSafe for PkarrRelayClientBuilder
Blanket Implementations§
Source§impl<T> Any for Twhere
+PkarrRelayClientBuilder in iroh::address_lookup::pkarr - Rust PkarrRelayClientBuilder
pub struct PkarrRelayClientBuilder { /* private fields */ }
Expand description
A builder for the PkarrRelayClient
+Implementations§
Source§impl PkarrRelayClientBuilder
Sourcepub fn build(self) -> PkarrRelayClient
Build a PkarrRelayClient.
+Trait Implementations§
Source§impl Clone for PkarrRelayClientBuilder
Source§fn clone(&self) -> PkarrRelayClientBuilder
Returns a duplicate 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 PkarrRelayClientBuilder
§impl !RefUnwindSafe for PkarrRelayClientBuilder
§impl Send for PkarrRelayClientBuilder
§impl Sync for PkarrRelayClientBuilder
§impl Unpin for PkarrRelayClientBuilder
§impl !UnwindSafe for PkarrRelayClientBuilder
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/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
index 13e12a4b01..1f7723299d 100644
--- a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
+++ b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
@@ -1,21 +1,21 @@
-PkarrResolver in iroh::address_lookup::pkarr - Rust PkarrResolver
pub struct PkarrResolver { /* private fields */ }
Expand description
Resolver of address lookup information from a pkarr relay.
+PkarrResolver in iroh::address_lookup::pkarr - Rust PkarrResolver
pub struct PkarrResolver { /* private fields */ }
Expand description
Resolver of address lookup information from a pkarr relay.
The resolver uses HTTP to query address lookup information from a pkarr relay server,
see the module docs for details.
This implements the AddressLookup trait to be used as an address lookup service. Note
that it only resolves address lookup information, for the corresponding publisher use
the PkarrPublisher together with AddressLookupServices.
-Implementations§
Source§impl PkarrResolver
Sourcepub fn builder(pkarr_relay: Url) -> PkarrResolverBuilder
Creates a new resolver builder using the pkarr relay server at the URL.
+Implementations§
Source§impl PkarrResolver
Sourcepub fn builder(pkarr_relay: Url) -> PkarrResolverBuilder
Creates a new resolver builder using the pkarr relay server at the URL.
The builder implements AddressLookupBuilder.
-Sourcepub fn n0_dns() -> PkarrResolverBuilder
Creates a pkarr resolver builder which uses the number 0 pkarr relay server.
+Sourcepub fn n0_dns() -> PkarrResolverBuilder
Creates a pkarr resolver builder which uses the number 0 pkarr relay server.
This uses the pkarr relay server operated by number 0 at
N0_DNS_PKARR_RELAY_PROD.
When running with the environment variable IROH_FORCE_STAGING_RELAYS
set to any non empty value N0_DNS_PKARR_RELAY_STAGING
server is used instead.
-Trait Implementations§
Source§impl AddressLookup for PkarrResolver
Trait Implementations§
Source§impl AddressLookup for PkarrResolver
Source§fn resolve(
&self,
endpoint_id: EndpointId,
-) -> Option<BoxStream<Result<AddressLookupItem, AddressLookupError>>>
Source§fn publish(&self, _data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreSource§impl Clone for PkarrResolver
Source§fn clone(&self) -> PkarrResolver
Returns a duplicate 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 PkarrResolver
§impl !RefUnwindSafe for PkarrResolver
§impl Send for PkarrResolver
§impl Sync for PkarrResolver
§impl Unpin for PkarrResolver
§impl !UnwindSafe for PkarrResolver
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
+) -> Option<BoxStream<Result<AddressLookupItem, AddressLookupError>>>Source§fn publish(&self, _data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read more
Source§impl Clone for PkarrResolver
Source§fn clone(&self) -> PkarrResolver
Returns a duplicate 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 PkarrResolver
§impl !RefUnwindSafe for PkarrResolver
§impl Send for PkarrResolver
§impl Sync for PkarrResolver
§impl Unpin for PkarrResolver
§impl !UnwindSafe for PkarrResolver
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
T: AddressLookup,
Source§fn into_address_lookup(
self,
_endpoint: &Endpoint,
diff --git a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
index cfd47f28e6..e549ec9d07 100644
--- a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
+++ b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
@@ -1,11 +1,11 @@
-PkarrResolverBuilder in iroh::address_lookup::pkarr - Rust PkarrResolverBuilder
pub struct PkarrResolverBuilder { /* private fields */ }
Expand description
Builder for PkarrResolver.
+PkarrResolverBuilder in iroh::address_lookup::pkarr - Rust PkarrResolverBuilder
pub struct PkarrResolverBuilder { /* private fields */ }
Expand description
Builder for PkarrResolver.
-Implementations§
Source§impl PkarrResolverBuilder
Sourcepub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self
Available on non-wasm_browser only.
Sets the DNS resolver to use for resolving the pkarr relay URL.
-Sourcepub fn build(self, tls_config: ClientConfig) -> PkarrResolver
Creates a PkarrResolver from this builder.
-Trait Implementations§
Implementations§
Source§impl PkarrResolverBuilder
Sourcepub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self
Available on non-wasm_browser only.
Sets the DNS resolver to use for resolving the pkarr relay URL.
+Sourcepub fn build(self, tls_config: ClientConfig) -> PkarrResolver
Creates a PkarrResolver from this builder.
+Trait Implementations§
Source§impl AddressLookupBuilder for PkarrResolverBuilder
Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this builder into a ready-to-use AddressLookup. Read moreAuto Trait Implementations§
§impl Freeze for PkarrResolverBuilder
§impl !RefUnwindSafe for PkarrResolverBuilder
§impl Send for PkarrResolverBuilder
§impl Sync for PkarrResolverBuilder
§impl Unpin for PkarrResolverBuilder
§impl !UnwindSafe for PkarrResolverBuilder
Blanket Implementations§
Source§impl<T> Any for Twhere
+) -> Result<impl AddressLookup, AddressLookupBuilderError>Turns this builder into a ready-to-use AddressLookup. Read more
Auto Trait Implementations§
§impl Freeze for PkarrResolverBuilder
§impl !RefUnwindSafe for PkarrResolverBuilder
§impl Send for PkarrResolverBuilder
§impl Sync for PkarrResolverBuilder
§impl Unpin for PkarrResolverBuilder
§impl !UnwindSafe for PkarrResolverBuilder
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/4036/docs/iroh/address_lookup/struct.EndpointData.html b/pr/4036/docs/iroh/address_lookup/struct.EndpointData.html
index 1ea4773718..7de6a2dd89 100644
--- a/pr/4036/docs/iroh/address_lookup/struct.EndpointData.html
+++ b/pr/4036/docs/iroh/address_lookup/struct.EndpointData.html
@@ -13,15 +13,15 @@ services, should they not fit into e.g. a single DNS packet otherwise.
See also Self::set_user_data.
Sourcepub fn add_relay_url(&mut self, relay_url: RelayUrl)
Adds the relay URL to the end of the endpoint data, unless it already existed.
Sourcepub fn add_ip_addrs(&mut self, addresses: Vec<SocketAddr>)
Adds addresses in order with duplicates or already existing addresses filtered out.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Adds addresses to the endpoint data in the given ordered, but with duplicates filtered.
-Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data and returns the updated endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Adds addresses to the endpoint data in the given order, but with duplicates filtered.
+Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data.
Sourcepub fn clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn clear_relay_urls(&mut self)
Removes all relay URLs from the endpoint data.
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses.
+Sourcepub fn filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
Returns a vec to allow re-ordering of addresses.
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
diff --git a/pr/4036/docs/iroh/address_lookup/struct.Item.html b/pr/4036/docs/iroh/address_lookup/struct.Item.html
index 9e63b37130..28d59f6feb 100644
--- a/pr/4036/docs/iroh/address_lookup/struct.Item.html
+++ b/pr/4036/docs/iroh/address_lookup/struct.Item.html
@@ -16,14 +16,14 @@ directly from Sourcepub fn last_updated(&self) -> Option<u64>
Returns the optional timestamp when this endpoint info was last updated.
The value is microseconds since the unix epoch.
-Sourcepub fn to_endpoint_addr(&self) -> EndpointAddr
Converts into a EndpointAddr by cloning the needed fields.
-Sourcepub fn into_endpoint_addr(self) -> EndpointAddr
Converts into a EndpointAddr without cloning.
+Sourcepub fn to_endpoint_addr(&self) -> EndpointAddr
Returns an EndpointAddr by cloning the needed fields.
+Sourcepub fn into_endpoint_addr(self) -> EndpointAddr
Converts into an EndpointAddr without cloning.
Methods from Deref<Target = EndpointData>§
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses.
+Sourcepub fn filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
Returns a vec to allow re-ordering of addresses.
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
diff --git a/pr/4036/docs/iroh/address_lookup/struct.UserData.html b/pr/4036/docs/iroh/address_lookup/struct.UserData.html
index 49c2183d40..5ae8665e57 100644
--- a/pr/4036/docs/iroh/address_lookup/struct.UserData.html
+++ b/pr/4036/docs/iroh/address_lookup/struct.UserData.html
@@ -1,4 +1,5 @@
-UserData in iroh::address_lookup - Rust 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.
+UserData in iroh::address_lookup - Rust UserData
pub struct UserData(/* private fields */);
Expand description
User-defined data that can be published and resolved through endpoint discovery.
+Under the hood this is a UTF-8 string 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.
diff --git a/pr/4036/docs/iroh/address_lookup/trait.AddressLookup.html b/pr/4036/docs/iroh/address_lookup/trait.AddressLookup.html
index 1be6efa3e6..79a8044def 100644
--- a/pr/4036/docs/iroh/address_lookup/trait.AddressLookup.html
+++ b/pr/4036/docs/iroh/address_lookup/trait.AddressLookup.html
@@ -22,7 +22,7 @@ Address Lookup information changes. If an Address Lookup mechanism requires a pe
refresh, it should start its own task.
Provided Methods§
Sourcefn publish(&self, _data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism.
This is fire and forget, since the Endpoint can not wait for successful
-publishing. If publishing is async, the implementation should start it’s own task.
+publishing. If publishing is async, the implementation should start its own task.
This will be called from a tokio task, so it is safe to spawn new tasks.
These tasks will be run on the runtime of the super::Endpoint.
Implementations on Foreign Types§
Source§impl<T: AddressLookup> AddressLookup for Arc<T>
Implementors§
Source§impl AddressLookup for DnsAddressLookup
Available on non-wasm_browser only. Source§impl AddressLookup for MemoryLookup
Source§impl AddressLookup for PkarrPublisher
Source§impl AddressLookup for PkarrResolver
Source§impl<T: AddressLookup> AddressLookup for FilteredAddressLookup<T>
\ No newline at end of file
+) -> Option<BoxStream<Result<Item, Error>>>Implementors§
Source§impl AddressLookup for DnsAddressLookup
Available on non-wasm_browser only. Source§impl AddressLookup for MemoryLookup
Source§impl AddressLookup for PkarrPublisher
Source§impl AddressLookup for PkarrResolver
Source§impl<T: AddressLookup> AddressLookup for FilteredAddressLookup<T>
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/address_lookup/trait.AddressLookupBuilder.html b/pr/4036/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
index 35aadc4338..edc4dff899 100644
--- a/pr/4036/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
+++ b/pr/4036/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
@@ -20,5 +20,5 @@ endpoint to Endpoint,
) -> Result<impl AddressLookup, AddressLookupBuilderError>Turns this builder into a ready-to-use AddressLookup.
If an error is returned, building the endpoint will fail with this error.
-Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
Source§impl AddressLookupBuilder for DnsAddressLookupBuilder
Available on non-wasm_browser only. Source§impl AddressLookupBuilder for PkarrPublisherBuilder
Source§impl AddressLookupBuilder for PkarrResolverBuilder
Source§impl<T: AddressLookup> AddressLookupBuilder for T
Blanket no-op impl of AddressLookupBuilder for T: AddressLookup.
+ Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
Source§impl AddressLookupBuilder for DnsAddressLookupBuilder
Available on non-wasm_browser only. Source§impl AddressLookupBuilder for PkarrPublisherBuilder
Source§impl AddressLookupBuilder for PkarrResolverBuilder
Source§impl<T: AddressLookup> AddressLookupBuilder for T
Blanket no-op impl of AddressLookupBuilder for T: AddressLookup.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/defaults/prod/fn.default_ap_relay.html b/pr/4036/docs/iroh/defaults/prod/fn.default_ap_relay.html
index 5961b7d1ab..3a67b98b91 100644
--- a/pr/4036/docs/iroh/defaults/prod/fn.default_ap_relay.html
+++ b/pr/4036/docs/iroh/defaults/prod/fn.default_ap_relay.html
@@ -1,2 +1,2 @@
-default_ap_relay in iroh::defaults::prod - Rust default_ap_relay
pub fn default_ap_relay() -> RelayConfig
Expand description
Get the default RelayConfig for Asia-Pacific
+default_ap_relay in iroh::defaults::prod - Rust default_ap_relay
pub fn default_ap_relay() -> RelayConfig
Expand description
Get the default RelayConfig for Asia-Pacific.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/defaults/prod/index.html b/pr/4036/docs/iroh/defaults/prod/index.html
index 8981fb6be4..b076bc3ce3 100644
--- a/pr/4036/docs/iroh/defaults/prod/index.html
+++ b/pr/4036/docs/iroh/defaults/prod/index.html
@@ -1,2 +1,2 @@
iroh::defaults::prod - Rust Module prod
Expand description
Production configuration.
-Constants§
- AP_
RELAY_HOSTNAME - Hostname of the default Asia-Pacific relay.
- EU_
RELAY_HOSTNAME - Hostname of the default EU relay.
- NA_
EAST_RELAY_HOSTNAME - Hostname of the default NA east relay.
- NA_
WEST_RELAY_HOSTNAME - Hostname of the default NA west relay.
Functions§
- default_
ap_relay - Get the default
RelayConfig for Asia-Pacific - default_
eu_relay - Get the default
RelayConfig for EU. - default_
na_east_relay - Get the default
RelayConfig for NA east. - default_
na_west_relay - Get the default
RelayConfig for NA west. - default_
relay_map - Get the default
RelayMap.
\ No newline at end of file
+Constants§
- AP_
RELAY_HOSTNAME - Hostname of the default Asia-Pacific relay.
- EU_
RELAY_HOSTNAME - Hostname of the default EU relay.
- NA_
EAST_RELAY_HOSTNAME - Hostname of the default NA east relay.
- NA_
WEST_RELAY_HOSTNAME - Hostname of the default NA west relay.
Functions§
- default_
ap_relay - Get the default
RelayConfig for Asia-Pacific. - default_
eu_relay - Get the default
RelayConfig for EU. - default_
na_east_relay - Get the default
RelayConfig for NA east. - default_
na_west_relay - Get the default
RelayConfig for NA west. - default_
relay_map - Get the default
RelayMap.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/dns/struct.DnsResolver.html b/pr/4036/docs/iroh/dns/struct.DnsResolver.html
index 754fa26465..3f8c6e27b6 100644
--- a/pr/4036/docs/iroh/dns/struct.DnsResolver.html
+++ b/pr/4036/docs/iroh/dns/struct.DnsResolver.html
@@ -15,7 +15,7 @@ public DNS.
Implementations§
Source§impl DnsResolver
Sourcepub fn new() -> DnsResolver
Creates 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.
+to the default ResolverConfig which uses e.g. Google’s 8.8.8.8 or 8.8.4.4.
Sourcepub fn with_nameserver(nameserver: SocketAddr) -> DnsResolver
Creates a new DNS resolver configured with a single UDP DNS nameserver.
Sourcepub fn custom(resolver: impl Resolver) -> DnsResolver
Creates a new DnsResolver from a struct that implements Resolver.
diff --git a/pr/4036/docs/iroh/dns/trait.Resolver.html b/pr/4036/docs/iroh/dns/trait.Resolver.html
index 4aaa7642fd..3ebf87a01f 100644
--- a/pr/4036/docs/iroh/dns/trait.Resolver.html
+++ b/pr/4036/docs/iroh/dns/trait.Resolver.html
@@ -38,13 +38,13 @@ atomic swap. Build a new instance with re-bound sockets and re-read nameserver
configuration rather than mutating in place. Must not perform IO: defer DNS
queries and socket binds until the new resolver is first used. May be called
concurrently, in which case all but one allocated replacement is dropped unused.
-Implementations on Foreign Types§
Implementations on Foreign Types§
Source§impl Resolver for Arc<SimpleDnsResolver>
Source§fn lookup_ipv4(
&self,
host: String,
-) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = Ipv4Addr> + Send>, DnsError>> + Send>>
Source§fn lookup_ipv6(
+) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = Ipv4Addr> + Send>, DnsError>> + Send>>
Source§fn lookup_ipv6(
&self,
host: String,
-) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = Ipv6Addr> + Send>, DnsError>> + Send>>
Source§fn lookup_txt(
+) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = Ipv6Addr> + Send>, DnsError>> + Send>>
Source§fn lookup_txt(
&self,
host: String,
-) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = TxtRecordData> + Send>, DnsError>> + Send>>
Source§fn clear_cache(&self)
Source§fn reset(&self) -> Box<dyn Resolver>
Implementors§
\ No newline at end of file
+) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = TxtRecordData> + Send>, DnsError>> + Send>>Source§fn clear_cache(&self)
Source§fn reset(&self) -> Box<dyn Resolver>
Implementors§
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html b/pr/4036/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html
index 0a8e0c05eb..cc00fac5e1 100644
--- a/pr/4036/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html
+++ b/pr/4036/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html
@@ -1,2 +1,2 @@
-ENV_FORCE_STAGING_RELAYS in iroh::endpoint - Rust ENV_FORCE_STAGING_RELAYS
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 ENV_FORCE_STAGING_RELAYS
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint/enum.RelayMode.html b/pr/4036/docs/iroh/endpoint/enum.RelayMode.html
index 326aae7405..0d7b755897 100644
--- a/pr/4036/docs/iroh/endpoint/enum.RelayMode.html
+++ b/pr/4036/docs/iroh/endpoint/enum.RelayMode.html
@@ -1,4 +1,4 @@
-RelayMode in iroh::endpoint - Rust RelayMode
pub enum RelayMode {
+RelayMode in iroh::endpoint - Rust RelayMode
pub enum RelayMode {
Disabled,
Default,
Staging,
@@ -10,14 +10,14 @@ This means that neither listening nor dialing relays will be available.
See crate::defaults::prod for the severs used.
§Staging
Use the staging relay servers from n0.
§Custom(RelayMap)
Use a custom relay map.
-
Implementations§
Source§impl RelayMode
Sourcepub fn custom(map: impl IntoIterator<Item = RelayUrl>) -> Self
Create a custom relay mode from a list of RelayUrls.
+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§
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/4036/docs/iroh/endpoint/fn.default_relay_mode.html b/pr/4036/docs/iroh/endpoint/fn.default_relay_mode.html
index d716677abc..98ff3579ee 100644
--- a/pr/4036/docs/iroh/endpoint/fn.default_relay_mode.html
+++ b/pr/4036/docs/iroh/endpoint/fn.default_relay_mode.html
@@ -1,4 +1,4 @@
-default_relay_mode in iroh::endpoint - Rust default_relay_mode
pub fn default_relay_mode() -> RelayMode
Expand description
Returns the default relay mode.
+default_relay_mode in iroh::endpoint - Rust default_relay_mode
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint/fn.force_staging_infra.html b/pr/4036/docs/iroh/endpoint/fn.force_staging_infra.html
index ff8dda7e69..b444491b3e 100644
--- a/pr/4036/docs/iroh/endpoint/fn.force_staging_infra.html
+++ b/pr/4036/docs/iroh/endpoint/fn.force_staging_infra.html
@@ -1,2 +1,2 @@
-force_staging_infra in iroh::endpoint - Rust force_staging_infra
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 force_staging_infra
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint/index.html b/pr/4036/docs/iroh/endpoint/index.html
index 2efb803d4c..f3a98d45f2 100644
--- a/pr/4036/docs/iroh/endpoint/index.html
+++ b/pr/4036/docs/iroh/endpoint/index.html
@@ -1,4 +1,4 @@
-iroh::endpoint - Rust Module endpoint
Expand description
The Endpoint allows establishing connections to other iroh endpoints.
+iroh::endpoint - Rust Module endpoint
Expand description
The Endpoint allows establishing connections to other iroh endpoints.
The Endpoint is the main API interface to manage a local iroh endpoint. It allows
connecting to and accepting connections from other endpoints. See the module docs for
more details on how iroh connections work.
diff --git a/pr/4036/docs/iroh/endpoint/presets/index.html b/pr/4036/docs/iroh/endpoint/presets/index.html
index 37b792c03d..a454626701 100644
--- a/pr/4036/docs/iroh/endpoint/presets/index.html
+++ b/pr/4036/docs/iroh/endpoint/presets/index.html
@@ -2,4 +2,4 @@
§Example
use iroh::{Endpoint, RelayMode, Watcher, endpoint::presets};
-let endpoint = Endpoint::builder(presets::N0).bind().await?;
Structs§
- Empty
- An empty preset that doesn’t set anything on the builder.
- Minimal
with_crypto_provider - A preset that is almost empty, besides setting mandatory options.
- N0
with_crypto_provider - Configures the endpoint to use the n0 defaults
- N0Disable
Relay with_crypto_provider - Configures the endpoint to use the n0 defaults, but with relay mode disabled.
Traits§
- Preset
- Defines a preset
\ No newline at end of file
+let endpoint = Endpoint::builder(presets::N0).bind().await?;Structs§
- Empty
- An empty preset that doesn’t set anything on the builder.
- Minimal
with_crypto_provider - A preset that is almost empty, besides setting mandatory options.
- N0
with_crypto_provider - Configures the endpoint to use the n0 defaults
- N0Disable
Relay with_crypto_provider - Configures the endpoint to use the n0 defaults, but with relay mode disabled.
Traits§
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint/presets/struct.N0.html b/pr/4036/docs/iroh/endpoint/presets/struct.N0.html
index 41c532b301..cf9fb0156e 100644
--- a/pr/4036/docs/iroh/endpoint/presets/struct.N0.html
+++ b/pr/4036/docs/iroh/endpoint/presets/struct.N0.html
@@ -6,8 +6,8 @@
setting the [rustls::crypto::CryptoProvider] to ring or aws-lc-rs, depending
on which feature is enabled in iroh (preferring ring if both are enabled).
-Due to the last point, this preset is only available with the ring or
-aws-lc-rs preset installed.
+
Due to the last point, this preset is only available with the tls-ring or
+tls-aws-lc-rs feature enabled.
If you want to set your own crypto provider, we recommend copying the
implementation of this preset into your own and setting the appropriate crypto
provider there.
diff --git a/pr/4036/docs/iroh/endpoint/presets/struct.N0DisableRelay.html b/pr/4036/docs/iroh/endpoint/presets/struct.N0DisableRelay.html
index dd14c88ba9..29795833c9 100644
--- a/pr/4036/docs/iroh/endpoint/presets/struct.N0DisableRelay.html
+++ b/pr/4036/docs/iroh/endpoint/presets/struct.N0DisableRelay.html
@@ -7,8 +7,8 @@ relay urls.
setting the [rustls::crypto::CryptoProvider] to ring or aws-lc-rs, depending
on which feature is enabled in iroh (preferring ring if both are enabled).
-Due to the last point, this preset is only available with the ring or
-aws-lc-rs preset installed.
+
Due to the last point, this preset is only available with the tls-ring or
+tls-aws-lc-rs feature enabled.
If you want to set your own crypto provider, we recommend copying the
implementation of this preset into your own and setting the appropriate crypto
provider there.
diff --git a/pr/4036/docs/iroh/endpoint/presets/trait.Preset.html b/pr/4036/docs/iroh/endpoint/presets/trait.Preset.html
index 59a71a95da..7e6f4bbcac 100644
--- a/pr/4036/docs/iroh/endpoint/presets/trait.Preset.html
+++ b/pr/4036/docs/iroh/endpoint/presets/trait.Preset.html
@@ -1,7 +1,7 @@
-Preset in iroh::endpoint::presets - Rust Preset
pub trait Preset {
+Preset in iroh::endpoint::presets - Rust Preset
pub trait Preset {
// Required method
fn apply(self, builder: Builder) -> Builder;
-}
Expand description
Defines a preset
+}Expand description
A reusable bundle of endpoint Builder configuration.
Required Methods§
Implementations on Foreign Types§
Source§impl Preset for Arc<TestTransport>
Available on crate feature unstable-custom-transports and (crate features test-utils) only.
Source§fn apply(self, builder: Builder) -> Builder
Configures the builder with this transport and the network’s address lookup.
§Example
diff --git a/pr/4036/docs/iroh/endpoint/struct.Builder.html b/pr/4036/docs/iroh/endpoint/struct.Builder.html
index 79894b8924..7cbb050d5e 100644
--- a/pr/4036/docs/iroh/endpoint/struct.Builder.html
+++ b/pr/4036/docs/iroh/endpoint/struct.Builder.html
@@ -92,7 +92,7 @@ is set to false explicitly.
destination addresses. It is valid to configure this, but no more than one such
socket should be bound or the routing will be non-deterministic.
To use a subnet with a non-zero prefix length as the default route in addition to
-being routed when its prefix matches, use `BindOpts::set_is_default_route.
+being routed when its prefix matches, use BindOpts::set_is_default_route.
Subnets with a prefix length of zero are always marked as default routes.
Finally note that most outgoing datagrams are part of an existing network flow. That
is, they are in response to an incoming datagram. In this case the outgoing datagram
@@ -142,7 +142,7 @@ direct addresses or relay URLs will fail.
Sourcepub fn addr_filter(self, filter: AddrFilter) -> Self
Sets the address filter applied to all address data before publishing.
This filter is applied once, at the AddressLookupServices level, before
distributing data to any individual address lookup service. This ensures
-consistent filtering regardless of how the services configured.
+consistent filtering regardless of how the services are configured.
Sourcepub fn clear_addr_filter(self) -> Self
Clears the address filter, allowing all addresses to be published.
This removes any filter previously set via Self::addr_filter, including
filters set by presets.
diff --git a/pr/4036/docs/iroh/endpoint/struct.ConnectOptions.html b/pr/4036/docs/iroh/endpoint/struct.ConnectOptions.html
index 30bf2e329e..3834b0244e 100644
--- a/pr/4036/docs/iroh/endpoint/struct.ConnectOptions.html
+++ b/pr/4036/docs/iroh/endpoint/struct.ConnectOptions.html
@@ -1,12 +1,12 @@
-ConnectOptions in iroh::endpoint - Rust ConnectOptions
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 ConnectOptions
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 QuicTransportConfig.
-Sourcepub fn with_transport_config(
+
Sourcepub fn with_transport_config(
self,
transport_config: QuicTransportConfig,
) -> Self
Sets the QUIC transport config options for this connection.
-Sourcepub fn with_additional_alpns(self, alpns: Vec<Vec<u8>>) -> Self
Sets ALPN identifiers that should be signaled as supported on connection, in
+
Sourcepub fn with_additional_alpns(self, alpns: Vec<Vec<u8>>) -> Self
Sets ALPN identifiers that should be signaled as supported on connection, in
addition to the main ALPN identifier used in Endpoint::connect_with_opts.
This allows connecting to servers that may only support older versions of your
protocol. In this case, you would add the older ALPN identifiers with this
@@ -20,7 +20,7 @@ list or the main ALPN identifiers on the accept side, see the endpoint
builder’s Builder::alpns function.
-Trait Implementations§
Source§impl Clone for ConnectOptions
Source§fn clone(&self) -> ConnectOptions
Returns a duplicate 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 duplicate 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/4036/docs/iroh/endpoint/struct.Connection.html b/pr/4036/docs/iroh/endpoint/struct.Connection.html
index ffc93497ee..74f53832af 100644
--- a/pr/4036/docs/iroh/endpoint/struct.Connection.html
+++ b/pr/4036/docs/iroh/endpoint/struct.Connection.html
@@ -8,7 +8,7 @@ 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<T: ConnectionState> Connection<T>
Implementations§
Source§impl<T: ConnectionState> Connection<T>
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.
@@ -18,13 +18,13 @@ consequence, the peer won’t be notified that a stream has been opened until th
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_bi(&self) -> AcceptBi<'_> ⓘ
Accepts 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 async fn closed(&self) -> ConnectionError
Waits 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.
@@ -97,17 +97,18 @@ strong and pseudorandom, and are suitable for use as keying material.
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)
See [noq_proto::TransportConfig::receive_window].
-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)
Sets the connection-level flow control receive window.
+See [noq_proto::TransportConfig::receive_window].
+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.
-Source§impl Connection<HandshakeCompleted>
Sourcepub fn remote_id(&self) -> EndpointId
Returns the EndpointId from the peer’s TLS certificate.
+Source§impl Connection<HandshakeCompleted>
Sourcepub fn remote_id(&self) -> EndpointId
Returns the EndpointId from the peer’s TLS certificate.
The PublicKey of an endpoint is also known as an EndpointId. This PublicKey is
included in the TLS certificate presented during the handshake when connecting.
This function allows you to get the EndpointId of the remote endpoint of this
connection.
-Sourcepub fn paths(&self) -> PathList<'_>
Returns the currently open network paths for this connection.
+Sourcepub fn paths(&self) -> PathList<'_>
Returns the currently open network paths for this connection.
A connection typically has one path via the relay server and,
once holepunching succeeds, a direct path. The returned
PathList is a snapshot taken at call time: it does not
@@ -116,14 +117,14 @@ already closed.
To observe changes over time, see Connection::paths_stream
for a stream of PathList snapshots and
Connection::path_events for individual PathEvents.
-Sourcepub fn paths_stream(&self) -> PathListStream<'_>
Returns a stream of PathList snapshots for this connection.
+Sourcepub fn paths_stream(&self) -> PathListStream<'_>
Returns a stream of PathList snapshots for this connection.
Yields the current snapshot on the first poll, and a fresh
snapshot whenever the open paths or the selected path change.
Ends when the connection closes.
The stream borrows this Connection. To consume it from a
spawned task, move a Connection clone into the task and
call this method inside.
-Sourcepub fn path_events(&self) -> PathEventStream
Returns a stream of PathEvents for this connection.
+Sourcepub fn path_events(&self) -> PathEventStream
Returns a stream of PathEvents for this connection.
Each event reports one of: a path opened, a path closed (with
final per-path statistics), the selected transmission path
changed, or the consumer fell behind. The stream ends when the
@@ -133,14 +134,14 @@ may be moved into a spawned task.
single PathEvent::Lagged; the current state of the open
paths and the selected path remains recoverable via
Connection::paths.
-Sourcepub fn weak_handle(&self) -> WeakConnectionHandle
Returns a WeakConnectionHandle for this connection.
+Sourcepub fn weak_handle(&self) -> WeakConnectionHandle
Returns a WeakConnectionHandle for this connection.
A WeakConnectionHandle does not keep the connection alive. It can be used to
wait for the connection to be closed via WeakConnectionHandle::closed and to
attempt to upgrade back to a strong Connection via
WeakConnectionHandle::upgrade.
-Source§impl Connection<IncomingZeroRtt>
Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
-Sourcepub async fn handshake_completed(&self) -> Result<Connection, ConnectingError>
Waits until the full handshake occurs and then returns a Connection.
+Source§impl Connection<IncomingZeroRtt>
Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
+Sourcepub async fn handshake_completed(&self) -> Result<Connection, ConnectingError>
Waits until the full handshake occurs and then returns a Connection.
This may fail with ConnectingError::ConnectionError, if there was
some general failure with the connection, such as a network timeout since
we accepted the connection.
@@ -149,18 +150,18 @@ doesn’t use the right TLS authentication, which usually every iroh endpoint
uses and requires.
Thus, those errors should only occur if someone connects to you with a
modified iroh endpoint or with a plain QUIC client.
-Sourcepub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError>
Returns the EndpointId from the peer’s TLS certificate.
+Sourcepub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError>
Returns the EndpointId from the peer’s TLS certificate.
The PublicKey of an endpoint is also known as an EndpointId. This PublicKey is
included in the TLS certificate presented during the handshake when connecting.
This function allows you to get the EndpointId of the remote endpoint of this
connection.
-Source§impl Connection<OutgoingZeroRtt>
Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
+Sourcepub async fn handshake_completed(
&self,
) -> Result<ZeroRttStatus, ConnectingError>
Waits until the full handshake occurs and returns a ZeroRttStatus.
-If ZeroRttStatus::Accepted is returned, than any streams created before
+
If ZeroRttStatus::Accepted is returned, then any streams created before
the handshake has completed can still be used.
-If ZeroRttStatus::Rejected is returned, than any streams created before
+
If ZeroRttStatus::Rejected is returned, then any streams created before
the handshake will error and any data sent should be re-sent on a
new stream.
This may fail with ConnectingError::ConnectionError, if there was
@@ -171,7 +172,7 @@ doesn’t use the right TLS authentication, which usually every iroh endpoint
uses and requires.
Thus, those errors should only occur if someone connects to you with a
modified iroh endpoint or with a plain QUIC client.
-Sourcepub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError>
Returns the EndpointId from the peer’s TLS certificate.
+Sourcepub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError>
Returns the EndpointId from the peer’s TLS certificate.
The PublicKey of an endpoint is also known as an EndpointId. This PublicKey is
included in the TLS certificate presented during the handshake when connecting.
This function allows you to get the EndpointId of the remote endpoint of this
diff --git a/pr/4036/docs/iroh/endpoint/struct.Endpoint.html b/pr/4036/docs/iroh/endpoint/struct.Endpoint.html
index cfd63c979e..0c6c2630b7 100644
--- a/pr/4036/docs/iroh/endpoint/struct.Endpoint.html
+++ b/pr/4036/docs/iroh/endpoint/struct.Endpoint.html
@@ -13,7 +13,7 @@ behaviour.
Endpoint::connect and Endpoint::accept methods. Once established, the
Connection gives access to most QUIC features. Individual streams to send data to
the peer are created using the Connection::open_bi, Connection::accept_bi,
-Connection::open_uni and Connection::open_bi functions.
+Connection::open_uni and Connection::accept_uni 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.
§Usage on Android
@@ -22,7 +22,7 @@ through JNI, which needs a JVM context published to DnsResolver for the supported
initialization paths.
-Implementations§
Source§impl Endpoint
Implementations§
Source§impl Endpoint
Sourcepub fn set_alpns(&self, alpns: Vec<Vec<u8>>)
Sets the list of accepted ALPN protocols.
This will only affect new incoming connections.
@@ -117,8 +117,8 @@ changes.
understand if the endpoint has ever been considered “online”. But after
that initial call to Endpoint::online, to understand if your
endpoint is no longer able to be connected to by endpoints outside
-of the private or local network, watch for changes in it’s EndpointAddr.
-If there are no addrsin the EndpointAddr, you may not be dialable by other endpoints
+of the private or local network, watch for changes in its EndpointAddr.
+If there are no addrs in the EndpointAddr, you may not be dialable by other endpoints
on the internet.
The EndpointAddr will change as:
@@ -146,7 +146,7 @@ tokio::spawn(endpoint_closed.run_until(async move {
}));
// Do fancy things, then close the endpoint.
// Our task above will stop even if there are still clones of `Endpoint` alive somewhere.
-endpoint.close().await;
Sourcepub async fn online(&self)
A convenience method that waits for the endpoint to be considered “online”.
This currently means at least one relay server has completed its
connection handshake (i.e. the endpoint is registered and reachable
via that relay). Merely selecting a relay URL is not sufficient.
@@ -167,49 +167,45 @@ entirely.
The online method does not interact with crate::address_lookup::AddressLookup
services, which means that any Address Lookup that relies on a WAN
connection is independent of the endpoint’s online status.
-§Examples
use iroh::Endpoint;
-
-#[tokio::main]
-async fn main() {
-// After this await returns, the endpoint is bound to a local socket.
-// It can be dialed, but almost certainly hasn't finished picking a
+§Examples
+// After this await returns, the endpoint is bound to a local socket.
+// It can be dialed, but almost certainly hasn't finished picking a
// relay.
-let endpoint = Endpoint::bind().await;
+let endpoint = Endpoint::bind(presets::N0).await?;
-// After this await returns we have a connection to at least one relay
+// After this await returns we have a connection to at least one relay
// and holepunching should work as expected.
-endpoint.online().await;
-}
Sourcepub fn home_relay_status(
+endpoint.online().await;
Sourcepub fn home_relay_status(
&self,
) -> impl Watcher<Value = Vec<RelayStatus>> + use<>
Returns a Watcher over the connection status of the endpoint’s home relays.
The watched value has one entry per home relay whose URL is known,
and is empty when no relays are configured or before the endpoint has
-selected one the home relay from the list of configured relays.
+selected a home relay from the list of configured relays.
The watcher updates whenever any home relay’s connection status changes.
See RelayStatus for the information available on each entry.
The returned watcher only becomes disconnected once the last clone of
the Endpoint is dropped. Closing the endpoint does not disconnect
the watcher. To stop a task once the endpoint stops, combine with
Self::closed.
-Sourcepub fn bound_sockets(&self) -> Vec<SocketAddr>
Available on non-wasm_browser only.
Returns the local socket addresses on which the underlying sockets are bound.
+Sourcepub fn bound_sockets(&self) -> Vec<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 dns_resolver(&self) -> Result<&DnsResolver, EndpointError>
Available on non-wasm_browser only.
Returns the DNS resolver used in this Endpoint.
+Sourcepub fn dns_resolver(&self) -> Result<&DnsResolver, EndpointError>
Available on non-wasm_browser only.
Sourcepub fn tls_config(&self) -> &ClientConfig
Returns the [rustls::ClientConfig] used by the endpoint for connecting to external services.
+Sourcepub fn tls_config(&self) -> &ClientConfig
Returns the [rustls::ClientConfig] used by the endpoint for connecting to external services.
This might be useful for address lookup services or other functions
that want to use the same trust anchors as iroh does for verifying the
validity of TLS certificates presented by external services.
Note that this TLS config is unrelated to how iroh validates the authenticity
of iroh connections itself.
The config is based on the trust anchors set via Builder::ca_tls_config.
-Sourcepub fn address_lookup(&self) -> Result<&AddressLookupServices, EndpointError>
Returns the Address Lookup service, if configured.
+Sourcepub fn address_lookup(&self) -> Result<&AddressLookupServices, EndpointError>
Returns the Address Lookup service, if configured.
§Errors
Returns a EndpointError::Closed error if the endpoint is closed.
-Sourcepub fn metrics(&self) -> &EndpointMetrics
Available on crate feature metrics only.
Returns metrics collected for this endpoint.
+Sourcepub fn metrics(&self) -> &EndpointMetrics
Available on crate feature metrics only.
Returns metrics collected for this endpoint.
The endpoint internally collects various metrics about its operation.
The returned EndpointMetrics struct contains all of these metrics.
You can access individual metrics directly by using the public fields:
@@ -275,13 +271,13 @@ registry.write().unwrap().register_all(endpoint.metrics());
.std_context("text")?;
assert!(res.contains(r#"TYPE socket_recv_datagrams counter"#));
-assert!(res.contains(r#"socket_recv_datagrams_total 0"#));Sourcepub async fn remote_info(&self, endpoint_id: EndpointId) -> Option<RemoteInfo>
Returns addressing information about a recently used remote endpoint.
+assert!(res.contains(r#"socket_recv_datagrams_total 0"#));Sourcepub async fn remote_info(&self, endpoint_id: EndpointId) -> Option<RemoteInfo>
Returns addressing information about a recently used remote endpoint.
The returned RemoteInfo contains a list of all transport addresses for the remote
that we know about. This is a snapshot in time and not a watcher.
Returns None if the endpoint doesn’t have information about the remote or if the endpoint is closed.
When remote endpoints are no longer used, our endpoint will keep information around
for a little while, and then drop it. Afterwards, this will return None.
-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
@@ -290,14 +286,14 @@ 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.
If the endpoint is closed, this method will log a warning and ignore the request.
-Sourcepub fn set_user_data_for_address_lookup(&self, user_data: Option<UserData>)
Sets the initial user-defined data to be published in Address Lookups for this endpoint.
+Sourcepub fn set_user_data_for_address_lookup(&self, user_data: Option<UserData>)
Sets the initial user-defined data to be published in Address Lookups for this endpoint.
If the user-defined data passed to this function is different to the previous one,
the endpoint will republish its endpoint info to the configured Address Lookups.
See also Builder::user_data_for_address_lookup for setting an initial value when
building the endpoint.
If the endpoint is closed, this method will log a warning and ignore the
request.
-Sourcepub async fn close(&self)
Closes the QUIC endpoint and the 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.
@@ -322,9 +318,9 @@ sockets. This is due to QUIC and its acknowledgments being implemented in user-l
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.
-Sourcepub fn closed(&self) -> EndpointClosed ⓘ
Returns a future that resolves once the endpoint closes.
+the respective Endpoint are dropped.
+Sourcepub fn closed(&self) -> EndpointClosed ⓘ
Returns a future that resolves once the endpoint closes.
The returned future does not contain a clone or reference to the Endpoint,
so keeping the returned future alive does not prevent the endpoint from being dropped.
To run a task and stop it once the endpoint closes, you can use
@@ -333,7 +329,7 @@ so keeping the returned future alive does not prevent the endpoint from being dr
let endpoint = Endpoint::bind(presets::N0).await?;
tokio::spawn(endpoint.closed().run_until(async move {
// the future will be aborted once the endpoint closes.
-}));
Sourcepub fn create_server_config_builder(
+}));
Sourcepub fn create_server_config_builder(
&self,
alpns: Vec<Vec<u8>>,
) -> ServerConfigBuilder
Create a ServerConfigBuilder for this endpoint that includes the given alpns.
diff --git a/pr/4036/docs/iroh/endpoint/struct.EndpointClosed.html b/pr/4036/docs/iroh/endpoint/struct.EndpointClosed.html
index 85b8fd921b..1a2b9e3683 100644
--- a/pr/4036/docs/iroh/endpoint/struct.EndpointClosed.html
+++ b/pr/4036/docs/iroh/endpoint/struct.EndpointClosed.html
@@ -1,9 +1,9 @@
-EndpointClosed in iroh::endpoint - Rust EndpointClosed
pub struct EndpointClosed { /* private fields */ }
Expand description
Future returned from Endpoint::closed.
-Implementations§
Source§impl EndpointClosed
Sourcepub async fn run_until<F: Future>(self, fut: F) -> Option<F::Output>
Runs a future to completion, or until the Endpoint is closed.
+EndpointClosed in iroh::endpoint - Rust EndpointClosed
pub struct EndpointClosed { /* private fields */ }
Expand description
Future returned from Endpoint::closed.
+Implementations§
Trait Implementations§
Source§impl Debug for EndpointClosed
Source§impl Future for EndpointClosed
Source§impl<'pin> Unpin for EndpointClosedwhere
+
Trait Implementations§
Source§impl Debug for EndpointClosed
Source§impl Future for EndpointClosed
Source§impl<'pin> Unpin for EndpointClosedwhere
PinnedFieldsOf<__EndpointClosed<'pin>>: Unpin,
Auto Trait Implementations§
§impl !Freeze for EndpointClosed
§impl !RefUnwindSafe for EndpointClosed
§impl Send for EndpointClosed
§impl Sync for EndpointClosed
§impl !UnwindSafe for EndpointClosed
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/4036/docs/iroh/endpoint/struct.Incoming.html b/pr/4036/docs/iroh/endpoint/struct.Incoming.html
index d0a2c29af8..eca1097eca 100644
--- a/pr/4036/docs/iroh/endpoint/struct.Incoming.html
+++ b/pr/4036/docs/iroh/endpoint/struct.Incoming.html
@@ -24,7 +24,7 @@ to customize a Sourcepub fn remote_addr_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_addr().
-Sourcepub fn decrypt(&self) -> Option<DecryptedInitial>
Decrypt the Initial packet payload
+Sourcepub fn decrypt(&self) -> Option<DecryptedInitial>
Decrypts the Initial packet payload.
This clones and decrypts the packet payload (~1200 bytes).
Can be used to extract information from the TLS ClientHello without completing the handshake.
Trait Implementations§
Source§impl IntoFuture for Incoming
Source§type Output = Result<Connection, ConnectingError>
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§
Source§impl<T> Any for Twhere
diff --git a/pr/4036/docs/iroh/endpoint/struct.QuicTransportConfigBuilder.html b/pr/4036/docs/iroh/endpoint/struct.QuicTransportConfigBuilder.html
index 3a193bd40a..5189f21509 100644
--- a/pr/4036/docs/iroh/endpoint/struct.QuicTransportConfigBuilder.html
+++ b/pr/4036/docs/iroh/endpoint/struct.QuicTransportConfigBuilder.html
@@ -136,7 +136,7 @@ enable multipath as well.
If the path is idle for this long the path will be abandoned. Bear in mind this will
interact with the QuicTransportConfigBuilder::max_idle_timeout, if the last path is
abandoned the entire connection will be closed.
-Note: values higher than [PATH_MAX_IDLE_TIMEOUT] are clamped and a warning is logged.
+Note: values higher than PATH_MAX_IDLE_TIMEOUT (15 seconds) are clamped and a warning is logged.
Sourcepub fn default_path_keep_alive_interval(self, interval: Duration) -> Self
Sets a default per-path keep alive interval.
Note that this does not interact with the connection-wide
QuicTransportConfigBuilder::keep_alive_interval. This setting will keep this path active,
diff --git a/pr/4036/docs/iroh/endpoint/struct.RelayStatus.html b/pr/4036/docs/iroh/endpoint/struct.RelayStatus.html
index 175b637f76..a1abba7e98 100644
--- a/pr/4036/docs/iroh/endpoint/struct.RelayStatus.html
+++ b/pr/4036/docs/iroh/endpoint/struct.RelayStatus.html
@@ -1,13 +1,13 @@
-
RelayStatus in iroh::endpoint - Rust RelayStatus
pub struct RelayStatus { /* private fields */ }
Expand description
Connection status of a single home relay.
+RelayStatus in iroh::endpoint - Rust RelayStatus
pub struct RelayStatus { /* private fields */ }
Expand description
Connection status of a single home relay.
Observed via Endpoint::home_relay_status.
-Implementations§
Source§impl RelayStatus
Sourcepub fn is_connected(&self) -> bool
Returns true if the endpoint is connected to the relay.
-Sourcepub fn last_error(&self) -> Option<&AnyError>
Returns the most recent connection error, if the relay is currently
+
Implementations§
Source§impl RelayStatus
Sourcepub fn is_connected(&self) -> bool
Returns true if the endpoint is connected to the relay.
+Sourcepub fn last_error(&self) -> Option<&AnyError>
Returns the most recent connection error, if the relay is currently
disconnected.
Returns None when the relay is connected, or when the endpoint has
not yet observed a failed connection attempt.
-Trait Implementations§
Source§impl Clone for RelayStatus
Source§fn clone(&self) -> RelayStatus
Returns a duplicate 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 RelayStatus
Source§impl PartialEq for RelayStatus
Source§impl Eq for RelayStatus
Source§impl StructuralPartialEq for RelayStatus
Auto Trait Implementations§
§impl Freeze for RelayStatus
§impl !RefUnwindSafe for RelayStatus
§impl Send for RelayStatus
§impl Sync for RelayStatus
§impl Unpin for RelayStatus
§impl !UnwindSafe for RelayStatus
Blanket Implementations§
Trait Implementations§
Source§impl Clone for RelayStatus
Source§fn clone(&self) -> RelayStatus
Returns a duplicate 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 RelayStatus
Source§impl PartialEq for RelayStatus
Source§impl Eq for RelayStatus
Source§impl StructuralPartialEq for RelayStatus
Auto Trait Implementations§
§impl Freeze for RelayStatus
§impl !RefUnwindSafe for RelayStatus
§impl Send for RelayStatus
§impl Sync for RelayStatus
§impl Unpin for RelayStatus
§impl !UnwindSafe for RelayStatus
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/4036/docs/iroh/endpoint/struct.VarInt.html b/pr/4036/docs/iroh/endpoint/struct.VarInt.html
index 0acf99654d..007540d1af 100644
--- a/pr/4036/docs/iroh/endpoint/struct.VarInt.html
+++ b/pr/4036/docs/iroh/endpoint/struct.VarInt.html
@@ -13,7 +13,7 @@ An integer less than 2^62
of overflowing.
Trait Implementations§
§impl From<VarInt> for IdleTimeout
§fn from(inner: VarInt) -> IdleTimeout
Converts to this type from the input type.§impl From<VarInt> for IdleTimeout
§fn from(inner: VarInt) -> IdleTimeout
Converts to this type from the input type.§impl Ord for VarInt
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
diff --git a/pr/4036/docs/iroh/endpoint/struct.WeakConnectionHandle.html b/pr/4036/docs/iroh/endpoint/struct.WeakConnectionHandle.html
index 47f6c23610..07bad208d7 100644
--- a/pr/4036/docs/iroh/endpoint/struct.WeakConnectionHandle.html
+++ b/pr/4036/docs/iroh/endpoint/struct.WeakConnectionHandle.html
@@ -1,18 +1,18 @@
-WeakConnectionHandle in iroh::endpoint - Rust WeakConnectionHandle
pub struct WeakConnectionHandle { /* private fields */ }
Expand description
A weak handle to a Connection.
+WeakConnectionHandle in iroh::endpoint - Rust WeakConnectionHandle
pub struct WeakConnectionHandle { /* private fields */ }
Expand description
A weak handle to a Connection.
A WeakConnectionHandle does not keep the connection alive: holding one will not
prevent the connection from being closed when the last Connection handle is dropped.
Use upgrade to obtain a strong Connection, and closed to wait for the
connection to be closed without keeping it alive.
-Implementations§
Source§impl WeakConnectionHandle
Sourcepub fn upgrade(&self) -> Option<Connection>
Attempts to upgrade this weak handle to a strong Connection.
+Implementations§
Source§impl WeakConnectionHandle
Sourcepub fn upgrade(&self) -> Option<Connection>
Attempts to upgrade this weak handle to a strong Connection.
Returns None if the connection has already been dropped.
-Sourcepub fn closed(&self) -> impl Future<Output = Option<Closed>> + Send + 'static
Returns a future that resolves once the connection has been closed.
+Sourcepub fn closed(&self) -> impl Future<Output = Option<Closed>> + Send + 'static
Returns a future that resolves once the connection has been closed.
If no strong references to the Connection exist at the time this is called,
the future resolves to None. If at least one strong reference still exists at
the time of this call, the returned future is guaranteed to receive the close
event with the close reason and final connection statistics, even if all strong
references are dropped before the future is awaited.
The future does not keep the connection alive.
-Trait Implementations§
Source§impl Clone for WeakConnectionHandle
Source§fn clone(&self) -> WeakConnectionHandle
Returns a duplicate 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 WeakConnectionHandle
§impl !RefUnwindSafe for WeakConnectionHandle
§impl Send for WeakConnectionHandle
§impl Sync for WeakConnectionHandle
§impl Unpin for WeakConnectionHandle
§impl !UnwindSafe for WeakConnectionHandle
Blanket Implementations§
Trait Implementations§
Source§impl Clone for WeakConnectionHandle
Source§fn clone(&self) -> WeakConnectionHandle
Returns a duplicate 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 WeakConnectionHandle
§impl !RefUnwindSafe for WeakConnectionHandle
§impl Send for WeakConnectionHandle
§impl Sync for WeakConnectionHandle
§impl Unpin for WeakConnectionHandle
§impl !UnwindSafe for WeakConnectionHandle
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/4036/docs/iroh/endpoint/trait.EndpointHooks.html b/pr/4036/docs/iroh/endpoint/trait.EndpointHooks.html
index 2ac883dd5d..90c7ff04fc 100644
--- a/pr/4036/docs/iroh/endpoint/trait.EndpointHooks.html
+++ b/pr/4036/docs/iroh/endpoint/trait.EndpointHooks.html
@@ -17,7 +17,7 @@
For each hook, all installed hooks are invoked in the order they were installed on
the endpoint builder. If a hook returns Accept, processing continues with the next
hook. If a hook returns Reject, processing is aborted and further hooks
-are not invoked for this hook.
+are not invoked for this hook point.
§Notes to implementers
As hooks are stored on the endpoint, you must make sure to never store an Endpoint
on the hook struct itself, as this would create reference counting loop and cause the
diff --git a/pr/4036/docs/iroh/endpoint_info/index.html b/pr/4036/docs/iroh/endpoint_info/index.html
index f27fe3b898..4a60b9fd8f 100644
--- a/pr/4036/docs/iroh/endpoint_info/index.html
+++ b/pr/4036/docs/iroh/endpoint_info/index.html
@@ -1,11 +1,11 @@
iroh::endpoint_info - Rust Module endpoint_info
Expand description
Support for handling DNS resource records for dialing by EndpointId.
Dialing by EndpointId is supported by iroh endpoints publishing Pkarr records to DNS
servers or the Mainline DHT. This module supports creating and parsing these records.
-EndpointInfo combines an iroh_base::EndpointId with EndpointData —
+
EndpointInfo combines an iroh_base::EndpointId with EndpointData:
the addressing and metadata that discovery services publish and resolve.
Discovery services use AddrFilter to control which addresses are published.
This module also provides serialization to and from pkarr signed packets and
-DNS TXT records. See the [crate::attrs] module for the on-the-wire format.
+DNS TXT records.
DNS records are published under the following names:
_iroh.<z32-endpoint-id>.<origin-domain> TXT
@@ -36,4 +36,4 @@ Each address is an IPv4 or IPv6 address with a port.
Structs§
- Addr
Filter - A filter and/or reordering function applied to transport addresses,
-typically used by AddressLookup services in iroh before publishing.
- Endpoint
Data - Data about an endpoint that may be published to and resolved from discovery services.
- Endpoint
Info - Information about an endpoint that may be published to and resolved from discovery services.
- MaxLength
ExceededError - Error returned when an input value is too long for
UserData. - User
Data - Under the hood this is a UTF-8 String is no longer than
UserData::MAX_LENGTH bytes.
\ No newline at end of file
+typically used by AddressLookup services in iroh before publishing.EndpointData Data about an endpoint that may be published to and resolved from discovery services. EndpointInfo Information about an endpoint that may be published to and resolved from discovery services. MaxLengthExceededError Error returned when an input value is too long for UserData. UserData User-defined data that can be published and resolved through endpoint discovery.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint_info/struct.EndpointData.html b/pr/4036/docs/iroh/endpoint_info/struct.EndpointData.html
index eaf2725892..2c818ea5b4 100644
--- a/pr/4036/docs/iroh/endpoint_info/struct.EndpointData.html
+++ b/pr/4036/docs/iroh/endpoint_info/struct.EndpointData.html
@@ -13,15 +13,15 @@ services, should they not fit into e.g. a single DNS packet otherwise.
See also Self::set_user_data.
Sourcepub fn add_relay_url(&mut self, relay_url: RelayUrl)
Adds the relay URL to the end of the endpoint data, unless it already existed.
Sourcepub fn add_ip_addrs(&mut self, addresses: Vec<SocketAddr>)
Adds addresses in order with duplicates or already existing addresses filtered out.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Adds addresses to the endpoint data in the given ordered, but with duplicates filtered.
-Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data and returns the updated endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Adds addresses to the endpoint data in the given order, but with duplicates filtered.
+Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data.
Sourcepub fn clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn clear_relay_urls(&mut self)
Removes all relay URLs from the endpoint data.
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses.
+Sourcepub fn filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
Returns a vec to allow re-ordering of addresses.
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
diff --git a/pr/4036/docs/iroh/endpoint_info/struct.UserData.html b/pr/4036/docs/iroh/endpoint_info/struct.UserData.html
index 3352480631..e73207e05e 100644
--- a/pr/4036/docs/iroh/endpoint_info/struct.UserData.html
+++ b/pr/4036/docs/iroh/endpoint_info/struct.UserData.html
@@ -1,4 +1,5 @@
-UserData in iroh::endpoint_info - Rust 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.
+UserData in iroh::endpoint_info - Rust UserData
pub struct UserData(/* private fields */);
Expand description
User-defined data that can be published and resolved through endpoint discovery.
+Under the hood this is a UTF-8 string 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.
diff --git a/pr/4036/docs/iroh/enum.KeyParsingError.html b/pr/4036/docs/iroh/enum.KeyParsingError.html
index 765ac27ad2..146ec05698 100644
--- a/pr/4036/docs/iroh/enum.KeyParsingError.html
+++ b/pr/4036/docs/iroh/enum.KeyParsingError.html
@@ -1,4 +1,4 @@
-KeyParsingError in iroh - Rust KeyParsingError
#[non_exhaustive]pub enum KeyParsingError {
+KeyParsingError in iroh - Rust KeyParsingError
#[non_exhaustive]pub enum KeyParsingError {
FailedToDecodeHex {
meta: Meta,
},
@@ -11,14 +11,14 @@
InvalidKeyData {
meta: Meta,
},
-}
Expand description
Error when deserialising a PublicKey or a SecretKey.
+}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§FailedToDecodeHex
The input string could not be decoded as hex.
Fields
§meta: MetaCaptured call-site metadata
§FailedToDecodeBase32
The input string could not be decoded as base32.
Fields
§meta: MetaCaptured call-site metadata
§InvalidLength
The input has invalid length.
Fields
§meta: MetaCaptured call-site metadata
-§InvalidKeyData
The decoded data is not a valid Ed25591 public key.
+§InvalidKeyData
The decoded data is not a valid Ed25519 public key.
Fields
§meta: MetaCaptured call-site metadata
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<KeyParsingError> for ParseError
Source§fn from(source: KeyParsingError) -> ParseError
Converts to this type from the input type.Source§impl StackError for KeyParsingError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<KeyParsingError>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Returns the next source in the chain, if any.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.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
diff --git a/pr/4036/docs/iroh/enum.TransportAddr.html b/pr/4036/docs/iroh/enum.TransportAddr.html
index df614a51ee..0e5f31d772 100644
--- a/pr/4036/docs/iroh/enum.TransportAddr.html
+++ b/pr/4036/docs/iroh/enum.TransportAddr.html
@@ -3,8 +3,8 @@
Ip(SocketAddr),
Custom(CustomAddr),
}Expand description
Available address types.
-Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§Relay(RelayUrl)
Relays
-§Ip(SocketAddr)
IP based addresses
+Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§Relay(RelayUrl)
A relay server address.
+§Ip(SocketAddr)
An IP based address.
§Custom(CustomAddr)
Custom transport address
Implementations§
Source§impl TransportAddr
Sourcepub fn is_ip(&self) -> bool
Whether this is an IP transport address.
diff --git a/pr/4036/docs/iroh/index.html b/pr/4036/docs/iroh/index.html
index a2ddd5617a..8c7bddcb16 100644
--- a/pr/4036/docs/iroh/index.html
+++ b/pr/4036/docs/iroh/index.html
@@ -1,5 +1,5 @@
iroh - Rust Crate iroh
Expand description
Peer-to-peer QUIC connections.
-iroh is a library to establish direct connectivity between peers. It exposes an
+
iroh is a library to establish direct connectivity between peers. It exposes an
interface to QUIC connections and streams to the user, while implementing direct
connectivity using hole punching complemented by relay servers under the hood.
An iroh endpoint is created and controlled by the Endpoint, e.g. connecting to
@@ -44,7 +44,7 @@ punching if needed. Once the direct connection is established the relay ser
longer involved in the connection.
If one of the iroh endpoints can be reached directly, connectivity can also be
established without involving a Relay server. This is done by using the endpoint’s
-listening addresses in the connection establishement instead of the RelayUrl which
+listening addresses in the connection establishment instead of the RelayUrl which
is used to identify a Relay server. Of course it is also possible to use both a
RelayUrl and direct addresses at the same time to connect.
§Encryption
@@ -179,4 +179,4 @@ connecting using only the Ok(())
}
Please see the examples directory for more nuanced examples.
-Re-exports§
Modules§
- address_
lookup - Lookup the address of an Endpoint ID.
- defaults
- Default values used in
iroh - dns
Non-wasm_browser - Configurable DNS resolver.
- endpoint
- The
Endpoint allows establishing connections to other iroh endpoints. - endpoint_
info - Support for handling DNS resource records for dialing by
EndpointId. - metrics
- Co-locating all of the iroh metrics structs
- protocol
- Tools for spawning an accept loop that routes incoming requests to the right protocol.
- test_
utils test-utils - Internal utilities to support testing.
- tls
- TLS configuration for iroh.
Structs§
- Endpoint
Addr - Network-level addressing information for an iroh endpoint.
- NetReport
- A net_report report.
- NetReport
Config - Configuration for the net report component.
- Public
Key - A public key.
- Relay
Config - Information on a specific relay server.
- Relay
Map - List of relay server configurations to be used in an iroh endpoint.
- Relay
Url - A URL identifying a relay server.
- Relay
UrlParseError - Can occur when parsing a string into a
RelayUrl. - Secret
Key - A secret key.
- Signature
- Ed25519 signature.
- Signature
Error - Verification of a signature failed.
Enums§
- KeyParsing
Error - Error when deserialising a
PublicKey or a SecretKey. - Transport
Addr - Available address types.
Constants§
- NET_
REPORT_TIMEOUT - The maximum amount of time, in seconds, the net_report will spend gathering a single report.
Traits§
- Watcher
- A handle to a value that’s represented by one or more underlying [
Watchable]s.
Type Aliases§
- Endpoint
Id - The identifier for an endpoint in the (iroh) network.
\ No newline at end of file
+Re-exports§
Modules§
- address_
lookup - Lookup the address of an Endpoint ID.
- defaults
- Default values used in
iroh - dns
Non-wasm_browser - Configurable DNS resolver.
- endpoint
- The
Endpoint allows establishing connections to other iroh endpoints. - endpoint_
info - Support for handling DNS resource records for dialing by
EndpointId. - metrics
- Co-locating all of the iroh metrics structs
- protocol
- Tools for spawning an accept loop that routes incoming requests to the right protocol.
- test_
utils test-utils - Internal utilities to support testing.
- tls
- TLS configuration for iroh.
Structs§
- Endpoint
Addr - Network-level addressing information for an iroh endpoint.
- NetReport
- A net_report report.
- NetReport
Config - Configuration for the net report component.
- Public
Key - A public key.
- Relay
Config - Information on a specific relay server.
- Relay
Map - List of relay server configurations to be used in an iroh endpoint.
- Relay
Url - A URL identifying a relay server.
- Relay
UrlParseError - Can occur when parsing a string into a
RelayUrl. - Secret
Key - A secret key.
- Signature
- Ed25519 signature.
- Signature
Error - Verification of a signature failed.
Enums§
- KeyParsing
Error - Error returned when parsing a
PublicKey or a SecretKey. - Transport
Addr - Available address types.
Constants§
- NET_
REPORT_TIMEOUT - The maximum amount of time, in seconds, the net_report will spend gathering a single report.
Traits§
- Watcher
- A handle to a value that’s represented by one or more underlying [
Watchable]s.
Type Aliases§
- Endpoint
Id - The identifier for an endpoint in the (iroh) network.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/metrics/index.html b/pr/4036/docs/iroh/metrics/index.html
index da53db7d6a..00f2275127 100644
--- a/pr/4036/docs/iroh/metrics/index.html
+++ b/pr/4036/docs/iroh/metrics/index.html
@@ -1,2 +1,2 @@
iroh::metrics - Rust Module metrics
Expand description
Co-locating all of the iroh metrics structs
-Structs§
- Endpoint
Metrics - Metrics collected by an
crate::endpoint::Endpoint. - NetReport
Metrics - Enum of metrics for the module
- Relay
Metrics test-utils - Metrics tracked for the relay server
- Socket
Metrics - Enum of metrics for the module
\ No newline at end of file
+Structs§
- Endpoint
Metrics - Metrics collected by an
crate::endpoint::Endpoint. - NetReport
Metrics - Enum of metrics for the module
- Relay
Metrics test-utils - Metrics tracked for the relay server
- Socket
Metrics - Metrics collected by the iroh socket.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/metrics/struct.RelayMetrics.html b/pr/4036/docs/iroh/metrics/struct.RelayMetrics.html
index f8768e50a1..da2588f738 100644
--- a/pr/4036/docs/iroh/metrics/struct.RelayMetrics.html
+++ b/pr/4036/docs/iroh/metrics/struct.RelayMetrics.html
@@ -26,21 +26,26 @@
pub http_connections_closed: Counter,
pub http_connections_errored: Counter,
}Available on crate feature test-utils only.Expand description
Metrics tracked for the relay server
-Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.§bytes_sent: CounterBytes sent from a FrameType::SendPacket
-§bytes_recv: CounterBytes received from a FrameType::SendPacket
-§send_packets_sent: CounterFrameType::SendPacket sent
-§send_packets_recv: CounterFrameType::SendPacket received
-§send_packets_dropped: CounterFrameType::SendPacket dropped
-§other_packets_sent: CounterPackets of other FrameTypes sent
-§other_packets_recv: CounterPackets of other FrameTypes received
-§other_packets_dropped: CounterPackets of other FrameTypes dropped
-§got_ping: CounterNumber of FrameType::Pings received
-§sent_pong: CounterNumber of FrameType::Pongs sent
-§unknown_frames: CounterNumber of FrameType::Unknown received
+Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.§bytes_sent: CounterBytes sent to a client in RelayToClientDatagram or RelayToClientDatagramBatch frames.
+§bytes_recv: CounterBytes received from a client in ClientToRelayDatagram or ClientToRelayDatagramBatch frames.
+§send_packets_sent: CounterRelayToClientDatagram or RelayToClientDatagramBatch frames sent to a client.
+§send_packets_recv: CounterClientToRelayDatagram or ClientToRelayDatagramBatch frames received from a client.
+§send_packets_dropped: CounterRelayToClientDatagram or RelayToClientDatagramBatch frames dropped instead of being
+delivered to a client, because the recipient is not connected or writing to its stream failed.
+Note that frames dropped because the recipient’s send queue is full or closed are not counted
+here.
+§other_packets_sent: CounterIntended to count sent frames other than datagrams, but currently unused (never incremented).
+§other_packets_recv: CounterIntended to count received frames other than datagrams, but currently unused (never incremented).
+§other_packets_dropped: CounterIntended to count dropped frames other than datagrams, but currently unused (never incremented).
+§got_ping: CounterNumber of FrameType::Ping frames received from a client.
+§sent_pong: CounterNumber of FrameType::Pong frames sent to a client.
+§unknown_frames: CounterIntended to count received frames with an unrecognized FrameType,
+but currently unused (never incremented).
§bytes_rx_ratelimited_total: CounterNumber of bytes received from client connection which have been rate-limited.
§conns_rx_ratelimited_total: CounterNumber of client connections which have had any frames rate-limited.
§accepts: CounterNumber of times this server has accepted a connection.
-§disconnects: CounterNumber of connections we have removed because of an error
+§disconnects: CounterNumber of times a client connection was disconnected.
+Incremented once per connection, paired with Self::accepts.
§unique_client_keys: CounterNumber of unique client keys per day
§clients_inactive_added: CounterNumber of times a client was moved into the inactive state.
A client becomes inactive when a new client connects with the same endpoint id. An inactive
diff --git a/pr/4036/docs/iroh/metrics/struct.SocketMetrics.html b/pr/4036/docs/iroh/metrics/struct.SocketMetrics.html
index 2291657920..f61d3786bb 100644
--- a/pr/4036/docs/iroh/metrics/struct.SocketMetrics.html
+++ b/pr/4036/docs/iroh/metrics/struct.SocketMetrics.html
@@ -1,4 +1,4 @@
-
SocketMetrics in iroh::metrics - Rust SocketMetrics
#[non_exhaustive]pub struct SocketMetrics {Show 31 fields
+SocketMetrics in iroh::metrics - Rust SocketMetrics
#[non_exhaustive]pub struct SocketMetrics {Show 31 fields
pub update_direct_addrs: Counter,
pub send_ipv4: Counter,
pub send_ipv6: Counter,
@@ -30,10 +30,23 @@
pub actor_tick_direct_addr_heartbeat: Counter,
pub actor_link_change: Counter,
pub actor_tick_other: Counter,
-}
Expand description
Enum of metrics for the module
-Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.§update_direct_addrs: Counter§send_ipv4: Counter§send_ipv6: Counter§send_relay: Counter§recv_data_relay: Counter§recv_data_custom: Counter§recv_data_ipv4: Counter§recv_data_ipv6: Counter§recv_datagrams: CounterNumber of QUIC datagrams received.
-§recv_gro_datagrams: CounterNumber of datagrams received using GRO
-§relay_home_change: Counter§holepunch_attempts: CounterThe number of times holepunching is initiated on a connection.
+}Expand description
Metrics collected by the iroh socket.
+Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.§update_direct_addrs: CounterIntended to count updates to the local direct address set, but currently unused
+(never incremented).
+§send_ipv4: CounterNumber of bytes sent over IPv4.
+§send_ipv6: CounterNumber of bytes sent over IPv6.
+§send_relay: CounterNumber of bytes sent over the relay transport.
+§recv_data_relay: CounterNumber of data bytes received over the relay transport.
+§recv_data_custom: CounterNumber of data bytes received over any custom transport.
+§recv_data_ipv4: CounterNumber of data bytes received over IPv4.
+§recv_data_ipv6: CounterNumber of data bytes received over IPv6.
+§recv_datagrams: CounterNumber of QUIC datagrams received.
+§recv_gro_datagrams: CounterNumber of receive events that used GRO (coalesced datagram batches).
+This counts batches, not the individual datagrams within them. See
+Self::recv_datagrams for the datagram count.
+§relay_home_change: CounterNumber of times the home relay changed to a different relay.
+This includes the initial assignment from no home relay to a home relay.
+§holepunch_attempts: CounterThe number of times holepunching is initiated on a connection.
This can be incremented multiple times for a single connection. Note that only the
client-side of a connection will increment this counter.
§paths_direct: CounterThe number of network paths to peers that are direct.
@@ -53,8 +66,15 @@ the number of opened connections.
§transport_relay_paths_removed: CounterNumber of relay transport paths closed.
§transport_custom_paths_added: CounterNumber of custom transport paths opened.
§transport_custom_paths_removed: CounterNumber of custom transport paths closed.
-§actor_tick_main: Counter§actor_tick_msg: Counter§actor_tick_re_stun: Counter§actor_tick_portmap_changed: Counter§actor_tick_direct_addr_heartbeat: Counter§actor_link_change: Counter§actor_tick_other: CounterTrait Implementations§
Source§impl<'de> Deserialize<'de> for Metrics
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Iterable for Metrics
Source§fn metric_field_count(&self) -> usize
Returns the number of metric fields in the struct.Source§fn metric_field_ref(&self, n: usize) -> Option<MetricItem<'_>>
Returns the metric field at the given index.§fn family_field_count(&self) -> usize
Returns the number of Family fields in the struct.§fn family_field_ref(&self, _n: usize) -> Option<FamilyItem<'_>>
Returns the Family field at the given index.Source§impl Serialize for Metrics
Source§fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where
+§actor_tick_main: CounterNumber of iterations of the main socket actor loop.
+§actor_tick_msg: CounterNumber of actor messages processed by the socket actor loop.
+§actor_tick_re_stun: CounterNumber of periodic re-STUN timer ticks handled by the socket actor loop.
+§actor_tick_portmap_changed: CounterNumber of port-mapping change events handled by the socket actor loop.
+§actor_tick_direct_addr_heartbeat: CounterIntended to count direct address heartbeat ticks, but currently unused (never incremented).
+§actor_link_change: CounterNumber of local network interface (link) change events handled by the socket actor loop.
+§actor_tick_other: CounterNumber of times an input watcher or receiver closed in the socket actor loop.
+Trait Implementations§
Source§impl<'de> Deserialize<'de> for Metrics
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Iterable for Metrics
Source§fn metric_field_count(&self) -> usize
Returns the number of metric fields in the struct.Source§fn metric_field_ref(&self, n: usize) -> Option<MetricItem<'_>>
Returns the metric field at the given index.§fn family_field_count(&self) -> usize
Returns the number of Family fields in the struct.§fn family_field_ref(&self, _n: usize) -> Option<FamilyItem<'_>>
Returns the Family field at the given index.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
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/4036/docs/iroh/protocol/enum.IncomingFilterOutcome.html b/pr/4036/docs/iroh/protocol/enum.IncomingFilterOutcome.html
index e11345eddc..4577fe8eaf 100644
--- a/pr/4036/docs/iroh/protocol/enum.IncomingFilterOutcome.html
+++ b/pr/4036/docs/iroh/protocol/enum.IncomingFilterOutcome.html
@@ -11,7 +11,7 @@ the source address, actively refuse the connection, or silently drop it.
What this does depends on the connection type:
-
-
Direct (UDP) connections : this is QUIC source address
+
Direct (UDP) connections: this is QUIC source address
validation. If the socket address was spoofed, the retry token is
sent to the spoofed address, so we never hear from the attacker
again. If the address was real, the client repeats the connection
@@ -20,7 +20,7 @@ attempt with the token, and the next
-
-
Relay connections : there is no source address to validate
+
Relay connections: there is no source address to validate
(the relay already vouches for the packet origin), so the
“validation” itself has no security meaning. However, the retry
still imposes a real cost on the client: an extra round trip
diff --git a/pr/4036/docs/iroh/protocol/struct.RouterBuilder.html b/pr/4036/docs/iroh/protocol/struct.RouterBuilder.html
index dfc8969679..06b2f59fad 100644
--- a/pr/4036/docs/iroh/protocol/struct.RouterBuilder.html
+++ b/pr/4036/docs/iroh/protocol/struct.RouterBuilder.html
@@ -16,7 +16,7 @@ cheaper signals (e.g. remote address) first.
with this alpn.
handler can either be a type that implements ProtocolHandler or a
Box<dyn DynProtocolHandler>.
-
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for RouterBuilder
§impl !RefUnwindSafe for RouterBuilder
§impl Send for RouterBuilder
§impl Sync for RouterBuilder
§impl Unpin for RouterBuilder
§impl !UnwindSafe for RouterBuilder
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/4036/docs/iroh/struct.EndpointAddr.html b/pr/4036/docs/iroh/struct.EndpointAddr.html
index 0aa53df633..867818d655 100644
--- a/pr/4036/docs/iroh/struct.EndpointAddr.html
+++ b/pr/4036/docs/iroh/struct.EndpointAddr.html
@@ -5,7 +5,7 @@
This combines an endpoint’s identifier with network-level addressing information of how to
contact the endpoint.
To establish a network connection to an endpoint both the EndpointId and one or more network
-paths are needed. The network paths can come from various sources, current sources can come from
+paths are needed. The network paths can come from various sources:
-
An Address Lookup service which can provide routing information for a given EndpointId.
@@ -24,7 +24,7 @@ connection without the help of a Fields§§id: PublicKeyThe endpoint’s identifier.
-§addrs: BTreeSet<TransportAddr>The endpoint’s addresses
+§addrs: BTreeSet<TransportAddr>The endpoint’s addresses.
Implementations§
Source§impl EndpointAddr
Sourcepub fn new(id: PublicKey) -> EndpointAddr
Creates a new EndpointAddr with no network level addresses.
This still is usable with e.g. an address lookup service to establish a connection,
depending on the situation.
@@ -38,9 +38,9 @@ depending on the situation.
self,
addrs: impl IntoIterator<Item = TransportAddr>,
) -> EndpointAddrAdds a list of addresses.
-Sourcepub fn is_empty(&self) -> bool
Returns true, if only a EndpointId is present.
-Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns a list of IP addresses of this peer.
-Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns a list of relay urls of this peer.
+Sourcepub fn is_empty(&self) -> bool
Returns true if only an EndpointId is present.
+Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns an iterator over the IP addresses of this endpoint address.
+Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns an iterator over the relay URLs of this endpoint address.
In practice this is expected to be zero or one home relay for all known cases currently.
Trait Implementations§
Source§impl Clone for EndpointAddr
Source§fn clone(&self) -> EndpointAddr
Returns a duplicate 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 EndpointAddr
Source§impl<'de> Deserialize<'de> for EndpointAddr
Source§fn deserialize<__D>(
__deserializer: __D,
diff --git a/pr/4036/docs/iroh/struct.NetReport.html b/pr/4036/docs/iroh/struct.NetReport.html
index 693c855529..8b8ec1aed1 100644
--- a/pr/4036/docs/iroh/struct.NetReport.html
+++ b/pr/4036/docs/iroh/struct.NetReport.html
@@ -1,4 +1,4 @@
-NetReport in iroh - Rust NetReport
pub struct NetReport {
+NetReport in iroh - Rust NetReport
pub struct NetReport {
pub udp_v4: bool,
pub udp_v6: bool,
pub mapping_varies_by_dest_ipv4: Option<bool>,
@@ -13,17 +13,16 @@
§udp_v6: boolA QAD IPv6 round trip completed.
§mapping_varies_by_dest_ipv4: Option<bool>Whether the reported public address differs when probing different servers (on IPv4).
§mapping_varies_by_dest_ipv6: Option<bool>Whether the reported public address differs when probing different servers (on IPv6).
-§preferred_relay: Option<RelayUrl>Probe indicating the presence of port mapping protocols on the LAN.
-None for unknown
-§relay_latency: RelayLatencieskeyed by relay Url
-§global_v4: Option<SocketAddrV4>ip:port of global IPv4
-§global_v6: Option<SocketAddrV6>[ip]:port of global IPv6
+§preferred_relay: Option<RelayUrl>The relay server with the lowest latency, if any.
+§relay_latency: RelayLatenciesThe measured latency to each relay, keyed by relay URL.
+§global_v4: Option<SocketAddrV4>The discovered global IPv4 address and port, if any.
+§global_v6: Option<SocketAddrV6>The discovered global IPv6 address and port, if any.
§captive_portal: Option<bool>CaptivePortal is set when we think there’s a captive portal that is
intercepting HTTP traffic.
-Implementations§
Source§impl Report
Sourcepub fn mapping_varies_by_dest(&self) -> Option<bool>
Whether the reported public address differs when probing different servers.
+Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Report
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl PartialEq for Report
Source§impl Eq for Report
Source§impl StructuralPartialEq for Report
Auto Trait Implementations§
§impl Freeze for Report
§impl RefUnwindSafe for Report
§impl Send for Report
§impl Sync for Report
§impl Unpin for Report
§impl UnwindSafe for Report
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/4036/docs/iroh/struct.PublicKey.html b/pr/4036/docs/iroh/struct.PublicKey.html
index f8fb4c5ae2..b725772ddc 100644
--- a/pr/4036/docs/iroh/struct.PublicKey.html
+++ b/pr/4036/docs/iroh/struct.PublicKey.html
@@ -1,5 +1,5 @@
PublicKey in iroh - Rust PublicKey
pub struct PublicKey(/* private fields */);
Expand description
A public key.
-The key itself is stored as the CompressedEdwards y coordinate of the public key
+
The key itself is stored as the CompressedEdwards y-coordinate of the public key.
It is verified to decompress into a valid key when created.
Implementations§
Source§impl PublicKey
Sourcepub fn as_bytes(&self) -> &[u8; 32]
Get this public key as a byte array.
@@ -12,7 +12,7 @@ See [VerifyingKey::from_bytes] for details.
&self,
message: &[u8],
signature: &Signature,
-) -> Result<(), SignatureError>Verify a signature on a message with this secret key’s public key.
+) -> Result<(), SignatureError>Verify a signature on a message with this public key.
§Return
Returns Ok(()) if the signature is valid, and Err otherwise.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PublicKey
Source§fn deserialize<D>(
deserializer: D,
) -> Result<PublicKey, <D as Deserializer<'de>>::Error>where
- D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl From<PublicKey> for EndpointAddr
Source§fn from(endpoint_id: PublicKey) -> EndpointAddr
Converts to this type from the input type.Source§impl From<PublicKey> for EndpointAddr
Source§fn from(endpoint_id: PublicKey) -> EndpointAddr
Converts to this type from the input type.Source§impl FromStr for PublicKey
Parses a PublicKey from its hex or base32 encoding.
+
Display produces the hex encoding.
Source§impl Hash for PublicKey
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
H: Hasher,
diff --git a/pr/4036/docs/iroh/tls/index.html b/pr/4036/docs/iroh/tls/index.html
index 3c1d92cf2a..16f63b088e 100644
--- a/pr/4036/docs/iroh/tls/index.html
+++ b/pr/4036/docs/iroh/tls/index.html
@@ -1,5 +1,5 @@
iroh::tls - Rust Module tls
Expand description
TLS configuration for iroh.
-Currently there is one mechanisms available
+Currently there is one mechanism available:
- Raw Public Keys, using the TLS extension described in RFC 7250
diff --git a/pr/4036/docs/iroh_base/enum.KeyParsingError.html b/pr/4036/docs/iroh_base/enum.KeyParsingError.html
index d0668a511c..7c849cddf2 100644
--- a/pr/4036/docs/iroh_base/enum.KeyParsingError.html
+++ b/pr/4036/docs/iroh_base/enum.KeyParsingError.html
@@ -1,4 +1,4 @@
-KeyParsingError in iroh_base - Rust KeyParsingError
#[non_exhaustive]pub enum KeyParsingError {
+KeyParsingError in iroh_base - Rust KeyParsingError
#[non_exhaustive]pub enum KeyParsingError {
FailedToDecodeHex {
meta: Meta,
},
@@ -11,14 +11,14 @@
InvalidKeyData {
meta: Meta,
},
-}
Available on crate feature key only.Expand description
Error when deserialising a PublicKey or a SecretKey.
+}Available on crate feature key only.Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§FailedToDecodeHex
The input string could not be decoded as hex.
Fields
§meta: MetaCaptured call-site metadata
§FailedToDecodeBase32
The input string could not be decoded as base32.
Fields
§meta: MetaCaptured call-site metadata
§InvalidLength
The input has invalid length.
Fields
§meta: MetaCaptured call-site metadata
-§InvalidKeyData
The decoded data is not a valid Ed25591 public key.
+§InvalidKeyData
The decoded data is not a valid Ed25519 public key.
Fields
§meta: MetaCaptured call-site metadata
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<KeyParsingError> for AnyError
Source§fn from(value: KeyParsingError) -> AnyError
Converts to this type from the input type.Source§impl StackError for KeyParsingError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
Returns the next source in the chain, if any.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.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§
Source§impl<T> Borrow<T> for Twhere
diff --git a/pr/4036/docs/iroh_base/enum.TransportAddr.html b/pr/4036/docs/iroh_base/enum.TransportAddr.html
index ec9989aea4..a55428eb22 100644
--- a/pr/4036/docs/iroh_base/enum.TransportAddr.html
+++ b/pr/4036/docs/iroh_base/enum.TransportAddr.html
@@ -3,8 +3,8 @@
Ip(SocketAddr),
Custom(CustomAddr),
}Available on crate feature key only.Expand description
Available address types.
-Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§Relay(RelayUrl)
Relays
-§Ip(SocketAddr)
IP based addresses
+Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§Relay(RelayUrl)
A relay server address.
+§Ip(SocketAddr)
An IP based address.
§Custom(CustomAddr)
Custom transport address
Implementations§
Source§impl TransportAddr
PkarrRelayClientBuilder
pub struct PkarrRelayClientBuilder { /* private fields */ }Expand description
A builder for the PkarrRelayClient
Implementations§
Source§impl PkarrRelayClientBuilder
impl PkarrRelayClientBuilder
Sourcepub fn build(self) -> PkarrRelayClient
pub fn build(self) -> PkarrRelayClient
Build a PkarrRelayClient.
Trait Implementations§
Source§impl Clone for PkarrRelayClientBuilder
impl Clone for PkarrRelayClientBuilder
Source§fn clone(&self) -> PkarrRelayClientBuilder
fn clone(&self) -> PkarrRelayClientBuilder
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 PkarrRelayClientBuilder
impl !RefUnwindSafe for PkarrRelayClientBuilder
impl Send for PkarrRelayClientBuilder
impl Sync for PkarrRelayClientBuilder
impl Unpin for PkarrRelayClientBuilder
impl !UnwindSafe for PkarrRelayClientBuilder
Blanket Implementations§
Source§impl<T> Any for Twhere
+PkarrRelayClientBuilder in iroh::address_lookup::pkarr - Rust PkarrRelayClientBuilder
pub struct PkarrRelayClientBuilder { /* private fields */ }
Expand description
A builder for the PkarrRelayClient
+Implementations§
Source§impl PkarrRelayClientBuilder
Sourcepub fn build(self) -> PkarrRelayClient
Build a PkarrRelayClient.
+Trait Implementations§
Source§impl Clone for PkarrRelayClientBuilder
Source§fn clone(&self) -> PkarrRelayClientBuilder
Returns a duplicate 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 PkarrRelayClientBuilder
§impl !RefUnwindSafe for PkarrRelayClientBuilder
§impl Send for PkarrRelayClientBuilder
§impl Sync for PkarrRelayClientBuilder
§impl Unpin for PkarrRelayClientBuilder
§impl !UnwindSafe for PkarrRelayClientBuilder
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/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
index 13e12a4b01..1f7723299d 100644
--- a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
+++ b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
@@ -1,21 +1,21 @@
-PkarrResolver in iroh::address_lookup::pkarr - Rust PkarrResolver
pub struct PkarrResolver { /* private fields */ }
Expand description
Resolver of address lookup information from a pkarr relay.
+PkarrResolver in iroh::address_lookup::pkarr - Rust PkarrResolver
pub struct PkarrResolver { /* private fields */ }
Expand description
Resolver of address lookup information from a pkarr relay.
The resolver uses HTTP to query address lookup information from a pkarr relay server,
see the module docs for details.
This implements the AddressLookup trait to be used as an address lookup service. Note
that it only resolves address lookup information, for the corresponding publisher use
the PkarrPublisher together with AddressLookupServices.
-Implementations§
Source§impl PkarrResolver
Sourcepub fn builder(pkarr_relay: Url) -> PkarrResolverBuilder
Creates a new resolver builder using the pkarr relay server at the URL.
+Implementations§
Source§impl PkarrResolver
Sourcepub fn builder(pkarr_relay: Url) -> PkarrResolverBuilder
Creates a new resolver builder using the pkarr relay server at the URL.
The builder implements AddressLookupBuilder.
-Sourcepub fn n0_dns() -> PkarrResolverBuilder
Creates a pkarr resolver builder which uses the number 0 pkarr relay server.
+Sourcepub fn n0_dns() -> PkarrResolverBuilder
Creates a pkarr resolver builder which uses the number 0 pkarr relay server.
This uses the pkarr relay server operated by number 0 at
N0_DNS_PKARR_RELAY_PROD.
When running with the environment variable IROH_FORCE_STAGING_RELAYS
set to any non empty value N0_DNS_PKARR_RELAY_STAGING
server is used instead.
-Trait Implementations§
Source§impl AddressLookup for PkarrResolver
Trait Implementations§
Source§impl AddressLookup for PkarrResolver
Source§fn resolve(
&self,
endpoint_id: EndpointId,
-) -> Option<BoxStream<Result<AddressLookupItem, AddressLookupError>>>
Source§fn publish(&self, _data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreSource§impl Clone for PkarrResolver
Source§fn clone(&self) -> PkarrResolver
Returns a duplicate 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 PkarrResolver
§impl !RefUnwindSafe for PkarrResolver
§impl Send for PkarrResolver
§impl Sync for PkarrResolver
§impl Unpin for PkarrResolver
§impl !UnwindSafe for PkarrResolver
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
+) -> Option<BoxStream<Result<AddressLookupItem, AddressLookupError>>>Source§fn publish(&self, _data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read more
Source§impl Clone for PkarrResolver
Source§fn clone(&self) -> PkarrResolver
Returns a duplicate 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 PkarrResolver
§impl !RefUnwindSafe for PkarrResolver
§impl Send for PkarrResolver
§impl Sync for PkarrResolver
§impl Unpin for PkarrResolver
§impl !UnwindSafe for PkarrResolver
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
T: AddressLookup,
Source§fn into_address_lookup(
self,
_endpoint: &Endpoint,
diff --git a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
index cfd47f28e6..e549ec9d07 100644
--- a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
+++ b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
@@ -1,11 +1,11 @@
-PkarrResolverBuilder in iroh::address_lookup::pkarr - Rust PkarrResolverBuilder
pub struct PkarrResolverBuilder { /* private fields */ }
Expand description
Builder for PkarrResolver.
+PkarrResolverBuilder in iroh::address_lookup::pkarr - Rust PkarrResolverBuilder
pub struct PkarrResolverBuilder { /* private fields */ }
Expand description
Builder for PkarrResolver.
-Implementations§
Source§impl PkarrResolverBuilder
Sourcepub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self
Available on non-wasm_browser only.
Sets the DNS resolver to use for resolving the pkarr relay URL.
-Sourcepub fn build(self, tls_config: ClientConfig) -> PkarrResolver
Creates a PkarrResolver from this builder.
-Trait Implementations§
Implementations§
Source§impl PkarrResolverBuilder
Sourcepub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self
Available on non-wasm_browser only.
Sets the DNS resolver to use for resolving the pkarr relay URL.
+Sourcepub fn build(self, tls_config: ClientConfig) -> PkarrResolver
Creates a PkarrResolver from this builder.
+Trait Implementations§
Source§impl AddressLookupBuilder for PkarrResolverBuilder
Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this builder into a ready-to-use AddressLookup. Read moreAuto Trait Implementations§
§impl Freeze for PkarrResolverBuilder
§impl !RefUnwindSafe for PkarrResolverBuilder
§impl Send for PkarrResolverBuilder
§impl Sync for PkarrResolverBuilder
§impl Unpin for PkarrResolverBuilder
§impl !UnwindSafe for PkarrResolverBuilder
Blanket Implementations§
Source§impl<T> Any for Twhere
+) -> Result<impl AddressLookup, AddressLookupBuilderError>Turns this builder into a ready-to-use AddressLookup. Read more
Auto Trait Implementations§
§impl Freeze for PkarrResolverBuilder
§impl !RefUnwindSafe for PkarrResolverBuilder
§impl Send for PkarrResolverBuilder
§impl Sync for PkarrResolverBuilder
§impl Unpin for PkarrResolverBuilder
§impl !UnwindSafe for PkarrResolverBuilder
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/4036/docs/iroh/address_lookup/struct.EndpointData.html b/pr/4036/docs/iroh/address_lookup/struct.EndpointData.html
index 1ea4773718..7de6a2dd89 100644
--- a/pr/4036/docs/iroh/address_lookup/struct.EndpointData.html
+++ b/pr/4036/docs/iroh/address_lookup/struct.EndpointData.html
@@ -13,15 +13,15 @@ services, should they not fit into e.g. a single DNS packet otherwise.
See also Self::set_user_data.
Sourcepub fn add_relay_url(&mut self, relay_url: RelayUrl)
Adds the relay URL to the end of the endpoint data, unless it already existed.
Sourcepub fn add_ip_addrs(&mut self, addresses: Vec<SocketAddr>)
Adds addresses in order with duplicates or already existing addresses filtered out.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Adds addresses to the endpoint data in the given ordered, but with duplicates filtered.
-Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data and returns the updated endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Adds addresses to the endpoint data in the given order, but with duplicates filtered.
+Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data.
Sourcepub fn clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn clear_relay_urls(&mut self)
Removes all relay URLs from the endpoint data.
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses.
+Sourcepub fn filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
Returns a vec to allow re-ordering of addresses.
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
diff --git a/pr/4036/docs/iroh/address_lookup/struct.Item.html b/pr/4036/docs/iroh/address_lookup/struct.Item.html
index 9e63b37130..28d59f6feb 100644
--- a/pr/4036/docs/iroh/address_lookup/struct.Item.html
+++ b/pr/4036/docs/iroh/address_lookup/struct.Item.html
@@ -16,14 +16,14 @@ directly from Sourcepub fn last_updated(&self) -> Option<u64>
Returns the optional timestamp when this endpoint info was last updated.
The value is microseconds since the unix epoch.
-Sourcepub fn to_endpoint_addr(&self) -> EndpointAddr
Converts into a EndpointAddr by cloning the needed fields.
-Sourcepub fn into_endpoint_addr(self) -> EndpointAddr
Converts into a EndpointAddr without cloning.
+Sourcepub fn to_endpoint_addr(&self) -> EndpointAddr
Returns an EndpointAddr by cloning the needed fields.
+Sourcepub fn into_endpoint_addr(self) -> EndpointAddr
Converts into an EndpointAddr without cloning.
Methods from Deref<Target = EndpointData>§
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses.
+Sourcepub fn filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
Returns a vec to allow re-ordering of addresses.
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
diff --git a/pr/4036/docs/iroh/address_lookup/struct.UserData.html b/pr/4036/docs/iroh/address_lookup/struct.UserData.html
index 49c2183d40..5ae8665e57 100644
--- a/pr/4036/docs/iroh/address_lookup/struct.UserData.html
+++ b/pr/4036/docs/iroh/address_lookup/struct.UserData.html
@@ -1,4 +1,5 @@
-UserData in iroh::address_lookup - Rust 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.
+UserData in iroh::address_lookup - Rust UserData
pub struct UserData(/* private fields */);
Expand description
User-defined data that can be published and resolved through endpoint discovery.
+Under the hood this is a UTF-8 string 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.
diff --git a/pr/4036/docs/iroh/address_lookup/trait.AddressLookup.html b/pr/4036/docs/iroh/address_lookup/trait.AddressLookup.html
index 1be6efa3e6..79a8044def 100644
--- a/pr/4036/docs/iroh/address_lookup/trait.AddressLookup.html
+++ b/pr/4036/docs/iroh/address_lookup/trait.AddressLookup.html
@@ -22,7 +22,7 @@ Address Lookup information changes. If an Address Lookup mechanism requires a pe
refresh, it should start its own task.
Provided Methods§
Sourcefn publish(&self, _data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism.
This is fire and forget, since the Endpoint can not wait for successful
-publishing. If publishing is async, the implementation should start it’s own task.
+publishing. If publishing is async, the implementation should start its own task.
This will be called from a tokio task, so it is safe to spawn new tasks.
These tasks will be run on the runtime of the super::Endpoint.
Implementations on Foreign Types§
Source§impl<T: AddressLookup> AddressLookup for Arc<T>
Implementors§
Source§impl AddressLookup for DnsAddressLookup
Available on non-wasm_browser only. Source§impl AddressLookup for MemoryLookup
Source§impl AddressLookup for PkarrPublisher
Source§impl AddressLookup for PkarrResolver
Source§impl<T: AddressLookup> AddressLookup for FilteredAddressLookup<T>
\ No newline at end of file
+) -> Option<BoxStream<Result<Item, Error>>>Implementors§
Source§impl AddressLookup for DnsAddressLookup
Available on non-wasm_browser only. Source§impl AddressLookup for MemoryLookup
Source§impl AddressLookup for PkarrPublisher
Source§impl AddressLookup for PkarrResolver
Source§impl<T: AddressLookup> AddressLookup for FilteredAddressLookup<T>
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/address_lookup/trait.AddressLookupBuilder.html b/pr/4036/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
index 35aadc4338..edc4dff899 100644
--- a/pr/4036/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
+++ b/pr/4036/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
@@ -20,5 +20,5 @@ endpoint to Endpoint,
) -> Result<impl AddressLookup, AddressLookupBuilderError>Turns this builder into a ready-to-use AddressLookup.
If an error is returned, building the endpoint will fail with this error.
-Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
Source§impl AddressLookupBuilder for DnsAddressLookupBuilder
Available on non-wasm_browser only. Source§impl AddressLookupBuilder for PkarrPublisherBuilder
Source§impl AddressLookupBuilder for PkarrResolverBuilder
Source§impl<T: AddressLookup> AddressLookupBuilder for T
Blanket no-op impl of AddressLookupBuilder for T: AddressLookup.
+ Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
Source§impl AddressLookupBuilder for DnsAddressLookupBuilder
Available on non-wasm_browser only. Source§impl AddressLookupBuilder for PkarrPublisherBuilder
Source§impl AddressLookupBuilder for PkarrResolverBuilder
Source§impl<T: AddressLookup> AddressLookupBuilder for T
Blanket no-op impl of AddressLookupBuilder for T: AddressLookup.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/defaults/prod/fn.default_ap_relay.html b/pr/4036/docs/iroh/defaults/prod/fn.default_ap_relay.html
index 5961b7d1ab..3a67b98b91 100644
--- a/pr/4036/docs/iroh/defaults/prod/fn.default_ap_relay.html
+++ b/pr/4036/docs/iroh/defaults/prod/fn.default_ap_relay.html
@@ -1,2 +1,2 @@
-default_ap_relay in iroh::defaults::prod - Rust default_ap_relay
pub fn default_ap_relay() -> RelayConfig
Expand description
Get the default RelayConfig for Asia-Pacific
+default_ap_relay in iroh::defaults::prod - Rust default_ap_relay
pub fn default_ap_relay() -> RelayConfig
Expand description
Get the default RelayConfig for Asia-Pacific.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/defaults/prod/index.html b/pr/4036/docs/iroh/defaults/prod/index.html
index 8981fb6be4..b076bc3ce3 100644
--- a/pr/4036/docs/iroh/defaults/prod/index.html
+++ b/pr/4036/docs/iroh/defaults/prod/index.html
@@ -1,2 +1,2 @@
iroh::defaults::prod - Rust Module prod
Expand description
Production configuration.
-Constants§
- AP_
RELAY_HOSTNAME - Hostname of the default Asia-Pacific relay.
- EU_
RELAY_HOSTNAME - Hostname of the default EU relay.
- NA_
EAST_RELAY_HOSTNAME - Hostname of the default NA east relay.
- NA_
WEST_RELAY_HOSTNAME - Hostname of the default NA west relay.
Functions§
- default_
ap_relay - Get the default
RelayConfig for Asia-Pacific - default_
eu_relay - Get the default
RelayConfig for EU. - default_
na_east_relay - Get the default
RelayConfig for NA east. - default_
na_west_relay - Get the default
RelayConfig for NA west. - default_
relay_map - Get the default
RelayMap.
\ No newline at end of file
+Constants§
- AP_
RELAY_HOSTNAME - Hostname of the default Asia-Pacific relay.
- EU_
RELAY_HOSTNAME - Hostname of the default EU relay.
- NA_
EAST_RELAY_HOSTNAME - Hostname of the default NA east relay.
- NA_
WEST_RELAY_HOSTNAME - Hostname of the default NA west relay.
Functions§
- default_
ap_relay - Get the default
RelayConfig for Asia-Pacific. - default_
eu_relay - Get the default
RelayConfig for EU. - default_
na_east_relay - Get the default
RelayConfig for NA east. - default_
na_west_relay - Get the default
RelayConfig for NA west. - default_
relay_map - Get the default
RelayMap.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/dns/struct.DnsResolver.html b/pr/4036/docs/iroh/dns/struct.DnsResolver.html
index 754fa26465..3f8c6e27b6 100644
--- a/pr/4036/docs/iroh/dns/struct.DnsResolver.html
+++ b/pr/4036/docs/iroh/dns/struct.DnsResolver.html
@@ -15,7 +15,7 @@ public DNS.
Implementations§
Source§impl DnsResolver
Sourcepub fn new() -> DnsResolver
Creates 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.
+to the default ResolverConfig which uses e.g. Google’s 8.8.8.8 or 8.8.4.4.
Sourcepub fn with_nameserver(nameserver: SocketAddr) -> DnsResolver
Creates a new DNS resolver configured with a single UDP DNS nameserver.
Sourcepub fn custom(resolver: impl Resolver) -> DnsResolver
Creates a new DnsResolver from a struct that implements Resolver.
diff --git a/pr/4036/docs/iroh/dns/trait.Resolver.html b/pr/4036/docs/iroh/dns/trait.Resolver.html
index 4aaa7642fd..3ebf87a01f 100644
--- a/pr/4036/docs/iroh/dns/trait.Resolver.html
+++ b/pr/4036/docs/iroh/dns/trait.Resolver.html
@@ -38,13 +38,13 @@ atomic swap. Build a new instance with re-bound sockets and re-read nameserver
configuration rather than mutating in place. Must not perform IO: defer DNS
queries and socket binds until the new resolver is first used. May be called
concurrently, in which case all but one allocated replacement is dropped unused.
-Implementations on Foreign Types§
Implementations on Foreign Types§
Source§impl Resolver for Arc<SimpleDnsResolver>
Source§fn lookup_ipv4(
&self,
host: String,
-) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = Ipv4Addr> + Send>, DnsError>> + Send>>
Source§fn lookup_ipv6(
+) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = Ipv4Addr> + Send>, DnsError>> + Send>>
Source§fn lookup_ipv6(
&self,
host: String,
-) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = Ipv6Addr> + Send>, DnsError>> + Send>>
Source§fn lookup_txt(
+) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = Ipv6Addr> + Send>, DnsError>> + Send>>
Source§fn lookup_txt(
&self,
host: String,
-) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = TxtRecordData> + Send>, DnsError>> + Send>>
Source§fn clear_cache(&self)
Source§fn reset(&self) -> Box<dyn Resolver>
Implementors§
\ No newline at end of file
+) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = TxtRecordData> + Send>, DnsError>> + Send>>Source§fn clear_cache(&self)
Source§fn reset(&self) -> Box<dyn Resolver>
Implementors§
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html b/pr/4036/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html
index 0a8e0c05eb..cc00fac5e1 100644
--- a/pr/4036/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html
+++ b/pr/4036/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html
@@ -1,2 +1,2 @@
-ENV_FORCE_STAGING_RELAYS in iroh::endpoint - Rust ENV_FORCE_STAGING_RELAYS
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 ENV_FORCE_STAGING_RELAYS
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint/enum.RelayMode.html b/pr/4036/docs/iroh/endpoint/enum.RelayMode.html
index 326aae7405..0d7b755897 100644
--- a/pr/4036/docs/iroh/endpoint/enum.RelayMode.html
+++ b/pr/4036/docs/iroh/endpoint/enum.RelayMode.html
@@ -1,4 +1,4 @@
-RelayMode in iroh::endpoint - Rust RelayMode
pub enum RelayMode {
+RelayMode in iroh::endpoint - Rust RelayMode
pub enum RelayMode {
Disabled,
Default,
Staging,
@@ -10,14 +10,14 @@ This means that neither listening nor dialing relays will be available.
See crate::defaults::prod for the severs used.
§Staging
Use the staging relay servers from n0.
§Custom(RelayMap)
Use a custom relay map.
-
Implementations§
Source§impl RelayMode
Sourcepub fn custom(map: impl IntoIterator<Item = RelayUrl>) -> Self
Create a custom relay mode from a list of RelayUrls.
+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§
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/4036/docs/iroh/endpoint/fn.default_relay_mode.html b/pr/4036/docs/iroh/endpoint/fn.default_relay_mode.html
index d716677abc..98ff3579ee 100644
--- a/pr/4036/docs/iroh/endpoint/fn.default_relay_mode.html
+++ b/pr/4036/docs/iroh/endpoint/fn.default_relay_mode.html
@@ -1,4 +1,4 @@
-default_relay_mode in iroh::endpoint - Rust default_relay_mode
pub fn default_relay_mode() -> RelayMode
Expand description
Returns the default relay mode.
+default_relay_mode in iroh::endpoint - Rust default_relay_mode
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint/fn.force_staging_infra.html b/pr/4036/docs/iroh/endpoint/fn.force_staging_infra.html
index ff8dda7e69..b444491b3e 100644
--- a/pr/4036/docs/iroh/endpoint/fn.force_staging_infra.html
+++ b/pr/4036/docs/iroh/endpoint/fn.force_staging_infra.html
@@ -1,2 +1,2 @@
-force_staging_infra in iroh::endpoint - Rust force_staging_infra
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 force_staging_infra
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint/index.html b/pr/4036/docs/iroh/endpoint/index.html
index 2efb803d4c..f3a98d45f2 100644
--- a/pr/4036/docs/iroh/endpoint/index.html
+++ b/pr/4036/docs/iroh/endpoint/index.html
@@ -1,4 +1,4 @@
-iroh::endpoint - Rust Module endpoint
Expand description
The Endpoint allows establishing connections to other iroh endpoints.
+iroh::endpoint - Rust Module endpoint
Expand description
The Endpoint allows establishing connections to other iroh endpoints.
The Endpoint is the main API interface to manage a local iroh endpoint. It allows
connecting to and accepting connections from other endpoints. See the module docs for
more details on how iroh connections work.
diff --git a/pr/4036/docs/iroh/endpoint/presets/index.html b/pr/4036/docs/iroh/endpoint/presets/index.html
index 37b792c03d..a454626701 100644
--- a/pr/4036/docs/iroh/endpoint/presets/index.html
+++ b/pr/4036/docs/iroh/endpoint/presets/index.html
@@ -2,4 +2,4 @@
§Example
use iroh::{Endpoint, RelayMode, Watcher, endpoint::presets};
-let endpoint = Endpoint::builder(presets::N0).bind().await?;
Structs§
- Empty
- An empty preset that doesn’t set anything on the builder.
- Minimal
with_crypto_provider - A preset that is almost empty, besides setting mandatory options.
- N0
with_crypto_provider - Configures the endpoint to use the n0 defaults
- N0Disable
Relay with_crypto_provider - Configures the endpoint to use the n0 defaults, but with relay mode disabled.
Traits§
- Preset
- Defines a preset
\ No newline at end of file
+let endpoint = Endpoint::builder(presets::N0).bind().await?;Structs§
- Empty
- An empty preset that doesn’t set anything on the builder.
- Minimal
with_crypto_provider - A preset that is almost empty, besides setting mandatory options.
- N0
with_crypto_provider - Configures the endpoint to use the n0 defaults
- N0Disable
Relay with_crypto_provider - Configures the endpoint to use the n0 defaults, but with relay mode disabled.
Traits§
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint/presets/struct.N0.html b/pr/4036/docs/iroh/endpoint/presets/struct.N0.html
index 41c532b301..cf9fb0156e 100644
--- a/pr/4036/docs/iroh/endpoint/presets/struct.N0.html
+++ b/pr/4036/docs/iroh/endpoint/presets/struct.N0.html
@@ -6,8 +6,8 @@
setting the [rustls::crypto::CryptoProvider] to ring or aws-lc-rs, depending
on which feature is enabled in iroh (preferring ring if both are enabled).
-Due to the last point, this preset is only available with the ring or
-aws-lc-rs preset installed.
+
Due to the last point, this preset is only available with the tls-ring or
+tls-aws-lc-rs feature enabled.
If you want to set your own crypto provider, we recommend copying the
implementation of this preset into your own and setting the appropriate crypto
provider there.
diff --git a/pr/4036/docs/iroh/endpoint/presets/struct.N0DisableRelay.html b/pr/4036/docs/iroh/endpoint/presets/struct.N0DisableRelay.html
index dd14c88ba9..29795833c9 100644
--- a/pr/4036/docs/iroh/endpoint/presets/struct.N0DisableRelay.html
+++ b/pr/4036/docs/iroh/endpoint/presets/struct.N0DisableRelay.html
@@ -7,8 +7,8 @@ relay urls.
setting the [rustls::crypto::CryptoProvider] to ring or aws-lc-rs, depending
on which feature is enabled in iroh (preferring ring if both are enabled).
-Due to the last point, this preset is only available with the ring or
-aws-lc-rs preset installed.
+
Due to the last point, this preset is only available with the tls-ring or
+tls-aws-lc-rs feature enabled.
If you want to set your own crypto provider, we recommend copying the
implementation of this preset into your own and setting the appropriate crypto
provider there.
diff --git a/pr/4036/docs/iroh/endpoint/presets/trait.Preset.html b/pr/4036/docs/iroh/endpoint/presets/trait.Preset.html
index 59a71a95da..7e6f4bbcac 100644
--- a/pr/4036/docs/iroh/endpoint/presets/trait.Preset.html
+++ b/pr/4036/docs/iroh/endpoint/presets/trait.Preset.html
@@ -1,7 +1,7 @@
-Preset in iroh::endpoint::presets - Rust Preset
pub trait Preset {
+Preset in iroh::endpoint::presets - Rust Preset
pub trait Preset {
// Required method
fn apply(self, builder: Builder) -> Builder;
-}
Expand description
Defines a preset
+}Expand description
A reusable bundle of endpoint Builder configuration.
Required Methods§
Implementations on Foreign Types§
Source§impl Preset for Arc<TestTransport>
Available on crate feature unstable-custom-transports and (crate features test-utils) only.
Source§fn apply(self, builder: Builder) -> Builder
Configures the builder with this transport and the network’s address lookup.
§Example
diff --git a/pr/4036/docs/iroh/endpoint/struct.Builder.html b/pr/4036/docs/iroh/endpoint/struct.Builder.html
index 79894b8924..7cbb050d5e 100644
--- a/pr/4036/docs/iroh/endpoint/struct.Builder.html
+++ b/pr/4036/docs/iroh/endpoint/struct.Builder.html
@@ -92,7 +92,7 @@ is set to false explicitly.
destination addresses. It is valid to configure this, but no more than one such
socket should be bound or the routing will be non-deterministic.
To use a subnet with a non-zero prefix length as the default route in addition to
-being routed when its prefix matches, use `BindOpts::set_is_default_route.
+being routed when its prefix matches, use BindOpts::set_is_default_route.
Subnets with a prefix length of zero are always marked as default routes.
Finally note that most outgoing datagrams are part of an existing network flow. That
is, they are in response to an incoming datagram. In this case the outgoing datagram
@@ -142,7 +142,7 @@ direct addresses or relay URLs will fail.
Sourcepub fn addr_filter(self, filter: AddrFilter) -> Self
Sets the address filter applied to all address data before publishing.
This filter is applied once, at the AddressLookupServices level, before
distributing data to any individual address lookup service. This ensures
-consistent filtering regardless of how the services configured.
+consistent filtering regardless of how the services are configured.
Sourcepub fn clear_addr_filter(self) -> Self
Clears the address filter, allowing all addresses to be published.
This removes any filter previously set via Self::addr_filter, including
filters set by presets.
diff --git a/pr/4036/docs/iroh/endpoint/struct.ConnectOptions.html b/pr/4036/docs/iroh/endpoint/struct.ConnectOptions.html
index 30bf2e329e..3834b0244e 100644
--- a/pr/4036/docs/iroh/endpoint/struct.ConnectOptions.html
+++ b/pr/4036/docs/iroh/endpoint/struct.ConnectOptions.html
@@ -1,12 +1,12 @@
-ConnectOptions in iroh::endpoint - Rust ConnectOptions
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 ConnectOptions
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 QuicTransportConfig.
-Sourcepub fn with_transport_config(
+
Sourcepub fn with_transport_config(
self,
transport_config: QuicTransportConfig,
) -> Self
Sets the QUIC transport config options for this connection.
-Sourcepub fn with_additional_alpns(self, alpns: Vec<Vec<u8>>) -> Self
Sets ALPN identifiers that should be signaled as supported on connection, in
+
Sourcepub fn with_additional_alpns(self, alpns: Vec<Vec<u8>>) -> Self
Sets ALPN identifiers that should be signaled as supported on connection, in
addition to the main ALPN identifier used in Endpoint::connect_with_opts.
This allows connecting to servers that may only support older versions of your
protocol. In this case, you would add the older ALPN identifiers with this
@@ -20,7 +20,7 @@ list or the main ALPN identifiers on the accept side, see the endpoint
builder’s Builder::alpns function.
-Trait Implementations§
Source§impl Clone for ConnectOptions
Source§fn clone(&self) -> ConnectOptions
Returns a duplicate 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 duplicate 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/4036/docs/iroh/endpoint/struct.Connection.html b/pr/4036/docs/iroh/endpoint/struct.Connection.html
index ffc93497ee..74f53832af 100644
--- a/pr/4036/docs/iroh/endpoint/struct.Connection.html
+++ b/pr/4036/docs/iroh/endpoint/struct.Connection.html
@@ -8,7 +8,7 @@ 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<T: ConnectionState> Connection<T>
Implementations§
Source§impl<T: ConnectionState> Connection<T>
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.
@@ -18,13 +18,13 @@ consequence, the peer won’t be notified that a stream has been opened until th
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_bi(&self) -> AcceptBi<'_> ⓘ
Accepts 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 async fn closed(&self) -> ConnectionError
Waits 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.
@@ -97,17 +97,18 @@ strong and pseudorandom, and are suitable for use as keying material.
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)
See [noq_proto::TransportConfig::receive_window].
-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)
Sets the connection-level flow control receive window.
+See [noq_proto::TransportConfig::receive_window].
+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.
-Source§impl Connection<HandshakeCompleted>
Sourcepub fn remote_id(&self) -> EndpointId
Returns the EndpointId from the peer’s TLS certificate.
+Source§impl Connection<HandshakeCompleted>
Sourcepub fn remote_id(&self) -> EndpointId
Returns the EndpointId from the peer’s TLS certificate.
The PublicKey of an endpoint is also known as an EndpointId. This PublicKey is
included in the TLS certificate presented during the handshake when connecting.
This function allows you to get the EndpointId of the remote endpoint of this
connection.
-Sourcepub fn paths(&self) -> PathList<'_>
Returns the currently open network paths for this connection.
+Sourcepub fn paths(&self) -> PathList<'_>
Returns the currently open network paths for this connection.
A connection typically has one path via the relay server and,
once holepunching succeeds, a direct path. The returned
PathList is a snapshot taken at call time: it does not
@@ -116,14 +117,14 @@ already closed.
To observe changes over time, see Connection::paths_stream
for a stream of PathList snapshots and
Connection::path_events for individual PathEvents.
-Sourcepub fn paths_stream(&self) -> PathListStream<'_>
Returns a stream of PathList snapshots for this connection.
+Sourcepub fn paths_stream(&self) -> PathListStream<'_>
Returns a stream of PathList snapshots for this connection.
Yields the current snapshot on the first poll, and a fresh
snapshot whenever the open paths or the selected path change.
Ends when the connection closes.
The stream borrows this Connection. To consume it from a
spawned task, move a Connection clone into the task and
call this method inside.
-Sourcepub fn path_events(&self) -> PathEventStream
Returns a stream of PathEvents for this connection.
+Sourcepub fn path_events(&self) -> PathEventStream
Returns a stream of PathEvents for this connection.
Each event reports one of: a path opened, a path closed (with
final per-path statistics), the selected transmission path
changed, or the consumer fell behind. The stream ends when the
@@ -133,14 +134,14 @@ may be moved into a spawned task.
single PathEvent::Lagged; the current state of the open
paths and the selected path remains recoverable via
Connection::paths.
-Sourcepub fn weak_handle(&self) -> WeakConnectionHandle
Returns a WeakConnectionHandle for this connection.
+Sourcepub fn weak_handle(&self) -> WeakConnectionHandle
Returns a WeakConnectionHandle for this connection.
A WeakConnectionHandle does not keep the connection alive. It can be used to
wait for the connection to be closed via WeakConnectionHandle::closed and to
attempt to upgrade back to a strong Connection via
WeakConnectionHandle::upgrade.
-Source§impl Connection<IncomingZeroRtt>
Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
-Sourcepub async fn handshake_completed(&self) -> Result<Connection, ConnectingError>
Waits until the full handshake occurs and then returns a Connection.
+Source§impl Connection<IncomingZeroRtt>
Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
+Sourcepub async fn handshake_completed(&self) -> Result<Connection, ConnectingError>
Waits until the full handshake occurs and then returns a Connection.
This may fail with ConnectingError::ConnectionError, if there was
some general failure with the connection, such as a network timeout since
we accepted the connection.
@@ -149,18 +150,18 @@ doesn’t use the right TLS authentication, which usually every iroh endpoint
uses and requires.
Thus, those errors should only occur if someone connects to you with a
modified iroh endpoint or with a plain QUIC client.
-Sourcepub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError>
Returns the EndpointId from the peer’s TLS certificate.
+Sourcepub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError>
Returns the EndpointId from the peer’s TLS certificate.
The PublicKey of an endpoint is also known as an EndpointId. This PublicKey is
included in the TLS certificate presented during the handshake when connecting.
This function allows you to get the EndpointId of the remote endpoint of this
connection.
-Source§impl Connection<OutgoingZeroRtt>
Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
+Sourcepub async fn handshake_completed(
&self,
) -> Result<ZeroRttStatus, ConnectingError>
Waits until the full handshake occurs and returns a ZeroRttStatus.
-If ZeroRttStatus::Accepted is returned, than any streams created before
+
If ZeroRttStatus::Accepted is returned, then any streams created before
the handshake has completed can still be used.
-If ZeroRttStatus::Rejected is returned, than any streams created before
+
If ZeroRttStatus::Rejected is returned, then any streams created before
the handshake will error and any data sent should be re-sent on a
new stream.
This may fail with ConnectingError::ConnectionError, if there was
@@ -171,7 +172,7 @@ doesn’t use the right TLS authentication, which usually every iroh endpoint
uses and requires.
Thus, those errors should only occur if someone connects to you with a
modified iroh endpoint or with a plain QUIC client.
-Sourcepub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError>
Returns the EndpointId from the peer’s TLS certificate.
+Sourcepub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError>
Returns the EndpointId from the peer’s TLS certificate.
The PublicKey of an endpoint is also known as an EndpointId. This PublicKey is
included in the TLS certificate presented during the handshake when connecting.
This function allows you to get the EndpointId of the remote endpoint of this
diff --git a/pr/4036/docs/iroh/endpoint/struct.Endpoint.html b/pr/4036/docs/iroh/endpoint/struct.Endpoint.html
index cfd63c979e..0c6c2630b7 100644
--- a/pr/4036/docs/iroh/endpoint/struct.Endpoint.html
+++ b/pr/4036/docs/iroh/endpoint/struct.Endpoint.html
@@ -13,7 +13,7 @@ behaviour.
Endpoint::connect and Endpoint::accept methods. Once established, the
Connection gives access to most QUIC features. Individual streams to send data to
the peer are created using the Connection::open_bi, Connection::accept_bi,
-Connection::open_uni and Connection::open_bi functions.
+Connection::open_uni and Connection::accept_uni 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.
§Usage on Android
@@ -22,7 +22,7 @@ through JNI, which needs a JVM context published to DnsResolver for the supported
initialization paths.
-Implementations§
Source§impl Endpoint
Implementations§
Source§impl Endpoint
Sourcepub fn set_alpns(&self, alpns: Vec<Vec<u8>>)
Sets the list of accepted ALPN protocols.
This will only affect new incoming connections.
@@ -117,8 +117,8 @@ changes.
understand if the endpoint has ever been considered “online”. But after
that initial call to Endpoint::online, to understand if your
endpoint is no longer able to be connected to by endpoints outside
-of the private or local network, watch for changes in it’s EndpointAddr.
-If there are no addrsin the EndpointAddr, you may not be dialable by other endpoints
+of the private or local network, watch for changes in its EndpointAddr.
+If there are no addrs in the EndpointAddr, you may not be dialable by other endpoints
on the internet.
The EndpointAddr will change as:
@@ -146,7 +146,7 @@ tokio::spawn(endpoint_closed.run_until(async move {
}));
// Do fancy things, then close the endpoint.
// Our task above will stop even if there are still clones of `Endpoint` alive somewhere.
-endpoint.close().await;
Sourcepub async fn online(&self)
A convenience method that waits for the endpoint to be considered “online”.
This currently means at least one relay server has completed its
connection handshake (i.e. the endpoint is registered and reachable
via that relay). Merely selecting a relay URL is not sufficient.
@@ -167,49 +167,45 @@ entirely.
The online method does not interact with crate::address_lookup::AddressLookup
services, which means that any Address Lookup that relies on a WAN
connection is independent of the endpoint’s online status.
-§Examples
use iroh::Endpoint;
-
-#[tokio::main]
-async fn main() {
-// After this await returns, the endpoint is bound to a local socket.
-// It can be dialed, but almost certainly hasn't finished picking a
+§Examples
+// After this await returns, the endpoint is bound to a local socket.
+// It can be dialed, but almost certainly hasn't finished picking a
// relay.
-let endpoint = Endpoint::bind().await;
+let endpoint = Endpoint::bind(presets::N0).await?;
-// After this await returns we have a connection to at least one relay
+// After this await returns we have a connection to at least one relay
// and holepunching should work as expected.
-endpoint.online().await;
-}
Sourcepub fn home_relay_status(
+endpoint.online().await;
Sourcepub fn home_relay_status(
&self,
) -> impl Watcher<Value = Vec<RelayStatus>> + use<>
Returns a Watcher over the connection status of the endpoint’s home relays.
The watched value has one entry per home relay whose URL is known,
and is empty when no relays are configured or before the endpoint has
-selected one the home relay from the list of configured relays.
+selected a home relay from the list of configured relays.
The watcher updates whenever any home relay’s connection status changes.
See RelayStatus for the information available on each entry.
The returned watcher only becomes disconnected once the last clone of
the Endpoint is dropped. Closing the endpoint does not disconnect
the watcher. To stop a task once the endpoint stops, combine with
Self::closed.
-Sourcepub fn bound_sockets(&self) -> Vec<SocketAddr>
Available on non-wasm_browser only.
Returns the local socket addresses on which the underlying sockets are bound.
+Sourcepub fn bound_sockets(&self) -> Vec<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 dns_resolver(&self) -> Result<&DnsResolver, EndpointError>
Available on non-wasm_browser only.
Returns the DNS resolver used in this Endpoint.
+Sourcepub fn dns_resolver(&self) -> Result<&DnsResolver, EndpointError>
Available on non-wasm_browser only.
Sourcepub fn tls_config(&self) -> &ClientConfig
Returns the [rustls::ClientConfig] used by the endpoint for connecting to external services.
+Sourcepub fn tls_config(&self) -> &ClientConfig
Returns the [rustls::ClientConfig] used by the endpoint for connecting to external services.
This might be useful for address lookup services or other functions
that want to use the same trust anchors as iroh does for verifying the
validity of TLS certificates presented by external services.
Note that this TLS config is unrelated to how iroh validates the authenticity
of iroh connections itself.
The config is based on the trust anchors set via Builder::ca_tls_config.
-Sourcepub fn address_lookup(&self) -> Result<&AddressLookupServices, EndpointError>
Returns the Address Lookup service, if configured.
+Sourcepub fn address_lookup(&self) -> Result<&AddressLookupServices, EndpointError>
Returns the Address Lookup service, if configured.
§Errors
Returns a EndpointError::Closed error if the endpoint is closed.
-Sourcepub fn metrics(&self) -> &EndpointMetrics
Available on crate feature metrics only.
Returns metrics collected for this endpoint.
+Sourcepub fn metrics(&self) -> &EndpointMetrics
Available on crate feature metrics only.
Returns metrics collected for this endpoint.
The endpoint internally collects various metrics about its operation.
The returned EndpointMetrics struct contains all of these metrics.
You can access individual metrics directly by using the public fields:
@@ -275,13 +271,13 @@ registry.write().unwrap().register_all(endpoint.metrics());
.std_context("text")?;
assert!(res.contains(r#"TYPE socket_recv_datagrams counter"#));
-assert!(res.contains(r#"socket_recv_datagrams_total 0"#));Sourcepub async fn remote_info(&self, endpoint_id: EndpointId) -> Option<RemoteInfo>
Returns addressing information about a recently used remote endpoint.
+assert!(res.contains(r#"socket_recv_datagrams_total 0"#));Sourcepub async fn remote_info(&self, endpoint_id: EndpointId) -> Option<RemoteInfo>
Returns addressing information about a recently used remote endpoint.
The returned RemoteInfo contains a list of all transport addresses for the remote
that we know about. This is a snapshot in time and not a watcher.
Returns None if the endpoint doesn’t have information about the remote or if the endpoint is closed.
When remote endpoints are no longer used, our endpoint will keep information around
for a little while, and then drop it. Afterwards, this will return None.
-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
@@ -290,14 +286,14 @@ 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.
If the endpoint is closed, this method will log a warning and ignore the request.
-Sourcepub fn set_user_data_for_address_lookup(&self, user_data: Option<UserData>)
Sets the initial user-defined data to be published in Address Lookups for this endpoint.
+Sourcepub fn set_user_data_for_address_lookup(&self, user_data: Option<UserData>)
Sets the initial user-defined data to be published in Address Lookups for this endpoint.
If the user-defined data passed to this function is different to the previous one,
the endpoint will republish its endpoint info to the configured Address Lookups.
See also Builder::user_data_for_address_lookup for setting an initial value when
building the endpoint.
If the endpoint is closed, this method will log a warning and ignore the
request.
-Sourcepub async fn close(&self)
Closes the QUIC endpoint and the 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.
@@ -322,9 +318,9 @@ sockets. This is due to QUIC and its acknowledgments being implemented in user-l
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.
-Sourcepub fn closed(&self) -> EndpointClosed ⓘ
Returns a future that resolves once the endpoint closes.
+the respective Endpoint are dropped.
+Sourcepub fn closed(&self) -> EndpointClosed ⓘ
Returns a future that resolves once the endpoint closes.
The returned future does not contain a clone or reference to the Endpoint,
so keeping the returned future alive does not prevent the endpoint from being dropped.
To run a task and stop it once the endpoint closes, you can use
@@ -333,7 +329,7 @@ so keeping the returned future alive does not prevent the endpoint from being dr
let endpoint = Endpoint::bind(presets::N0).await?;
tokio::spawn(endpoint.closed().run_until(async move {
// the future will be aborted once the endpoint closes.
-}));
Sourcepub fn create_server_config_builder(
+}));
Sourcepub fn create_server_config_builder(
&self,
alpns: Vec<Vec<u8>>,
) -> ServerConfigBuilder
Create a ServerConfigBuilder for this endpoint that includes the given alpns.
diff --git a/pr/4036/docs/iroh/endpoint/struct.EndpointClosed.html b/pr/4036/docs/iroh/endpoint/struct.EndpointClosed.html
index 85b8fd921b..1a2b9e3683 100644
--- a/pr/4036/docs/iroh/endpoint/struct.EndpointClosed.html
+++ b/pr/4036/docs/iroh/endpoint/struct.EndpointClosed.html
@@ -1,9 +1,9 @@
-EndpointClosed in iroh::endpoint - Rust EndpointClosed
pub struct EndpointClosed { /* private fields */ }
Expand description
Future returned from Endpoint::closed.
-Implementations§
Source§impl EndpointClosed
Sourcepub async fn run_until<F: Future>(self, fut: F) -> Option<F::Output>
Runs a future to completion, or until the Endpoint is closed.
+EndpointClosed in iroh::endpoint - Rust EndpointClosed
pub struct EndpointClosed { /* private fields */ }
Expand description
Future returned from Endpoint::closed.
+Implementations§
Trait Implementations§
Source§impl Debug for EndpointClosed
Source§impl Future for EndpointClosed
Source§impl<'pin> Unpin for EndpointClosedwhere
+
Trait Implementations§
Source§impl Debug for EndpointClosed
Source§impl Future for EndpointClosed
Source§impl<'pin> Unpin for EndpointClosedwhere
PinnedFieldsOf<__EndpointClosed<'pin>>: Unpin,
Auto Trait Implementations§
§impl !Freeze for EndpointClosed
§impl !RefUnwindSafe for EndpointClosed
§impl Send for EndpointClosed
§impl Sync for EndpointClosed
§impl !UnwindSafe for EndpointClosed
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/4036/docs/iroh/endpoint/struct.Incoming.html b/pr/4036/docs/iroh/endpoint/struct.Incoming.html
index d0a2c29af8..eca1097eca 100644
--- a/pr/4036/docs/iroh/endpoint/struct.Incoming.html
+++ b/pr/4036/docs/iroh/endpoint/struct.Incoming.html
@@ -24,7 +24,7 @@ to customize a Sourcepub fn remote_addr_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_addr().
-Sourcepub fn decrypt(&self) -> Option<DecryptedInitial>
Decrypt the Initial packet payload
+Sourcepub fn decrypt(&self) -> Option<DecryptedInitial>
Decrypts the Initial packet payload.
This clones and decrypts the packet payload (~1200 bytes).
Can be used to extract information from the TLS ClientHello without completing the handshake.
Trait Implementations§
Source§impl IntoFuture for Incoming
Source§type Output = Result<Connection, ConnectingError>
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§
Source§impl<T> Any for Twhere
diff --git a/pr/4036/docs/iroh/endpoint/struct.QuicTransportConfigBuilder.html b/pr/4036/docs/iroh/endpoint/struct.QuicTransportConfigBuilder.html
index 3a193bd40a..5189f21509 100644
--- a/pr/4036/docs/iroh/endpoint/struct.QuicTransportConfigBuilder.html
+++ b/pr/4036/docs/iroh/endpoint/struct.QuicTransportConfigBuilder.html
@@ -136,7 +136,7 @@ enable multipath as well.
If the path is idle for this long the path will be abandoned. Bear in mind this will
interact with the QuicTransportConfigBuilder::max_idle_timeout, if the last path is
abandoned the entire connection will be closed.
-Note: values higher than [PATH_MAX_IDLE_TIMEOUT] are clamped and a warning is logged.
+Note: values higher than PATH_MAX_IDLE_TIMEOUT (15 seconds) are clamped and a warning is logged.
Sourcepub fn default_path_keep_alive_interval(self, interval: Duration) -> Self
Sets a default per-path keep alive interval.
Note that this does not interact with the connection-wide
QuicTransportConfigBuilder::keep_alive_interval. This setting will keep this path active,
diff --git a/pr/4036/docs/iroh/endpoint/struct.RelayStatus.html b/pr/4036/docs/iroh/endpoint/struct.RelayStatus.html
index 175b637f76..a1abba7e98 100644
--- a/pr/4036/docs/iroh/endpoint/struct.RelayStatus.html
+++ b/pr/4036/docs/iroh/endpoint/struct.RelayStatus.html
@@ -1,13 +1,13 @@
-
RelayStatus in iroh::endpoint - Rust RelayStatus
pub struct RelayStatus { /* private fields */ }
Expand description
Connection status of a single home relay.
+RelayStatus in iroh::endpoint - Rust RelayStatus
pub struct RelayStatus { /* private fields */ }
Expand description
Connection status of a single home relay.
Observed via Endpoint::home_relay_status.
-Implementations§
Source§impl RelayStatus
Sourcepub fn is_connected(&self) -> bool
Returns true if the endpoint is connected to the relay.
-Sourcepub fn last_error(&self) -> Option<&AnyError>
Returns the most recent connection error, if the relay is currently
+
Implementations§
Source§impl RelayStatus
Sourcepub fn is_connected(&self) -> bool
Returns true if the endpoint is connected to the relay.
+Sourcepub fn last_error(&self) -> Option<&AnyError>
Returns the most recent connection error, if the relay is currently
disconnected.
Returns None when the relay is connected, or when the endpoint has
not yet observed a failed connection attempt.
-Trait Implementations§
Source§impl Clone for RelayStatus
Source§fn clone(&self) -> RelayStatus
Returns a duplicate 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 RelayStatus
Source§impl PartialEq for RelayStatus
Source§impl Eq for RelayStatus
Source§impl StructuralPartialEq for RelayStatus
Auto Trait Implementations§
§impl Freeze for RelayStatus
§impl !RefUnwindSafe for RelayStatus
§impl Send for RelayStatus
§impl Sync for RelayStatus
§impl Unpin for RelayStatus
§impl !UnwindSafe for RelayStatus
Blanket Implementations§
Trait Implementations§
Source§impl Clone for RelayStatus
Source§fn clone(&self) -> RelayStatus
Returns a duplicate 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 RelayStatus
Source§impl PartialEq for RelayStatus
Source§impl Eq for RelayStatus
Source§impl StructuralPartialEq for RelayStatus
Auto Trait Implementations§
§impl Freeze for RelayStatus
§impl !RefUnwindSafe for RelayStatus
§impl Send for RelayStatus
§impl Sync for RelayStatus
§impl Unpin for RelayStatus
§impl !UnwindSafe for RelayStatus
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/4036/docs/iroh/endpoint/struct.VarInt.html b/pr/4036/docs/iroh/endpoint/struct.VarInt.html
index 0acf99654d..007540d1af 100644
--- a/pr/4036/docs/iroh/endpoint/struct.VarInt.html
+++ b/pr/4036/docs/iroh/endpoint/struct.VarInt.html
@@ -13,7 +13,7 @@ An integer less than 2^62
of overflowing.
Trait Implementations§
§impl From<VarInt> for IdleTimeout
§fn from(inner: VarInt) -> IdleTimeout
Converts to this type from the input type.§impl From<VarInt> for IdleTimeout
§fn from(inner: VarInt) -> IdleTimeout
Converts to this type from the input type.§impl Ord for VarInt
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
diff --git a/pr/4036/docs/iroh/endpoint/struct.WeakConnectionHandle.html b/pr/4036/docs/iroh/endpoint/struct.WeakConnectionHandle.html
index 47f6c23610..07bad208d7 100644
--- a/pr/4036/docs/iroh/endpoint/struct.WeakConnectionHandle.html
+++ b/pr/4036/docs/iroh/endpoint/struct.WeakConnectionHandle.html
@@ -1,18 +1,18 @@
-WeakConnectionHandle in iroh::endpoint - Rust WeakConnectionHandle
pub struct WeakConnectionHandle { /* private fields */ }
Expand description
A weak handle to a Connection.
+WeakConnectionHandle in iroh::endpoint - Rust WeakConnectionHandle
pub struct WeakConnectionHandle { /* private fields */ }
Expand description
A weak handle to a Connection.
A WeakConnectionHandle does not keep the connection alive: holding one will not
prevent the connection from being closed when the last Connection handle is dropped.
Use upgrade to obtain a strong Connection, and closed to wait for the
connection to be closed without keeping it alive.
-Implementations§
Source§impl WeakConnectionHandle
Sourcepub fn upgrade(&self) -> Option<Connection>
Attempts to upgrade this weak handle to a strong Connection.
+Implementations§
Source§impl WeakConnectionHandle
Sourcepub fn upgrade(&self) -> Option<Connection>
Attempts to upgrade this weak handle to a strong Connection.
Returns None if the connection has already been dropped.
-Sourcepub fn closed(&self) -> impl Future<Output = Option<Closed>> + Send + 'static
Returns a future that resolves once the connection has been closed.
+Sourcepub fn closed(&self) -> impl Future<Output = Option<Closed>> + Send + 'static
Returns a future that resolves once the connection has been closed.
If no strong references to the Connection exist at the time this is called,
the future resolves to None. If at least one strong reference still exists at
the time of this call, the returned future is guaranteed to receive the close
event with the close reason and final connection statistics, even if all strong
references are dropped before the future is awaited.
The future does not keep the connection alive.
-Trait Implementations§
Source§impl Clone for WeakConnectionHandle
Source§fn clone(&self) -> WeakConnectionHandle
Returns a duplicate 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 WeakConnectionHandle
§impl !RefUnwindSafe for WeakConnectionHandle
§impl Send for WeakConnectionHandle
§impl Sync for WeakConnectionHandle
§impl Unpin for WeakConnectionHandle
§impl !UnwindSafe for WeakConnectionHandle
Blanket Implementations§
Trait Implementations§
Source§impl Clone for WeakConnectionHandle
Source§fn clone(&self) -> WeakConnectionHandle
Returns a duplicate 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 WeakConnectionHandle
§impl !RefUnwindSafe for WeakConnectionHandle
§impl Send for WeakConnectionHandle
§impl Sync for WeakConnectionHandle
§impl Unpin for WeakConnectionHandle
§impl !UnwindSafe for WeakConnectionHandle
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/4036/docs/iroh/endpoint/trait.EndpointHooks.html b/pr/4036/docs/iroh/endpoint/trait.EndpointHooks.html
index 2ac883dd5d..90c7ff04fc 100644
--- a/pr/4036/docs/iroh/endpoint/trait.EndpointHooks.html
+++ b/pr/4036/docs/iroh/endpoint/trait.EndpointHooks.html
@@ -17,7 +17,7 @@
For each hook, all installed hooks are invoked in the order they were installed on
the endpoint builder. If a hook returns Accept, processing continues with the next
hook. If a hook returns Reject, processing is aborted and further hooks
-are not invoked for this hook.
+are not invoked for this hook point.
§Notes to implementers
As hooks are stored on the endpoint, you must make sure to never store an Endpoint
on the hook struct itself, as this would create reference counting loop and cause the
diff --git a/pr/4036/docs/iroh/endpoint_info/index.html b/pr/4036/docs/iroh/endpoint_info/index.html
index f27fe3b898..4a60b9fd8f 100644
--- a/pr/4036/docs/iroh/endpoint_info/index.html
+++ b/pr/4036/docs/iroh/endpoint_info/index.html
@@ -1,11 +1,11 @@
iroh::endpoint_info - Rust Module endpoint_info
Expand description
Support for handling DNS resource records for dialing by EndpointId.
Dialing by EndpointId is supported by iroh endpoints publishing Pkarr records to DNS
servers or the Mainline DHT. This module supports creating and parsing these records.
-EndpointInfo combines an iroh_base::EndpointId with EndpointData —
+
EndpointInfo combines an iroh_base::EndpointId with EndpointData:
the addressing and metadata that discovery services publish and resolve.
Discovery services use AddrFilter to control which addresses are published.
This module also provides serialization to and from pkarr signed packets and
-DNS TXT records. See the [crate::attrs] module for the on-the-wire format.
+DNS TXT records.
DNS records are published under the following names:
_iroh.<z32-endpoint-id>.<origin-domain> TXT
@@ -36,4 +36,4 @@ Each address is an IPv4 or IPv6 address with a port.
Structs§
- Addr
Filter - A filter and/or reordering function applied to transport addresses,
-typically used by AddressLookup services in iroh before publishing.
- Endpoint
Data - Data about an endpoint that may be published to and resolved from discovery services.
- Endpoint
Info - Information about an endpoint that may be published to and resolved from discovery services.
- MaxLength
ExceededError - Error returned when an input value is too long for
UserData. - User
Data - Under the hood this is a UTF-8 String is no longer than
UserData::MAX_LENGTH bytes.
\ No newline at end of file
+typically used by AddressLookup services in iroh before publishing.EndpointData Data about an endpoint that may be published to and resolved from discovery services. EndpointInfo Information about an endpoint that may be published to and resolved from discovery services. MaxLengthExceededError Error returned when an input value is too long for UserData. UserData User-defined data that can be published and resolved through endpoint discovery.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint_info/struct.EndpointData.html b/pr/4036/docs/iroh/endpoint_info/struct.EndpointData.html
index eaf2725892..2c818ea5b4 100644
--- a/pr/4036/docs/iroh/endpoint_info/struct.EndpointData.html
+++ b/pr/4036/docs/iroh/endpoint_info/struct.EndpointData.html
@@ -13,15 +13,15 @@ services, should they not fit into e.g. a single DNS packet otherwise.
See also Self::set_user_data.
Sourcepub fn add_relay_url(&mut self, relay_url: RelayUrl)
Adds the relay URL to the end of the endpoint data, unless it already existed.
Sourcepub fn add_ip_addrs(&mut self, addresses: Vec<SocketAddr>)
Adds addresses in order with duplicates or already existing addresses filtered out.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Adds addresses to the endpoint data in the given ordered, but with duplicates filtered.
-Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data and returns the updated endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Adds addresses to the endpoint data in the given order, but with duplicates filtered.
+Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data.
Sourcepub fn clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn clear_relay_urls(&mut self)
Removes all relay URLs from the endpoint data.
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses.
+Sourcepub fn filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
Returns a vec to allow re-ordering of addresses.
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
diff --git a/pr/4036/docs/iroh/endpoint_info/struct.UserData.html b/pr/4036/docs/iroh/endpoint_info/struct.UserData.html
index 3352480631..e73207e05e 100644
--- a/pr/4036/docs/iroh/endpoint_info/struct.UserData.html
+++ b/pr/4036/docs/iroh/endpoint_info/struct.UserData.html
@@ -1,4 +1,5 @@
-UserData in iroh::endpoint_info - Rust 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.
+UserData in iroh::endpoint_info - Rust UserData
pub struct UserData(/* private fields */);
Expand description
User-defined data that can be published and resolved through endpoint discovery.
+Under the hood this is a UTF-8 string 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.
diff --git a/pr/4036/docs/iroh/enum.KeyParsingError.html b/pr/4036/docs/iroh/enum.KeyParsingError.html
index 765ac27ad2..146ec05698 100644
--- a/pr/4036/docs/iroh/enum.KeyParsingError.html
+++ b/pr/4036/docs/iroh/enum.KeyParsingError.html
@@ -1,4 +1,4 @@
-KeyParsingError in iroh - Rust KeyParsingError
#[non_exhaustive]pub enum KeyParsingError {
+KeyParsingError in iroh - Rust KeyParsingError
#[non_exhaustive]pub enum KeyParsingError {
FailedToDecodeHex {
meta: Meta,
},
@@ -11,14 +11,14 @@
InvalidKeyData {
meta: Meta,
},
-}
Expand description
Error when deserialising a PublicKey or a SecretKey.
+}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§FailedToDecodeHex
The input string could not be decoded as hex.
Fields
§meta: MetaCaptured call-site metadata
§FailedToDecodeBase32
The input string could not be decoded as base32.
Fields
§meta: MetaCaptured call-site metadata
§InvalidLength
The input has invalid length.
Fields
§meta: MetaCaptured call-site metadata
-§InvalidKeyData
The decoded data is not a valid Ed25591 public key.
+§InvalidKeyData
The decoded data is not a valid Ed25519 public key.
Fields
§meta: MetaCaptured call-site metadata
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<KeyParsingError> for ParseError
Source§fn from(source: KeyParsingError) -> ParseError
Converts to this type from the input type.Source§impl StackError for KeyParsingError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<KeyParsingError>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Returns the next source in the chain, if any.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.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
diff --git a/pr/4036/docs/iroh/enum.TransportAddr.html b/pr/4036/docs/iroh/enum.TransportAddr.html
index df614a51ee..0e5f31d772 100644
--- a/pr/4036/docs/iroh/enum.TransportAddr.html
+++ b/pr/4036/docs/iroh/enum.TransportAddr.html
@@ -3,8 +3,8 @@
Ip(SocketAddr),
Custom(CustomAddr),
}Expand description
Available address types.
-Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§Relay(RelayUrl)
Relays
-§Ip(SocketAddr)
IP based addresses
+Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§Relay(RelayUrl)
A relay server address.
+§Ip(SocketAddr)
An IP based address.
§Custom(CustomAddr)
Custom transport address
Implementations§
Source§impl TransportAddr
Sourcepub fn is_ip(&self) -> bool
Whether this is an IP transport address.
diff --git a/pr/4036/docs/iroh/index.html b/pr/4036/docs/iroh/index.html
index a2ddd5617a..8c7bddcb16 100644
--- a/pr/4036/docs/iroh/index.html
+++ b/pr/4036/docs/iroh/index.html
@@ -1,5 +1,5 @@
iroh - Rust Crate iroh
Expand description
Peer-to-peer QUIC connections.
-iroh is a library to establish direct connectivity between peers. It exposes an
+
iroh is a library to establish direct connectivity between peers. It exposes an
interface to QUIC connections and streams to the user, while implementing direct
connectivity using hole punching complemented by relay servers under the hood.
An iroh endpoint is created and controlled by the Endpoint, e.g. connecting to
@@ -44,7 +44,7 @@ punching if needed. Once the direct connection is established the relay ser
longer involved in the connection.
If one of the iroh endpoints can be reached directly, connectivity can also be
established without involving a Relay server. This is done by using the endpoint’s
-listening addresses in the connection establishement instead of the RelayUrl which
+listening addresses in the connection establishment instead of the RelayUrl which
is used to identify a Relay server. Of course it is also possible to use both a
RelayUrl and direct addresses at the same time to connect.
§Encryption
@@ -179,4 +179,4 @@ connecting using only the Ok(())
}
Please see the examples directory for more nuanced examples.
-Re-exports§
Modules§
- address_
lookup - Lookup the address of an Endpoint ID.
- defaults
- Default values used in
iroh - dns
Non-wasm_browser - Configurable DNS resolver.
- endpoint
- The
Endpoint allows establishing connections to other iroh endpoints. - endpoint_
info - Support for handling DNS resource records for dialing by
EndpointId. - metrics
- Co-locating all of the iroh metrics structs
- protocol
- Tools for spawning an accept loop that routes incoming requests to the right protocol.
- test_
utils test-utils - Internal utilities to support testing.
- tls
- TLS configuration for iroh.
Structs§
- Endpoint
Addr - Network-level addressing information for an iroh endpoint.
- NetReport
- A net_report report.
- NetReport
Config - Configuration for the net report component.
- Public
Key - A public key.
- Relay
Config - Information on a specific relay server.
- Relay
Map - List of relay server configurations to be used in an iroh endpoint.
- Relay
Url - A URL identifying a relay server.
- Relay
UrlParseError - Can occur when parsing a string into a
RelayUrl. - Secret
Key - A secret key.
- Signature
- Ed25519 signature.
- Signature
Error - Verification of a signature failed.
Enums§
- KeyParsing
Error - Error when deserialising a
PublicKey or a SecretKey. - Transport
Addr - Available address types.
Constants§
- NET_
REPORT_TIMEOUT - The maximum amount of time, in seconds, the net_report will spend gathering a single report.
Traits§
- Watcher
- A handle to a value that’s represented by one or more underlying [
Watchable]s.
Type Aliases§
- Endpoint
Id - The identifier for an endpoint in the (iroh) network.
\ No newline at end of file
+Re-exports§
Modules§
- address_
lookup - Lookup the address of an Endpoint ID.
- defaults
- Default values used in
iroh - dns
Non-wasm_browser - Configurable DNS resolver.
- endpoint
- The
Endpoint allows establishing connections to other iroh endpoints. - endpoint_
info - Support for handling DNS resource records for dialing by
EndpointId. - metrics
- Co-locating all of the iroh metrics structs
- protocol
- Tools for spawning an accept loop that routes incoming requests to the right protocol.
- test_
utils test-utils - Internal utilities to support testing.
- tls
- TLS configuration for iroh.
Structs§
- Endpoint
Addr - Network-level addressing information for an iroh endpoint.
- NetReport
- A net_report report.
- NetReport
Config - Configuration for the net report component.
- Public
Key - A public key.
- Relay
Config - Information on a specific relay server.
- Relay
Map - List of relay server configurations to be used in an iroh endpoint.
- Relay
Url - A URL identifying a relay server.
- Relay
UrlParseError - Can occur when parsing a string into a
RelayUrl. - Secret
Key - A secret key.
- Signature
- Ed25519 signature.
- Signature
Error - Verification of a signature failed.
Enums§
- KeyParsing
Error - Error returned when parsing a
PublicKey or a SecretKey. - Transport
Addr - Available address types.
Constants§
- NET_
REPORT_TIMEOUT - The maximum amount of time, in seconds, the net_report will spend gathering a single report.
Traits§
- Watcher
- A handle to a value that’s represented by one or more underlying [
Watchable]s.
Type Aliases§
- Endpoint
Id - The identifier for an endpoint in the (iroh) network.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/metrics/index.html b/pr/4036/docs/iroh/metrics/index.html
index da53db7d6a..00f2275127 100644
--- a/pr/4036/docs/iroh/metrics/index.html
+++ b/pr/4036/docs/iroh/metrics/index.html
@@ -1,2 +1,2 @@
iroh::metrics - Rust Module metrics
Expand description
Co-locating all of the iroh metrics structs
-Structs§
- Endpoint
Metrics - Metrics collected by an
crate::endpoint::Endpoint. - NetReport
Metrics - Enum of metrics for the module
- Relay
Metrics test-utils - Metrics tracked for the relay server
- Socket
Metrics - Enum of metrics for the module
\ No newline at end of file
+Structs§
- Endpoint
Metrics - Metrics collected by an
crate::endpoint::Endpoint. - NetReport
Metrics - Enum of metrics for the module
- Relay
Metrics test-utils - Metrics tracked for the relay server
- Socket
Metrics - Metrics collected by the iroh socket.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/metrics/struct.RelayMetrics.html b/pr/4036/docs/iroh/metrics/struct.RelayMetrics.html
index f8768e50a1..da2588f738 100644
--- a/pr/4036/docs/iroh/metrics/struct.RelayMetrics.html
+++ b/pr/4036/docs/iroh/metrics/struct.RelayMetrics.html
@@ -26,21 +26,26 @@
pub http_connections_closed: Counter,
pub http_connections_errored: Counter,
}Available on crate feature test-utils only.Expand description
Metrics tracked for the relay server
-Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.§bytes_sent: CounterBytes sent from a FrameType::SendPacket
-§bytes_recv: CounterBytes received from a FrameType::SendPacket
-§send_packets_sent: CounterFrameType::SendPacket sent
-§send_packets_recv: CounterFrameType::SendPacket received
-§send_packets_dropped: CounterFrameType::SendPacket dropped
-§other_packets_sent: CounterPackets of other FrameTypes sent
-§other_packets_recv: CounterPackets of other FrameTypes received
-§other_packets_dropped: CounterPackets of other FrameTypes dropped
-§got_ping: CounterNumber of FrameType::Pings received
-§sent_pong: CounterNumber of FrameType::Pongs sent
-§unknown_frames: CounterNumber of FrameType::Unknown received
+Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.§bytes_sent: CounterBytes sent to a client in RelayToClientDatagram or RelayToClientDatagramBatch frames.
+§bytes_recv: CounterBytes received from a client in ClientToRelayDatagram or ClientToRelayDatagramBatch frames.
+§send_packets_sent: CounterRelayToClientDatagram or RelayToClientDatagramBatch frames sent to a client.
+§send_packets_recv: CounterClientToRelayDatagram or ClientToRelayDatagramBatch frames received from a client.
+§send_packets_dropped: CounterRelayToClientDatagram or RelayToClientDatagramBatch frames dropped instead of being
+delivered to a client, because the recipient is not connected or writing to its stream failed.
+Note that frames dropped because the recipient’s send queue is full or closed are not counted
+here.
+§other_packets_sent: CounterIntended to count sent frames other than datagrams, but currently unused (never incremented).
+§other_packets_recv: CounterIntended to count received frames other than datagrams, but currently unused (never incremented).
+§other_packets_dropped: CounterIntended to count dropped frames other than datagrams, but currently unused (never incremented).
+§got_ping: CounterNumber of FrameType::Ping frames received from a client.
+§sent_pong: CounterNumber of FrameType::Pong frames sent to a client.
+§unknown_frames: CounterIntended to count received frames with an unrecognized FrameType,
+but currently unused (never incremented).
§bytes_rx_ratelimited_total: CounterNumber of bytes received from client connection which have been rate-limited.
§conns_rx_ratelimited_total: CounterNumber of client connections which have had any frames rate-limited.
§accepts: CounterNumber of times this server has accepted a connection.
-§disconnects: CounterNumber of connections we have removed because of an error
+§disconnects: CounterNumber of times a client connection was disconnected.
+Incremented once per connection, paired with Self::accepts.
§unique_client_keys: CounterNumber of unique client keys per day
§clients_inactive_added: CounterNumber of times a client was moved into the inactive state.
A client becomes inactive when a new client connects with the same endpoint id. An inactive
diff --git a/pr/4036/docs/iroh/metrics/struct.SocketMetrics.html b/pr/4036/docs/iroh/metrics/struct.SocketMetrics.html
index 2291657920..f61d3786bb 100644
--- a/pr/4036/docs/iroh/metrics/struct.SocketMetrics.html
+++ b/pr/4036/docs/iroh/metrics/struct.SocketMetrics.html
@@ -1,4 +1,4 @@
-
SocketMetrics in iroh::metrics - Rust SocketMetrics
#[non_exhaustive]pub struct SocketMetrics {Show 31 fields
+SocketMetrics in iroh::metrics - Rust SocketMetrics
#[non_exhaustive]pub struct SocketMetrics {Show 31 fields
pub update_direct_addrs: Counter,
pub send_ipv4: Counter,
pub send_ipv6: Counter,
@@ -30,10 +30,23 @@
pub actor_tick_direct_addr_heartbeat: Counter,
pub actor_link_change: Counter,
pub actor_tick_other: Counter,
-}
Expand description
Enum of metrics for the module
-Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.§update_direct_addrs: Counter§send_ipv4: Counter§send_ipv6: Counter§send_relay: Counter§recv_data_relay: Counter§recv_data_custom: Counter§recv_data_ipv4: Counter§recv_data_ipv6: Counter§recv_datagrams: CounterNumber of QUIC datagrams received.
-§recv_gro_datagrams: CounterNumber of datagrams received using GRO
-§relay_home_change: Counter§holepunch_attempts: CounterThe number of times holepunching is initiated on a connection.
+}Expand description
Metrics collected by the iroh socket.
+Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.§update_direct_addrs: CounterIntended to count updates to the local direct address set, but currently unused
+(never incremented).
+§send_ipv4: CounterNumber of bytes sent over IPv4.
+§send_ipv6: CounterNumber of bytes sent over IPv6.
+§send_relay: CounterNumber of bytes sent over the relay transport.
+§recv_data_relay: CounterNumber of data bytes received over the relay transport.
+§recv_data_custom: CounterNumber of data bytes received over any custom transport.
+§recv_data_ipv4: CounterNumber of data bytes received over IPv4.
+§recv_data_ipv6: CounterNumber of data bytes received over IPv6.
+§recv_datagrams: CounterNumber of QUIC datagrams received.
+§recv_gro_datagrams: CounterNumber of receive events that used GRO (coalesced datagram batches).
+This counts batches, not the individual datagrams within them. See
+Self::recv_datagrams for the datagram count.
+§relay_home_change: CounterNumber of times the home relay changed to a different relay.
+This includes the initial assignment from no home relay to a home relay.
+§holepunch_attempts: CounterThe number of times holepunching is initiated on a connection.
This can be incremented multiple times for a single connection. Note that only the
client-side of a connection will increment this counter.
§paths_direct: CounterThe number of network paths to peers that are direct.
@@ -53,8 +66,15 @@ the number of opened connections.
§transport_relay_paths_removed: CounterNumber of relay transport paths closed.
§transport_custom_paths_added: CounterNumber of custom transport paths opened.
§transport_custom_paths_removed: CounterNumber of custom transport paths closed.
-§actor_tick_main: Counter§actor_tick_msg: Counter§actor_tick_re_stun: Counter§actor_tick_portmap_changed: Counter§actor_tick_direct_addr_heartbeat: Counter§actor_link_change: Counter§actor_tick_other: CounterTrait Implementations§
Source§impl<'de> Deserialize<'de> for Metrics
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Iterable for Metrics
Source§fn metric_field_count(&self) -> usize
Returns the number of metric fields in the struct.Source§fn metric_field_ref(&self, n: usize) -> Option<MetricItem<'_>>
Returns the metric field at the given index.§fn family_field_count(&self) -> usize
Returns the number of Family fields in the struct.§fn family_field_ref(&self, _n: usize) -> Option<FamilyItem<'_>>
Returns the Family field at the given index.Source§impl Serialize for Metrics
Source§fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where
+§actor_tick_main: CounterNumber of iterations of the main socket actor loop.
+§actor_tick_msg: CounterNumber of actor messages processed by the socket actor loop.
+§actor_tick_re_stun: CounterNumber of periodic re-STUN timer ticks handled by the socket actor loop.
+§actor_tick_portmap_changed: CounterNumber of port-mapping change events handled by the socket actor loop.
+§actor_tick_direct_addr_heartbeat: CounterIntended to count direct address heartbeat ticks, but currently unused (never incremented).
+§actor_link_change: CounterNumber of local network interface (link) change events handled by the socket actor loop.
+§actor_tick_other: CounterNumber of times an input watcher or receiver closed in the socket actor loop.
+Trait Implementations§
Source§impl<'de> Deserialize<'de> for Metrics
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Iterable for Metrics
Source§fn metric_field_count(&self) -> usize
Returns the number of metric fields in the struct.Source§fn metric_field_ref(&self, n: usize) -> Option<MetricItem<'_>>
Returns the metric field at the given index.§fn family_field_count(&self) -> usize
Returns the number of Family fields in the struct.§fn family_field_ref(&self, _n: usize) -> Option<FamilyItem<'_>>
Returns the Family field at the given index.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
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/4036/docs/iroh/protocol/enum.IncomingFilterOutcome.html b/pr/4036/docs/iroh/protocol/enum.IncomingFilterOutcome.html
index e11345eddc..4577fe8eaf 100644
--- a/pr/4036/docs/iroh/protocol/enum.IncomingFilterOutcome.html
+++ b/pr/4036/docs/iroh/protocol/enum.IncomingFilterOutcome.html
@@ -11,7 +11,7 @@ the source address, actively refuse the connection, or silently drop it.
What this does depends on the connection type:
-
-
Direct (UDP) connections : this is QUIC source address
+
Direct (UDP) connections: this is QUIC source address
validation. If the socket address was spoofed, the retry token is
sent to the spoofed address, so we never hear from the attacker
again. If the address was real, the client repeats the connection
@@ -20,7 +20,7 @@ attempt with the token, and the next
-
-
Relay connections : there is no source address to validate
+
Relay connections: there is no source address to validate
(the relay already vouches for the packet origin), so the
“validation” itself has no security meaning. However, the retry
still imposes a real cost on the client: an extra round trip
diff --git a/pr/4036/docs/iroh/protocol/struct.RouterBuilder.html b/pr/4036/docs/iroh/protocol/struct.RouterBuilder.html
index dfc8969679..06b2f59fad 100644
--- a/pr/4036/docs/iroh/protocol/struct.RouterBuilder.html
+++ b/pr/4036/docs/iroh/protocol/struct.RouterBuilder.html
@@ -16,7 +16,7 @@ cheaper signals (e.g. remote address) first.
with this alpn.
handler can either be a type that implements ProtocolHandler or a
Box<dyn DynProtocolHandler>.
-
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for RouterBuilder
§impl !RefUnwindSafe for RouterBuilder
§impl Send for RouterBuilder
§impl Sync for RouterBuilder
§impl Unpin for RouterBuilder
§impl !UnwindSafe for RouterBuilder
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/4036/docs/iroh/struct.EndpointAddr.html b/pr/4036/docs/iroh/struct.EndpointAddr.html
index 0aa53df633..867818d655 100644
--- a/pr/4036/docs/iroh/struct.EndpointAddr.html
+++ b/pr/4036/docs/iroh/struct.EndpointAddr.html
@@ -5,7 +5,7 @@
This combines an endpoint’s identifier with network-level addressing information of how to
contact the endpoint.
To establish a network connection to an endpoint both the EndpointId and one or more network
-paths are needed. The network paths can come from various sources, current sources can come from
+paths are needed. The network paths can come from various sources:
-
An Address Lookup service which can provide routing information for a given EndpointId.
@@ -24,7 +24,7 @@ connection without the help of a Fields§§id: PublicKeyThe endpoint’s identifier.
-§addrs: BTreeSet<TransportAddr>The endpoint’s addresses
+§addrs: BTreeSet<TransportAddr>The endpoint’s addresses.
Implementations§
Source§impl EndpointAddr
Sourcepub fn new(id: PublicKey) -> EndpointAddr
Creates a new EndpointAddr with no network level addresses.
This still is usable with e.g. an address lookup service to establish a connection,
depending on the situation.
@@ -38,9 +38,9 @@ depending on the situation.
self,
addrs: impl IntoIterator<Item = TransportAddr>,
) -> EndpointAddrAdds a list of addresses.
-Sourcepub fn is_empty(&self) -> bool
Returns true, if only a EndpointId is present.
-Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns a list of IP addresses of this peer.
-Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns a list of relay urls of this peer.
+Sourcepub fn is_empty(&self) -> bool
Returns true if only an EndpointId is present.
+Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns an iterator over the IP addresses of this endpoint address.
+Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns an iterator over the relay URLs of this endpoint address.
In practice this is expected to be zero or one home relay for all known cases currently.
Trait Implementations§
Source§impl Clone for EndpointAddr
Source§fn clone(&self) -> EndpointAddr
Returns a duplicate 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 EndpointAddr
Source§impl<'de> Deserialize<'de> for EndpointAddr
Source§fn deserialize<__D>(
__deserializer: __D,
diff --git a/pr/4036/docs/iroh/struct.NetReport.html b/pr/4036/docs/iroh/struct.NetReport.html
index 693c855529..8b8ec1aed1 100644
--- a/pr/4036/docs/iroh/struct.NetReport.html
+++ b/pr/4036/docs/iroh/struct.NetReport.html
@@ -1,4 +1,4 @@
-NetReport in iroh - Rust NetReport
pub struct NetReport {
+NetReport in iroh - Rust NetReport
pub struct NetReport {
pub udp_v4: bool,
pub udp_v6: bool,
pub mapping_varies_by_dest_ipv4: Option<bool>,
@@ -13,17 +13,16 @@
§udp_v6: boolA QAD IPv6 round trip completed.
§mapping_varies_by_dest_ipv4: Option<bool>Whether the reported public address differs when probing different servers (on IPv4).
§mapping_varies_by_dest_ipv6: Option<bool>Whether the reported public address differs when probing different servers (on IPv6).
-§preferred_relay: Option<RelayUrl>Probe indicating the presence of port mapping protocols on the LAN.
-None for unknown
-§relay_latency: RelayLatencieskeyed by relay Url
-§global_v4: Option<SocketAddrV4>ip:port of global IPv4
-§global_v6: Option<SocketAddrV6>[ip]:port of global IPv6
+§preferred_relay: Option<RelayUrl>The relay server with the lowest latency, if any.
+§relay_latency: RelayLatenciesThe measured latency to each relay, keyed by relay URL.
+§global_v4: Option<SocketAddrV4>The discovered global IPv4 address and port, if any.
+§global_v6: Option<SocketAddrV6>The discovered global IPv6 address and port, if any.
§captive_portal: Option<bool>CaptivePortal is set when we think there’s a captive portal that is
intercepting HTTP traffic.
-Implementations§
Source§impl Report
Sourcepub fn mapping_varies_by_dest(&self) -> Option<bool>
Whether the reported public address differs when probing different servers.
+Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Report
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl PartialEq for Report
Source§impl Eq for Report
Source§impl StructuralPartialEq for Report
Auto Trait Implementations§
§impl Freeze for Report
§impl RefUnwindSafe for Report
§impl Send for Report
§impl Sync for Report
§impl Unpin for Report
§impl UnwindSafe for Report
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/4036/docs/iroh/struct.PublicKey.html b/pr/4036/docs/iroh/struct.PublicKey.html
index f8fb4c5ae2..b725772ddc 100644
--- a/pr/4036/docs/iroh/struct.PublicKey.html
+++ b/pr/4036/docs/iroh/struct.PublicKey.html
@@ -1,5 +1,5 @@
PublicKey in iroh - Rust PublicKey
pub struct PublicKey(/* private fields */);
Expand description
A public key.
-The key itself is stored as the CompressedEdwards y coordinate of the public key
+
The key itself is stored as the CompressedEdwards y-coordinate of the public key.
It is verified to decompress into a valid key when created.
Implementations§
Source§impl PublicKey
Sourcepub fn as_bytes(&self) -> &[u8; 32]
Get this public key as a byte array.
@@ -12,7 +12,7 @@ See [VerifyingKey::from_bytes] for details.
&self,
message: &[u8],
signature: &Signature,
-) -> Result<(), SignatureError>Verify a signature on a message with this secret key’s public key.
+) -> Result<(), SignatureError>Verify a signature on a message with this public key.
§Return
Returns Ok(()) if the signature is valid, and Err otherwise.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PublicKey
Source§fn deserialize<D>(
deserializer: D,
) -> Result<PublicKey, <D as Deserializer<'de>>::Error>where
- D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl From<PublicKey> for EndpointAddr
Source§fn from(endpoint_id: PublicKey) -> EndpointAddr
Converts to this type from the input type.Source§impl From<PublicKey> for EndpointAddr
Source§fn from(endpoint_id: PublicKey) -> EndpointAddr
Converts to this type from the input type.Source§impl FromStr for PublicKey
Parses a PublicKey from its hex or base32 encoding.
+
Display produces the hex encoding.
Source§impl Hash for PublicKey
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
H: Hasher,
diff --git a/pr/4036/docs/iroh/tls/index.html b/pr/4036/docs/iroh/tls/index.html
index 3c1d92cf2a..16f63b088e 100644
--- a/pr/4036/docs/iroh/tls/index.html
+++ b/pr/4036/docs/iroh/tls/index.html
@@ -1,5 +1,5 @@
iroh::tls - Rust Module tls
Expand description
TLS configuration for iroh.
-Currently there is one mechanisms available
+Currently there is one mechanism available:
- Raw Public Keys, using the TLS extension described in RFC 7250
diff --git a/pr/4036/docs/iroh_base/enum.KeyParsingError.html b/pr/4036/docs/iroh_base/enum.KeyParsingError.html
index d0668a511c..7c849cddf2 100644
--- a/pr/4036/docs/iroh_base/enum.KeyParsingError.html
+++ b/pr/4036/docs/iroh_base/enum.KeyParsingError.html
@@ -1,4 +1,4 @@
-KeyParsingError in iroh_base - Rust KeyParsingError
#[non_exhaustive]pub enum KeyParsingError {
+KeyParsingError in iroh_base - Rust KeyParsingError
#[non_exhaustive]pub enum KeyParsingError {
FailedToDecodeHex {
meta: Meta,
},
@@ -11,14 +11,14 @@
InvalidKeyData {
meta: Meta,
},
-}
Available on crate feature key only.Expand description
Error when deserialising a PublicKey or a SecretKey.
+}Available on crate feature key only.Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§FailedToDecodeHex
The input string could not be decoded as hex.
Fields
§meta: MetaCaptured call-site metadata
§FailedToDecodeBase32
The input string could not be decoded as base32.
Fields
§meta: MetaCaptured call-site metadata
§InvalidLength
The input has invalid length.
Fields
§meta: MetaCaptured call-site metadata
-§InvalidKeyData
The decoded data is not a valid Ed25591 public key.
+§InvalidKeyData
The decoded data is not a valid Ed25519 public key.
Fields
§meta: MetaCaptured call-site metadata
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<KeyParsingError> for AnyError
Source§fn from(value: KeyParsingError) -> AnyError
Converts to this type from the input type.Source§impl StackError for KeyParsingError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
Returns the next source in the chain, if any.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.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§
Source§impl<T> Borrow<T> for Twhere
diff --git a/pr/4036/docs/iroh_base/enum.TransportAddr.html b/pr/4036/docs/iroh_base/enum.TransportAddr.html
index ec9989aea4..a55428eb22 100644
--- a/pr/4036/docs/iroh_base/enum.TransportAddr.html
+++ b/pr/4036/docs/iroh_base/enum.TransportAddr.html
@@ -3,8 +3,8 @@
Ip(SocketAddr),
Custom(CustomAddr),
}Available on crate feature key only.Expand description
Available address types.
-Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§Relay(RelayUrl)
Relays
-§Ip(SocketAddr)
IP based addresses
+Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§Relay(RelayUrl)
A relay server address.
+§Ip(SocketAddr)
An IP based address.
§Custom(CustomAddr)
Custom transport address
Implementations§
Source§impl TransportAddr
impl<T> Any for Twhere
+PkarrRelayClientBuilder in iroh::address_lookup::pkarr - Rust PkarrRelayClientBuilder
pub struct PkarrRelayClientBuilder { /* private fields */ }
Expand description
A builder for the PkarrRelayClient
+Implementations§
Source§impl PkarrRelayClientBuilder
Sourcepub fn build(self) -> PkarrRelayClient
Build a PkarrRelayClient.
+Trait Implementations§
Source§impl Clone for PkarrRelayClientBuilder
Source§fn clone(&self) -> PkarrRelayClientBuilder
Returns a duplicate 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 PkarrRelayClientBuilder
§impl !RefUnwindSafe for PkarrRelayClientBuilder
§impl Send for PkarrRelayClientBuilder
§impl Sync for PkarrRelayClientBuilder
§impl Unpin for PkarrRelayClientBuilder
§impl !UnwindSafe for PkarrRelayClientBuilder
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/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
index 13e12a4b01..1f7723299d 100644
--- a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
+++ b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
@@ -1,21 +1,21 @@
-PkarrResolver in iroh::address_lookup::pkarr - Rust PkarrResolver
pub struct PkarrResolver { /* private fields */ }
Expand description
Resolver of address lookup information from a pkarr relay.
+PkarrResolver in iroh::address_lookup::pkarr - Rust PkarrResolver
pub struct PkarrResolver { /* private fields */ }
Expand description
Resolver of address lookup information from a pkarr relay.
The resolver uses HTTP to query address lookup information from a pkarr relay server,
see the module docs for details.
This implements the AddressLookup trait to be used as an address lookup service. Note
that it only resolves address lookup information, for the corresponding publisher use
the PkarrPublisher together with AddressLookupServices.
-Implementations§
Source§impl PkarrResolver
Sourcepub fn builder(pkarr_relay: Url) -> PkarrResolverBuilder
Creates a new resolver builder using the pkarr relay server at the URL.
+Implementations§
Source§impl PkarrResolver
Sourcepub fn builder(pkarr_relay: Url) -> PkarrResolverBuilder
Creates a new resolver builder using the pkarr relay server at the URL.
The builder implements AddressLookupBuilder.
-Sourcepub fn n0_dns() -> PkarrResolverBuilder
Creates a pkarr resolver builder which uses the number 0 pkarr relay server.
+Sourcepub fn n0_dns() -> PkarrResolverBuilder
Creates a pkarr resolver builder which uses the number 0 pkarr relay server.
This uses the pkarr relay server operated by number 0 at
N0_DNS_PKARR_RELAY_PROD.
When running with the environment variable IROH_FORCE_STAGING_RELAYS
set to any non empty value N0_DNS_PKARR_RELAY_STAGING
server is used instead.
-Trait Implementations§
Source§impl AddressLookup for PkarrResolver
Trait Implementations§
Source§impl AddressLookup for PkarrResolver
Source§fn resolve(
&self,
endpoint_id: EndpointId,
-) -> Option<BoxStream<Result<AddressLookupItem, AddressLookupError>>>
Source§fn publish(&self, _data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreSource§impl Clone for PkarrResolver
Source§fn clone(&self) -> PkarrResolver
Returns a duplicate 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 PkarrResolver
§impl !RefUnwindSafe for PkarrResolver
§impl Send for PkarrResolver
§impl Sync for PkarrResolver
§impl Unpin for PkarrResolver
§impl !UnwindSafe for PkarrResolver
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
+) -> Option<BoxStream<Result<AddressLookupItem, AddressLookupError>>>Source§fn publish(&self, _data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read more
Source§impl Clone for PkarrResolver
Source§fn clone(&self) -> PkarrResolver
Returns a duplicate 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 PkarrResolver
§impl !RefUnwindSafe for PkarrResolver
§impl Send for PkarrResolver
§impl Sync for PkarrResolver
§impl Unpin for PkarrResolver
§impl !UnwindSafe for PkarrResolver
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
T: AddressLookup,
Source§fn into_address_lookup(
self,
_endpoint: &Endpoint,
diff --git a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
index cfd47f28e6..e549ec9d07 100644
--- a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
+++ b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
@@ -1,11 +1,11 @@
-PkarrResolverBuilder in iroh::address_lookup::pkarr - Rust PkarrResolverBuilder
pub struct PkarrResolverBuilder { /* private fields */ }
Expand description
Builder for PkarrResolver.
+PkarrResolverBuilder in iroh::address_lookup::pkarr - Rust PkarrResolverBuilder
pub struct PkarrResolverBuilder { /* private fields */ }
Expand description
Builder for PkarrResolver.
-Implementations§
Source§impl PkarrResolverBuilder
Sourcepub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self
Available on non-wasm_browser only.
Sets the DNS resolver to use for resolving the pkarr relay URL.
-Sourcepub fn build(self, tls_config: ClientConfig) -> PkarrResolver
Creates a PkarrResolver from this builder.
-Trait Implementations§
Implementations§
Source§impl PkarrResolverBuilder
Sourcepub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self
Available on non-wasm_browser only.
Sets the DNS resolver to use for resolving the pkarr relay URL.
+Sourcepub fn build(self, tls_config: ClientConfig) -> PkarrResolver
Creates a PkarrResolver from this builder.
+Trait Implementations§
Source§impl AddressLookupBuilder for PkarrResolverBuilder
Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this builder into a ready-to-use AddressLookup. Read moreAuto Trait Implementations§
§impl Freeze for PkarrResolverBuilder
§impl !RefUnwindSafe for PkarrResolverBuilder
§impl Send for PkarrResolverBuilder
§impl Sync for PkarrResolverBuilder
§impl Unpin for PkarrResolverBuilder
§impl !UnwindSafe for PkarrResolverBuilder
Blanket Implementations§
Source§impl<T> Any for Twhere
+) -> Result<impl AddressLookup, AddressLookupBuilderError>Turns this builder into a ready-to-use AddressLookup. Read more
Auto Trait Implementations§
§impl Freeze for PkarrResolverBuilder
§impl !RefUnwindSafe for PkarrResolverBuilder
§impl Send for PkarrResolverBuilder
§impl Sync for PkarrResolverBuilder
§impl Unpin for PkarrResolverBuilder
§impl !UnwindSafe for PkarrResolverBuilder
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/4036/docs/iroh/address_lookup/struct.EndpointData.html b/pr/4036/docs/iroh/address_lookup/struct.EndpointData.html
index 1ea4773718..7de6a2dd89 100644
--- a/pr/4036/docs/iroh/address_lookup/struct.EndpointData.html
+++ b/pr/4036/docs/iroh/address_lookup/struct.EndpointData.html
@@ -13,15 +13,15 @@ services, should they not fit into e.g. a single DNS packet otherwise.
See also Self::set_user_data.
Sourcepub fn add_relay_url(&mut self, relay_url: RelayUrl)
Adds the relay URL to the end of the endpoint data, unless it already existed.
Sourcepub fn add_ip_addrs(&mut self, addresses: Vec<SocketAddr>)
Adds addresses in order with duplicates or already existing addresses filtered out.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Adds addresses to the endpoint data in the given ordered, but with duplicates filtered.
-Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data and returns the updated endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Adds addresses to the endpoint data in the given order, but with duplicates filtered.
+Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data.
Sourcepub fn clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn clear_relay_urls(&mut self)
Removes all relay URLs from the endpoint data.
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses.
+Sourcepub fn filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
Returns a vec to allow re-ordering of addresses.
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
diff --git a/pr/4036/docs/iroh/address_lookup/struct.Item.html b/pr/4036/docs/iroh/address_lookup/struct.Item.html
index 9e63b37130..28d59f6feb 100644
--- a/pr/4036/docs/iroh/address_lookup/struct.Item.html
+++ b/pr/4036/docs/iroh/address_lookup/struct.Item.html
@@ -16,14 +16,14 @@ directly from Sourcepub fn last_updated(&self) -> Option<u64>
Returns the optional timestamp when this endpoint info was last updated.
The value is microseconds since the unix epoch.
-Sourcepub fn to_endpoint_addr(&self) -> EndpointAddr
Converts into a EndpointAddr by cloning the needed fields.
-Sourcepub fn into_endpoint_addr(self) -> EndpointAddr
Converts into a EndpointAddr without cloning.
+Sourcepub fn to_endpoint_addr(&self) -> EndpointAddr
Returns an EndpointAddr by cloning the needed fields.
+Sourcepub fn into_endpoint_addr(self) -> EndpointAddr
Converts into an EndpointAddr without cloning.
Methods from Deref<Target = EndpointData>§
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses.
+Sourcepub fn filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
Returns a vec to allow re-ordering of addresses.
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
diff --git a/pr/4036/docs/iroh/address_lookup/struct.UserData.html b/pr/4036/docs/iroh/address_lookup/struct.UserData.html
index 49c2183d40..5ae8665e57 100644
--- a/pr/4036/docs/iroh/address_lookup/struct.UserData.html
+++ b/pr/4036/docs/iroh/address_lookup/struct.UserData.html
@@ -1,4 +1,5 @@
-UserData in iroh::address_lookup - Rust 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.
+UserData in iroh::address_lookup - Rust UserData
pub struct UserData(/* private fields */);
Expand description
User-defined data that can be published and resolved through endpoint discovery.
+Under the hood this is a UTF-8 string 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.
diff --git a/pr/4036/docs/iroh/address_lookup/trait.AddressLookup.html b/pr/4036/docs/iroh/address_lookup/trait.AddressLookup.html
index 1be6efa3e6..79a8044def 100644
--- a/pr/4036/docs/iroh/address_lookup/trait.AddressLookup.html
+++ b/pr/4036/docs/iroh/address_lookup/trait.AddressLookup.html
@@ -22,7 +22,7 @@ Address Lookup information changes. If an Address Lookup mechanism requires a pe
refresh, it should start its own task.
Provided Methods§
Sourcefn publish(&self, _data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism.
This is fire and forget, since the Endpoint can not wait for successful
-publishing. If publishing is async, the implementation should start it’s own task.
+publishing. If publishing is async, the implementation should start its own task.
This will be called from a tokio task, so it is safe to spawn new tasks.
These tasks will be run on the runtime of the super::Endpoint.
Implementations on Foreign Types§
Source§impl<T: AddressLookup> AddressLookup for Arc<T>
Implementors§
Source§impl AddressLookup for DnsAddressLookup
Available on non-wasm_browser only. Source§impl AddressLookup for MemoryLookup
Source§impl AddressLookup for PkarrPublisher
Source§impl AddressLookup for PkarrResolver
Source§impl<T: AddressLookup> AddressLookup for FilteredAddressLookup<T>
\ No newline at end of file
+) -> Option<BoxStream<Result<Item, Error>>>Implementors§
Source§impl AddressLookup for DnsAddressLookup
Available on non-wasm_browser only. Source§impl AddressLookup for MemoryLookup
Source§impl AddressLookup for PkarrPublisher
Source§impl AddressLookup for PkarrResolver
Source§impl<T: AddressLookup> AddressLookup for FilteredAddressLookup<T>
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/address_lookup/trait.AddressLookupBuilder.html b/pr/4036/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
index 35aadc4338..edc4dff899 100644
--- a/pr/4036/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
+++ b/pr/4036/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
@@ -20,5 +20,5 @@ endpoint to Endpoint,
) -> Result<impl AddressLookup, AddressLookupBuilderError>Turns this builder into a ready-to-use AddressLookup.
If an error is returned, building the endpoint will fail with this error.
-Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
Source§impl AddressLookupBuilder for DnsAddressLookupBuilder
Available on non-wasm_browser only. Source§impl AddressLookupBuilder for PkarrPublisherBuilder
Source§impl AddressLookupBuilder for PkarrResolverBuilder
Source§impl<T: AddressLookup> AddressLookupBuilder for T
Blanket no-op impl of AddressLookupBuilder for T: AddressLookup.
+ Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
Source§impl AddressLookupBuilder for DnsAddressLookupBuilder
Available on non-wasm_browser only. Source§impl AddressLookupBuilder for PkarrPublisherBuilder
Source§impl AddressLookupBuilder for PkarrResolverBuilder
Source§impl<T: AddressLookup> AddressLookupBuilder for T
Blanket no-op impl of AddressLookupBuilder for T: AddressLookup.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/defaults/prod/fn.default_ap_relay.html b/pr/4036/docs/iroh/defaults/prod/fn.default_ap_relay.html
index 5961b7d1ab..3a67b98b91 100644
--- a/pr/4036/docs/iroh/defaults/prod/fn.default_ap_relay.html
+++ b/pr/4036/docs/iroh/defaults/prod/fn.default_ap_relay.html
@@ -1,2 +1,2 @@
-default_ap_relay in iroh::defaults::prod - Rust default_ap_relay
pub fn default_ap_relay() -> RelayConfig
Expand description
Get the default RelayConfig for Asia-Pacific
+default_ap_relay in iroh::defaults::prod - Rust default_ap_relay
pub fn default_ap_relay() -> RelayConfig
Expand description
Get the default RelayConfig for Asia-Pacific.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/defaults/prod/index.html b/pr/4036/docs/iroh/defaults/prod/index.html
index 8981fb6be4..b076bc3ce3 100644
--- a/pr/4036/docs/iroh/defaults/prod/index.html
+++ b/pr/4036/docs/iroh/defaults/prod/index.html
@@ -1,2 +1,2 @@
iroh::defaults::prod - Rust Module prod
Expand description
Production configuration.
-Constants§
- AP_
RELAY_HOSTNAME - Hostname of the default Asia-Pacific relay.
- EU_
RELAY_HOSTNAME - Hostname of the default EU relay.
- NA_
EAST_RELAY_HOSTNAME - Hostname of the default NA east relay.
- NA_
WEST_RELAY_HOSTNAME - Hostname of the default NA west relay.
Functions§
- default_
ap_relay - Get the default
RelayConfig for Asia-Pacific - default_
eu_relay - Get the default
RelayConfig for EU. - default_
na_east_relay - Get the default
RelayConfig for NA east. - default_
na_west_relay - Get the default
RelayConfig for NA west. - default_
relay_map - Get the default
RelayMap.
\ No newline at end of file
+Constants§
- AP_
RELAY_HOSTNAME - Hostname of the default Asia-Pacific relay.
- EU_
RELAY_HOSTNAME - Hostname of the default EU relay.
- NA_
EAST_RELAY_HOSTNAME - Hostname of the default NA east relay.
- NA_
WEST_RELAY_HOSTNAME - Hostname of the default NA west relay.
Functions§
- default_
ap_relay - Get the default
RelayConfig for Asia-Pacific. - default_
eu_relay - Get the default
RelayConfig for EU. - default_
na_east_relay - Get the default
RelayConfig for NA east. - default_
na_west_relay - Get the default
RelayConfig for NA west. - default_
relay_map - Get the default
RelayMap.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/dns/struct.DnsResolver.html b/pr/4036/docs/iroh/dns/struct.DnsResolver.html
index 754fa26465..3f8c6e27b6 100644
--- a/pr/4036/docs/iroh/dns/struct.DnsResolver.html
+++ b/pr/4036/docs/iroh/dns/struct.DnsResolver.html
@@ -15,7 +15,7 @@ public DNS.
Implementations§
Source§impl DnsResolver
Sourcepub fn new() -> DnsResolver
Creates 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.
+to the default ResolverConfig which uses e.g. Google’s 8.8.8.8 or 8.8.4.4.
Sourcepub fn with_nameserver(nameserver: SocketAddr) -> DnsResolver
Creates a new DNS resolver configured with a single UDP DNS nameserver.
Sourcepub fn custom(resolver: impl Resolver) -> DnsResolver
Creates a new DnsResolver from a struct that implements Resolver.
diff --git a/pr/4036/docs/iroh/dns/trait.Resolver.html b/pr/4036/docs/iroh/dns/trait.Resolver.html
index 4aaa7642fd..3ebf87a01f 100644
--- a/pr/4036/docs/iroh/dns/trait.Resolver.html
+++ b/pr/4036/docs/iroh/dns/trait.Resolver.html
@@ -38,13 +38,13 @@ atomic swap. Build a new instance with re-bound sockets and re-read nameserver
configuration rather than mutating in place. Must not perform IO: defer DNS
queries and socket binds until the new resolver is first used. May be called
concurrently, in which case all but one allocated replacement is dropped unused.
-Implementations on Foreign Types§
Implementations on Foreign Types§
Source§impl Resolver for Arc<SimpleDnsResolver>
Source§fn lookup_ipv4(
&self,
host: String,
-) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = Ipv4Addr> + Send>, DnsError>> + Send>>
Source§fn lookup_ipv6(
+) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = Ipv4Addr> + Send>, DnsError>> + Send>>
Source§fn lookup_ipv6(
&self,
host: String,
-) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = Ipv6Addr> + Send>, DnsError>> + Send>>
Source§fn lookup_txt(
+) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = Ipv6Addr> + Send>, DnsError>> + Send>>
Source§fn lookup_txt(
&self,
host: String,
-) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = TxtRecordData> + Send>, DnsError>> + Send>>
Source§fn clear_cache(&self)
Source§fn reset(&self) -> Box<dyn Resolver>
Implementors§
\ No newline at end of file
+) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = TxtRecordData> + Send>, DnsError>> + Send>>Source§fn clear_cache(&self)
Source§fn reset(&self) -> Box<dyn Resolver>
Implementors§
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html b/pr/4036/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html
index 0a8e0c05eb..cc00fac5e1 100644
--- a/pr/4036/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html
+++ b/pr/4036/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html
@@ -1,2 +1,2 @@
-ENV_FORCE_STAGING_RELAYS in iroh::endpoint - Rust ENV_FORCE_STAGING_RELAYS
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 ENV_FORCE_STAGING_RELAYS
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint/enum.RelayMode.html b/pr/4036/docs/iroh/endpoint/enum.RelayMode.html
index 326aae7405..0d7b755897 100644
--- a/pr/4036/docs/iroh/endpoint/enum.RelayMode.html
+++ b/pr/4036/docs/iroh/endpoint/enum.RelayMode.html
@@ -1,4 +1,4 @@
-RelayMode in iroh::endpoint - Rust RelayMode
pub enum RelayMode {
+RelayMode in iroh::endpoint - Rust RelayMode
pub enum RelayMode {
Disabled,
Default,
Staging,
@@ -10,14 +10,14 @@ This means that neither listening nor dialing relays will be available.
See crate::defaults::prod for the severs used.
§Staging
Use the staging relay servers from n0.
§Custom(RelayMap)
Use a custom relay map.
-
Implementations§
Source§impl RelayMode
Sourcepub fn custom(map: impl IntoIterator<Item = RelayUrl>) -> Self
Create a custom relay mode from a list of RelayUrls.
+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§
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/4036/docs/iroh/endpoint/fn.default_relay_mode.html b/pr/4036/docs/iroh/endpoint/fn.default_relay_mode.html
index d716677abc..98ff3579ee 100644
--- a/pr/4036/docs/iroh/endpoint/fn.default_relay_mode.html
+++ b/pr/4036/docs/iroh/endpoint/fn.default_relay_mode.html
@@ -1,4 +1,4 @@
-default_relay_mode in iroh::endpoint - Rust default_relay_mode
pub fn default_relay_mode() -> RelayMode
Expand description
Returns the default relay mode.
+default_relay_mode in iroh::endpoint - Rust default_relay_mode
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint/fn.force_staging_infra.html b/pr/4036/docs/iroh/endpoint/fn.force_staging_infra.html
index ff8dda7e69..b444491b3e 100644
--- a/pr/4036/docs/iroh/endpoint/fn.force_staging_infra.html
+++ b/pr/4036/docs/iroh/endpoint/fn.force_staging_infra.html
@@ -1,2 +1,2 @@
-force_staging_infra in iroh::endpoint - Rust force_staging_infra
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 force_staging_infra
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint/index.html b/pr/4036/docs/iroh/endpoint/index.html
index 2efb803d4c..f3a98d45f2 100644
--- a/pr/4036/docs/iroh/endpoint/index.html
+++ b/pr/4036/docs/iroh/endpoint/index.html
@@ -1,4 +1,4 @@
-iroh::endpoint - Rust Module endpoint
Expand description
The Endpoint allows establishing connections to other iroh endpoints.
+iroh::endpoint - Rust Module endpoint
Expand description
The Endpoint allows establishing connections to other iroh endpoints.
The Endpoint is the main API interface to manage a local iroh endpoint. It allows
connecting to and accepting connections from other endpoints. See the module docs for
more details on how iroh connections work.
diff --git a/pr/4036/docs/iroh/endpoint/presets/index.html b/pr/4036/docs/iroh/endpoint/presets/index.html
index 37b792c03d..a454626701 100644
--- a/pr/4036/docs/iroh/endpoint/presets/index.html
+++ b/pr/4036/docs/iroh/endpoint/presets/index.html
@@ -2,4 +2,4 @@
§Example
use iroh::{Endpoint, RelayMode, Watcher, endpoint::presets};
-let endpoint = Endpoint::builder(presets::N0).bind().await?;
Structs§
- Empty
- An empty preset that doesn’t set anything on the builder.
- Minimal
with_crypto_provider - A preset that is almost empty, besides setting mandatory options.
- N0
with_crypto_provider - Configures the endpoint to use the n0 defaults
- N0Disable
Relay with_crypto_provider - Configures the endpoint to use the n0 defaults, but with relay mode disabled.
Traits§
- Preset
- Defines a preset
\ No newline at end of file
+let endpoint = Endpoint::builder(presets::N0).bind().await?;Structs§
- Empty
- An empty preset that doesn’t set anything on the builder.
- Minimal
with_crypto_provider - A preset that is almost empty, besides setting mandatory options.
- N0
with_crypto_provider - Configures the endpoint to use the n0 defaults
- N0Disable
Relay with_crypto_provider - Configures the endpoint to use the n0 defaults, but with relay mode disabled.
Traits§
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint/presets/struct.N0.html b/pr/4036/docs/iroh/endpoint/presets/struct.N0.html
index 41c532b301..cf9fb0156e 100644
--- a/pr/4036/docs/iroh/endpoint/presets/struct.N0.html
+++ b/pr/4036/docs/iroh/endpoint/presets/struct.N0.html
@@ -6,8 +6,8 @@
setting the [rustls::crypto::CryptoProvider] to ring or aws-lc-rs, depending
on which feature is enabled in iroh (preferring ring if both are enabled).
-Due to the last point, this preset is only available with the ring or
-aws-lc-rs preset installed.
+
Due to the last point, this preset is only available with the tls-ring or
+tls-aws-lc-rs feature enabled.
If you want to set your own crypto provider, we recommend copying the
implementation of this preset into your own and setting the appropriate crypto
provider there.
diff --git a/pr/4036/docs/iroh/endpoint/presets/struct.N0DisableRelay.html b/pr/4036/docs/iroh/endpoint/presets/struct.N0DisableRelay.html
index dd14c88ba9..29795833c9 100644
--- a/pr/4036/docs/iroh/endpoint/presets/struct.N0DisableRelay.html
+++ b/pr/4036/docs/iroh/endpoint/presets/struct.N0DisableRelay.html
@@ -7,8 +7,8 @@ relay urls.
setting the [rustls::crypto::CryptoProvider] to ring or aws-lc-rs, depending
on which feature is enabled in iroh (preferring ring if both are enabled).
-Due to the last point, this preset is only available with the ring or
-aws-lc-rs preset installed.
+
Due to the last point, this preset is only available with the tls-ring or
+tls-aws-lc-rs feature enabled.
If you want to set your own crypto provider, we recommend copying the
implementation of this preset into your own and setting the appropriate crypto
provider there.
diff --git a/pr/4036/docs/iroh/endpoint/presets/trait.Preset.html b/pr/4036/docs/iroh/endpoint/presets/trait.Preset.html
index 59a71a95da..7e6f4bbcac 100644
--- a/pr/4036/docs/iroh/endpoint/presets/trait.Preset.html
+++ b/pr/4036/docs/iroh/endpoint/presets/trait.Preset.html
@@ -1,7 +1,7 @@
-Preset in iroh::endpoint::presets - Rust Preset
pub trait Preset {
+Preset in iroh::endpoint::presets - Rust Preset
pub trait Preset {
// Required method
fn apply(self, builder: Builder) -> Builder;
-}
Expand description
Defines a preset
+}Expand description
A reusable bundle of endpoint Builder configuration.
Required Methods§
Implementations on Foreign Types§
Source§impl Preset for Arc<TestTransport>
Available on crate feature unstable-custom-transports and (crate features test-utils) only.
Source§fn apply(self, builder: Builder) -> Builder
Configures the builder with this transport and the network’s address lookup.
§Example
diff --git a/pr/4036/docs/iroh/endpoint/struct.Builder.html b/pr/4036/docs/iroh/endpoint/struct.Builder.html
index 79894b8924..7cbb050d5e 100644
--- a/pr/4036/docs/iroh/endpoint/struct.Builder.html
+++ b/pr/4036/docs/iroh/endpoint/struct.Builder.html
@@ -92,7 +92,7 @@ is set to false explicitly.
destination addresses. It is valid to configure this, but no more than one such
socket should be bound or the routing will be non-deterministic.
To use a subnet with a non-zero prefix length as the default route in addition to
-being routed when its prefix matches, use `BindOpts::set_is_default_route.
+being routed when its prefix matches, use BindOpts::set_is_default_route.
Subnets with a prefix length of zero are always marked as default routes.
Finally note that most outgoing datagrams are part of an existing network flow. That
is, they are in response to an incoming datagram. In this case the outgoing datagram
@@ -142,7 +142,7 @@ direct addresses or relay URLs will fail.
Sourcepub fn addr_filter(self, filter: AddrFilter) -> Self
Sets the address filter applied to all address data before publishing.
This filter is applied once, at the AddressLookupServices level, before
distributing data to any individual address lookup service. This ensures
-consistent filtering regardless of how the services configured.
+consistent filtering regardless of how the services are configured.
Sourcepub fn clear_addr_filter(self) -> Self
Clears the address filter, allowing all addresses to be published.
This removes any filter previously set via Self::addr_filter, including
filters set by presets.
diff --git a/pr/4036/docs/iroh/endpoint/struct.ConnectOptions.html b/pr/4036/docs/iroh/endpoint/struct.ConnectOptions.html
index 30bf2e329e..3834b0244e 100644
--- a/pr/4036/docs/iroh/endpoint/struct.ConnectOptions.html
+++ b/pr/4036/docs/iroh/endpoint/struct.ConnectOptions.html
@@ -1,12 +1,12 @@
-ConnectOptions in iroh::endpoint - Rust ConnectOptions
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 ConnectOptions
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 QuicTransportConfig.
-Sourcepub fn with_transport_config(
+
Sourcepub fn with_transport_config(
self,
transport_config: QuicTransportConfig,
) -> Self
Sets the QUIC transport config options for this connection.
-Sourcepub fn with_additional_alpns(self, alpns: Vec<Vec<u8>>) -> Self
Sets ALPN identifiers that should be signaled as supported on connection, in
+
Sourcepub fn with_additional_alpns(self, alpns: Vec<Vec<u8>>) -> Self
Sets ALPN identifiers that should be signaled as supported on connection, in
addition to the main ALPN identifier used in Endpoint::connect_with_opts.
This allows connecting to servers that may only support older versions of your
protocol. In this case, you would add the older ALPN identifiers with this
@@ -20,7 +20,7 @@ list or the main ALPN identifiers on the accept side, see the endpoint
builder’s Builder::alpns function.
-Trait Implementations§
Source§impl Clone for ConnectOptions
Source§fn clone(&self) -> ConnectOptions
Returns a duplicate 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 duplicate 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/4036/docs/iroh/endpoint/struct.Connection.html b/pr/4036/docs/iroh/endpoint/struct.Connection.html
index ffc93497ee..74f53832af 100644
--- a/pr/4036/docs/iroh/endpoint/struct.Connection.html
+++ b/pr/4036/docs/iroh/endpoint/struct.Connection.html
@@ -8,7 +8,7 @@ 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<T: ConnectionState> Connection<T>
Implementations§
Source§impl<T: ConnectionState> Connection<T>
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.
@@ -18,13 +18,13 @@ consequence, the peer won’t be notified that a stream has been opened until th
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_bi(&self) -> AcceptBi<'_> ⓘ
Accepts 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 async fn closed(&self) -> ConnectionError
Waits 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.
@@ -97,17 +97,18 @@ strong and pseudorandom, and are suitable for use as keying material.
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)
See [noq_proto::TransportConfig::receive_window].
-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)
Sets the connection-level flow control receive window.
+See [noq_proto::TransportConfig::receive_window].
+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.
-Source§impl Connection<HandshakeCompleted>
Sourcepub fn remote_id(&self) -> EndpointId
Returns the EndpointId from the peer’s TLS certificate.
+Source§impl Connection<HandshakeCompleted>
Sourcepub fn remote_id(&self) -> EndpointId
Returns the EndpointId from the peer’s TLS certificate.
The PublicKey of an endpoint is also known as an EndpointId. This PublicKey is
included in the TLS certificate presented during the handshake when connecting.
This function allows you to get the EndpointId of the remote endpoint of this
connection.
-Sourcepub fn paths(&self) -> PathList<'_>
Returns the currently open network paths for this connection.
+Sourcepub fn paths(&self) -> PathList<'_>
Returns the currently open network paths for this connection.
A connection typically has one path via the relay server and,
once holepunching succeeds, a direct path. The returned
PathList is a snapshot taken at call time: it does not
@@ -116,14 +117,14 @@ already closed.
To observe changes over time, see Connection::paths_stream
for a stream of PathList snapshots and
Connection::path_events for individual PathEvents.
-Sourcepub fn paths_stream(&self) -> PathListStream<'_>
Returns a stream of PathList snapshots for this connection.
+Sourcepub fn paths_stream(&self) -> PathListStream<'_>
Returns a stream of PathList snapshots for this connection.
Yields the current snapshot on the first poll, and a fresh
snapshot whenever the open paths or the selected path change.
Ends when the connection closes.
The stream borrows this Connection. To consume it from a
spawned task, move a Connection clone into the task and
call this method inside.
-Sourcepub fn path_events(&self) -> PathEventStream
Returns a stream of PathEvents for this connection.
+Sourcepub fn path_events(&self) -> PathEventStream
Returns a stream of PathEvents for this connection.
Each event reports one of: a path opened, a path closed (with
final per-path statistics), the selected transmission path
changed, or the consumer fell behind. The stream ends when the
@@ -133,14 +134,14 @@ may be moved into a spawned task.
single PathEvent::Lagged; the current state of the open
paths and the selected path remains recoverable via
Connection::paths.
-Sourcepub fn weak_handle(&self) -> WeakConnectionHandle
Returns a WeakConnectionHandle for this connection.
+Sourcepub fn weak_handle(&self) -> WeakConnectionHandle
Returns a WeakConnectionHandle for this connection.
A WeakConnectionHandle does not keep the connection alive. It can be used to
wait for the connection to be closed via WeakConnectionHandle::closed and to
attempt to upgrade back to a strong Connection via
WeakConnectionHandle::upgrade.
-Source§impl Connection<IncomingZeroRtt>
Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
-Sourcepub async fn handshake_completed(&self) -> Result<Connection, ConnectingError>
Waits until the full handshake occurs and then returns a Connection.
+Source§impl Connection<IncomingZeroRtt>
Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
+Sourcepub async fn handshake_completed(&self) -> Result<Connection, ConnectingError>
Waits until the full handshake occurs and then returns a Connection.
This may fail with ConnectingError::ConnectionError, if there was
some general failure with the connection, such as a network timeout since
we accepted the connection.
@@ -149,18 +150,18 @@ doesn’t use the right TLS authentication, which usually every iroh endpoint
uses and requires.
Thus, those errors should only occur if someone connects to you with a
modified iroh endpoint or with a plain QUIC client.
-Sourcepub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError>
Returns the EndpointId from the peer’s TLS certificate.
+Sourcepub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError>
Returns the EndpointId from the peer’s TLS certificate.
The PublicKey of an endpoint is also known as an EndpointId. This PublicKey is
included in the TLS certificate presented during the handshake when connecting.
This function allows you to get the EndpointId of the remote endpoint of this
connection.
-Source§impl Connection<OutgoingZeroRtt>
Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
+Sourcepub async fn handshake_completed(
&self,
) -> Result<ZeroRttStatus, ConnectingError>
Waits until the full handshake occurs and returns a ZeroRttStatus.
-If ZeroRttStatus::Accepted is returned, than any streams created before
+
If ZeroRttStatus::Accepted is returned, then any streams created before
the handshake has completed can still be used.
-If ZeroRttStatus::Rejected is returned, than any streams created before
+
If ZeroRttStatus::Rejected is returned, then any streams created before
the handshake will error and any data sent should be re-sent on a
new stream.
This may fail with ConnectingError::ConnectionError, if there was
@@ -171,7 +172,7 @@ doesn’t use the right TLS authentication, which usually every iroh endpoint
uses and requires.
Thus, those errors should only occur if someone connects to you with a
modified iroh endpoint or with a plain QUIC client.
-Sourcepub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError>
Returns the EndpointId from the peer’s TLS certificate.
+Sourcepub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError>
Returns the EndpointId from the peer’s TLS certificate.
The PublicKey of an endpoint is also known as an EndpointId. This PublicKey is
included in the TLS certificate presented during the handshake when connecting.
This function allows you to get the EndpointId of the remote endpoint of this
diff --git a/pr/4036/docs/iroh/endpoint/struct.Endpoint.html b/pr/4036/docs/iroh/endpoint/struct.Endpoint.html
index cfd63c979e..0c6c2630b7 100644
--- a/pr/4036/docs/iroh/endpoint/struct.Endpoint.html
+++ b/pr/4036/docs/iroh/endpoint/struct.Endpoint.html
@@ -13,7 +13,7 @@ behaviour.
Endpoint::connect and Endpoint::accept methods. Once established, the
Connection gives access to most QUIC features. Individual streams to send data to
the peer are created using the Connection::open_bi, Connection::accept_bi,
-Connection::open_uni and Connection::open_bi functions.
+Connection::open_uni and Connection::accept_uni 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.
§Usage on Android
@@ -22,7 +22,7 @@ through JNI, which needs a JVM context published to DnsResolver for the supported
initialization paths.
-Implementations§
Source§impl Endpoint
Implementations§
Source§impl Endpoint
Sourcepub fn set_alpns(&self, alpns: Vec<Vec<u8>>)
Sets the list of accepted ALPN protocols.
This will only affect new incoming connections.
@@ -117,8 +117,8 @@ changes.
understand if the endpoint has ever been considered “online”. But after
that initial call to Endpoint::online, to understand if your
endpoint is no longer able to be connected to by endpoints outside
-of the private or local network, watch for changes in it’s EndpointAddr.
-If there are no addrsin the EndpointAddr, you may not be dialable by other endpoints
+of the private or local network, watch for changes in its EndpointAddr.
+If there are no addrs in the EndpointAddr, you may not be dialable by other endpoints
on the internet.
The EndpointAddr will change as:
@@ -146,7 +146,7 @@ tokio::spawn(endpoint_closed.run_until(async move {
}));
// Do fancy things, then close the endpoint.
// Our task above will stop even if there are still clones of `Endpoint` alive somewhere.
-endpoint.close().await;
Sourcepub async fn online(&self)
A convenience method that waits for the endpoint to be considered “online”.
This currently means at least one relay server has completed its
connection handshake (i.e. the endpoint is registered and reachable
via that relay). Merely selecting a relay URL is not sufficient.
@@ -167,49 +167,45 @@ entirely.
The online method does not interact with crate::address_lookup::AddressLookup
services, which means that any Address Lookup that relies on a WAN
connection is independent of the endpoint’s online status.
-§Examples
use iroh::Endpoint;
-
-#[tokio::main]
-async fn main() {
-// After this await returns, the endpoint is bound to a local socket.
-// It can be dialed, but almost certainly hasn't finished picking a
+§Examples
+// After this await returns, the endpoint is bound to a local socket.
+// It can be dialed, but almost certainly hasn't finished picking a
// relay.
-let endpoint = Endpoint::bind().await;
+let endpoint = Endpoint::bind(presets::N0).await?;
-// After this await returns we have a connection to at least one relay
+// After this await returns we have a connection to at least one relay
// and holepunching should work as expected.
-endpoint.online().await;
-}
Sourcepub fn home_relay_status(
+endpoint.online().await;
Sourcepub fn home_relay_status(
&self,
) -> impl Watcher<Value = Vec<RelayStatus>> + use<>
Returns a Watcher over the connection status of the endpoint’s home relays.
The watched value has one entry per home relay whose URL is known,
and is empty when no relays are configured or before the endpoint has
-selected one the home relay from the list of configured relays.
+selected a home relay from the list of configured relays.
The watcher updates whenever any home relay’s connection status changes.
See RelayStatus for the information available on each entry.
The returned watcher only becomes disconnected once the last clone of
the Endpoint is dropped. Closing the endpoint does not disconnect
the watcher. To stop a task once the endpoint stops, combine with
Self::closed.
-Sourcepub fn bound_sockets(&self) -> Vec<SocketAddr>
Available on non-wasm_browser only.
Returns the local socket addresses on which the underlying sockets are bound.
+Sourcepub fn bound_sockets(&self) -> Vec<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 dns_resolver(&self) -> Result<&DnsResolver, EndpointError>
Available on non-wasm_browser only.
Returns the DNS resolver used in this Endpoint.
+Sourcepub fn dns_resolver(&self) -> Result<&DnsResolver, EndpointError>
Available on non-wasm_browser only.
Sourcepub fn tls_config(&self) -> &ClientConfig
Returns the [rustls::ClientConfig] used by the endpoint for connecting to external services.
+Sourcepub fn tls_config(&self) -> &ClientConfig
Returns the [rustls::ClientConfig] used by the endpoint for connecting to external services.
This might be useful for address lookup services or other functions
that want to use the same trust anchors as iroh does for verifying the
validity of TLS certificates presented by external services.
Note that this TLS config is unrelated to how iroh validates the authenticity
of iroh connections itself.
The config is based on the trust anchors set via Builder::ca_tls_config.
-Sourcepub fn address_lookup(&self) -> Result<&AddressLookupServices, EndpointError>
Returns the Address Lookup service, if configured.
+Sourcepub fn address_lookup(&self) -> Result<&AddressLookupServices, EndpointError>
Returns the Address Lookup service, if configured.
§Errors
Returns a EndpointError::Closed error if the endpoint is closed.
-Sourcepub fn metrics(&self) -> &EndpointMetrics
Available on crate feature metrics only.
Returns metrics collected for this endpoint.
+Sourcepub fn metrics(&self) -> &EndpointMetrics
Available on crate feature metrics only.
Returns metrics collected for this endpoint.
The endpoint internally collects various metrics about its operation.
The returned EndpointMetrics struct contains all of these metrics.
You can access individual metrics directly by using the public fields:
@@ -275,13 +271,13 @@ registry.write().unwrap().register_all(endpoint.metrics());
.std_context("text")?;
assert!(res.contains(r#"TYPE socket_recv_datagrams counter"#));
-assert!(res.contains(r#"socket_recv_datagrams_total 0"#));Sourcepub async fn remote_info(&self, endpoint_id: EndpointId) -> Option<RemoteInfo>
Returns addressing information about a recently used remote endpoint.
+assert!(res.contains(r#"socket_recv_datagrams_total 0"#));Sourcepub async fn remote_info(&self, endpoint_id: EndpointId) -> Option<RemoteInfo>
Returns addressing information about a recently used remote endpoint.
The returned RemoteInfo contains a list of all transport addresses for the remote
that we know about. This is a snapshot in time and not a watcher.
Returns None if the endpoint doesn’t have information about the remote or if the endpoint is closed.
When remote endpoints are no longer used, our endpoint will keep information around
for a little while, and then drop it. Afterwards, this will return None.
-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
@@ -290,14 +286,14 @@ 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.
If the endpoint is closed, this method will log a warning and ignore the request.
-Sourcepub fn set_user_data_for_address_lookup(&self, user_data: Option<UserData>)
Sets the initial user-defined data to be published in Address Lookups for this endpoint.
+Sourcepub fn set_user_data_for_address_lookup(&self, user_data: Option<UserData>)
Sets the initial user-defined data to be published in Address Lookups for this endpoint.
If the user-defined data passed to this function is different to the previous one,
the endpoint will republish its endpoint info to the configured Address Lookups.
See also Builder::user_data_for_address_lookup for setting an initial value when
building the endpoint.
If the endpoint is closed, this method will log a warning and ignore the
request.
-Sourcepub async fn close(&self)
Closes the QUIC endpoint and the 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.
@@ -322,9 +318,9 @@ sockets. This is due to QUIC and its acknowledgments being implemented in user-l
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.
-Sourcepub fn closed(&self) -> EndpointClosed ⓘ
Returns a future that resolves once the endpoint closes.
+the respective Endpoint are dropped.
+Sourcepub fn closed(&self) -> EndpointClosed ⓘ
Returns a future that resolves once the endpoint closes.
The returned future does not contain a clone or reference to the Endpoint,
so keeping the returned future alive does not prevent the endpoint from being dropped.
To run a task and stop it once the endpoint closes, you can use
@@ -333,7 +329,7 @@ so keeping the returned future alive does not prevent the endpoint from being dr
let endpoint = Endpoint::bind(presets::N0).await?;
tokio::spawn(endpoint.closed().run_until(async move {
// the future will be aborted once the endpoint closes.
-}));
Sourcepub fn create_server_config_builder(
+}));
Sourcepub fn create_server_config_builder(
&self,
alpns: Vec<Vec<u8>>,
) -> ServerConfigBuilder
Create a ServerConfigBuilder for this endpoint that includes the given alpns.
diff --git a/pr/4036/docs/iroh/endpoint/struct.EndpointClosed.html b/pr/4036/docs/iroh/endpoint/struct.EndpointClosed.html
index 85b8fd921b..1a2b9e3683 100644
--- a/pr/4036/docs/iroh/endpoint/struct.EndpointClosed.html
+++ b/pr/4036/docs/iroh/endpoint/struct.EndpointClosed.html
@@ -1,9 +1,9 @@
-EndpointClosed in iroh::endpoint - Rust EndpointClosed
pub struct EndpointClosed { /* private fields */ }
Expand description
Future returned from Endpoint::closed.
-Implementations§
Source§impl EndpointClosed
Sourcepub async fn run_until<F: Future>(self, fut: F) -> Option<F::Output>
Runs a future to completion, or until the Endpoint is closed.
+EndpointClosed in iroh::endpoint - Rust EndpointClosed
pub struct EndpointClosed { /* private fields */ }
Expand description
Future returned from Endpoint::closed.
+Implementations§
Trait Implementations§
Source§impl Debug for EndpointClosed
Source§impl Future for EndpointClosed
Source§impl<'pin> Unpin for EndpointClosedwhere
+
Trait Implementations§
Source§impl Debug for EndpointClosed
Source§impl Future for EndpointClosed
Source§impl<'pin> Unpin for EndpointClosedwhere
PinnedFieldsOf<__EndpointClosed<'pin>>: Unpin,
Auto Trait Implementations§
§impl !Freeze for EndpointClosed
§impl !RefUnwindSafe for EndpointClosed
§impl Send for EndpointClosed
§impl Sync for EndpointClosed
§impl !UnwindSafe for EndpointClosed
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/4036/docs/iroh/endpoint/struct.Incoming.html b/pr/4036/docs/iroh/endpoint/struct.Incoming.html
index d0a2c29af8..eca1097eca 100644
--- a/pr/4036/docs/iroh/endpoint/struct.Incoming.html
+++ b/pr/4036/docs/iroh/endpoint/struct.Incoming.html
@@ -24,7 +24,7 @@ to customize a Sourcepub fn remote_addr_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_addr().
-Sourcepub fn decrypt(&self) -> Option<DecryptedInitial>
Decrypt the Initial packet payload
+Sourcepub fn decrypt(&self) -> Option<DecryptedInitial>
Decrypts the Initial packet payload.
This clones and decrypts the packet payload (~1200 bytes).
Can be used to extract information from the TLS ClientHello without completing the handshake.
Trait Implementations§
Source§impl IntoFuture for Incoming
Source§type Output = Result<Connection, ConnectingError>
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§
Source§impl<T> Any for Twhere
diff --git a/pr/4036/docs/iroh/endpoint/struct.QuicTransportConfigBuilder.html b/pr/4036/docs/iroh/endpoint/struct.QuicTransportConfigBuilder.html
index 3a193bd40a..5189f21509 100644
--- a/pr/4036/docs/iroh/endpoint/struct.QuicTransportConfigBuilder.html
+++ b/pr/4036/docs/iroh/endpoint/struct.QuicTransportConfigBuilder.html
@@ -136,7 +136,7 @@ enable multipath as well.
If the path is idle for this long the path will be abandoned. Bear in mind this will
interact with the QuicTransportConfigBuilder::max_idle_timeout, if the last path is
abandoned the entire connection will be closed.
-Note: values higher than [PATH_MAX_IDLE_TIMEOUT] are clamped and a warning is logged.
+Note: values higher than PATH_MAX_IDLE_TIMEOUT (15 seconds) are clamped and a warning is logged.
Sourcepub fn default_path_keep_alive_interval(self, interval: Duration) -> Self
Sets a default per-path keep alive interval.
Note that this does not interact with the connection-wide
QuicTransportConfigBuilder::keep_alive_interval. This setting will keep this path active,
diff --git a/pr/4036/docs/iroh/endpoint/struct.RelayStatus.html b/pr/4036/docs/iroh/endpoint/struct.RelayStatus.html
index 175b637f76..a1abba7e98 100644
--- a/pr/4036/docs/iroh/endpoint/struct.RelayStatus.html
+++ b/pr/4036/docs/iroh/endpoint/struct.RelayStatus.html
@@ -1,13 +1,13 @@
-
RelayStatus in iroh::endpoint - Rust RelayStatus
pub struct RelayStatus { /* private fields */ }
Expand description
Connection status of a single home relay.
+RelayStatus in iroh::endpoint - Rust RelayStatus
pub struct RelayStatus { /* private fields */ }
Expand description
Connection status of a single home relay.
Observed via Endpoint::home_relay_status.
-Implementations§
Source§impl RelayStatus
Sourcepub fn is_connected(&self) -> bool
Returns true if the endpoint is connected to the relay.
-Sourcepub fn last_error(&self) -> Option<&AnyError>
Returns the most recent connection error, if the relay is currently
+
Implementations§
Source§impl RelayStatus
Sourcepub fn is_connected(&self) -> bool
Returns true if the endpoint is connected to the relay.
+Sourcepub fn last_error(&self) -> Option<&AnyError>
Returns the most recent connection error, if the relay is currently
disconnected.
Returns None when the relay is connected, or when the endpoint has
not yet observed a failed connection attempt.
-Trait Implementations§
Source§impl Clone for RelayStatus
Source§fn clone(&self) -> RelayStatus
Returns a duplicate 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 RelayStatus
Source§impl PartialEq for RelayStatus
Source§impl Eq for RelayStatus
Source§impl StructuralPartialEq for RelayStatus
Auto Trait Implementations§
§impl Freeze for RelayStatus
§impl !RefUnwindSafe for RelayStatus
§impl Send for RelayStatus
§impl Sync for RelayStatus
§impl Unpin for RelayStatus
§impl !UnwindSafe for RelayStatus
Blanket Implementations§
Trait Implementations§
Source§impl Clone for RelayStatus
Source§fn clone(&self) -> RelayStatus
Returns a duplicate 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 RelayStatus
Source§impl PartialEq for RelayStatus
Source§impl Eq for RelayStatus
Source§impl StructuralPartialEq for RelayStatus
Auto Trait Implementations§
§impl Freeze for RelayStatus
§impl !RefUnwindSafe for RelayStatus
§impl Send for RelayStatus
§impl Sync for RelayStatus
§impl Unpin for RelayStatus
§impl !UnwindSafe for RelayStatus
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/4036/docs/iroh/endpoint/struct.VarInt.html b/pr/4036/docs/iroh/endpoint/struct.VarInt.html
index 0acf99654d..007540d1af 100644
--- a/pr/4036/docs/iroh/endpoint/struct.VarInt.html
+++ b/pr/4036/docs/iroh/endpoint/struct.VarInt.html
@@ -13,7 +13,7 @@ An integer less than 2^62
of overflowing.
Trait Implementations§
§impl From<VarInt> for IdleTimeout
§fn from(inner: VarInt) -> IdleTimeout
Converts to this type from the input type.§impl From<VarInt> for IdleTimeout
§fn from(inner: VarInt) -> IdleTimeout
Converts to this type from the input type.§impl Ord for VarInt
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
diff --git a/pr/4036/docs/iroh/endpoint/struct.WeakConnectionHandle.html b/pr/4036/docs/iroh/endpoint/struct.WeakConnectionHandle.html
index 47f6c23610..07bad208d7 100644
--- a/pr/4036/docs/iroh/endpoint/struct.WeakConnectionHandle.html
+++ b/pr/4036/docs/iroh/endpoint/struct.WeakConnectionHandle.html
@@ -1,18 +1,18 @@
-WeakConnectionHandle in iroh::endpoint - Rust WeakConnectionHandle
pub struct WeakConnectionHandle { /* private fields */ }
Expand description
A weak handle to a Connection.
+WeakConnectionHandle in iroh::endpoint - Rust WeakConnectionHandle
pub struct WeakConnectionHandle { /* private fields */ }
Expand description
A weak handle to a Connection.
A WeakConnectionHandle does not keep the connection alive: holding one will not
prevent the connection from being closed when the last Connection handle is dropped.
Use upgrade to obtain a strong Connection, and closed to wait for the
connection to be closed without keeping it alive.
-Implementations§
Source§impl WeakConnectionHandle
Sourcepub fn upgrade(&self) -> Option<Connection>
Attempts to upgrade this weak handle to a strong Connection.
+Implementations§
Source§impl WeakConnectionHandle
Sourcepub fn upgrade(&self) -> Option<Connection>
Attempts to upgrade this weak handle to a strong Connection.
Returns None if the connection has already been dropped.
-Sourcepub fn closed(&self) -> impl Future<Output = Option<Closed>> + Send + 'static
Returns a future that resolves once the connection has been closed.
+Sourcepub fn closed(&self) -> impl Future<Output = Option<Closed>> + Send + 'static
Returns a future that resolves once the connection has been closed.
If no strong references to the Connection exist at the time this is called,
the future resolves to None. If at least one strong reference still exists at
the time of this call, the returned future is guaranteed to receive the close
event with the close reason and final connection statistics, even if all strong
references are dropped before the future is awaited.
The future does not keep the connection alive.
-Trait Implementations§
Source§impl Clone for WeakConnectionHandle
Source§fn clone(&self) -> WeakConnectionHandle
Returns a duplicate 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 WeakConnectionHandle
§impl !RefUnwindSafe for WeakConnectionHandle
§impl Send for WeakConnectionHandle
§impl Sync for WeakConnectionHandle
§impl Unpin for WeakConnectionHandle
§impl !UnwindSafe for WeakConnectionHandle
Blanket Implementations§
Trait Implementations§
Source§impl Clone for WeakConnectionHandle
Source§fn clone(&self) -> WeakConnectionHandle
Returns a duplicate 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 WeakConnectionHandle
§impl !RefUnwindSafe for WeakConnectionHandle
§impl Send for WeakConnectionHandle
§impl Sync for WeakConnectionHandle
§impl Unpin for WeakConnectionHandle
§impl !UnwindSafe for WeakConnectionHandle
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/4036/docs/iroh/endpoint/trait.EndpointHooks.html b/pr/4036/docs/iroh/endpoint/trait.EndpointHooks.html
index 2ac883dd5d..90c7ff04fc 100644
--- a/pr/4036/docs/iroh/endpoint/trait.EndpointHooks.html
+++ b/pr/4036/docs/iroh/endpoint/trait.EndpointHooks.html
@@ -17,7 +17,7 @@
For each hook, all installed hooks are invoked in the order they were installed on
the endpoint builder. If a hook returns Accept, processing continues with the next
hook. If a hook returns Reject, processing is aborted and further hooks
-are not invoked for this hook.
+are not invoked for this hook point.
§Notes to implementers
As hooks are stored on the endpoint, you must make sure to never store an Endpoint
on the hook struct itself, as this would create reference counting loop and cause the
diff --git a/pr/4036/docs/iroh/endpoint_info/index.html b/pr/4036/docs/iroh/endpoint_info/index.html
index f27fe3b898..4a60b9fd8f 100644
--- a/pr/4036/docs/iroh/endpoint_info/index.html
+++ b/pr/4036/docs/iroh/endpoint_info/index.html
@@ -1,11 +1,11 @@
iroh::endpoint_info - Rust Module endpoint_info
Expand description
Support for handling DNS resource records for dialing by EndpointId.
Dialing by EndpointId is supported by iroh endpoints publishing Pkarr records to DNS
servers or the Mainline DHT. This module supports creating and parsing these records.
-EndpointInfo combines an iroh_base::EndpointId with EndpointData —
+
EndpointInfo combines an iroh_base::EndpointId with EndpointData:
the addressing and metadata that discovery services publish and resolve.
Discovery services use AddrFilter to control which addresses are published.
This module also provides serialization to and from pkarr signed packets and
-DNS TXT records. See the [crate::attrs] module for the on-the-wire format.
+DNS TXT records.
DNS records are published under the following names:
_iroh.<z32-endpoint-id>.<origin-domain> TXT
@@ -36,4 +36,4 @@ Each address is an IPv4 or IPv6 address with a port.
Structs§
- Addr
Filter - A filter and/or reordering function applied to transport addresses,
-typically used by AddressLookup services in iroh before publishing.
- Endpoint
Data - Data about an endpoint that may be published to and resolved from discovery services.
- Endpoint
Info - Information about an endpoint that may be published to and resolved from discovery services.
- MaxLength
ExceededError - Error returned when an input value is too long for
UserData. - User
Data - Under the hood this is a UTF-8 String is no longer than
UserData::MAX_LENGTH bytes.
\ No newline at end of file
+typically used by AddressLookup services in iroh before publishing.EndpointData Data about an endpoint that may be published to and resolved from discovery services. EndpointInfo Information about an endpoint that may be published to and resolved from discovery services. MaxLengthExceededError Error returned when an input value is too long for UserData. UserData User-defined data that can be published and resolved through endpoint discovery.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint_info/struct.EndpointData.html b/pr/4036/docs/iroh/endpoint_info/struct.EndpointData.html
index eaf2725892..2c818ea5b4 100644
--- a/pr/4036/docs/iroh/endpoint_info/struct.EndpointData.html
+++ b/pr/4036/docs/iroh/endpoint_info/struct.EndpointData.html
@@ -13,15 +13,15 @@ services, should they not fit into e.g. a single DNS packet otherwise.
See also Self::set_user_data.
Sourcepub fn add_relay_url(&mut self, relay_url: RelayUrl)
Adds the relay URL to the end of the endpoint data, unless it already existed.
Sourcepub fn add_ip_addrs(&mut self, addresses: Vec<SocketAddr>)
Adds addresses in order with duplicates or already existing addresses filtered out.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Adds addresses to the endpoint data in the given ordered, but with duplicates filtered.
-Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data and returns the updated endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Adds addresses to the endpoint data in the given order, but with duplicates filtered.
+Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data.
Sourcepub fn clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn clear_relay_urls(&mut self)
Removes all relay URLs from the endpoint data.
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses.
+Sourcepub fn filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
Returns a vec to allow re-ordering of addresses.
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
diff --git a/pr/4036/docs/iroh/endpoint_info/struct.UserData.html b/pr/4036/docs/iroh/endpoint_info/struct.UserData.html
index 3352480631..e73207e05e 100644
--- a/pr/4036/docs/iroh/endpoint_info/struct.UserData.html
+++ b/pr/4036/docs/iroh/endpoint_info/struct.UserData.html
@@ -1,4 +1,5 @@
-UserData in iroh::endpoint_info - Rust 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.
+UserData in iroh::endpoint_info - Rust UserData
pub struct UserData(/* private fields */);
Expand description
User-defined data that can be published and resolved through endpoint discovery.
+Under the hood this is a UTF-8 string 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.
diff --git a/pr/4036/docs/iroh/enum.KeyParsingError.html b/pr/4036/docs/iroh/enum.KeyParsingError.html
index 765ac27ad2..146ec05698 100644
--- a/pr/4036/docs/iroh/enum.KeyParsingError.html
+++ b/pr/4036/docs/iroh/enum.KeyParsingError.html
@@ -1,4 +1,4 @@
-KeyParsingError in iroh - Rust KeyParsingError
#[non_exhaustive]pub enum KeyParsingError {
+KeyParsingError in iroh - Rust KeyParsingError
#[non_exhaustive]pub enum KeyParsingError {
FailedToDecodeHex {
meta: Meta,
},
@@ -11,14 +11,14 @@
InvalidKeyData {
meta: Meta,
},
-}
Expand description
Error when deserialising a PublicKey or a SecretKey.
+}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§FailedToDecodeHex
The input string could not be decoded as hex.
Fields
§meta: MetaCaptured call-site metadata
§FailedToDecodeBase32
The input string could not be decoded as base32.
Fields
§meta: MetaCaptured call-site metadata
§InvalidLength
The input has invalid length.
Fields
§meta: MetaCaptured call-site metadata
-§InvalidKeyData
The decoded data is not a valid Ed25591 public key.
+§InvalidKeyData
The decoded data is not a valid Ed25519 public key.
Fields
§meta: MetaCaptured call-site metadata
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<KeyParsingError> for ParseError
Source§fn from(source: KeyParsingError) -> ParseError
Converts to this type from the input type.Source§impl StackError for KeyParsingError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<KeyParsingError>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Returns the next source in the chain, if any.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.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
diff --git a/pr/4036/docs/iroh/enum.TransportAddr.html b/pr/4036/docs/iroh/enum.TransportAddr.html
index df614a51ee..0e5f31d772 100644
--- a/pr/4036/docs/iroh/enum.TransportAddr.html
+++ b/pr/4036/docs/iroh/enum.TransportAddr.html
@@ -3,8 +3,8 @@
Ip(SocketAddr),
Custom(CustomAddr),
}Expand description
Available address types.
-Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§Relay(RelayUrl)
Relays
-§Ip(SocketAddr)
IP based addresses
+Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§Relay(RelayUrl)
A relay server address.
+§Ip(SocketAddr)
An IP based address.
§Custom(CustomAddr)
Custom transport address
Implementations§
Source§impl TransportAddr
Sourcepub fn is_ip(&self) -> bool
Whether this is an IP transport address.
diff --git a/pr/4036/docs/iroh/index.html b/pr/4036/docs/iroh/index.html
index a2ddd5617a..8c7bddcb16 100644
--- a/pr/4036/docs/iroh/index.html
+++ b/pr/4036/docs/iroh/index.html
@@ -1,5 +1,5 @@
iroh - Rust Crate iroh
Expand description
Peer-to-peer QUIC connections.
-iroh is a library to establish direct connectivity between peers. It exposes an
+
iroh is a library to establish direct connectivity between peers. It exposes an
interface to QUIC connections and streams to the user, while implementing direct
connectivity using hole punching complemented by relay servers under the hood.
An iroh endpoint is created and controlled by the Endpoint, e.g. connecting to
@@ -44,7 +44,7 @@ punching if needed. Once the direct connection is established the relay ser
longer involved in the connection.
If one of the iroh endpoints can be reached directly, connectivity can also be
established without involving a Relay server. This is done by using the endpoint’s
-listening addresses in the connection establishement instead of the RelayUrl which
+listening addresses in the connection establishment instead of the RelayUrl which
is used to identify a Relay server. Of course it is also possible to use both a
RelayUrl and direct addresses at the same time to connect.
§Encryption
@@ -179,4 +179,4 @@ connecting using only the Ok(())
}
Please see the examples directory for more nuanced examples.
-Re-exports§
Modules§
- address_
lookup - Lookup the address of an Endpoint ID.
- defaults
- Default values used in
iroh - dns
Non-wasm_browser - Configurable DNS resolver.
- endpoint
- The
Endpoint allows establishing connections to other iroh endpoints. - endpoint_
info - Support for handling DNS resource records for dialing by
EndpointId. - metrics
- Co-locating all of the iroh metrics structs
- protocol
- Tools for spawning an accept loop that routes incoming requests to the right protocol.
- test_
utils test-utils - Internal utilities to support testing.
- tls
- TLS configuration for iroh.
Structs§
- Endpoint
Addr - Network-level addressing information for an iroh endpoint.
- NetReport
- A net_report report.
- NetReport
Config - Configuration for the net report component.
- Public
Key - A public key.
- Relay
Config - Information on a specific relay server.
- Relay
Map - List of relay server configurations to be used in an iroh endpoint.
- Relay
Url - A URL identifying a relay server.
- Relay
UrlParseError - Can occur when parsing a string into a
RelayUrl. - Secret
Key - A secret key.
- Signature
- Ed25519 signature.
- Signature
Error - Verification of a signature failed.
Enums§
- KeyParsing
Error - Error when deserialising a
PublicKey or a SecretKey. - Transport
Addr - Available address types.
Constants§
- NET_
REPORT_TIMEOUT - The maximum amount of time, in seconds, the net_report will spend gathering a single report.
Traits§
- Watcher
- A handle to a value that’s represented by one or more underlying [
Watchable]s.
Type Aliases§
- Endpoint
Id - The identifier for an endpoint in the (iroh) network.
\ No newline at end of file
+Re-exports§
Modules§
- address_
lookup - Lookup the address of an Endpoint ID.
- defaults
- Default values used in
iroh - dns
Non-wasm_browser - Configurable DNS resolver.
- endpoint
- The
Endpoint allows establishing connections to other iroh endpoints. - endpoint_
info - Support for handling DNS resource records for dialing by
EndpointId. - metrics
- Co-locating all of the iroh metrics structs
- protocol
- Tools for spawning an accept loop that routes incoming requests to the right protocol.
- test_
utils test-utils - Internal utilities to support testing.
- tls
- TLS configuration for iroh.
Structs§
- Endpoint
Addr - Network-level addressing information for an iroh endpoint.
- NetReport
- A net_report report.
- NetReport
Config - Configuration for the net report component.
- Public
Key - A public key.
- Relay
Config - Information on a specific relay server.
- Relay
Map - List of relay server configurations to be used in an iroh endpoint.
- Relay
Url - A URL identifying a relay server.
- Relay
UrlParseError - Can occur when parsing a string into a
RelayUrl. - Secret
Key - A secret key.
- Signature
- Ed25519 signature.
- Signature
Error - Verification of a signature failed.
Enums§
- KeyParsing
Error - Error returned when parsing a
PublicKey or a SecretKey. - Transport
Addr - Available address types.
Constants§
- NET_
REPORT_TIMEOUT - The maximum amount of time, in seconds, the net_report will spend gathering a single report.
Traits§
- Watcher
- A handle to a value that’s represented by one or more underlying [
Watchable]s.
Type Aliases§
- Endpoint
Id - The identifier for an endpoint in the (iroh) network.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/metrics/index.html b/pr/4036/docs/iroh/metrics/index.html
index da53db7d6a..00f2275127 100644
--- a/pr/4036/docs/iroh/metrics/index.html
+++ b/pr/4036/docs/iroh/metrics/index.html
@@ -1,2 +1,2 @@
iroh::metrics - Rust Module metrics
Expand description
Co-locating all of the iroh metrics structs
-Structs§
- Endpoint
Metrics - Metrics collected by an
crate::endpoint::Endpoint. - NetReport
Metrics - Enum of metrics for the module
- Relay
Metrics test-utils - Metrics tracked for the relay server
- Socket
Metrics - Enum of metrics for the module
\ No newline at end of file
+Structs§
- Endpoint
Metrics - Metrics collected by an
crate::endpoint::Endpoint. - NetReport
Metrics - Enum of metrics for the module
- Relay
Metrics test-utils - Metrics tracked for the relay server
- Socket
Metrics - Metrics collected by the iroh socket.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/metrics/struct.RelayMetrics.html b/pr/4036/docs/iroh/metrics/struct.RelayMetrics.html
index f8768e50a1..da2588f738 100644
--- a/pr/4036/docs/iroh/metrics/struct.RelayMetrics.html
+++ b/pr/4036/docs/iroh/metrics/struct.RelayMetrics.html
@@ -26,21 +26,26 @@
pub http_connections_closed: Counter,
pub http_connections_errored: Counter,
}Available on crate feature test-utils only.Expand description
Metrics tracked for the relay server
-Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.§bytes_sent: CounterBytes sent from a FrameType::SendPacket
-§bytes_recv: CounterBytes received from a FrameType::SendPacket
-§send_packets_sent: CounterFrameType::SendPacket sent
-§send_packets_recv: CounterFrameType::SendPacket received
-§send_packets_dropped: CounterFrameType::SendPacket dropped
-§other_packets_sent: CounterPackets of other FrameTypes sent
-§other_packets_recv: CounterPackets of other FrameTypes received
-§other_packets_dropped: CounterPackets of other FrameTypes dropped
-§got_ping: CounterNumber of FrameType::Pings received
-§sent_pong: CounterNumber of FrameType::Pongs sent
-§unknown_frames: CounterNumber of FrameType::Unknown received
+Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.§bytes_sent: CounterBytes sent to a client in RelayToClientDatagram or RelayToClientDatagramBatch frames.
+§bytes_recv: CounterBytes received from a client in ClientToRelayDatagram or ClientToRelayDatagramBatch frames.
+§send_packets_sent: CounterRelayToClientDatagram or RelayToClientDatagramBatch frames sent to a client.
+§send_packets_recv: CounterClientToRelayDatagram or ClientToRelayDatagramBatch frames received from a client.
+§send_packets_dropped: CounterRelayToClientDatagram or RelayToClientDatagramBatch frames dropped instead of being
+delivered to a client, because the recipient is not connected or writing to its stream failed.
+Note that frames dropped because the recipient’s send queue is full or closed are not counted
+here.
+§other_packets_sent: CounterIntended to count sent frames other than datagrams, but currently unused (never incremented).
+§other_packets_recv: CounterIntended to count received frames other than datagrams, but currently unused (never incremented).
+§other_packets_dropped: CounterIntended to count dropped frames other than datagrams, but currently unused (never incremented).
+§got_ping: CounterNumber of FrameType::Ping frames received from a client.
+§sent_pong: CounterNumber of FrameType::Pong frames sent to a client.
+§unknown_frames: CounterIntended to count received frames with an unrecognized FrameType,
+but currently unused (never incremented).
§bytes_rx_ratelimited_total: CounterNumber of bytes received from client connection which have been rate-limited.
§conns_rx_ratelimited_total: CounterNumber of client connections which have had any frames rate-limited.
§accepts: CounterNumber of times this server has accepted a connection.
-§disconnects: CounterNumber of connections we have removed because of an error
+§disconnects: CounterNumber of times a client connection was disconnected.
+Incremented once per connection, paired with Self::accepts.
§unique_client_keys: CounterNumber of unique client keys per day
§clients_inactive_added: CounterNumber of times a client was moved into the inactive state.
A client becomes inactive when a new client connects with the same endpoint id. An inactive
diff --git a/pr/4036/docs/iroh/metrics/struct.SocketMetrics.html b/pr/4036/docs/iroh/metrics/struct.SocketMetrics.html
index 2291657920..f61d3786bb 100644
--- a/pr/4036/docs/iroh/metrics/struct.SocketMetrics.html
+++ b/pr/4036/docs/iroh/metrics/struct.SocketMetrics.html
@@ -1,4 +1,4 @@
-
SocketMetrics in iroh::metrics - Rust SocketMetrics
#[non_exhaustive]pub struct SocketMetrics {Show 31 fields
+SocketMetrics in iroh::metrics - Rust SocketMetrics
#[non_exhaustive]pub struct SocketMetrics {Show 31 fields
pub update_direct_addrs: Counter,
pub send_ipv4: Counter,
pub send_ipv6: Counter,
@@ -30,10 +30,23 @@
pub actor_tick_direct_addr_heartbeat: Counter,
pub actor_link_change: Counter,
pub actor_tick_other: Counter,
-}
Expand description
Enum of metrics for the module
-Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.§update_direct_addrs: Counter§send_ipv4: Counter§send_ipv6: Counter§send_relay: Counter§recv_data_relay: Counter§recv_data_custom: Counter§recv_data_ipv4: Counter§recv_data_ipv6: Counter§recv_datagrams: CounterNumber of QUIC datagrams received.
-§recv_gro_datagrams: CounterNumber of datagrams received using GRO
-§relay_home_change: Counter§holepunch_attempts: CounterThe number of times holepunching is initiated on a connection.
+}Expand description
Metrics collected by the iroh socket.
+Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.§update_direct_addrs: CounterIntended to count updates to the local direct address set, but currently unused
+(never incremented).
+§send_ipv4: CounterNumber of bytes sent over IPv4.
+§send_ipv6: CounterNumber of bytes sent over IPv6.
+§send_relay: CounterNumber of bytes sent over the relay transport.
+§recv_data_relay: CounterNumber of data bytes received over the relay transport.
+§recv_data_custom: CounterNumber of data bytes received over any custom transport.
+§recv_data_ipv4: CounterNumber of data bytes received over IPv4.
+§recv_data_ipv6: CounterNumber of data bytes received over IPv6.
+§recv_datagrams: CounterNumber of QUIC datagrams received.
+§recv_gro_datagrams: CounterNumber of receive events that used GRO (coalesced datagram batches).
+This counts batches, not the individual datagrams within them. See
+Self::recv_datagrams for the datagram count.
+§relay_home_change: CounterNumber of times the home relay changed to a different relay.
+This includes the initial assignment from no home relay to a home relay.
+§holepunch_attempts: CounterThe number of times holepunching is initiated on a connection.
This can be incremented multiple times for a single connection. Note that only the
client-side of a connection will increment this counter.
§paths_direct: CounterThe number of network paths to peers that are direct.
@@ -53,8 +66,15 @@ the number of opened connections.
§transport_relay_paths_removed: CounterNumber of relay transport paths closed.
§transport_custom_paths_added: CounterNumber of custom transport paths opened.
§transport_custom_paths_removed: CounterNumber of custom transport paths closed.
-§actor_tick_main: Counter§actor_tick_msg: Counter§actor_tick_re_stun: Counter§actor_tick_portmap_changed: Counter§actor_tick_direct_addr_heartbeat: Counter§actor_link_change: Counter§actor_tick_other: CounterTrait Implementations§
Source§impl<'de> Deserialize<'de> for Metrics
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Iterable for Metrics
Source§fn metric_field_count(&self) -> usize
Returns the number of metric fields in the struct.Source§fn metric_field_ref(&self, n: usize) -> Option<MetricItem<'_>>
Returns the metric field at the given index.§fn family_field_count(&self) -> usize
Returns the number of Family fields in the struct.§fn family_field_ref(&self, _n: usize) -> Option<FamilyItem<'_>>
Returns the Family field at the given index.Source§impl Serialize for Metrics
Source§fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where
+§actor_tick_main: CounterNumber of iterations of the main socket actor loop.
+§actor_tick_msg: CounterNumber of actor messages processed by the socket actor loop.
+§actor_tick_re_stun: CounterNumber of periodic re-STUN timer ticks handled by the socket actor loop.
+§actor_tick_portmap_changed: CounterNumber of port-mapping change events handled by the socket actor loop.
+§actor_tick_direct_addr_heartbeat: CounterIntended to count direct address heartbeat ticks, but currently unused (never incremented).
+§actor_link_change: CounterNumber of local network interface (link) change events handled by the socket actor loop.
+§actor_tick_other: CounterNumber of times an input watcher or receiver closed in the socket actor loop.
+Trait Implementations§
Source§impl<'de> Deserialize<'de> for Metrics
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Iterable for Metrics
Source§fn metric_field_count(&self) -> usize
Returns the number of metric fields in the struct.Source§fn metric_field_ref(&self, n: usize) -> Option<MetricItem<'_>>
Returns the metric field at the given index.§fn family_field_count(&self) -> usize
Returns the number of Family fields in the struct.§fn family_field_ref(&self, _n: usize) -> Option<FamilyItem<'_>>
Returns the Family field at the given index.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
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/4036/docs/iroh/protocol/enum.IncomingFilterOutcome.html b/pr/4036/docs/iroh/protocol/enum.IncomingFilterOutcome.html
index e11345eddc..4577fe8eaf 100644
--- a/pr/4036/docs/iroh/protocol/enum.IncomingFilterOutcome.html
+++ b/pr/4036/docs/iroh/protocol/enum.IncomingFilterOutcome.html
@@ -11,7 +11,7 @@ the source address, actively refuse the connection, or silently drop it.
What this does depends on the connection type:
-
-
Direct (UDP) connections : this is QUIC source address
+
Direct (UDP) connections: this is QUIC source address
validation. If the socket address was spoofed, the retry token is
sent to the spoofed address, so we never hear from the attacker
again. If the address was real, the client repeats the connection
@@ -20,7 +20,7 @@ attempt with the token, and the next
-
-
Relay connections : there is no source address to validate
+
Relay connections: there is no source address to validate
(the relay already vouches for the packet origin), so the
“validation” itself has no security meaning. However, the retry
still imposes a real cost on the client: an extra round trip
diff --git a/pr/4036/docs/iroh/protocol/struct.RouterBuilder.html b/pr/4036/docs/iroh/protocol/struct.RouterBuilder.html
index dfc8969679..06b2f59fad 100644
--- a/pr/4036/docs/iroh/protocol/struct.RouterBuilder.html
+++ b/pr/4036/docs/iroh/protocol/struct.RouterBuilder.html
@@ -16,7 +16,7 @@ cheaper signals (e.g. remote address) first.
with this alpn.
handler can either be a type that implements ProtocolHandler or a
Box<dyn DynProtocolHandler>.
-
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for RouterBuilder
§impl !RefUnwindSafe for RouterBuilder
§impl Send for RouterBuilder
§impl Sync for RouterBuilder
§impl Unpin for RouterBuilder
§impl !UnwindSafe for RouterBuilder
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/4036/docs/iroh/struct.EndpointAddr.html b/pr/4036/docs/iroh/struct.EndpointAddr.html
index 0aa53df633..867818d655 100644
--- a/pr/4036/docs/iroh/struct.EndpointAddr.html
+++ b/pr/4036/docs/iroh/struct.EndpointAddr.html
@@ -5,7 +5,7 @@
This combines an endpoint’s identifier with network-level addressing information of how to
contact the endpoint.
To establish a network connection to an endpoint both the EndpointId and one or more network
-paths are needed. The network paths can come from various sources, current sources can come from
+paths are needed. The network paths can come from various sources:
-
An Address Lookup service which can provide routing information for a given EndpointId.
@@ -24,7 +24,7 @@ connection without the help of a Fields§§id: PublicKeyThe endpoint’s identifier.
-§addrs: BTreeSet<TransportAddr>The endpoint’s addresses
+§addrs: BTreeSet<TransportAddr>The endpoint’s addresses.
Implementations§
Source§impl EndpointAddr
Sourcepub fn new(id: PublicKey) -> EndpointAddr
Creates a new EndpointAddr with no network level addresses.
This still is usable with e.g. an address lookup service to establish a connection,
depending on the situation.
@@ -38,9 +38,9 @@ depending on the situation.
self,
addrs: impl IntoIterator<Item = TransportAddr>,
) -> EndpointAddrAdds a list of addresses.
-Sourcepub fn is_empty(&self) -> bool
Returns true, if only a EndpointId is present.
-Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns a list of IP addresses of this peer.
-Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns a list of relay urls of this peer.
+Sourcepub fn is_empty(&self) -> bool
Returns true if only an EndpointId is present.
+Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns an iterator over the IP addresses of this endpoint address.
+Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns an iterator over the relay URLs of this endpoint address.
In practice this is expected to be zero or one home relay for all known cases currently.
Trait Implementations§
Source§impl Clone for EndpointAddr
Source§fn clone(&self) -> EndpointAddr
Returns a duplicate 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 EndpointAddr
Source§impl<'de> Deserialize<'de> for EndpointAddr
Source§fn deserialize<__D>(
__deserializer: __D,
diff --git a/pr/4036/docs/iroh/struct.NetReport.html b/pr/4036/docs/iroh/struct.NetReport.html
index 693c855529..8b8ec1aed1 100644
--- a/pr/4036/docs/iroh/struct.NetReport.html
+++ b/pr/4036/docs/iroh/struct.NetReport.html
@@ -1,4 +1,4 @@
-NetReport in iroh - Rust NetReport
pub struct NetReport {
+NetReport in iroh - Rust NetReport
pub struct NetReport {
pub udp_v4: bool,
pub udp_v6: bool,
pub mapping_varies_by_dest_ipv4: Option<bool>,
@@ -13,17 +13,16 @@
§udp_v6: boolA QAD IPv6 round trip completed.
§mapping_varies_by_dest_ipv4: Option<bool>Whether the reported public address differs when probing different servers (on IPv4).
§mapping_varies_by_dest_ipv6: Option<bool>Whether the reported public address differs when probing different servers (on IPv6).
-§preferred_relay: Option<RelayUrl>Probe indicating the presence of port mapping protocols on the LAN.
-None for unknown
-§relay_latency: RelayLatencieskeyed by relay Url
-§global_v4: Option<SocketAddrV4>ip:port of global IPv4
-§global_v6: Option<SocketAddrV6>[ip]:port of global IPv6
+§preferred_relay: Option<RelayUrl>The relay server with the lowest latency, if any.
+§relay_latency: RelayLatenciesThe measured latency to each relay, keyed by relay URL.
+§global_v4: Option<SocketAddrV4>The discovered global IPv4 address and port, if any.
+§global_v6: Option<SocketAddrV6>The discovered global IPv6 address and port, if any.
§captive_portal: Option<bool>CaptivePortal is set when we think there’s a captive portal that is
intercepting HTTP traffic.
-Implementations§
Source§impl Report
Sourcepub fn mapping_varies_by_dest(&self) -> Option<bool>
Whether the reported public address differs when probing different servers.
+Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Report
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl PartialEq for Report
Source§impl Eq for Report
Source§impl StructuralPartialEq for Report
Auto Trait Implementations§
§impl Freeze for Report
§impl RefUnwindSafe for Report
§impl Send for Report
§impl Sync for Report
§impl Unpin for Report
§impl UnwindSafe for Report
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/4036/docs/iroh/struct.PublicKey.html b/pr/4036/docs/iroh/struct.PublicKey.html
index f8fb4c5ae2..b725772ddc 100644
--- a/pr/4036/docs/iroh/struct.PublicKey.html
+++ b/pr/4036/docs/iroh/struct.PublicKey.html
@@ -1,5 +1,5 @@
PublicKey in iroh - Rust PublicKey
pub struct PublicKey(/* private fields */);
Expand description
A public key.
-The key itself is stored as the CompressedEdwards y coordinate of the public key
+
The key itself is stored as the CompressedEdwards y-coordinate of the public key.
It is verified to decompress into a valid key when created.
Implementations§
Source§impl PublicKey
Sourcepub fn as_bytes(&self) -> &[u8; 32]
Get this public key as a byte array.
@@ -12,7 +12,7 @@ See [VerifyingKey::from_bytes] for details.
&self,
message: &[u8],
signature: &Signature,
-) -> Result<(), SignatureError>Verify a signature on a message with this secret key’s public key.
+) -> Result<(), SignatureError>Verify a signature on a message with this public key.
§Return
Returns Ok(()) if the signature is valid, and Err otherwise.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PublicKey
Source§fn deserialize<D>(
deserializer: D,
) -> Result<PublicKey, <D as Deserializer<'de>>::Error>where
- D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl From<PublicKey> for EndpointAddr
Source§fn from(endpoint_id: PublicKey) -> EndpointAddr
Converts to this type from the input type.Source§impl From<PublicKey> for EndpointAddr
Source§fn from(endpoint_id: PublicKey) -> EndpointAddr
Converts to this type from the input type.Source§impl FromStr for PublicKey
Parses a PublicKey from its hex or base32 encoding.
+
Display produces the hex encoding.
Source§impl Hash for PublicKey
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
H: Hasher,
diff --git a/pr/4036/docs/iroh/tls/index.html b/pr/4036/docs/iroh/tls/index.html
index 3c1d92cf2a..16f63b088e 100644
--- a/pr/4036/docs/iroh/tls/index.html
+++ b/pr/4036/docs/iroh/tls/index.html
@@ -1,5 +1,5 @@
iroh::tls - Rust Module tls
Expand description
TLS configuration for iroh.
-Currently there is one mechanisms available
+Currently there is one mechanism available:
- Raw Public Keys, using the TLS extension described in RFC 7250
diff --git a/pr/4036/docs/iroh_base/enum.KeyParsingError.html b/pr/4036/docs/iroh_base/enum.KeyParsingError.html
index d0668a511c..7c849cddf2 100644
--- a/pr/4036/docs/iroh_base/enum.KeyParsingError.html
+++ b/pr/4036/docs/iroh_base/enum.KeyParsingError.html
@@ -1,4 +1,4 @@
-KeyParsingError in iroh_base - Rust KeyParsingError
#[non_exhaustive]pub enum KeyParsingError {
+KeyParsingError in iroh_base - Rust KeyParsingError
#[non_exhaustive]pub enum KeyParsingError {
FailedToDecodeHex {
meta: Meta,
},
@@ -11,14 +11,14 @@
InvalidKeyData {
meta: Meta,
},
-}
Available on crate feature key only.Expand description
Error when deserialising a PublicKey or a SecretKey.
+}Available on crate feature key only.Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§FailedToDecodeHex
The input string could not be decoded as hex.
Fields
§meta: MetaCaptured call-site metadata
§FailedToDecodeBase32
The input string could not be decoded as base32.
Fields
§meta: MetaCaptured call-site metadata
§InvalidLength
The input has invalid length.
Fields
§meta: MetaCaptured call-site metadata
-§InvalidKeyData
The decoded data is not a valid Ed25591 public key.
+§InvalidKeyData
The decoded data is not a valid Ed25519 public key.
Fields
§meta: MetaCaptured call-site metadata
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<KeyParsingError> for AnyError
Source§fn from(value: KeyParsingError) -> AnyError
Converts to this type from the input type.Source§impl StackError for KeyParsingError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
Returns the next source in the chain, if any.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.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§
Source§impl<T> Borrow<T> for Twhere
diff --git a/pr/4036/docs/iroh_base/enum.TransportAddr.html b/pr/4036/docs/iroh_base/enum.TransportAddr.html
index ec9989aea4..a55428eb22 100644
--- a/pr/4036/docs/iroh_base/enum.TransportAddr.html
+++ b/pr/4036/docs/iroh_base/enum.TransportAddr.html
@@ -3,8 +3,8 @@
Ip(SocketAddr),
Custom(CustomAddr),
}Available on crate feature key only.Expand description
Available address types.
-Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§Relay(RelayUrl)
Relays
-§Ip(SocketAddr)
IP based addresses
+Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§Relay(RelayUrl)
A relay server address.
+§Ip(SocketAddr)
An IP based address.
§Custom(CustomAddr)
Custom transport address
Implementations§
Source§impl TransportAddr
PkarrRelayClientBuilder
pub struct PkarrRelayClientBuilder { /* private fields */ }Expand description
A builder for the PkarrRelayClient
Implementations§
Source§impl PkarrRelayClientBuilder
impl PkarrRelayClientBuilder
Sourcepub fn build(self) -> PkarrRelayClient
pub fn build(self) -> PkarrRelayClient
Build a PkarrRelayClient.
Trait Implementations§
Source§impl Clone for PkarrRelayClientBuilder
impl Clone for PkarrRelayClientBuilder
Source§fn clone(&self) -> PkarrRelayClientBuilder
fn clone(&self) -> PkarrRelayClientBuilder
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 PkarrRelayClientBuilder
impl !RefUnwindSafe for PkarrRelayClientBuilder
impl Send for PkarrRelayClientBuilder
impl Sync for PkarrRelayClientBuilder
impl Unpin for PkarrRelayClientBuilder
impl !UnwindSafe for PkarrRelayClientBuilder
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/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
index 13e12a4b01..1f7723299d 100644
--- a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
+++ b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
@@ -1,21 +1,21 @@
-PkarrResolver in iroh::address_lookup::pkarr - Rust PkarrResolver
pub struct PkarrResolver { /* private fields */ }
Expand description
Resolver of address lookup information from a pkarr relay.
+PkarrResolver in iroh::address_lookup::pkarr - Rust PkarrResolver
pub struct PkarrResolver { /* private fields */ }
Expand description
Resolver of address lookup information from a pkarr relay.
The resolver uses HTTP to query address lookup information from a pkarr relay server,
see the module docs for details.
This implements the AddressLookup trait to be used as an address lookup service. Note
that it only resolves address lookup information, for the corresponding publisher use
the PkarrPublisher together with AddressLookupServices.
-Implementations§
Source§impl PkarrResolver
Sourcepub fn builder(pkarr_relay: Url) -> PkarrResolverBuilder
Creates a new resolver builder using the pkarr relay server at the URL.
+Implementations§
Source§impl PkarrResolver
Sourcepub fn builder(pkarr_relay: Url) -> PkarrResolverBuilder
Creates a new resolver builder using the pkarr relay server at the URL.
The builder implements AddressLookupBuilder.
-Sourcepub fn n0_dns() -> PkarrResolverBuilder
Creates a pkarr resolver builder which uses the number 0 pkarr relay server.
+Sourcepub fn n0_dns() -> PkarrResolverBuilder
Creates a pkarr resolver builder which uses the number 0 pkarr relay server.
This uses the pkarr relay server operated by number 0 at
N0_DNS_PKARR_RELAY_PROD.
When running with the environment variable IROH_FORCE_STAGING_RELAYS
set to any non empty value N0_DNS_PKARR_RELAY_STAGING
server is used instead.
-Trait Implementations§
Source§impl AddressLookup for PkarrResolver
Trait Implementations§
Source§impl AddressLookup for PkarrResolver
Source§fn resolve(
&self,
endpoint_id: EndpointId,
-) -> Option<BoxStream<Result<AddressLookupItem, AddressLookupError>>>
Source§fn publish(&self, _data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreSource§impl Clone for PkarrResolver
Source§fn clone(&self) -> PkarrResolver
Returns a duplicate 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 PkarrResolver
§impl !RefUnwindSafe for PkarrResolver
§impl Send for PkarrResolver
§impl Sync for PkarrResolver
§impl Unpin for PkarrResolver
§impl !UnwindSafe for PkarrResolver
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
+) -> Option<BoxStream<Result<AddressLookupItem, AddressLookupError>>>Source§fn publish(&self, _data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read more
Source§impl Clone for PkarrResolver
Source§fn clone(&self) -> PkarrResolver
Returns a duplicate 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 PkarrResolver
§impl !RefUnwindSafe for PkarrResolver
§impl Send for PkarrResolver
§impl Sync for PkarrResolver
§impl Unpin for PkarrResolver
§impl !UnwindSafe for PkarrResolver
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
T: AddressLookup,
Source§fn into_address_lookup(
self,
_endpoint: &Endpoint,
diff --git a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
index cfd47f28e6..e549ec9d07 100644
--- a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
+++ b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
@@ -1,11 +1,11 @@
-PkarrResolverBuilder in iroh::address_lookup::pkarr - Rust PkarrResolverBuilder
pub struct PkarrResolverBuilder { /* private fields */ }
Expand description
Builder for PkarrResolver.
+PkarrResolverBuilder in iroh::address_lookup::pkarr - Rust PkarrResolverBuilder
pub struct PkarrResolverBuilder { /* private fields */ }
Expand description
Builder for PkarrResolver.
-Implementations§
Source§impl PkarrResolverBuilder
Sourcepub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self
Available on non-wasm_browser only.
Sets the DNS resolver to use for resolving the pkarr relay URL.
-Sourcepub fn build(self, tls_config: ClientConfig) -> PkarrResolver
Creates a PkarrResolver from this builder.
-Trait Implementations§
Implementations§
Source§impl PkarrResolverBuilder
Sourcepub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self
Available on non-wasm_browser only.
Sets the DNS resolver to use for resolving the pkarr relay URL.
+Sourcepub fn build(self, tls_config: ClientConfig) -> PkarrResolver
Creates a PkarrResolver from this builder.
+Trait Implementations§
Source§impl AddressLookupBuilder for PkarrResolverBuilder
Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this builder into a ready-to-use AddressLookup. Read moreAuto Trait Implementations§
§impl Freeze for PkarrResolverBuilder
§impl !RefUnwindSafe for PkarrResolverBuilder
§impl Send for PkarrResolverBuilder
§impl Sync for PkarrResolverBuilder
§impl Unpin for PkarrResolverBuilder
§impl !UnwindSafe for PkarrResolverBuilder
Blanket Implementations§
Source§impl<T> Any for Twhere
+) -> Result<impl AddressLookup, AddressLookupBuilderError>Turns this builder into a ready-to-use AddressLookup. Read more
Auto Trait Implementations§
§impl Freeze for PkarrResolverBuilder
§impl !RefUnwindSafe for PkarrResolverBuilder
§impl Send for PkarrResolverBuilder
§impl Sync for PkarrResolverBuilder
§impl Unpin for PkarrResolverBuilder
§impl !UnwindSafe for PkarrResolverBuilder
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/4036/docs/iroh/address_lookup/struct.EndpointData.html b/pr/4036/docs/iroh/address_lookup/struct.EndpointData.html
index 1ea4773718..7de6a2dd89 100644
--- a/pr/4036/docs/iroh/address_lookup/struct.EndpointData.html
+++ b/pr/4036/docs/iroh/address_lookup/struct.EndpointData.html
@@ -13,15 +13,15 @@ services, should they not fit into e.g. a single DNS packet otherwise.
See also Self::set_user_data.
Sourcepub fn add_relay_url(&mut self, relay_url: RelayUrl)
Adds the relay URL to the end of the endpoint data, unless it already existed.
Sourcepub fn add_ip_addrs(&mut self, addresses: Vec<SocketAddr>)
Adds addresses in order with duplicates or already existing addresses filtered out.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Adds addresses to the endpoint data in the given ordered, but with duplicates filtered.
-Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data and returns the updated endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Adds addresses to the endpoint data in the given order, but with duplicates filtered.
+Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data.
Sourcepub fn clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn clear_relay_urls(&mut self)
Removes all relay URLs from the endpoint data.
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses.
+Sourcepub fn filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
Returns a vec to allow re-ordering of addresses.
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
diff --git a/pr/4036/docs/iroh/address_lookup/struct.Item.html b/pr/4036/docs/iroh/address_lookup/struct.Item.html
index 9e63b37130..28d59f6feb 100644
--- a/pr/4036/docs/iroh/address_lookup/struct.Item.html
+++ b/pr/4036/docs/iroh/address_lookup/struct.Item.html
@@ -16,14 +16,14 @@ directly from Sourcepub fn last_updated(&self) -> Option<u64>
Returns the optional timestamp when this endpoint info was last updated.
The value is microseconds since the unix epoch.
-Sourcepub fn to_endpoint_addr(&self) -> EndpointAddr
Converts into a EndpointAddr by cloning the needed fields.
-Sourcepub fn into_endpoint_addr(self) -> EndpointAddr
Converts into a EndpointAddr without cloning.
+Sourcepub fn to_endpoint_addr(&self) -> EndpointAddr
Returns an EndpointAddr by cloning the needed fields.
+Sourcepub fn into_endpoint_addr(self) -> EndpointAddr
Converts into an EndpointAddr without cloning.
Methods from Deref<Target = EndpointData>§
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses.
+Sourcepub fn filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
Returns a vec to allow re-ordering of addresses.
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
diff --git a/pr/4036/docs/iroh/address_lookup/struct.UserData.html b/pr/4036/docs/iroh/address_lookup/struct.UserData.html
index 49c2183d40..5ae8665e57 100644
--- a/pr/4036/docs/iroh/address_lookup/struct.UserData.html
+++ b/pr/4036/docs/iroh/address_lookup/struct.UserData.html
@@ -1,4 +1,5 @@
-UserData in iroh::address_lookup - Rust 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.
+UserData in iroh::address_lookup - Rust UserData
pub struct UserData(/* private fields */);
Expand description
User-defined data that can be published and resolved through endpoint discovery.
+Under the hood this is a UTF-8 string 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.
diff --git a/pr/4036/docs/iroh/address_lookup/trait.AddressLookup.html b/pr/4036/docs/iroh/address_lookup/trait.AddressLookup.html
index 1be6efa3e6..79a8044def 100644
--- a/pr/4036/docs/iroh/address_lookup/trait.AddressLookup.html
+++ b/pr/4036/docs/iroh/address_lookup/trait.AddressLookup.html
@@ -22,7 +22,7 @@ Address Lookup information changes. If an Address Lookup mechanism requires a pe
refresh, it should start its own task.
Provided Methods§
Sourcefn publish(&self, _data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism.
This is fire and forget, since the Endpoint can not wait for successful
-publishing. If publishing is async, the implementation should start it’s own task.
+publishing. If publishing is async, the implementation should start its own task.
This will be called from a tokio task, so it is safe to spawn new tasks.
These tasks will be run on the runtime of the super::Endpoint.
Implementations on Foreign Types§
Source§impl<T: AddressLookup> AddressLookup for Arc<T>
Implementors§
Source§impl AddressLookup for DnsAddressLookup
Available on non-wasm_browser only. Source§impl AddressLookup for MemoryLookup
Source§impl AddressLookup for PkarrPublisher
Source§impl AddressLookup for PkarrResolver
Source§impl<T: AddressLookup> AddressLookup for FilteredAddressLookup<T>
\ No newline at end of file
+) -> Option<BoxStream<Result<Item, Error>>>Implementors§
Source§impl AddressLookup for DnsAddressLookup
Available on non-wasm_browser only. Source§impl AddressLookup for MemoryLookup
Source§impl AddressLookup for PkarrPublisher
Source§impl AddressLookup for PkarrResolver
Source§impl<T: AddressLookup> AddressLookup for FilteredAddressLookup<T>
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/address_lookup/trait.AddressLookupBuilder.html b/pr/4036/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
index 35aadc4338..edc4dff899 100644
--- a/pr/4036/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
+++ b/pr/4036/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
@@ -20,5 +20,5 @@ endpoint to Endpoint,
) -> Result<impl AddressLookup, AddressLookupBuilderError>Turns this builder into a ready-to-use AddressLookup.
If an error is returned, building the endpoint will fail with this error.
-Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
Source§impl AddressLookupBuilder for DnsAddressLookupBuilder
Available on non-wasm_browser only. Source§impl AddressLookupBuilder for PkarrPublisherBuilder
Source§impl AddressLookupBuilder for PkarrResolverBuilder
Source§impl<T: AddressLookup> AddressLookupBuilder for T
Blanket no-op impl of AddressLookupBuilder for T: AddressLookup.
+ Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
Source§impl AddressLookupBuilder for DnsAddressLookupBuilder
Available on non-wasm_browser only. Source§impl AddressLookupBuilder for PkarrPublisherBuilder
Source§impl AddressLookupBuilder for PkarrResolverBuilder
Source§impl<T: AddressLookup> AddressLookupBuilder for T
Blanket no-op impl of AddressLookupBuilder for T: AddressLookup.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/defaults/prod/fn.default_ap_relay.html b/pr/4036/docs/iroh/defaults/prod/fn.default_ap_relay.html
index 5961b7d1ab..3a67b98b91 100644
--- a/pr/4036/docs/iroh/defaults/prod/fn.default_ap_relay.html
+++ b/pr/4036/docs/iroh/defaults/prod/fn.default_ap_relay.html
@@ -1,2 +1,2 @@
-default_ap_relay in iroh::defaults::prod - Rust default_ap_relay
pub fn default_ap_relay() -> RelayConfig
Expand description
Get the default RelayConfig for Asia-Pacific
+default_ap_relay in iroh::defaults::prod - Rust default_ap_relay
pub fn default_ap_relay() -> RelayConfig
Expand description
Get the default RelayConfig for Asia-Pacific.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/defaults/prod/index.html b/pr/4036/docs/iroh/defaults/prod/index.html
index 8981fb6be4..b076bc3ce3 100644
--- a/pr/4036/docs/iroh/defaults/prod/index.html
+++ b/pr/4036/docs/iroh/defaults/prod/index.html
@@ -1,2 +1,2 @@
iroh::defaults::prod - Rust Module prod
Expand description
Production configuration.
-Constants§
- AP_
RELAY_HOSTNAME - Hostname of the default Asia-Pacific relay.
- EU_
RELAY_HOSTNAME - Hostname of the default EU relay.
- NA_
EAST_RELAY_HOSTNAME - Hostname of the default NA east relay.
- NA_
WEST_RELAY_HOSTNAME - Hostname of the default NA west relay.
Functions§
- default_
ap_relay - Get the default
RelayConfig for Asia-Pacific - default_
eu_relay - Get the default
RelayConfig for EU. - default_
na_east_relay - Get the default
RelayConfig for NA east. - default_
na_west_relay - Get the default
RelayConfig for NA west. - default_
relay_map - Get the default
RelayMap.
\ No newline at end of file
+Constants§
- AP_
RELAY_HOSTNAME - Hostname of the default Asia-Pacific relay.
- EU_
RELAY_HOSTNAME - Hostname of the default EU relay.
- NA_
EAST_RELAY_HOSTNAME - Hostname of the default NA east relay.
- NA_
WEST_RELAY_HOSTNAME - Hostname of the default NA west relay.
Functions§
- default_
ap_relay - Get the default
RelayConfig for Asia-Pacific. - default_
eu_relay - Get the default
RelayConfig for EU. - default_
na_east_relay - Get the default
RelayConfig for NA east. - default_
na_west_relay - Get the default
RelayConfig for NA west. - default_
relay_map - Get the default
RelayMap.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/dns/struct.DnsResolver.html b/pr/4036/docs/iroh/dns/struct.DnsResolver.html
index 754fa26465..3f8c6e27b6 100644
--- a/pr/4036/docs/iroh/dns/struct.DnsResolver.html
+++ b/pr/4036/docs/iroh/dns/struct.DnsResolver.html
@@ -15,7 +15,7 @@ public DNS.
Implementations§
Source§impl DnsResolver
Sourcepub fn new() -> DnsResolver
Creates 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.
+to the default ResolverConfig which uses e.g. Google’s 8.8.8.8 or 8.8.4.4.
Sourcepub fn with_nameserver(nameserver: SocketAddr) -> DnsResolver
Creates a new DNS resolver configured with a single UDP DNS nameserver.
Sourcepub fn custom(resolver: impl Resolver) -> DnsResolver
Creates a new DnsResolver from a struct that implements Resolver.
diff --git a/pr/4036/docs/iroh/dns/trait.Resolver.html b/pr/4036/docs/iroh/dns/trait.Resolver.html
index 4aaa7642fd..3ebf87a01f 100644
--- a/pr/4036/docs/iroh/dns/trait.Resolver.html
+++ b/pr/4036/docs/iroh/dns/trait.Resolver.html
@@ -38,13 +38,13 @@ atomic swap. Build a new instance with re-bound sockets and re-read nameserver
configuration rather than mutating in place. Must not perform IO: defer DNS
queries and socket binds until the new resolver is first used. May be called
concurrently, in which case all but one allocated replacement is dropped unused.
-Implementations on Foreign Types§
Implementations on Foreign Types§
Source§impl Resolver for Arc<SimpleDnsResolver>
Source§fn lookup_ipv4(
&self,
host: String,
-) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = Ipv4Addr> + Send>, DnsError>> + Send>>
Source§fn lookup_ipv6(
+) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = Ipv4Addr> + Send>, DnsError>> + Send>>
Source§fn lookup_ipv6(
&self,
host: String,
-) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = Ipv6Addr> + Send>, DnsError>> + Send>>
Source§fn lookup_txt(
+) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = Ipv6Addr> + Send>, DnsError>> + Send>>
Source§fn lookup_txt(
&self,
host: String,
-) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = TxtRecordData> + Send>, DnsError>> + Send>>
Source§fn clear_cache(&self)
Source§fn reset(&self) -> Box<dyn Resolver>
Implementors§
\ No newline at end of file
+) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = TxtRecordData> + Send>, DnsError>> + Send>>Source§fn clear_cache(&self)
Source§fn reset(&self) -> Box<dyn Resolver>
Implementors§
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html b/pr/4036/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html
index 0a8e0c05eb..cc00fac5e1 100644
--- a/pr/4036/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html
+++ b/pr/4036/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html
@@ -1,2 +1,2 @@
-ENV_FORCE_STAGING_RELAYS in iroh::endpoint - Rust ENV_FORCE_STAGING_RELAYS
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 ENV_FORCE_STAGING_RELAYS
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint/enum.RelayMode.html b/pr/4036/docs/iroh/endpoint/enum.RelayMode.html
index 326aae7405..0d7b755897 100644
--- a/pr/4036/docs/iroh/endpoint/enum.RelayMode.html
+++ b/pr/4036/docs/iroh/endpoint/enum.RelayMode.html
@@ -1,4 +1,4 @@
-RelayMode in iroh::endpoint - Rust RelayMode
pub enum RelayMode {
+RelayMode in iroh::endpoint - Rust RelayMode
pub enum RelayMode {
Disabled,
Default,
Staging,
@@ -10,14 +10,14 @@ This means that neither listening nor dialing relays will be available.
See crate::defaults::prod for the severs used.
§Staging
Use the staging relay servers from n0.
§Custom(RelayMap)
Use a custom relay map.
-
Implementations§
Source§impl RelayMode
Sourcepub fn custom(map: impl IntoIterator<Item = RelayUrl>) -> Self
Create a custom relay mode from a list of RelayUrls.
+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§
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/4036/docs/iroh/endpoint/fn.default_relay_mode.html b/pr/4036/docs/iroh/endpoint/fn.default_relay_mode.html
index d716677abc..98ff3579ee 100644
--- a/pr/4036/docs/iroh/endpoint/fn.default_relay_mode.html
+++ b/pr/4036/docs/iroh/endpoint/fn.default_relay_mode.html
@@ -1,4 +1,4 @@
-default_relay_mode in iroh::endpoint - Rust default_relay_mode
pub fn default_relay_mode() -> RelayMode
Expand description
Returns the default relay mode.
+default_relay_mode in iroh::endpoint - Rust default_relay_mode
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint/fn.force_staging_infra.html b/pr/4036/docs/iroh/endpoint/fn.force_staging_infra.html
index ff8dda7e69..b444491b3e 100644
--- a/pr/4036/docs/iroh/endpoint/fn.force_staging_infra.html
+++ b/pr/4036/docs/iroh/endpoint/fn.force_staging_infra.html
@@ -1,2 +1,2 @@
-force_staging_infra in iroh::endpoint - Rust force_staging_infra
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 force_staging_infra
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint/index.html b/pr/4036/docs/iroh/endpoint/index.html
index 2efb803d4c..f3a98d45f2 100644
--- a/pr/4036/docs/iroh/endpoint/index.html
+++ b/pr/4036/docs/iroh/endpoint/index.html
@@ -1,4 +1,4 @@
-iroh::endpoint - Rust Module endpoint
Expand description
The Endpoint allows establishing connections to other iroh endpoints.
+iroh::endpoint - Rust Module endpoint
Expand description
The Endpoint allows establishing connections to other iroh endpoints.
The Endpoint is the main API interface to manage a local iroh endpoint. It allows
connecting to and accepting connections from other endpoints. See the module docs for
more details on how iroh connections work.
diff --git a/pr/4036/docs/iroh/endpoint/presets/index.html b/pr/4036/docs/iroh/endpoint/presets/index.html
index 37b792c03d..a454626701 100644
--- a/pr/4036/docs/iroh/endpoint/presets/index.html
+++ b/pr/4036/docs/iroh/endpoint/presets/index.html
@@ -2,4 +2,4 @@
§Example
use iroh::{Endpoint, RelayMode, Watcher, endpoint::presets};
-let endpoint = Endpoint::builder(presets::N0).bind().await?;
Structs§
- Empty
- An empty preset that doesn’t set anything on the builder.
- Minimal
with_crypto_provider - A preset that is almost empty, besides setting mandatory options.
- N0
with_crypto_provider - Configures the endpoint to use the n0 defaults
- N0Disable
Relay with_crypto_provider - Configures the endpoint to use the n0 defaults, but with relay mode disabled.
Traits§
- Preset
- Defines a preset
\ No newline at end of file
+let endpoint = Endpoint::builder(presets::N0).bind().await?;Structs§
- Empty
- An empty preset that doesn’t set anything on the builder.
- Minimal
with_crypto_provider - A preset that is almost empty, besides setting mandatory options.
- N0
with_crypto_provider - Configures the endpoint to use the n0 defaults
- N0Disable
Relay with_crypto_provider - Configures the endpoint to use the n0 defaults, but with relay mode disabled.
Traits§
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint/presets/struct.N0.html b/pr/4036/docs/iroh/endpoint/presets/struct.N0.html
index 41c532b301..cf9fb0156e 100644
--- a/pr/4036/docs/iroh/endpoint/presets/struct.N0.html
+++ b/pr/4036/docs/iroh/endpoint/presets/struct.N0.html
@@ -6,8 +6,8 @@
setting the [rustls::crypto::CryptoProvider] to ring or aws-lc-rs, depending
on which feature is enabled in iroh (preferring ring if both are enabled).
-Due to the last point, this preset is only available with the ring or
-aws-lc-rs preset installed.
+
Due to the last point, this preset is only available with the tls-ring or
+tls-aws-lc-rs feature enabled.
If you want to set your own crypto provider, we recommend copying the
implementation of this preset into your own and setting the appropriate crypto
provider there.
diff --git a/pr/4036/docs/iroh/endpoint/presets/struct.N0DisableRelay.html b/pr/4036/docs/iroh/endpoint/presets/struct.N0DisableRelay.html
index dd14c88ba9..29795833c9 100644
--- a/pr/4036/docs/iroh/endpoint/presets/struct.N0DisableRelay.html
+++ b/pr/4036/docs/iroh/endpoint/presets/struct.N0DisableRelay.html
@@ -7,8 +7,8 @@ relay urls.
setting the [rustls::crypto::CryptoProvider] to ring or aws-lc-rs, depending
on which feature is enabled in iroh (preferring ring if both are enabled).
-Due to the last point, this preset is only available with the ring or
-aws-lc-rs preset installed.
+
Due to the last point, this preset is only available with the tls-ring or
+tls-aws-lc-rs feature enabled.
If you want to set your own crypto provider, we recommend copying the
implementation of this preset into your own and setting the appropriate crypto
provider there.
diff --git a/pr/4036/docs/iroh/endpoint/presets/trait.Preset.html b/pr/4036/docs/iroh/endpoint/presets/trait.Preset.html
index 59a71a95da..7e6f4bbcac 100644
--- a/pr/4036/docs/iroh/endpoint/presets/trait.Preset.html
+++ b/pr/4036/docs/iroh/endpoint/presets/trait.Preset.html
@@ -1,7 +1,7 @@
-Preset in iroh::endpoint::presets - Rust Preset
pub trait Preset {
+Preset in iroh::endpoint::presets - Rust Preset
pub trait Preset {
// Required method
fn apply(self, builder: Builder) -> Builder;
-}
Expand description
Defines a preset
+}Expand description
A reusable bundle of endpoint Builder configuration.
Required Methods§
Implementations on Foreign Types§
Source§impl Preset for Arc<TestTransport>
Available on crate feature unstable-custom-transports and (crate features test-utils) only.
Source§fn apply(self, builder: Builder) -> Builder
Configures the builder with this transport and the network’s address lookup.
§Example
diff --git a/pr/4036/docs/iroh/endpoint/struct.Builder.html b/pr/4036/docs/iroh/endpoint/struct.Builder.html
index 79894b8924..7cbb050d5e 100644
--- a/pr/4036/docs/iroh/endpoint/struct.Builder.html
+++ b/pr/4036/docs/iroh/endpoint/struct.Builder.html
@@ -92,7 +92,7 @@ is set to false explicitly.
destination addresses. It is valid to configure this, but no more than one such
socket should be bound or the routing will be non-deterministic.
To use a subnet with a non-zero prefix length as the default route in addition to
-being routed when its prefix matches, use `BindOpts::set_is_default_route.
+being routed when its prefix matches, use BindOpts::set_is_default_route.
Subnets with a prefix length of zero are always marked as default routes.
Finally note that most outgoing datagrams are part of an existing network flow. That
is, they are in response to an incoming datagram. In this case the outgoing datagram
@@ -142,7 +142,7 @@ direct addresses or relay URLs will fail.
Sourcepub fn addr_filter(self, filter: AddrFilter) -> Self
Sets the address filter applied to all address data before publishing.
This filter is applied once, at the AddressLookupServices level, before
distributing data to any individual address lookup service. This ensures
-consistent filtering regardless of how the services configured.
+consistent filtering regardless of how the services are configured.
Sourcepub fn clear_addr_filter(self) -> Self
Clears the address filter, allowing all addresses to be published.
This removes any filter previously set via Self::addr_filter, including
filters set by presets.
diff --git a/pr/4036/docs/iroh/endpoint/struct.ConnectOptions.html b/pr/4036/docs/iroh/endpoint/struct.ConnectOptions.html
index 30bf2e329e..3834b0244e 100644
--- a/pr/4036/docs/iroh/endpoint/struct.ConnectOptions.html
+++ b/pr/4036/docs/iroh/endpoint/struct.ConnectOptions.html
@@ -1,12 +1,12 @@
-ConnectOptions in iroh::endpoint - Rust ConnectOptions
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 ConnectOptions
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 QuicTransportConfig.
-Sourcepub fn with_transport_config(
+
Sourcepub fn with_transport_config(
self,
transport_config: QuicTransportConfig,
) -> Self
Sets the QUIC transport config options for this connection.
-Sourcepub fn with_additional_alpns(self, alpns: Vec<Vec<u8>>) -> Self
Sets ALPN identifiers that should be signaled as supported on connection, in
+
Sourcepub fn with_additional_alpns(self, alpns: Vec<Vec<u8>>) -> Self
Sets ALPN identifiers that should be signaled as supported on connection, in
addition to the main ALPN identifier used in Endpoint::connect_with_opts.
This allows connecting to servers that may only support older versions of your
protocol. In this case, you would add the older ALPN identifiers with this
@@ -20,7 +20,7 @@ list or the main ALPN identifiers on the accept side, see the endpoint
builder’s Builder::alpns function.
-Trait Implementations§
Source§impl Clone for ConnectOptions
Source§fn clone(&self) -> ConnectOptions
Returns a duplicate 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 duplicate 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/4036/docs/iroh/endpoint/struct.Connection.html b/pr/4036/docs/iroh/endpoint/struct.Connection.html
index ffc93497ee..74f53832af 100644
--- a/pr/4036/docs/iroh/endpoint/struct.Connection.html
+++ b/pr/4036/docs/iroh/endpoint/struct.Connection.html
@@ -8,7 +8,7 @@ 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<T: ConnectionState> Connection<T>
Implementations§
Source§impl<T: ConnectionState> Connection<T>
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.
@@ -18,13 +18,13 @@ consequence, the peer won’t be notified that a stream has been opened until th
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_bi(&self) -> AcceptBi<'_> ⓘ
Accepts 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 async fn closed(&self) -> ConnectionError
Waits 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.
@@ -97,17 +97,18 @@ strong and pseudorandom, and are suitable for use as keying material.
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)
See [noq_proto::TransportConfig::receive_window].
-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)
Sets the connection-level flow control receive window.
+See [noq_proto::TransportConfig::receive_window].
+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.
-Source§impl Connection<HandshakeCompleted>
Sourcepub fn remote_id(&self) -> EndpointId
Returns the EndpointId from the peer’s TLS certificate.
+Source§impl Connection<HandshakeCompleted>
Sourcepub fn remote_id(&self) -> EndpointId
Returns the EndpointId from the peer’s TLS certificate.
The PublicKey of an endpoint is also known as an EndpointId. This PublicKey is
included in the TLS certificate presented during the handshake when connecting.
This function allows you to get the EndpointId of the remote endpoint of this
connection.
-Sourcepub fn paths(&self) -> PathList<'_>
Returns the currently open network paths for this connection.
+Sourcepub fn paths(&self) -> PathList<'_>
Returns the currently open network paths for this connection.
A connection typically has one path via the relay server and,
once holepunching succeeds, a direct path. The returned
PathList is a snapshot taken at call time: it does not
@@ -116,14 +117,14 @@ already closed.
To observe changes over time, see Connection::paths_stream
for a stream of PathList snapshots and
Connection::path_events for individual PathEvents.
-Sourcepub fn paths_stream(&self) -> PathListStream<'_>
Returns a stream of PathList snapshots for this connection.
+Sourcepub fn paths_stream(&self) -> PathListStream<'_>
Returns a stream of PathList snapshots for this connection.
Yields the current snapshot on the first poll, and a fresh
snapshot whenever the open paths or the selected path change.
Ends when the connection closes.
The stream borrows this Connection. To consume it from a
spawned task, move a Connection clone into the task and
call this method inside.
-Sourcepub fn path_events(&self) -> PathEventStream
Returns a stream of PathEvents for this connection.
+Sourcepub fn path_events(&self) -> PathEventStream
Returns a stream of PathEvents for this connection.
Each event reports one of: a path opened, a path closed (with
final per-path statistics), the selected transmission path
changed, or the consumer fell behind. The stream ends when the
@@ -133,14 +134,14 @@ may be moved into a spawned task.
single PathEvent::Lagged; the current state of the open
paths and the selected path remains recoverable via
Connection::paths.
-Sourcepub fn weak_handle(&self) -> WeakConnectionHandle
Returns a WeakConnectionHandle for this connection.
+Sourcepub fn weak_handle(&self) -> WeakConnectionHandle
Returns a WeakConnectionHandle for this connection.
A WeakConnectionHandle does not keep the connection alive. It can be used to
wait for the connection to be closed via WeakConnectionHandle::closed and to
attempt to upgrade back to a strong Connection via
WeakConnectionHandle::upgrade.
-Source§impl Connection<IncomingZeroRtt>
Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
-Sourcepub async fn handshake_completed(&self) -> Result<Connection, ConnectingError>
Waits until the full handshake occurs and then returns a Connection.
+Source§impl Connection<IncomingZeroRtt>
Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
+Sourcepub async fn handshake_completed(&self) -> Result<Connection, ConnectingError>
Waits until the full handshake occurs and then returns a Connection.
This may fail with ConnectingError::ConnectionError, if there was
some general failure with the connection, such as a network timeout since
we accepted the connection.
@@ -149,18 +150,18 @@ doesn’t use the right TLS authentication, which usually every iroh endpoint
uses and requires.
Thus, those errors should only occur if someone connects to you with a
modified iroh endpoint or with a plain QUIC client.
-Sourcepub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError>
Returns the EndpointId from the peer’s TLS certificate.
+Sourcepub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError>
Returns the EndpointId from the peer’s TLS certificate.
The PublicKey of an endpoint is also known as an EndpointId. This PublicKey is
included in the TLS certificate presented during the handshake when connecting.
This function allows you to get the EndpointId of the remote endpoint of this
connection.
-Source§impl Connection<OutgoingZeroRtt>
Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
+Sourcepub async fn handshake_completed(
&self,
) -> Result<ZeroRttStatus, ConnectingError>
Waits until the full handshake occurs and returns a ZeroRttStatus.
-If ZeroRttStatus::Accepted is returned, than any streams created before
+
If ZeroRttStatus::Accepted is returned, then any streams created before
the handshake has completed can still be used.
-If ZeroRttStatus::Rejected is returned, than any streams created before
+
If ZeroRttStatus::Rejected is returned, then any streams created before
the handshake will error and any data sent should be re-sent on a
new stream.
This may fail with ConnectingError::ConnectionError, if there was
@@ -171,7 +172,7 @@ doesn’t use the right TLS authentication, which usually every iroh endpoint
uses and requires.
Thus, those errors should only occur if someone connects to you with a
modified iroh endpoint or with a plain QUIC client.
-Sourcepub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError>
Returns the EndpointId from the peer’s TLS certificate.
+Sourcepub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError>
Returns the EndpointId from the peer’s TLS certificate.
The PublicKey of an endpoint is also known as an EndpointId. This PublicKey is
included in the TLS certificate presented during the handshake when connecting.
This function allows you to get the EndpointId of the remote endpoint of this
diff --git a/pr/4036/docs/iroh/endpoint/struct.Endpoint.html b/pr/4036/docs/iroh/endpoint/struct.Endpoint.html
index cfd63c979e..0c6c2630b7 100644
--- a/pr/4036/docs/iroh/endpoint/struct.Endpoint.html
+++ b/pr/4036/docs/iroh/endpoint/struct.Endpoint.html
@@ -13,7 +13,7 @@ behaviour.
Endpoint::connect and Endpoint::accept methods. Once established, the
Connection gives access to most QUIC features. Individual streams to send data to
the peer are created using the Connection::open_bi, Connection::accept_bi,
-Connection::open_uni and Connection::open_bi functions.
+Connection::open_uni and Connection::accept_uni 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.
§Usage on Android
@@ -22,7 +22,7 @@ through JNI, which needs a JVM context published to DnsResolver for the supported
initialization paths.
-Implementations§
Source§impl Endpoint
Implementations§
Source§impl Endpoint
Sourcepub fn set_alpns(&self, alpns: Vec<Vec<u8>>)
Sets the list of accepted ALPN protocols.
This will only affect new incoming connections.
@@ -117,8 +117,8 @@ changes.
understand if the endpoint has ever been considered “online”. But after
that initial call to Endpoint::online, to understand if your
endpoint is no longer able to be connected to by endpoints outside
-of the private or local network, watch for changes in it’s EndpointAddr.
-If there are no addrsin the EndpointAddr, you may not be dialable by other endpoints
+of the private or local network, watch for changes in its EndpointAddr.
+If there are no addrs in the EndpointAddr, you may not be dialable by other endpoints
on the internet.
The EndpointAddr will change as:
@@ -146,7 +146,7 @@ tokio::spawn(endpoint_closed.run_until(async move {
}));
// Do fancy things, then close the endpoint.
// Our task above will stop even if there are still clones of `Endpoint` alive somewhere.
-endpoint.close().await;
Sourcepub async fn online(&self)
A convenience method that waits for the endpoint to be considered “online”.
This currently means at least one relay server has completed its
connection handshake (i.e. the endpoint is registered and reachable
via that relay). Merely selecting a relay URL is not sufficient.
@@ -167,49 +167,45 @@ entirely.
The online method does not interact with crate::address_lookup::AddressLookup
services, which means that any Address Lookup that relies on a WAN
connection is independent of the endpoint’s online status.
-§Examples
use iroh::Endpoint;
-
-#[tokio::main]
-async fn main() {
-// After this await returns, the endpoint is bound to a local socket.
-// It can be dialed, but almost certainly hasn't finished picking a
+§Examples
+// After this await returns, the endpoint is bound to a local socket.
+// It can be dialed, but almost certainly hasn't finished picking a
// relay.
-let endpoint = Endpoint::bind().await;
+let endpoint = Endpoint::bind(presets::N0).await?;
-// After this await returns we have a connection to at least one relay
+// After this await returns we have a connection to at least one relay
// and holepunching should work as expected.
-endpoint.online().await;
-}
Sourcepub fn home_relay_status(
+endpoint.online().await;
Sourcepub fn home_relay_status(
&self,
) -> impl Watcher<Value = Vec<RelayStatus>> + use<>
Returns a Watcher over the connection status of the endpoint’s home relays.
The watched value has one entry per home relay whose URL is known,
and is empty when no relays are configured or before the endpoint has
-selected one the home relay from the list of configured relays.
+selected a home relay from the list of configured relays.
The watcher updates whenever any home relay’s connection status changes.
See RelayStatus for the information available on each entry.
The returned watcher only becomes disconnected once the last clone of
the Endpoint is dropped. Closing the endpoint does not disconnect
the watcher. To stop a task once the endpoint stops, combine with
Self::closed.
-Sourcepub fn bound_sockets(&self) -> Vec<SocketAddr>
Available on non-wasm_browser only.
Returns the local socket addresses on which the underlying sockets are bound.
+Sourcepub fn bound_sockets(&self) -> Vec<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 dns_resolver(&self) -> Result<&DnsResolver, EndpointError>
Available on non-wasm_browser only.
Returns the DNS resolver used in this Endpoint.
+Sourcepub fn dns_resolver(&self) -> Result<&DnsResolver, EndpointError>
Available on non-wasm_browser only.
Sourcepub fn tls_config(&self) -> &ClientConfig
Returns the [rustls::ClientConfig] used by the endpoint for connecting to external services.
+Sourcepub fn tls_config(&self) -> &ClientConfig
Returns the [rustls::ClientConfig] used by the endpoint for connecting to external services.
This might be useful for address lookup services or other functions
that want to use the same trust anchors as iroh does for verifying the
validity of TLS certificates presented by external services.
Note that this TLS config is unrelated to how iroh validates the authenticity
of iroh connections itself.
The config is based on the trust anchors set via Builder::ca_tls_config.
-Sourcepub fn address_lookup(&self) -> Result<&AddressLookupServices, EndpointError>
Returns the Address Lookup service, if configured.
+Sourcepub fn address_lookup(&self) -> Result<&AddressLookupServices, EndpointError>
Returns the Address Lookup service, if configured.
§Errors
Returns a EndpointError::Closed error if the endpoint is closed.
-Sourcepub fn metrics(&self) -> &EndpointMetrics
Available on crate feature metrics only.
Returns metrics collected for this endpoint.
+Sourcepub fn metrics(&self) -> &EndpointMetrics
Available on crate feature metrics only.
Returns metrics collected for this endpoint.
The endpoint internally collects various metrics about its operation.
The returned EndpointMetrics struct contains all of these metrics.
You can access individual metrics directly by using the public fields:
@@ -275,13 +271,13 @@ registry.write().unwrap().register_all(endpoint.metrics());
.std_context("text")?;
assert!(res.contains(r#"TYPE socket_recv_datagrams counter"#));
-assert!(res.contains(r#"socket_recv_datagrams_total 0"#));Sourcepub async fn remote_info(&self, endpoint_id: EndpointId) -> Option<RemoteInfo>
Returns addressing information about a recently used remote endpoint.
+assert!(res.contains(r#"socket_recv_datagrams_total 0"#));Sourcepub async fn remote_info(&self, endpoint_id: EndpointId) -> Option<RemoteInfo>
Returns addressing information about a recently used remote endpoint.
The returned RemoteInfo contains a list of all transport addresses for the remote
that we know about. This is a snapshot in time and not a watcher.
Returns None if the endpoint doesn’t have information about the remote or if the endpoint is closed.
When remote endpoints are no longer used, our endpoint will keep information around
for a little while, and then drop it. Afterwards, this will return None.
-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
@@ -290,14 +286,14 @@ 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.
If the endpoint is closed, this method will log a warning and ignore the request.
-Sourcepub fn set_user_data_for_address_lookup(&self, user_data: Option<UserData>)
Sets the initial user-defined data to be published in Address Lookups for this endpoint.
+Sourcepub fn set_user_data_for_address_lookup(&self, user_data: Option<UserData>)
Sets the initial user-defined data to be published in Address Lookups for this endpoint.
If the user-defined data passed to this function is different to the previous one,
the endpoint will republish its endpoint info to the configured Address Lookups.
See also Builder::user_data_for_address_lookup for setting an initial value when
building the endpoint.
If the endpoint is closed, this method will log a warning and ignore the
request.
-Sourcepub async fn close(&self)
Closes the QUIC endpoint and the 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.
@@ -322,9 +318,9 @@ sockets. This is due to QUIC and its acknowledgments being implemented in user-l
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.
-Sourcepub fn closed(&self) -> EndpointClosed ⓘ
Returns a future that resolves once the endpoint closes.
+the respective Endpoint are dropped.
+Sourcepub fn closed(&self) -> EndpointClosed ⓘ
Returns a future that resolves once the endpoint closes.
The returned future does not contain a clone or reference to the Endpoint,
so keeping the returned future alive does not prevent the endpoint from being dropped.
To run a task and stop it once the endpoint closes, you can use
@@ -333,7 +329,7 @@ so keeping the returned future alive does not prevent the endpoint from being dr
let endpoint = Endpoint::bind(presets::N0).await?;
tokio::spawn(endpoint.closed().run_until(async move {
// the future will be aborted once the endpoint closes.
-}));
Sourcepub fn create_server_config_builder(
+}));
Sourcepub fn create_server_config_builder(
&self,
alpns: Vec<Vec<u8>>,
) -> ServerConfigBuilder
Create a ServerConfigBuilder for this endpoint that includes the given alpns.
diff --git a/pr/4036/docs/iroh/endpoint/struct.EndpointClosed.html b/pr/4036/docs/iroh/endpoint/struct.EndpointClosed.html
index 85b8fd921b..1a2b9e3683 100644
--- a/pr/4036/docs/iroh/endpoint/struct.EndpointClosed.html
+++ b/pr/4036/docs/iroh/endpoint/struct.EndpointClosed.html
@@ -1,9 +1,9 @@
-EndpointClosed in iroh::endpoint - Rust EndpointClosed
pub struct EndpointClosed { /* private fields */ }
Expand description
Future returned from Endpoint::closed.
-Implementations§
Source§impl EndpointClosed
Sourcepub async fn run_until<F: Future>(self, fut: F) -> Option<F::Output>
Runs a future to completion, or until the Endpoint is closed.
+EndpointClosed in iroh::endpoint - Rust EndpointClosed
pub struct EndpointClosed { /* private fields */ }
Expand description
Future returned from Endpoint::closed.
+Implementations§
Trait Implementations§
Source§impl Debug for EndpointClosed
Source§impl Future for EndpointClosed
Source§impl<'pin> Unpin for EndpointClosedwhere
+
Trait Implementations§
Source§impl Debug for EndpointClosed
Source§impl Future for EndpointClosed
Source§impl<'pin> Unpin for EndpointClosedwhere
PinnedFieldsOf<__EndpointClosed<'pin>>: Unpin,
Auto Trait Implementations§
§impl !Freeze for EndpointClosed
§impl !RefUnwindSafe for EndpointClosed
§impl Send for EndpointClosed
§impl Sync for EndpointClosed
§impl !UnwindSafe for EndpointClosed
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/4036/docs/iroh/endpoint/struct.Incoming.html b/pr/4036/docs/iroh/endpoint/struct.Incoming.html
index d0a2c29af8..eca1097eca 100644
--- a/pr/4036/docs/iroh/endpoint/struct.Incoming.html
+++ b/pr/4036/docs/iroh/endpoint/struct.Incoming.html
@@ -24,7 +24,7 @@ to customize a Sourcepub fn remote_addr_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_addr().
-Sourcepub fn decrypt(&self) -> Option<DecryptedInitial>
Decrypt the Initial packet payload
+Sourcepub fn decrypt(&self) -> Option<DecryptedInitial>
Decrypts the Initial packet payload.
This clones and decrypts the packet payload (~1200 bytes).
Can be used to extract information from the TLS ClientHello without completing the handshake.
Trait Implementations§
Source§impl IntoFuture for Incoming
Source§type Output = Result<Connection, ConnectingError>
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§
Source§impl<T> Any for Twhere
diff --git a/pr/4036/docs/iroh/endpoint/struct.QuicTransportConfigBuilder.html b/pr/4036/docs/iroh/endpoint/struct.QuicTransportConfigBuilder.html
index 3a193bd40a..5189f21509 100644
--- a/pr/4036/docs/iroh/endpoint/struct.QuicTransportConfigBuilder.html
+++ b/pr/4036/docs/iroh/endpoint/struct.QuicTransportConfigBuilder.html
@@ -136,7 +136,7 @@ enable multipath as well.
If the path is idle for this long the path will be abandoned. Bear in mind this will
interact with the QuicTransportConfigBuilder::max_idle_timeout, if the last path is
abandoned the entire connection will be closed.
-Note: values higher than [PATH_MAX_IDLE_TIMEOUT] are clamped and a warning is logged.
+Note: values higher than PATH_MAX_IDLE_TIMEOUT (15 seconds) are clamped and a warning is logged.
Sourcepub fn default_path_keep_alive_interval(self, interval: Duration) -> Self
Sets a default per-path keep alive interval.
Note that this does not interact with the connection-wide
QuicTransportConfigBuilder::keep_alive_interval. This setting will keep this path active,
diff --git a/pr/4036/docs/iroh/endpoint/struct.RelayStatus.html b/pr/4036/docs/iroh/endpoint/struct.RelayStatus.html
index 175b637f76..a1abba7e98 100644
--- a/pr/4036/docs/iroh/endpoint/struct.RelayStatus.html
+++ b/pr/4036/docs/iroh/endpoint/struct.RelayStatus.html
@@ -1,13 +1,13 @@
-
RelayStatus in iroh::endpoint - Rust RelayStatus
pub struct RelayStatus { /* private fields */ }
Expand description
Connection status of a single home relay.
+RelayStatus in iroh::endpoint - Rust RelayStatus
pub struct RelayStatus { /* private fields */ }
Expand description
Connection status of a single home relay.
Observed via Endpoint::home_relay_status.
-Implementations§
Source§impl RelayStatus
Sourcepub fn is_connected(&self) -> bool
Returns true if the endpoint is connected to the relay.
-Sourcepub fn last_error(&self) -> Option<&AnyError>
Returns the most recent connection error, if the relay is currently
+
Implementations§
Source§impl RelayStatus
Sourcepub fn is_connected(&self) -> bool
Returns true if the endpoint is connected to the relay.
+Sourcepub fn last_error(&self) -> Option<&AnyError>
Returns the most recent connection error, if the relay is currently
disconnected.
Returns None when the relay is connected, or when the endpoint has
not yet observed a failed connection attempt.
-Trait Implementations§
Source§impl Clone for RelayStatus
Source§fn clone(&self) -> RelayStatus
Returns a duplicate 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 RelayStatus
Source§impl PartialEq for RelayStatus
Source§impl Eq for RelayStatus
Source§impl StructuralPartialEq for RelayStatus
Auto Trait Implementations§
§impl Freeze for RelayStatus
§impl !RefUnwindSafe for RelayStatus
§impl Send for RelayStatus
§impl Sync for RelayStatus
§impl Unpin for RelayStatus
§impl !UnwindSafe for RelayStatus
Blanket Implementations§
Trait Implementations§
Source§impl Clone for RelayStatus
Source§fn clone(&self) -> RelayStatus
Returns a duplicate 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 RelayStatus
Source§impl PartialEq for RelayStatus
Source§impl Eq for RelayStatus
Source§impl StructuralPartialEq for RelayStatus
Auto Trait Implementations§
§impl Freeze for RelayStatus
§impl !RefUnwindSafe for RelayStatus
§impl Send for RelayStatus
§impl Sync for RelayStatus
§impl Unpin for RelayStatus
§impl !UnwindSafe for RelayStatus
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/4036/docs/iroh/endpoint/struct.VarInt.html b/pr/4036/docs/iroh/endpoint/struct.VarInt.html
index 0acf99654d..007540d1af 100644
--- a/pr/4036/docs/iroh/endpoint/struct.VarInt.html
+++ b/pr/4036/docs/iroh/endpoint/struct.VarInt.html
@@ -13,7 +13,7 @@ An integer less than 2^62
of overflowing.
Trait Implementations§
§impl From<VarInt> for IdleTimeout
§fn from(inner: VarInt) -> IdleTimeout
Converts to this type from the input type.§impl From<VarInt> for IdleTimeout
§fn from(inner: VarInt) -> IdleTimeout
Converts to this type from the input type.§impl Ord for VarInt
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
diff --git a/pr/4036/docs/iroh/endpoint/struct.WeakConnectionHandle.html b/pr/4036/docs/iroh/endpoint/struct.WeakConnectionHandle.html
index 47f6c23610..07bad208d7 100644
--- a/pr/4036/docs/iroh/endpoint/struct.WeakConnectionHandle.html
+++ b/pr/4036/docs/iroh/endpoint/struct.WeakConnectionHandle.html
@@ -1,18 +1,18 @@
-WeakConnectionHandle in iroh::endpoint - Rust WeakConnectionHandle
pub struct WeakConnectionHandle { /* private fields */ }
Expand description
A weak handle to a Connection.
+WeakConnectionHandle in iroh::endpoint - Rust WeakConnectionHandle
pub struct WeakConnectionHandle { /* private fields */ }
Expand description
A weak handle to a Connection.
A WeakConnectionHandle does not keep the connection alive: holding one will not
prevent the connection from being closed when the last Connection handle is dropped.
Use upgrade to obtain a strong Connection, and closed to wait for the
connection to be closed without keeping it alive.
-Implementations§
Source§impl WeakConnectionHandle
Sourcepub fn upgrade(&self) -> Option<Connection>
Attempts to upgrade this weak handle to a strong Connection.
+Implementations§
Source§impl WeakConnectionHandle
Sourcepub fn upgrade(&self) -> Option<Connection>
Attempts to upgrade this weak handle to a strong Connection.
Returns None if the connection has already been dropped.
-Sourcepub fn closed(&self) -> impl Future<Output = Option<Closed>> + Send + 'static
Returns a future that resolves once the connection has been closed.
+Sourcepub fn closed(&self) -> impl Future<Output = Option<Closed>> + Send + 'static
Returns a future that resolves once the connection has been closed.
If no strong references to the Connection exist at the time this is called,
the future resolves to None. If at least one strong reference still exists at
the time of this call, the returned future is guaranteed to receive the close
event with the close reason and final connection statistics, even if all strong
references are dropped before the future is awaited.
The future does not keep the connection alive.
-Trait Implementations§
Source§impl Clone for WeakConnectionHandle
Source§fn clone(&self) -> WeakConnectionHandle
Returns a duplicate 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 WeakConnectionHandle
§impl !RefUnwindSafe for WeakConnectionHandle
§impl Send for WeakConnectionHandle
§impl Sync for WeakConnectionHandle
§impl Unpin for WeakConnectionHandle
§impl !UnwindSafe for WeakConnectionHandle
Blanket Implementations§
Trait Implementations§
Source§impl Clone for WeakConnectionHandle
Source§fn clone(&self) -> WeakConnectionHandle
Returns a duplicate 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 WeakConnectionHandle
§impl !RefUnwindSafe for WeakConnectionHandle
§impl Send for WeakConnectionHandle
§impl Sync for WeakConnectionHandle
§impl Unpin for WeakConnectionHandle
§impl !UnwindSafe for WeakConnectionHandle
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/4036/docs/iroh/endpoint/trait.EndpointHooks.html b/pr/4036/docs/iroh/endpoint/trait.EndpointHooks.html
index 2ac883dd5d..90c7ff04fc 100644
--- a/pr/4036/docs/iroh/endpoint/trait.EndpointHooks.html
+++ b/pr/4036/docs/iroh/endpoint/trait.EndpointHooks.html
@@ -17,7 +17,7 @@
For each hook, all installed hooks are invoked in the order they were installed on
the endpoint builder. If a hook returns Accept, processing continues with the next
hook. If a hook returns Reject, processing is aborted and further hooks
-are not invoked for this hook.
+are not invoked for this hook point.
§Notes to implementers
As hooks are stored on the endpoint, you must make sure to never store an Endpoint
on the hook struct itself, as this would create reference counting loop and cause the
diff --git a/pr/4036/docs/iroh/endpoint_info/index.html b/pr/4036/docs/iroh/endpoint_info/index.html
index f27fe3b898..4a60b9fd8f 100644
--- a/pr/4036/docs/iroh/endpoint_info/index.html
+++ b/pr/4036/docs/iroh/endpoint_info/index.html
@@ -1,11 +1,11 @@
iroh::endpoint_info - Rust Module endpoint_info
Expand description
Support for handling DNS resource records for dialing by EndpointId.
Dialing by EndpointId is supported by iroh endpoints publishing Pkarr records to DNS
servers or the Mainline DHT. This module supports creating and parsing these records.
-EndpointInfo combines an iroh_base::EndpointId with EndpointData —
+
EndpointInfo combines an iroh_base::EndpointId with EndpointData:
the addressing and metadata that discovery services publish and resolve.
Discovery services use AddrFilter to control which addresses are published.
This module also provides serialization to and from pkarr signed packets and
-DNS TXT records. See the [crate::attrs] module for the on-the-wire format.
+DNS TXT records.
DNS records are published under the following names:
_iroh.<z32-endpoint-id>.<origin-domain> TXT
@@ -36,4 +36,4 @@ Each address is an IPv4 or IPv6 address with a port.
Structs§
- Addr
Filter - A filter and/or reordering function applied to transport addresses,
-typically used by AddressLookup services in iroh before publishing.
- Endpoint
Data - Data about an endpoint that may be published to and resolved from discovery services.
- Endpoint
Info - Information about an endpoint that may be published to and resolved from discovery services.
- MaxLength
ExceededError - Error returned when an input value is too long for
UserData. - User
Data - Under the hood this is a UTF-8 String is no longer than
UserData::MAX_LENGTH bytes.
\ No newline at end of file
+typically used by AddressLookup services in iroh before publishing.EndpointData Data about an endpoint that may be published to and resolved from discovery services. EndpointInfo Information about an endpoint that may be published to and resolved from discovery services. MaxLengthExceededError Error returned when an input value is too long for UserData. UserData User-defined data that can be published and resolved through endpoint discovery.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint_info/struct.EndpointData.html b/pr/4036/docs/iroh/endpoint_info/struct.EndpointData.html
index eaf2725892..2c818ea5b4 100644
--- a/pr/4036/docs/iroh/endpoint_info/struct.EndpointData.html
+++ b/pr/4036/docs/iroh/endpoint_info/struct.EndpointData.html
@@ -13,15 +13,15 @@ services, should they not fit into e.g. a single DNS packet otherwise.
See also Self::set_user_data.
Sourcepub fn add_relay_url(&mut self, relay_url: RelayUrl)
Adds the relay URL to the end of the endpoint data, unless it already existed.
Sourcepub fn add_ip_addrs(&mut self, addresses: Vec<SocketAddr>)
Adds addresses in order with duplicates or already existing addresses filtered out.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Adds addresses to the endpoint data in the given ordered, but with duplicates filtered.
-Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data and returns the updated endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Adds addresses to the endpoint data in the given order, but with duplicates filtered.
+Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data.
Sourcepub fn clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn clear_relay_urls(&mut self)
Removes all relay URLs from the endpoint data.
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses.
+Sourcepub fn filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
Returns a vec to allow re-ordering of addresses.
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
diff --git a/pr/4036/docs/iroh/endpoint_info/struct.UserData.html b/pr/4036/docs/iroh/endpoint_info/struct.UserData.html
index 3352480631..e73207e05e 100644
--- a/pr/4036/docs/iroh/endpoint_info/struct.UserData.html
+++ b/pr/4036/docs/iroh/endpoint_info/struct.UserData.html
@@ -1,4 +1,5 @@
-UserData in iroh::endpoint_info - Rust 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.
+UserData in iroh::endpoint_info - Rust UserData
pub struct UserData(/* private fields */);
Expand description
User-defined data that can be published and resolved through endpoint discovery.
+Under the hood this is a UTF-8 string 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.
diff --git a/pr/4036/docs/iroh/enum.KeyParsingError.html b/pr/4036/docs/iroh/enum.KeyParsingError.html
index 765ac27ad2..146ec05698 100644
--- a/pr/4036/docs/iroh/enum.KeyParsingError.html
+++ b/pr/4036/docs/iroh/enum.KeyParsingError.html
@@ -1,4 +1,4 @@
-KeyParsingError in iroh - Rust KeyParsingError
#[non_exhaustive]pub enum KeyParsingError {
+KeyParsingError in iroh - Rust KeyParsingError
#[non_exhaustive]pub enum KeyParsingError {
FailedToDecodeHex {
meta: Meta,
},
@@ -11,14 +11,14 @@
InvalidKeyData {
meta: Meta,
},
-}
Expand description
Error when deserialising a PublicKey or a SecretKey.
+}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§FailedToDecodeHex
The input string could not be decoded as hex.
Fields
§meta: MetaCaptured call-site metadata
§FailedToDecodeBase32
The input string could not be decoded as base32.
Fields
§meta: MetaCaptured call-site metadata
§InvalidLength
The input has invalid length.
Fields
§meta: MetaCaptured call-site metadata
-§InvalidKeyData
The decoded data is not a valid Ed25591 public key.
+§InvalidKeyData
The decoded data is not a valid Ed25519 public key.
Fields
§meta: MetaCaptured call-site metadata
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<KeyParsingError> for ParseError
Source§fn from(source: KeyParsingError) -> ParseError
Converts to this type from the input type.Source§impl StackError for KeyParsingError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<KeyParsingError>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Returns the next source in the chain, if any.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.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
diff --git a/pr/4036/docs/iroh/enum.TransportAddr.html b/pr/4036/docs/iroh/enum.TransportAddr.html
index df614a51ee..0e5f31d772 100644
--- a/pr/4036/docs/iroh/enum.TransportAddr.html
+++ b/pr/4036/docs/iroh/enum.TransportAddr.html
@@ -3,8 +3,8 @@
Ip(SocketAddr),
Custom(CustomAddr),
}Expand description
Available address types.
-Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§Relay(RelayUrl)
Relays
-§Ip(SocketAddr)
IP based addresses
+Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§Relay(RelayUrl)
A relay server address.
+§Ip(SocketAddr)
An IP based address.
§Custom(CustomAddr)
Custom transport address
Implementations§
Source§impl TransportAddr
Sourcepub fn is_ip(&self) -> bool
Whether this is an IP transport address.
diff --git a/pr/4036/docs/iroh/index.html b/pr/4036/docs/iroh/index.html
index a2ddd5617a..8c7bddcb16 100644
--- a/pr/4036/docs/iroh/index.html
+++ b/pr/4036/docs/iroh/index.html
@@ -1,5 +1,5 @@
iroh - Rust Crate iroh
Expand description
Peer-to-peer QUIC connections.
-iroh is a library to establish direct connectivity between peers. It exposes an
+
iroh is a library to establish direct connectivity between peers. It exposes an
interface to QUIC connections and streams to the user, while implementing direct
connectivity using hole punching complemented by relay servers under the hood.
An iroh endpoint is created and controlled by the Endpoint, e.g. connecting to
@@ -44,7 +44,7 @@ punching if needed. Once the direct connection is established the relay ser
longer involved in the connection.
If one of the iroh endpoints can be reached directly, connectivity can also be
established without involving a Relay server. This is done by using the endpoint’s
-listening addresses in the connection establishement instead of the RelayUrl which
+listening addresses in the connection establishment instead of the RelayUrl which
is used to identify a Relay server. Of course it is also possible to use both a
RelayUrl and direct addresses at the same time to connect.
§Encryption
@@ -179,4 +179,4 @@ connecting using only the Ok(())
}
Please see the examples directory for more nuanced examples.
-Re-exports§
Modules§
- address_
lookup - Lookup the address of an Endpoint ID.
- defaults
- Default values used in
iroh - dns
Non-wasm_browser - Configurable DNS resolver.
- endpoint
- The
Endpoint allows establishing connections to other iroh endpoints. - endpoint_
info - Support for handling DNS resource records for dialing by
EndpointId. - metrics
- Co-locating all of the iroh metrics structs
- protocol
- Tools for spawning an accept loop that routes incoming requests to the right protocol.
- test_
utils test-utils - Internal utilities to support testing.
- tls
- TLS configuration for iroh.
Structs§
- Endpoint
Addr - Network-level addressing information for an iroh endpoint.
- NetReport
- A net_report report.
- NetReport
Config - Configuration for the net report component.
- Public
Key - A public key.
- Relay
Config - Information on a specific relay server.
- Relay
Map - List of relay server configurations to be used in an iroh endpoint.
- Relay
Url - A URL identifying a relay server.
- Relay
UrlParseError - Can occur when parsing a string into a
RelayUrl. - Secret
Key - A secret key.
- Signature
- Ed25519 signature.
- Signature
Error - Verification of a signature failed.
Enums§
- KeyParsing
Error - Error when deserialising a
PublicKey or a SecretKey. - Transport
Addr - Available address types.
Constants§
- NET_
REPORT_TIMEOUT - The maximum amount of time, in seconds, the net_report will spend gathering a single report.
Traits§
- Watcher
- A handle to a value that’s represented by one or more underlying [
Watchable]s.
Type Aliases§
- Endpoint
Id - The identifier for an endpoint in the (iroh) network.
\ No newline at end of file
+Re-exports§
Modules§
- address_
lookup - Lookup the address of an Endpoint ID.
- defaults
- Default values used in
iroh - dns
Non-wasm_browser - Configurable DNS resolver.
- endpoint
- The
Endpoint allows establishing connections to other iroh endpoints. - endpoint_
info - Support for handling DNS resource records for dialing by
EndpointId. - metrics
- Co-locating all of the iroh metrics structs
- protocol
- Tools for spawning an accept loop that routes incoming requests to the right protocol.
- test_
utils test-utils - Internal utilities to support testing.
- tls
- TLS configuration for iroh.
Structs§
- Endpoint
Addr - Network-level addressing information for an iroh endpoint.
- NetReport
- A net_report report.
- NetReport
Config - Configuration for the net report component.
- Public
Key - A public key.
- Relay
Config - Information on a specific relay server.
- Relay
Map - List of relay server configurations to be used in an iroh endpoint.
- Relay
Url - A URL identifying a relay server.
- Relay
UrlParseError - Can occur when parsing a string into a
RelayUrl. - Secret
Key - A secret key.
- Signature
- Ed25519 signature.
- Signature
Error - Verification of a signature failed.
Enums§
- KeyParsing
Error - Error returned when parsing a
PublicKey or a SecretKey. - Transport
Addr - Available address types.
Constants§
- NET_
REPORT_TIMEOUT - The maximum amount of time, in seconds, the net_report will spend gathering a single report.
Traits§
- Watcher
- A handle to a value that’s represented by one or more underlying [
Watchable]s.
Type Aliases§
- Endpoint
Id - The identifier for an endpoint in the (iroh) network.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/metrics/index.html b/pr/4036/docs/iroh/metrics/index.html
index da53db7d6a..00f2275127 100644
--- a/pr/4036/docs/iroh/metrics/index.html
+++ b/pr/4036/docs/iroh/metrics/index.html
@@ -1,2 +1,2 @@
iroh::metrics - Rust Module metrics
Expand description
Co-locating all of the iroh metrics structs
-Structs§
- Endpoint
Metrics - Metrics collected by an
crate::endpoint::Endpoint. - NetReport
Metrics - Enum of metrics for the module
- Relay
Metrics test-utils - Metrics tracked for the relay server
- Socket
Metrics - Enum of metrics for the module
\ No newline at end of file
+Structs§
- Endpoint
Metrics - Metrics collected by an
crate::endpoint::Endpoint. - NetReport
Metrics - Enum of metrics for the module
- Relay
Metrics test-utils - Metrics tracked for the relay server
- Socket
Metrics - Metrics collected by the iroh socket.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/metrics/struct.RelayMetrics.html b/pr/4036/docs/iroh/metrics/struct.RelayMetrics.html
index f8768e50a1..da2588f738 100644
--- a/pr/4036/docs/iroh/metrics/struct.RelayMetrics.html
+++ b/pr/4036/docs/iroh/metrics/struct.RelayMetrics.html
@@ -26,21 +26,26 @@
pub http_connections_closed: Counter,
pub http_connections_errored: Counter,
}Available on crate feature test-utils only.Expand description
Metrics tracked for the relay server
-Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.§bytes_sent: CounterBytes sent from a FrameType::SendPacket
-§bytes_recv: CounterBytes received from a FrameType::SendPacket
-§send_packets_sent: CounterFrameType::SendPacket sent
-§send_packets_recv: CounterFrameType::SendPacket received
-§send_packets_dropped: CounterFrameType::SendPacket dropped
-§other_packets_sent: CounterPackets of other FrameTypes sent
-§other_packets_recv: CounterPackets of other FrameTypes received
-§other_packets_dropped: CounterPackets of other FrameTypes dropped
-§got_ping: CounterNumber of FrameType::Pings received
-§sent_pong: CounterNumber of FrameType::Pongs sent
-§unknown_frames: CounterNumber of FrameType::Unknown received
+Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.§bytes_sent: CounterBytes sent to a client in RelayToClientDatagram or RelayToClientDatagramBatch frames.
+§bytes_recv: CounterBytes received from a client in ClientToRelayDatagram or ClientToRelayDatagramBatch frames.
+§send_packets_sent: CounterRelayToClientDatagram or RelayToClientDatagramBatch frames sent to a client.
+§send_packets_recv: CounterClientToRelayDatagram or ClientToRelayDatagramBatch frames received from a client.
+§send_packets_dropped: CounterRelayToClientDatagram or RelayToClientDatagramBatch frames dropped instead of being
+delivered to a client, because the recipient is not connected or writing to its stream failed.
+Note that frames dropped because the recipient’s send queue is full or closed are not counted
+here.
+§other_packets_sent: CounterIntended to count sent frames other than datagrams, but currently unused (never incremented).
+§other_packets_recv: CounterIntended to count received frames other than datagrams, but currently unused (never incremented).
+§other_packets_dropped: CounterIntended to count dropped frames other than datagrams, but currently unused (never incremented).
+§got_ping: CounterNumber of FrameType::Ping frames received from a client.
+§sent_pong: CounterNumber of FrameType::Pong frames sent to a client.
+§unknown_frames: CounterIntended to count received frames with an unrecognized FrameType,
+but currently unused (never incremented).
§bytes_rx_ratelimited_total: CounterNumber of bytes received from client connection which have been rate-limited.
§conns_rx_ratelimited_total: CounterNumber of client connections which have had any frames rate-limited.
§accepts: CounterNumber of times this server has accepted a connection.
-§disconnects: CounterNumber of connections we have removed because of an error
+§disconnects: CounterNumber of times a client connection was disconnected.
+Incremented once per connection, paired with Self::accepts.
§unique_client_keys: CounterNumber of unique client keys per day
§clients_inactive_added: CounterNumber of times a client was moved into the inactive state.
A client becomes inactive when a new client connects with the same endpoint id. An inactive
diff --git a/pr/4036/docs/iroh/metrics/struct.SocketMetrics.html b/pr/4036/docs/iroh/metrics/struct.SocketMetrics.html
index 2291657920..f61d3786bb 100644
--- a/pr/4036/docs/iroh/metrics/struct.SocketMetrics.html
+++ b/pr/4036/docs/iroh/metrics/struct.SocketMetrics.html
@@ -1,4 +1,4 @@
-
SocketMetrics in iroh::metrics - Rust SocketMetrics
#[non_exhaustive]pub struct SocketMetrics {Show 31 fields
+SocketMetrics in iroh::metrics - Rust SocketMetrics
#[non_exhaustive]pub struct SocketMetrics {Show 31 fields
pub update_direct_addrs: Counter,
pub send_ipv4: Counter,
pub send_ipv6: Counter,
@@ -30,10 +30,23 @@
pub actor_tick_direct_addr_heartbeat: Counter,
pub actor_link_change: Counter,
pub actor_tick_other: Counter,
-}
Expand description
Enum of metrics for the module
-Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.§update_direct_addrs: Counter§send_ipv4: Counter§send_ipv6: Counter§send_relay: Counter§recv_data_relay: Counter§recv_data_custom: Counter§recv_data_ipv4: Counter§recv_data_ipv6: Counter§recv_datagrams: CounterNumber of QUIC datagrams received.
-§recv_gro_datagrams: CounterNumber of datagrams received using GRO
-§relay_home_change: Counter§holepunch_attempts: CounterThe number of times holepunching is initiated on a connection.
+}Expand description
Metrics collected by the iroh socket.
+Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.§update_direct_addrs: CounterIntended to count updates to the local direct address set, but currently unused
+(never incremented).
+§send_ipv4: CounterNumber of bytes sent over IPv4.
+§send_ipv6: CounterNumber of bytes sent over IPv6.
+§send_relay: CounterNumber of bytes sent over the relay transport.
+§recv_data_relay: CounterNumber of data bytes received over the relay transport.
+§recv_data_custom: CounterNumber of data bytes received over any custom transport.
+§recv_data_ipv4: CounterNumber of data bytes received over IPv4.
+§recv_data_ipv6: CounterNumber of data bytes received over IPv6.
+§recv_datagrams: CounterNumber of QUIC datagrams received.
+§recv_gro_datagrams: CounterNumber of receive events that used GRO (coalesced datagram batches).
+This counts batches, not the individual datagrams within them. See
+Self::recv_datagrams for the datagram count.
+§relay_home_change: CounterNumber of times the home relay changed to a different relay.
+This includes the initial assignment from no home relay to a home relay.
+§holepunch_attempts: CounterThe number of times holepunching is initiated on a connection.
This can be incremented multiple times for a single connection. Note that only the
client-side of a connection will increment this counter.
§paths_direct: CounterThe number of network paths to peers that are direct.
@@ -53,8 +66,15 @@ the number of opened connections.
§transport_relay_paths_removed: CounterNumber of relay transport paths closed.
§transport_custom_paths_added: CounterNumber of custom transport paths opened.
§transport_custom_paths_removed: CounterNumber of custom transport paths closed.
-§actor_tick_main: Counter§actor_tick_msg: Counter§actor_tick_re_stun: Counter§actor_tick_portmap_changed: Counter§actor_tick_direct_addr_heartbeat: Counter§actor_link_change: Counter§actor_tick_other: CounterTrait Implementations§
Source§impl<'de> Deserialize<'de> for Metrics
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Iterable for Metrics
Source§fn metric_field_count(&self) -> usize
Returns the number of metric fields in the struct.Source§fn metric_field_ref(&self, n: usize) -> Option<MetricItem<'_>>
Returns the metric field at the given index.§fn family_field_count(&self) -> usize
Returns the number of Family fields in the struct.§fn family_field_ref(&self, _n: usize) -> Option<FamilyItem<'_>>
Returns the Family field at the given index.Source§impl Serialize for Metrics
Source§fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where
+§actor_tick_main: CounterNumber of iterations of the main socket actor loop.
+§actor_tick_msg: CounterNumber of actor messages processed by the socket actor loop.
+§actor_tick_re_stun: CounterNumber of periodic re-STUN timer ticks handled by the socket actor loop.
+§actor_tick_portmap_changed: CounterNumber of port-mapping change events handled by the socket actor loop.
+§actor_tick_direct_addr_heartbeat: CounterIntended to count direct address heartbeat ticks, but currently unused (never incremented).
+§actor_link_change: CounterNumber of local network interface (link) change events handled by the socket actor loop.
+§actor_tick_other: CounterNumber of times an input watcher or receiver closed in the socket actor loop.
+Trait Implementations§
Source§impl<'de> Deserialize<'de> for Metrics
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Iterable for Metrics
Source§fn metric_field_count(&self) -> usize
Returns the number of metric fields in the struct.Source§fn metric_field_ref(&self, n: usize) -> Option<MetricItem<'_>>
Returns the metric field at the given index.§fn family_field_count(&self) -> usize
Returns the number of Family fields in the struct.§fn family_field_ref(&self, _n: usize) -> Option<FamilyItem<'_>>
Returns the Family field at the given index.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
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/4036/docs/iroh/protocol/enum.IncomingFilterOutcome.html b/pr/4036/docs/iroh/protocol/enum.IncomingFilterOutcome.html
index e11345eddc..4577fe8eaf 100644
--- a/pr/4036/docs/iroh/protocol/enum.IncomingFilterOutcome.html
+++ b/pr/4036/docs/iroh/protocol/enum.IncomingFilterOutcome.html
@@ -11,7 +11,7 @@ the source address, actively refuse the connection, or silently drop it.
What this does depends on the connection type:
-
-
Direct (UDP) connections : this is QUIC source address
+
Direct (UDP) connections: this is QUIC source address
validation. If the socket address was spoofed, the retry token is
sent to the spoofed address, so we never hear from the attacker
again. If the address was real, the client repeats the connection
@@ -20,7 +20,7 @@ attempt with the token, and the next
-
-
Relay connections : there is no source address to validate
+
Relay connections: there is no source address to validate
(the relay already vouches for the packet origin), so the
“validation” itself has no security meaning. However, the retry
still imposes a real cost on the client: an extra round trip
diff --git a/pr/4036/docs/iroh/protocol/struct.RouterBuilder.html b/pr/4036/docs/iroh/protocol/struct.RouterBuilder.html
index dfc8969679..06b2f59fad 100644
--- a/pr/4036/docs/iroh/protocol/struct.RouterBuilder.html
+++ b/pr/4036/docs/iroh/protocol/struct.RouterBuilder.html
@@ -16,7 +16,7 @@ cheaper signals (e.g. remote address) first.
with this alpn.
handler can either be a type that implements ProtocolHandler or a
Box<dyn DynProtocolHandler>.
-
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for RouterBuilder
§impl !RefUnwindSafe for RouterBuilder
§impl Send for RouterBuilder
§impl Sync for RouterBuilder
§impl Unpin for RouterBuilder
§impl !UnwindSafe for RouterBuilder
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/4036/docs/iroh/struct.EndpointAddr.html b/pr/4036/docs/iroh/struct.EndpointAddr.html
index 0aa53df633..867818d655 100644
--- a/pr/4036/docs/iroh/struct.EndpointAddr.html
+++ b/pr/4036/docs/iroh/struct.EndpointAddr.html
@@ -5,7 +5,7 @@
This combines an endpoint’s identifier with network-level addressing information of how to
contact the endpoint.
To establish a network connection to an endpoint both the EndpointId and one or more network
-paths are needed. The network paths can come from various sources, current sources can come from
+paths are needed. The network paths can come from various sources:
-
An Address Lookup service which can provide routing information for a given EndpointId.
@@ -24,7 +24,7 @@ connection without the help of a Fields§§id: PublicKeyThe endpoint’s identifier.
-§addrs: BTreeSet<TransportAddr>The endpoint’s addresses
+§addrs: BTreeSet<TransportAddr>The endpoint’s addresses.
Implementations§
Source§impl EndpointAddr
Sourcepub fn new(id: PublicKey) -> EndpointAddr
Creates a new EndpointAddr with no network level addresses.
This still is usable with e.g. an address lookup service to establish a connection,
depending on the situation.
@@ -38,9 +38,9 @@ depending on the situation.
self,
addrs: impl IntoIterator<Item = TransportAddr>,
) -> EndpointAddrAdds a list of addresses.
-Sourcepub fn is_empty(&self) -> bool
Returns true, if only a EndpointId is present.
-Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns a list of IP addresses of this peer.
-Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns a list of relay urls of this peer.
+Sourcepub fn is_empty(&self) -> bool
Returns true if only an EndpointId is present.
+Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns an iterator over the IP addresses of this endpoint address.
+Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns an iterator over the relay URLs of this endpoint address.
In practice this is expected to be zero or one home relay for all known cases currently.
Trait Implementations§
Source§impl Clone for EndpointAddr
Source§fn clone(&self) -> EndpointAddr
Returns a duplicate 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 EndpointAddr
Source§impl<'de> Deserialize<'de> for EndpointAddr
Source§fn deserialize<__D>(
__deserializer: __D,
diff --git a/pr/4036/docs/iroh/struct.NetReport.html b/pr/4036/docs/iroh/struct.NetReport.html
index 693c855529..8b8ec1aed1 100644
--- a/pr/4036/docs/iroh/struct.NetReport.html
+++ b/pr/4036/docs/iroh/struct.NetReport.html
@@ -1,4 +1,4 @@
-NetReport in iroh - Rust NetReport
pub struct NetReport {
+NetReport in iroh - Rust NetReport
pub struct NetReport {
pub udp_v4: bool,
pub udp_v6: bool,
pub mapping_varies_by_dest_ipv4: Option<bool>,
@@ -13,17 +13,16 @@
§udp_v6: boolA QAD IPv6 round trip completed.
§mapping_varies_by_dest_ipv4: Option<bool>Whether the reported public address differs when probing different servers (on IPv4).
§mapping_varies_by_dest_ipv6: Option<bool>Whether the reported public address differs when probing different servers (on IPv6).
-§preferred_relay: Option<RelayUrl>Probe indicating the presence of port mapping protocols on the LAN.
-None for unknown
-§relay_latency: RelayLatencieskeyed by relay Url
-§global_v4: Option<SocketAddrV4>ip:port of global IPv4
-§global_v6: Option<SocketAddrV6>[ip]:port of global IPv6
+§preferred_relay: Option<RelayUrl>The relay server with the lowest latency, if any.
+§relay_latency: RelayLatenciesThe measured latency to each relay, keyed by relay URL.
+§global_v4: Option<SocketAddrV4>The discovered global IPv4 address and port, if any.
+§global_v6: Option<SocketAddrV6>The discovered global IPv6 address and port, if any.
§captive_portal: Option<bool>CaptivePortal is set when we think there’s a captive portal that is
intercepting HTTP traffic.
-Implementations§
Source§impl Report
Sourcepub fn mapping_varies_by_dest(&self) -> Option<bool>
Whether the reported public address differs when probing different servers.
+Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Report
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl PartialEq for Report
Source§impl Eq for Report
Source§impl StructuralPartialEq for Report
Auto Trait Implementations§
§impl Freeze for Report
§impl RefUnwindSafe for Report
§impl Send for Report
§impl Sync for Report
§impl Unpin for Report
§impl UnwindSafe for Report
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/4036/docs/iroh/struct.PublicKey.html b/pr/4036/docs/iroh/struct.PublicKey.html
index f8fb4c5ae2..b725772ddc 100644
--- a/pr/4036/docs/iroh/struct.PublicKey.html
+++ b/pr/4036/docs/iroh/struct.PublicKey.html
@@ -1,5 +1,5 @@
PublicKey in iroh - Rust PublicKey
pub struct PublicKey(/* private fields */);
Expand description
A public key.
-The key itself is stored as the CompressedEdwards y coordinate of the public key
+
The key itself is stored as the CompressedEdwards y-coordinate of the public key.
It is verified to decompress into a valid key when created.
Implementations§
Source§impl PublicKey
Sourcepub fn as_bytes(&self) -> &[u8; 32]
Get this public key as a byte array.
@@ -12,7 +12,7 @@ See [VerifyingKey::from_bytes] for details.
&self,
message: &[u8],
signature: &Signature,
-) -> Result<(), SignatureError>Verify a signature on a message with this secret key’s public key.
+) -> Result<(), SignatureError>Verify a signature on a message with this public key.
§Return
Returns Ok(()) if the signature is valid, and Err otherwise.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PublicKey
Source§fn deserialize<D>(
deserializer: D,
) -> Result<PublicKey, <D as Deserializer<'de>>::Error>where
- D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl From<PublicKey> for EndpointAddr
Source§fn from(endpoint_id: PublicKey) -> EndpointAddr
Converts to this type from the input type.Source§impl From<PublicKey> for EndpointAddr
Source§fn from(endpoint_id: PublicKey) -> EndpointAddr
Converts to this type from the input type.Source§impl FromStr for PublicKey
Parses a PublicKey from its hex or base32 encoding.
+
Display produces the hex encoding.
Source§impl Hash for PublicKey
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
H: Hasher,
diff --git a/pr/4036/docs/iroh/tls/index.html b/pr/4036/docs/iroh/tls/index.html
index 3c1d92cf2a..16f63b088e 100644
--- a/pr/4036/docs/iroh/tls/index.html
+++ b/pr/4036/docs/iroh/tls/index.html
@@ -1,5 +1,5 @@
iroh::tls - Rust Module tls
Expand description
TLS configuration for iroh.
-Currently there is one mechanisms available
+Currently there is one mechanism available:
- Raw Public Keys, using the TLS extension described in RFC 7250
diff --git a/pr/4036/docs/iroh_base/enum.KeyParsingError.html b/pr/4036/docs/iroh_base/enum.KeyParsingError.html
index d0668a511c..7c849cddf2 100644
--- a/pr/4036/docs/iroh_base/enum.KeyParsingError.html
+++ b/pr/4036/docs/iroh_base/enum.KeyParsingError.html
@@ -1,4 +1,4 @@
-KeyParsingError in iroh_base - Rust KeyParsingError
#[non_exhaustive]pub enum KeyParsingError {
+KeyParsingError in iroh_base - Rust KeyParsingError
#[non_exhaustive]pub enum KeyParsingError {
FailedToDecodeHex {
meta: Meta,
},
@@ -11,14 +11,14 @@
InvalidKeyData {
meta: Meta,
},
-}
Available on crate feature key only.Expand description
Error when deserialising a PublicKey or a SecretKey.
+}Available on crate feature key only.Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§FailedToDecodeHex
The input string could not be decoded as hex.
Fields
§meta: MetaCaptured call-site metadata
§FailedToDecodeBase32
The input string could not be decoded as base32.
Fields
§meta: MetaCaptured call-site metadata
§InvalidLength
The input has invalid length.
Fields
§meta: MetaCaptured call-site metadata
-§InvalidKeyData
The decoded data is not a valid Ed25591 public key.
+§InvalidKeyData
The decoded data is not a valid Ed25519 public key.
Fields
§meta: MetaCaptured call-site metadata
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<KeyParsingError> for AnyError
Source§fn from(value: KeyParsingError) -> AnyError
Converts to this type from the input type.Source§impl StackError for KeyParsingError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
Returns the next source in the chain, if any.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.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§
Source§impl<T> Borrow<T> for Twhere
diff --git a/pr/4036/docs/iroh_base/enum.TransportAddr.html b/pr/4036/docs/iroh_base/enum.TransportAddr.html
index ec9989aea4..a55428eb22 100644
--- a/pr/4036/docs/iroh_base/enum.TransportAddr.html
+++ b/pr/4036/docs/iroh_base/enum.TransportAddr.html
@@ -3,8 +3,8 @@
Ip(SocketAddr),
Custom(CustomAddr),
}Available on crate feature key only.Expand description
Available address types.
-Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§Relay(RelayUrl)
Relays
-§Ip(SocketAddr)
IP based addresses
+Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§Relay(RelayUrl)
A relay server address.
+§Ip(SocketAddr)
An IP based address.
§Custom(CustomAddr)
Custom transport address
Implementations§
Source§impl TransportAddr
PkarrResolver
pub struct PkarrResolver { /* private fields */ }Expand description
Resolver of address lookup information from a pkarr relay.
+PkarrResolver
pub struct PkarrResolver { /* private fields */ }Expand description
Resolver of address lookup information from a pkarr relay.
The resolver uses HTTP to query address lookup information from a pkarr relay server, see the module docs for details.
This implements the AddressLookup trait to be used as an address lookup service. Note
that it only resolves address lookup information, for the corresponding publisher use
the PkarrPublisher together with AddressLookupServices.
Implementations§
Source§impl PkarrResolver
impl PkarrResolver
Sourcepub fn builder(pkarr_relay: Url) -> PkarrResolverBuilder
pub fn builder(pkarr_relay: Url) -> PkarrResolverBuilder
Creates a new resolver builder using the pkarr relay server at the URL.
+Implementations§
Source§impl PkarrResolver
impl PkarrResolver
Sourcepub fn builder(pkarr_relay: Url) -> PkarrResolverBuilder
pub fn builder(pkarr_relay: Url) -> PkarrResolverBuilder
Creates a new resolver builder using the pkarr relay server at the URL.
The builder implements AddressLookupBuilder.
Sourcepub fn n0_dns() -> PkarrResolverBuilder
pub fn n0_dns() -> PkarrResolverBuilder
Creates a pkarr resolver builder which uses the number 0 pkarr relay server.
+Sourcepub fn n0_dns() -> PkarrResolverBuilder
pub fn n0_dns() -> PkarrResolverBuilder
Creates a pkarr resolver builder which uses the number 0 pkarr relay server.
This uses the pkarr relay server operated by number 0 at
N0_DNS_PKARR_RELAY_PROD.
When running with the environment variable IROH_FORCE_STAGING_RELAYS
set to any non empty value N0_DNS_PKARR_RELAY_STAGING
server is used instead.
Trait Implementations§
Source§impl AddressLookup for PkarrResolver
impl AddressLookup for PkarrResolver
Trait Implementations§
Source§impl AddressLookup for PkarrResolver
impl AddressLookup for PkarrResolver
Source§fn resolve(
&self,
endpoint_id: EndpointId,
-) -> Option<BoxStream<Result<AddressLookupItem, AddressLookupError>>>
fn resolve( &self, endpoint_id: EndpointId, -) -> Option<BoxStream<Result<AddressLookupItem, AddressLookupError>>>
Source§fn publish(&self, _data: &EndpointData)
fn publish(&self, _data: &EndpointData)
EndpointData to the Address Lookup mechanism. Read moreSource§impl Clone for PkarrResolver
impl Clone for PkarrResolver
Source§fn clone(&self) -> PkarrResolver
fn clone(&self) -> PkarrResolver
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 PkarrResolver
impl !RefUnwindSafe for PkarrResolver
impl Send for PkarrResolver
impl Sync for PkarrResolver
impl Unpin for PkarrResolver
impl !UnwindSafe for PkarrResolver
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
+) -> Option<BoxStream<Result<AddressLookupItem, AddressLookupError>>>Source§fn publish(&self, _data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read more
impl<T> AddressLookupBuilder for Twhere
+) -> Option<BoxStream<Result<AddressLookupItem, AddressLookupError>>>Source§fn publish(&self, _data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read more
Source§fn publish(&self, _data: &EndpointData)
fn publish(&self, _data: &EndpointData)
EndpointData to the Address Lookup mechanism. Read moreSource§impl Clone for PkarrResolver
impl Clone for PkarrResolver
Source§fn clone(&self) -> PkarrResolver
fn clone(&self) -> PkarrResolver
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 PkarrResolver
impl !RefUnwindSafe for PkarrResolver
impl Send for PkarrResolver
impl Sync for PkarrResolver
impl Unpin for PkarrResolver
impl !UnwindSafe for PkarrResolver
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
T: AddressLookup,
impl<T> AddressLookupBuilder for Twhere
T: AddressLookup,
Source§fn into_address_lookup(
self,
_endpoint: &Endpoint,
diff --git a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
index cfd47f28e6..e549ec9d07 100644
--- a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
+++ b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
@@ -1,11 +1,11 @@
-PkarrResolverBuilder in iroh::address_lookup::pkarr - Rust PkarrResolverBuilder
pub struct PkarrResolverBuilder { /* private fields */ }
Expand description
Builder for PkarrResolver.
+PkarrResolverBuilder in iroh::address_lookup::pkarr - Rust PkarrResolverBuilder
pub struct PkarrResolverBuilder { /* private fields */ }
Expand description
Builder for PkarrResolver.
-Implementations§
Source§impl PkarrResolverBuilder
Sourcepub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self
Available on non-wasm_browser only.
Sets the DNS resolver to use for resolving the pkarr relay URL.
-Sourcepub fn build(self, tls_config: ClientConfig) -> PkarrResolver
Creates a PkarrResolver from this builder.
-Trait Implementations§
Implementations§
Source§impl PkarrResolverBuilder
Sourcepub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self
Available on non-wasm_browser only.
Sets the DNS resolver to use for resolving the pkarr relay URL.
+Sourcepub fn build(self, tls_config: ClientConfig) -> PkarrResolver
Creates a PkarrResolver from this builder.
+Trait Implementations§
Source§impl AddressLookupBuilder for PkarrResolverBuilder
Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this builder into a ready-to-use AddressLookup. Read moreAuto Trait Implementations§
§impl Freeze for PkarrResolverBuilder
§impl !RefUnwindSafe for PkarrResolverBuilder
§impl Send for PkarrResolverBuilder
§impl Sync for PkarrResolverBuilder
§impl Unpin for PkarrResolverBuilder
§impl !UnwindSafe for PkarrResolverBuilder
Blanket Implementations§
Source§impl<T> Any for Twhere
+) -> Result<impl AddressLookup, AddressLookupBuilderError>Turns this builder into a ready-to-use AddressLookup. Read more
Auto Trait Implementations§
§impl Freeze for PkarrResolverBuilder
§impl !RefUnwindSafe for PkarrResolverBuilder
§impl Send for PkarrResolverBuilder
§impl Sync for PkarrResolverBuilder
§impl Unpin for PkarrResolverBuilder
§impl !UnwindSafe for PkarrResolverBuilder
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/4036/docs/iroh/address_lookup/struct.EndpointData.html b/pr/4036/docs/iroh/address_lookup/struct.EndpointData.html
index 1ea4773718..7de6a2dd89 100644
--- a/pr/4036/docs/iroh/address_lookup/struct.EndpointData.html
+++ b/pr/4036/docs/iroh/address_lookup/struct.EndpointData.html
@@ -13,15 +13,15 @@ services, should they not fit into e.g. a single DNS packet otherwise.
See also Self::set_user_data.
Sourcepub fn add_relay_url(&mut self, relay_url: RelayUrl)
Adds the relay URL to the end of the endpoint data, unless it already existed.
Sourcepub fn add_ip_addrs(&mut self, addresses: Vec<SocketAddr>)
Adds addresses in order with duplicates or already existing addresses filtered out.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Adds addresses to the endpoint data in the given ordered, but with duplicates filtered.
-Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data and returns the updated endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Adds addresses to the endpoint data in the given order, but with duplicates filtered.
+Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data.
Sourcepub fn clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn clear_relay_urls(&mut self)
Removes all relay URLs from the endpoint data.
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses.
+Sourcepub fn filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
Returns a vec to allow re-ordering of addresses.
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
diff --git a/pr/4036/docs/iroh/address_lookup/struct.Item.html b/pr/4036/docs/iroh/address_lookup/struct.Item.html
index 9e63b37130..28d59f6feb 100644
--- a/pr/4036/docs/iroh/address_lookup/struct.Item.html
+++ b/pr/4036/docs/iroh/address_lookup/struct.Item.html
@@ -16,14 +16,14 @@ directly from Sourcepub fn last_updated(&self) -> Option<u64>
Returns the optional timestamp when this endpoint info was last updated.
The value is microseconds since the unix epoch.
-Sourcepub fn to_endpoint_addr(&self) -> EndpointAddr
Converts into a EndpointAddr by cloning the needed fields.
-Sourcepub fn into_endpoint_addr(self) -> EndpointAddr
Converts into a EndpointAddr without cloning.
+Sourcepub fn to_endpoint_addr(&self) -> EndpointAddr
Returns an EndpointAddr by cloning the needed fields.
+Sourcepub fn into_endpoint_addr(self) -> EndpointAddr
Converts into an EndpointAddr without cloning.
Methods from Deref<Target = EndpointData>§
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses.
+Sourcepub fn filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
Returns a vec to allow re-ordering of addresses.
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
diff --git a/pr/4036/docs/iroh/address_lookup/struct.UserData.html b/pr/4036/docs/iroh/address_lookup/struct.UserData.html
index 49c2183d40..5ae8665e57 100644
--- a/pr/4036/docs/iroh/address_lookup/struct.UserData.html
+++ b/pr/4036/docs/iroh/address_lookup/struct.UserData.html
@@ -1,4 +1,5 @@
-UserData in iroh::address_lookup - Rust 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.
+UserData in iroh::address_lookup - Rust UserData
pub struct UserData(/* private fields */);
Expand description
User-defined data that can be published and resolved through endpoint discovery.
+Under the hood this is a UTF-8 string 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.
diff --git a/pr/4036/docs/iroh/address_lookup/trait.AddressLookup.html b/pr/4036/docs/iroh/address_lookup/trait.AddressLookup.html
index 1be6efa3e6..79a8044def 100644
--- a/pr/4036/docs/iroh/address_lookup/trait.AddressLookup.html
+++ b/pr/4036/docs/iroh/address_lookup/trait.AddressLookup.html
@@ -22,7 +22,7 @@ Address Lookup information changes. If an Address Lookup mechanism requires a pe
refresh, it should start its own task.
Provided Methods§
Sourcefn publish(&self, _data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism.
This is fire and forget, since the Endpoint can not wait for successful
-publishing. If publishing is async, the implementation should start it’s own task.
+publishing. If publishing is async, the implementation should start its own task.
This will be called from a tokio task, so it is safe to spawn new tasks.
These tasks will be run on the runtime of the super::Endpoint.
Implementations on Foreign Types§
Source§impl<T: AddressLookup> AddressLookup for Arc<T>
Implementors§
Source§impl AddressLookup for DnsAddressLookup
Available on non-wasm_browser only. Source§impl AddressLookup for MemoryLookup
Source§impl AddressLookup for PkarrPublisher
Source§impl AddressLookup for PkarrResolver
Source§impl<T: AddressLookup> AddressLookup for FilteredAddressLookup<T>
\ No newline at end of file
+) -> Option<BoxStream<Result<Item, Error>>>Implementors§
Source§impl AddressLookup for DnsAddressLookup
Available on non-wasm_browser only. Source§impl AddressLookup for MemoryLookup
Source§impl AddressLookup for PkarrPublisher
Source§impl AddressLookup for PkarrResolver
Source§impl<T: AddressLookup> AddressLookup for FilteredAddressLookup<T>
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/address_lookup/trait.AddressLookupBuilder.html b/pr/4036/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
index 35aadc4338..edc4dff899 100644
--- a/pr/4036/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
+++ b/pr/4036/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
@@ -20,5 +20,5 @@ endpoint to Endpoint,
) -> Result<impl AddressLookup, AddressLookupBuilderError>Turns this builder into a ready-to-use AddressLookup.
If an error is returned, building the endpoint will fail with this error.
-Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
Source§impl AddressLookupBuilder for DnsAddressLookupBuilder
Available on non-wasm_browser only. Source§impl AddressLookupBuilder for PkarrPublisherBuilder
Source§impl AddressLookupBuilder for PkarrResolverBuilder
Source§impl<T: AddressLookup> AddressLookupBuilder for T
Blanket no-op impl of AddressLookupBuilder for T: AddressLookup.
+ Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
Source§impl AddressLookupBuilder for DnsAddressLookupBuilder
Available on non-wasm_browser only. Source§impl AddressLookupBuilder for PkarrPublisherBuilder
Source§impl AddressLookupBuilder for PkarrResolverBuilder
Source§impl<T: AddressLookup> AddressLookupBuilder for T
Blanket no-op impl of AddressLookupBuilder for T: AddressLookup.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/defaults/prod/fn.default_ap_relay.html b/pr/4036/docs/iroh/defaults/prod/fn.default_ap_relay.html
index 5961b7d1ab..3a67b98b91 100644
--- a/pr/4036/docs/iroh/defaults/prod/fn.default_ap_relay.html
+++ b/pr/4036/docs/iroh/defaults/prod/fn.default_ap_relay.html
@@ -1,2 +1,2 @@
-default_ap_relay in iroh::defaults::prod - Rust default_ap_relay
pub fn default_ap_relay() -> RelayConfig
Expand description
Get the default RelayConfig for Asia-Pacific
+default_ap_relay in iroh::defaults::prod - Rust default_ap_relay
pub fn default_ap_relay() -> RelayConfig
Expand description
Get the default RelayConfig for Asia-Pacific.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/defaults/prod/index.html b/pr/4036/docs/iroh/defaults/prod/index.html
index 8981fb6be4..b076bc3ce3 100644
--- a/pr/4036/docs/iroh/defaults/prod/index.html
+++ b/pr/4036/docs/iroh/defaults/prod/index.html
@@ -1,2 +1,2 @@
iroh::defaults::prod - Rust Module prod
Expand description
Production configuration.
-Constants§
- AP_
RELAY_HOSTNAME - Hostname of the default Asia-Pacific relay.
- EU_
RELAY_HOSTNAME - Hostname of the default EU relay.
- NA_
EAST_RELAY_HOSTNAME - Hostname of the default NA east relay.
- NA_
WEST_RELAY_HOSTNAME - Hostname of the default NA west relay.
Functions§
- default_
ap_relay - Get the default
RelayConfig for Asia-Pacific - default_
eu_relay - Get the default
RelayConfig for EU. - default_
na_east_relay - Get the default
RelayConfig for NA east. - default_
na_west_relay - Get the default
RelayConfig for NA west. - default_
relay_map - Get the default
RelayMap.
\ No newline at end of file
+Constants§
- AP_
RELAY_HOSTNAME - Hostname of the default Asia-Pacific relay.
- EU_
RELAY_HOSTNAME - Hostname of the default EU relay.
- NA_
EAST_RELAY_HOSTNAME - Hostname of the default NA east relay.
- NA_
WEST_RELAY_HOSTNAME - Hostname of the default NA west relay.
Functions§
- default_
ap_relay - Get the default
RelayConfig for Asia-Pacific. - default_
eu_relay - Get the default
RelayConfig for EU. - default_
na_east_relay - Get the default
RelayConfig for NA east. - default_
na_west_relay - Get the default
RelayConfig for NA west. - default_
relay_map - Get the default
RelayMap.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/dns/struct.DnsResolver.html b/pr/4036/docs/iroh/dns/struct.DnsResolver.html
index 754fa26465..3f8c6e27b6 100644
--- a/pr/4036/docs/iroh/dns/struct.DnsResolver.html
+++ b/pr/4036/docs/iroh/dns/struct.DnsResolver.html
@@ -15,7 +15,7 @@ public DNS.
Implementations§
Source§impl DnsResolver
Sourcepub fn new() -> DnsResolver
Creates 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.
+to the default ResolverConfig which uses e.g. Google’s 8.8.8.8 or 8.8.4.4.
Sourcepub fn with_nameserver(nameserver: SocketAddr) -> DnsResolver
Creates a new DNS resolver configured with a single UDP DNS nameserver.
Sourcepub fn custom(resolver: impl Resolver) -> DnsResolver
Creates a new DnsResolver from a struct that implements Resolver.
diff --git a/pr/4036/docs/iroh/dns/trait.Resolver.html b/pr/4036/docs/iroh/dns/trait.Resolver.html
index 4aaa7642fd..3ebf87a01f 100644
--- a/pr/4036/docs/iroh/dns/trait.Resolver.html
+++ b/pr/4036/docs/iroh/dns/trait.Resolver.html
@@ -38,13 +38,13 @@ atomic swap. Build a new instance with re-bound sockets and re-read nameserver
configuration rather than mutating in place. Must not perform IO: defer DNS
queries and socket binds until the new resolver is first used. May be called
concurrently, in which case all but one allocated replacement is dropped unused.
-Implementations on Foreign Types§
Implementations on Foreign Types§
Source§impl Resolver for Arc<SimpleDnsResolver>
Source§fn lookup_ipv4(
&self,
host: String,
-) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = Ipv4Addr> + Send>, DnsError>> + Send>>
Source§fn lookup_ipv6(
+) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = Ipv4Addr> + Send>, DnsError>> + Send>>
Source§fn lookup_ipv6(
&self,
host: String,
-) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = Ipv6Addr> + Send>, DnsError>> + Send>>
Source§fn lookup_txt(
+) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = Ipv6Addr> + Send>, DnsError>> + Send>>
Source§fn lookup_txt(
&self,
host: String,
-) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = TxtRecordData> + Send>, DnsError>> + Send>>
Source§fn clear_cache(&self)
Source§fn reset(&self) -> Box<dyn Resolver>
Implementors§
\ No newline at end of file
+) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = TxtRecordData> + Send>, DnsError>> + Send>>Source§fn clear_cache(&self)
Source§fn reset(&self) -> Box<dyn Resolver>
fn into_address_lookup(
self,
_endpoint: &Endpoint,
diff --git a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
index cfd47f28e6..e549ec9d07 100644
--- a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
+++ b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
@@ -1,11 +1,11 @@
-PkarrResolverBuilder in iroh::address_lookup::pkarr - Rust PkarrResolverBuilder
pub struct PkarrResolverBuilder { /* private fields */ }
Expand description
Builder for PkarrResolver.
+PkarrResolverBuilder in iroh::address_lookup::pkarr - Rust PkarrResolverBuilder
pub struct PkarrResolverBuilder { /* private fields */ }
Expand description
Builder for PkarrResolver.
-Implementations§
Source§impl PkarrResolverBuilder
Sourcepub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self
Available on non-wasm_browser only.
Sets the DNS resolver to use for resolving the pkarr relay URL.
-Sourcepub fn build(self, tls_config: ClientConfig) -> PkarrResolver
Creates a PkarrResolver from this builder.
-Trait Implementations§
Implementations§
Source§impl PkarrResolverBuilder
Sourcepub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self
Available on non-wasm_browser only.
Sets the DNS resolver to use for resolving the pkarr relay URL.
+Sourcepub fn build(self, tls_config: ClientConfig) -> PkarrResolver
Creates a PkarrResolver from this builder.
+Trait Implementations§
Source§impl AddressLookupBuilder for PkarrResolverBuilder
Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this builder into a ready-to-use AddressLookup. Read moreAuto Trait Implementations§
§impl Freeze for PkarrResolverBuilder
§impl !RefUnwindSafe for PkarrResolverBuilder
§impl Send for PkarrResolverBuilder
§impl Sync for PkarrResolverBuilder
§impl Unpin for PkarrResolverBuilder
§impl !UnwindSafe for PkarrResolverBuilder
Blanket Implementations§
Source§impl<T> Any for Twhere
+) -> Result<impl AddressLookup, AddressLookupBuilderError>Turns this builder into a ready-to-use AddressLookup. Read more
Auto Trait Implementations§
§impl Freeze for PkarrResolverBuilder
§impl !RefUnwindSafe for PkarrResolverBuilder
§impl Send for PkarrResolverBuilder
§impl Sync for PkarrResolverBuilder
§impl Unpin for PkarrResolverBuilder
§impl !UnwindSafe for PkarrResolverBuilder
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/4036/docs/iroh/address_lookup/struct.EndpointData.html b/pr/4036/docs/iroh/address_lookup/struct.EndpointData.html
index 1ea4773718..7de6a2dd89 100644
--- a/pr/4036/docs/iroh/address_lookup/struct.EndpointData.html
+++ b/pr/4036/docs/iroh/address_lookup/struct.EndpointData.html
@@ -13,15 +13,15 @@ services, should they not fit into e.g. a single DNS packet otherwise.
See also Self::set_user_data.
Sourcepub fn add_relay_url(&mut self, relay_url: RelayUrl)
Adds the relay URL to the end of the endpoint data, unless it already existed.
Sourcepub fn add_ip_addrs(&mut self, addresses: Vec<SocketAddr>)
Adds addresses in order with duplicates or already existing addresses filtered out.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Adds addresses to the endpoint data in the given ordered, but with duplicates filtered.
-Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data and returns the updated endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Adds addresses to the endpoint data in the given order, but with duplicates filtered.
+Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data.
Sourcepub fn clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn clear_relay_urls(&mut self)
Removes all relay URLs from the endpoint data.
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses.
+Sourcepub fn filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
Returns a vec to allow re-ordering of addresses.
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
diff --git a/pr/4036/docs/iroh/address_lookup/struct.Item.html b/pr/4036/docs/iroh/address_lookup/struct.Item.html
index 9e63b37130..28d59f6feb 100644
--- a/pr/4036/docs/iroh/address_lookup/struct.Item.html
+++ b/pr/4036/docs/iroh/address_lookup/struct.Item.html
@@ -16,14 +16,14 @@ directly from Sourcepub fn last_updated(&self) -> Option<u64>
Returns the optional timestamp when this endpoint info was last updated.
The value is microseconds since the unix epoch.
-Sourcepub fn to_endpoint_addr(&self) -> EndpointAddr
Converts into a EndpointAddr by cloning the needed fields.
-Sourcepub fn into_endpoint_addr(self) -> EndpointAddr
Converts into a EndpointAddr without cloning.
+Sourcepub fn to_endpoint_addr(&self) -> EndpointAddr
Returns an EndpointAddr by cloning the needed fields.
+Sourcepub fn into_endpoint_addr(self) -> EndpointAddr
Converts into an EndpointAddr without cloning.
Methods from Deref<Target = EndpointData>§
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses.
+Sourcepub fn filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
Returns a vec to allow re-ordering of addresses.
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
diff --git a/pr/4036/docs/iroh/address_lookup/struct.UserData.html b/pr/4036/docs/iroh/address_lookup/struct.UserData.html
index 49c2183d40..5ae8665e57 100644
--- a/pr/4036/docs/iroh/address_lookup/struct.UserData.html
+++ b/pr/4036/docs/iroh/address_lookup/struct.UserData.html
@@ -1,4 +1,5 @@
-UserData in iroh::address_lookup - Rust 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.
+UserData in iroh::address_lookup - Rust UserData
pub struct UserData(/* private fields */);
Expand description
User-defined data that can be published and resolved through endpoint discovery.
+Under the hood this is a UTF-8 string 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.
diff --git a/pr/4036/docs/iroh/address_lookup/trait.AddressLookup.html b/pr/4036/docs/iroh/address_lookup/trait.AddressLookup.html
index 1be6efa3e6..79a8044def 100644
--- a/pr/4036/docs/iroh/address_lookup/trait.AddressLookup.html
+++ b/pr/4036/docs/iroh/address_lookup/trait.AddressLookup.html
@@ -22,7 +22,7 @@ Address Lookup information changes. If an Address Lookup mechanism requires a pe
refresh, it should start its own task.
Provided Methods§
Sourcefn publish(&self, _data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism.
This is fire and forget, since the Endpoint can not wait for successful
-publishing. If publishing is async, the implementation should start it’s own task.
+publishing. If publishing is async, the implementation should start its own task.
This will be called from a tokio task, so it is safe to spawn new tasks.
These tasks will be run on the runtime of the super::Endpoint.
Implementations on Foreign Types§
Source§impl<T: AddressLookup> AddressLookup for Arc<T>
Implementors§
Source§impl AddressLookup for DnsAddressLookup
Available on non-wasm_browser only. Source§impl AddressLookup for MemoryLookup
Source§impl AddressLookup for PkarrPublisher
Source§impl AddressLookup for PkarrResolver
Source§impl<T: AddressLookup> AddressLookup for FilteredAddressLookup<T>
\ No newline at end of file
+) -> Option<BoxStream<Result<Item, Error>>>Implementors§
Source§impl AddressLookup for DnsAddressLookup
Available on non-wasm_browser only. Source§impl AddressLookup for MemoryLookup
Source§impl AddressLookup for PkarrPublisher
Source§impl AddressLookup for PkarrResolver
Source§impl<T: AddressLookup> AddressLookup for FilteredAddressLookup<T>
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/address_lookup/trait.AddressLookupBuilder.html b/pr/4036/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
index 35aadc4338..edc4dff899 100644
--- a/pr/4036/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
+++ b/pr/4036/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
@@ -20,5 +20,5 @@ endpoint to Endpoint,
) -> Result<impl AddressLookup, AddressLookupBuilderError>Turns this builder into a ready-to-use AddressLookup.
If an error is returned, building the endpoint will fail with this error.
-Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
Source§impl AddressLookupBuilder for DnsAddressLookupBuilder
Available on non-wasm_browser only. Source§impl AddressLookupBuilder for PkarrPublisherBuilder
Source§impl AddressLookupBuilder for PkarrResolverBuilder
Source§impl<T: AddressLookup> AddressLookupBuilder for T
Blanket no-op impl of AddressLookupBuilder for T: AddressLookup.
+ Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
Source§impl AddressLookupBuilder for DnsAddressLookupBuilder
Available on non-wasm_browser only. Source§impl AddressLookupBuilder for PkarrPublisherBuilder
Source§impl AddressLookupBuilder for PkarrResolverBuilder
Source§impl<T: AddressLookup> AddressLookupBuilder for T
Blanket no-op impl of AddressLookupBuilder for T: AddressLookup.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/defaults/prod/fn.default_ap_relay.html b/pr/4036/docs/iroh/defaults/prod/fn.default_ap_relay.html
index 5961b7d1ab..3a67b98b91 100644
--- a/pr/4036/docs/iroh/defaults/prod/fn.default_ap_relay.html
+++ b/pr/4036/docs/iroh/defaults/prod/fn.default_ap_relay.html
@@ -1,2 +1,2 @@
-default_ap_relay in iroh::defaults::prod - Rust default_ap_relay
pub fn default_ap_relay() -> RelayConfig
Expand description
Get the default RelayConfig for Asia-Pacific
+default_ap_relay in iroh::defaults::prod - Rust default_ap_relay
pub fn default_ap_relay() -> RelayConfig
Expand description
Get the default RelayConfig for Asia-Pacific.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/defaults/prod/index.html b/pr/4036/docs/iroh/defaults/prod/index.html
index 8981fb6be4..b076bc3ce3 100644
--- a/pr/4036/docs/iroh/defaults/prod/index.html
+++ b/pr/4036/docs/iroh/defaults/prod/index.html
@@ -1,2 +1,2 @@
iroh::defaults::prod - Rust Module prod
Expand description
Production configuration.
-Constants§
- AP_
RELAY_HOSTNAME - Hostname of the default Asia-Pacific relay.
- EU_
RELAY_HOSTNAME - Hostname of the default EU relay.
- NA_
EAST_RELAY_HOSTNAME - Hostname of the default NA east relay.
- NA_
WEST_RELAY_HOSTNAME - Hostname of the default NA west relay.
Functions§
- default_
ap_relay - Get the default
RelayConfig for Asia-Pacific - default_
eu_relay - Get the default
RelayConfig for EU. - default_
na_east_relay - Get the default
RelayConfig for NA east. - default_
na_west_relay - Get the default
RelayConfig for NA west. - default_
relay_map - Get the default
RelayMap.
\ No newline at end of file
+Constants§
- AP_
RELAY_HOSTNAME - Hostname of the default Asia-Pacific relay.
- EU_
RELAY_HOSTNAME - Hostname of the default EU relay.
- NA_
EAST_RELAY_HOSTNAME - Hostname of the default NA east relay.
- NA_
WEST_RELAY_HOSTNAME - Hostname of the default NA west relay.
Functions§
- default_
ap_relay - Get the default
RelayConfig for Asia-Pacific. - default_
eu_relay - Get the default
RelayConfig for EU. - default_
na_east_relay - Get the default
RelayConfig for NA east. - default_
na_west_relay - Get the default
RelayConfig for NA west. - default_
relay_map - Get the default
RelayMap.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/dns/struct.DnsResolver.html b/pr/4036/docs/iroh/dns/struct.DnsResolver.html
index 754fa26465..3f8c6e27b6 100644
--- a/pr/4036/docs/iroh/dns/struct.DnsResolver.html
+++ b/pr/4036/docs/iroh/dns/struct.DnsResolver.html
@@ -15,7 +15,7 @@ public DNS.
Implementations§
Source§impl DnsResolver
Sourcepub fn new() -> DnsResolver
Creates 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.
+to the default ResolverConfig which uses e.g. Google’s 8.8.8.8 or 8.8.4.4.
Sourcepub fn with_nameserver(nameserver: SocketAddr) -> DnsResolver
Creates a new DNS resolver configured with a single UDP DNS nameserver.
Sourcepub fn custom(resolver: impl Resolver) -> DnsResolver
Creates a new DnsResolver from a struct that implements Resolver.
diff --git a/pr/4036/docs/iroh/dns/trait.Resolver.html b/pr/4036/docs/iroh/dns/trait.Resolver.html
index 4aaa7642fd..3ebf87a01f 100644
--- a/pr/4036/docs/iroh/dns/trait.Resolver.html
+++ b/pr/4036/docs/iroh/dns/trait.Resolver.html
@@ -38,13 +38,13 @@ atomic swap. Build a new instance with re-bound sockets and re-read nameserver
configuration rather than mutating in place. Must not perform IO: defer DNS
queries and socket binds until the new resolver is first used. May be called
concurrently, in which case all but one allocated replacement is dropped unused.
-Implementations on Foreign Types§
Implementations on Foreign Types§
Source§impl Resolver for Arc<SimpleDnsResolver>
Source§fn lookup_ipv4(
&self,
host: String,
-) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = Ipv4Addr> + Send>, DnsError>> + Send>>
Source§fn lookup_ipv6(
+) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = Ipv4Addr> + Send>, DnsError>> + Send>>
Source§fn lookup_ipv6(
&self,
host: String,
-) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = Ipv6Addr> + Send>, DnsError>> + Send>>
Source§fn lookup_txt(
+) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = Ipv6Addr> + Send>, DnsError>> + Send>>
Source§fn lookup_txt(
&self,
host: String,
-) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = TxtRecordData> + Send>, DnsError>> + Send>>
Source§fn clear_cache(&self)
Source§fn reset(&self) -> Box<dyn Resolver>
Implementors§
\ No newline at end of file
+) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = TxtRecordData> + Send>, DnsError>> + Send>>Source§fn clear_cache(&self)
Source§fn reset(&self) -> Box<dyn Resolver>
PkarrResolverBuilder
pub struct PkarrResolverBuilder { /* private fields */ }Expand description
Builder for PkarrResolver.
PkarrResolverBuilder
pub struct PkarrResolverBuilder { /* private fields */ }Expand description
Builder for PkarrResolver.
Implementations§
Source§impl PkarrResolverBuilder
impl PkarrResolverBuilder
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.Sets the DNS resolver to use for resolving the pkarr relay URL.
-Sourcepub fn build(self, tls_config: ClientConfig) -> PkarrResolver
pub fn build(self, tls_config: ClientConfig) -> PkarrResolver
Creates a PkarrResolver from this builder.
Trait Implementations§
Implementations§
Source§impl PkarrResolverBuilder
impl PkarrResolverBuilder
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.Sets the DNS resolver to use for resolving the pkarr relay URL.
+Sourcepub fn build(self, tls_config: ClientConfig) -> PkarrResolver
pub fn build(self, tls_config: ClientConfig) -> PkarrResolver
Creates a PkarrResolver from this builder.
Trait Implementations§
Source§impl AddressLookupBuilder for PkarrResolverBuilder
impl AddressLookupBuilder for PkarrResolverBuilder
Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, AddressLookupBuilderError>
fn into_address_lookup( self, endpoint: &Endpoint, -) -> Result<impl AddressLookup, AddressLookupBuilderError>
AddressLookup. Read moreAuto Trait Implementations§
impl Freeze for PkarrResolverBuilder
impl !RefUnwindSafe for PkarrResolverBuilder
impl Send for PkarrResolverBuilder
impl Sync for PkarrResolverBuilder
impl Unpin for PkarrResolverBuilder
impl !UnwindSafe for PkarrResolverBuilder
Blanket Implementations§
Source§impl<T> Any for Twhere
+) -> Result<impl AddressLookup, AddressLookupBuilderError>Turns this builder into a ready-to-use AddressLookup. Read more
impl<T> Any for Twhere
+) -> Result<impl AddressLookup, AddressLookupBuilderError>Turns this builder into a ready-to-use AddressLookup. Read more
AddressLookup. Read moreAuto Trait Implementations§
impl Freeze for PkarrResolverBuilder
impl !RefUnwindSafe for PkarrResolverBuilder
impl Send for PkarrResolverBuilder
impl Sync for PkarrResolverBuilder
impl Unpin for PkarrResolverBuilder
impl !UnwindSafe for PkarrResolverBuilder
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/4036/docs/iroh/address_lookup/struct.EndpointData.html b/pr/4036/docs/iroh/address_lookup/struct.EndpointData.html index 1ea4773718..7de6a2dd89 100644 --- a/pr/4036/docs/iroh/address_lookup/struct.EndpointData.html +++ b/pr/4036/docs/iroh/address_lookup/struct.EndpointData.html @@ -13,15 +13,15 @@ services, should they not fit into e.g. a single DNS packet otherwise.
See also Self::set_user_data.
Sourcepub fn add_relay_url(&mut self, relay_url: RelayUrl)
pub fn add_relay_url(&mut self, relay_url: RelayUrl)
Adds the relay URL to the end of the endpoint data, unless it already existed.
Sourcepub fn add_ip_addrs(&mut self, addresses: Vec<SocketAddr>)
pub fn add_ip_addrs(&mut self, addresses: Vec<SocketAddr>)
Adds addresses in order with duplicates or already existing addresses filtered out.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
pub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Adds addresses to the endpoint data in the given ordered, but with duplicates filtered.
-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 and returns the updated endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
pub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Adds addresses to the endpoint data in the given order, but with duplicates filtered.
+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.
Sourcepub fn clear_ip_addrs(&mut self)
pub fn clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn clear_relay_urls(&mut self)
pub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn clear_relay_urls(&mut self)
pub fn clear_relay_urls(&mut self)
Removes all relay URLs from the endpoint data.
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
pub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
pub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
pub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
pub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
pub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses.
+Sourcepub fn filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
pub fn filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
Returns a vec to allow re-ordering of addresses.
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
pub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
Sourcepub fn last_updated(&self) -> Option<u64>
pub fn last_updated(&self) -> Option<u64>
Returns the optional timestamp when this endpoint info was last updated.
The value is microseconds since the unix epoch.
-Sourcepub fn to_endpoint_addr(&self) -> EndpointAddr
pub fn to_endpoint_addr(&self) -> EndpointAddr
Converts into a EndpointAddr by cloning the needed fields.
Sourcepub fn into_endpoint_addr(self) -> EndpointAddr
pub fn into_endpoint_addr(self) -> EndpointAddr
Converts into a EndpointAddr without cloning.
Sourcepub fn to_endpoint_addr(&self) -> EndpointAddr
pub fn to_endpoint_addr(&self) -> EndpointAddr
Returns an EndpointAddr by cloning the needed fields.
Sourcepub fn into_endpoint_addr(self) -> EndpointAddr
pub fn into_endpoint_addr(self) -> EndpointAddr
Converts into an EndpointAddr without cloning.
Methods from Deref<Target = EndpointData>§
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
pub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
pub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
pub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
pub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
pub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses.
+Sourcepub fn filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
pub fn filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
Returns a vec to allow re-ordering of addresses.
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
pub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
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.
UserData
pub struct UserData(/* private fields */);Expand description
User-defined data that can be published and resolved through endpoint discovery.
+Under the hood this is a UTF-8 string 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.
Provided Methods§
Sourcefn publish(&self, _data: &EndpointData)
fn publish(&self, _data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism.
This is fire and forget, since the Endpoint can not wait for successful
-publishing. If publishing is async, the implementation should start it’s own task.
This will be called from a tokio task, so it is safe to spawn new tasks.
These tasks will be run on the runtime of the super::Endpoint.
Implementations on Foreign Types§
Source§impl<T: AddressLookup> AddressLookup for Arc<T>
impl<T: AddressLookup> AddressLookup for Arc<T>
Implementors§
impl AddressLookup for DnsAddressLookup
wasm_browser only.impl AddressLookup for MemoryLookup
impl AddressLookup for PkarrPublisher
impl AddressLookup for PkarrResolver
impl<T: AddressLookup> AddressLookup for FilteredAddressLookup<T>
Implementors§
impl AddressLookup for DnsAddressLookup
wasm_browser only.impl AddressLookup for MemoryLookup
impl AddressLookup for PkarrPublisher
impl AddressLookup for PkarrResolver
impl<T: AddressLookup> AddressLookup for FilteredAddressLookup<T>
Turns this builder into a ready-to-use AddressLookup.
If an error is returned, building the endpoint will fail with this error.
-Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
impl AddressLookupBuilder for DnsAddressLookupBuilder
wasm_browser only.impl AddressLookupBuilder for PkarrPublisherBuilder
impl AddressLookupBuilder for PkarrResolverBuilder
impl<T: AddressLookup> AddressLookupBuilder for T
Blanket no-op impl of AddressLookupBuilder for T: AddressLookup.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
impl AddressLookupBuilder for DnsAddressLookupBuilder
wasm_browser only.impl AddressLookupBuilder for PkarrPublisherBuilder
impl AddressLookupBuilder for PkarrResolverBuilder
impl<T: AddressLookup> AddressLookupBuilder for T
Blanket no-op impl of AddressLookupBuilder for T: AddressLookup.
default_ap_relay
pub fn default_ap_relay() -> RelayConfigExpand description
Get the default RelayConfig for Asia-Pacific
default_ap_relay
pub fn default_ap_relay() -> RelayConfigExpand description
Get the default RelayConfig for Asia-Pacific.
Module prod
Expand description
Production configuration.
-Constants§
- AP_
RELAY_ HOSTNAME - Hostname of the default Asia-Pacific relay.
- EU_
RELAY_ HOSTNAME - Hostname of the default EU relay.
- NA_
EAST_ RELAY_ HOSTNAME - Hostname of the default NA east relay.
- NA_
WEST_ RELAY_ HOSTNAME - Hostname of the default NA west relay.
Functions§
- default_
ap_ relay - Get the default
RelayConfigfor Asia-Pacific - default_
eu_ relay - Get the default
RelayConfigfor EU. - default_
na_ east_ relay - Get the default
RelayConfigfor NA east. - default_
na_ west_ relay - Get the default
RelayConfigfor NA west. - default_
relay_ map - Get the default
RelayMap.
Constants§
- AP_
RELAY_ HOSTNAME - Hostname of the default Asia-Pacific relay.
- EU_
RELAY_ HOSTNAME - Hostname of the default EU relay.
- NA_
EAST_ RELAY_ HOSTNAME - Hostname of the default NA east relay.
- NA_
WEST_ RELAY_ HOSTNAME - Hostname of the default NA west relay.
Functions§
- default_
ap_ relay - Get the default
RelayConfigfor Asia-Pacific. - default_
eu_ relay - Get the default
RelayConfigfor EU. - default_
na_ east_ relay - Get the default
RelayConfigfor NA east. - default_
na_ west_ relay - Get the default
RelayConfigfor NA west. - default_
relay_ map - Get the default
RelayMap.
Implementations§
Source§impl DnsResolver
impl DnsResolver
Sourcepub fn new() -> DnsResolver
pub fn new() -> DnsResolver
Creates 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.
ResolverConfig which uses e.g. 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
Creates a new DNS resolver configured with a single UDP DNS nameserver.
Sourcepub fn custom(resolver: impl Resolver) -> DnsResolver
pub fn custom(resolver: impl Resolver) -> DnsResolver
Creates a new DnsResolver from a struct that implements Resolver.
Implementations on Foreign Types§
Implementations on Foreign Types§
Source§impl Resolver for Arc<SimpleDnsResolver>
impl Resolver for Arc<SimpleDnsResolver>
fn lookup_ipv4( &self, host: String, -) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = Ipv4Addr> + Send>, DnsError>> + Send>>
fn lookup_ipv6( +) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = Ipv4Addr> + Send>, DnsError>> + Send>>
fn lookup_ipv6( &self, host: String, -) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = Ipv6Addr> + Send>, DnsError>> + Send>>
fn lookup_txt( +) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = Ipv6Addr> + Send>, DnsError>> + Send>>
fn lookup_txt( &self, host: String, -) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = TxtRecordData> + Send>, DnsError>> + Send>>
fn clear_cache(&self)
fn reset(&self) -> Box<dyn Resolver>
Implementors§
fn clear_cache(&self)
fn reset(&self) -> Box<dyn Resolver>
Implementors§
ENV_FORCE_STAGING_RELAYS
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
RelayMode
pub enum RelayMode {
+RelayMode in iroh::endpoint - Rust RelayMode
pub enum RelayMode {
Disabled,
Default,
Staging,
@@ -10,14 +10,14 @@ This means that neither listening nor dialing relays will be available.
See crate::defaults::prod for the severs used.
§Staging
Use the staging relay servers from n0.
§Custom(RelayMap)
Use a custom relay map.
-Implementations§
Source§impl RelayMode
impl RelayMode
Sourcepub fn custom(map: impl IntoIterator<Item = RelayUrl>) -> Self
pub fn custom(map: impl IntoIterator<Item = RelayUrl>) -> Self
Create a custom relay mode from a list of RelayUrls.
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§
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/4036/docs/iroh/endpoint/fn.default_relay_mode.html b/pr/4036/docs/iroh/endpoint/fn.default_relay_mode.html
index d716677abc..98ff3579ee 100644
--- a/pr/4036/docs/iroh/endpoint/fn.default_relay_mode.html
+++ b/pr/4036/docs/iroh/endpoint/fn.default_relay_mode.html
@@ -1,4 +1,4 @@
-default_relay_mode in iroh::endpoint - Rust default_relay_mode
pub fn default_relay_mode() -> RelayMode
Expand description
Returns the default relay mode.
+default_relay_mode in iroh::endpoint - Rust default_relay_mode
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint/fn.force_staging_infra.html b/pr/4036/docs/iroh/endpoint/fn.force_staging_infra.html
index ff8dda7e69..b444491b3e 100644
--- a/pr/4036/docs/iroh/endpoint/fn.force_staging_infra.html
+++ b/pr/4036/docs/iroh/endpoint/fn.force_staging_infra.html
@@ -1,2 +1,2 @@
-force_staging_infra in iroh::endpoint - Rust force_staging_infra
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 force_staging_infra
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint/index.html b/pr/4036/docs/iroh/endpoint/index.html
index 2efb803d4c..f3a98d45f2 100644
--- a/pr/4036/docs/iroh/endpoint/index.html
+++ b/pr/4036/docs/iroh/endpoint/index.html
@@ -1,4 +1,4 @@
-iroh::endpoint - Rust Module endpoint
Expand description
The Endpoint allows establishing connections to other iroh endpoints.
+iroh::endpoint - Rust Module endpoint
Expand description
The Endpoint allows establishing connections to other iroh endpoints.
The Endpoint is the main API interface to manage a local iroh endpoint. It allows
connecting to and accepting connections from other endpoints. See the module docs for
more details on how iroh connections work.
diff --git a/pr/4036/docs/iroh/endpoint/presets/index.html b/pr/4036/docs/iroh/endpoint/presets/index.html
index 37b792c03d..a454626701 100644
--- a/pr/4036/docs/iroh/endpoint/presets/index.html
+++ b/pr/4036/docs/iroh/endpoint/presets/index.html
@@ -2,4 +2,4 @@
§Example
use iroh::{Endpoint, RelayMode, Watcher, endpoint::presets};
-let endpoint = Endpoint::builder(presets::N0).bind().await?;
Structs§
- Empty
- An empty preset that doesn’t set anything on the builder.
- Minimal
with_crypto_provider - A preset that is almost empty, besides setting mandatory options.
- N0
with_crypto_provider - Configures the endpoint to use the n0 defaults
- N0Disable
Relay with_crypto_provider - Configures the endpoint to use the n0 defaults, but with relay mode disabled.
Traits§
- Preset
- Defines a preset
\ No newline at end of file
+let endpoint = Endpoint::builder(presets::N0).bind().await?;Structs§
- Empty
- An empty preset that doesn’t set anything on the builder.
- Minimal
with_crypto_provider - A preset that is almost empty, besides setting mandatory options.
- N0
with_crypto_provider - Configures the endpoint to use the n0 defaults
- N0Disable
Relay with_crypto_provider - Configures the endpoint to use the n0 defaults, but with relay mode disabled.
Traits§
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint/presets/struct.N0.html b/pr/4036/docs/iroh/endpoint/presets/struct.N0.html
index 41c532b301..cf9fb0156e 100644
--- a/pr/4036/docs/iroh/endpoint/presets/struct.N0.html
+++ b/pr/4036/docs/iroh/endpoint/presets/struct.N0.html
@@ -6,8 +6,8 @@
setting the [rustls::crypto::CryptoProvider] to ring or aws-lc-rs, depending
on which feature is enabled in iroh (preferring ring if both are enabled).
-Due to the last point, this preset is only available with the ring or
-aws-lc-rs preset installed.
+
Due to the last point, this preset is only available with the tls-ring or
+tls-aws-lc-rs feature enabled.
If you want to set your own crypto provider, we recommend copying the
implementation of this preset into your own and setting the appropriate crypto
provider there.
diff --git a/pr/4036/docs/iroh/endpoint/presets/struct.N0DisableRelay.html b/pr/4036/docs/iroh/endpoint/presets/struct.N0DisableRelay.html
index dd14c88ba9..29795833c9 100644
--- a/pr/4036/docs/iroh/endpoint/presets/struct.N0DisableRelay.html
+++ b/pr/4036/docs/iroh/endpoint/presets/struct.N0DisableRelay.html
@@ -7,8 +7,8 @@ relay urls.
setting the [rustls::crypto::CryptoProvider] to ring or aws-lc-rs, depending
on which feature is enabled in iroh (preferring ring if both are enabled).
-Due to the last point, this preset is only available with the ring or
-aws-lc-rs preset installed.
+
Due to the last point, this preset is only available with the tls-ring or
+tls-aws-lc-rs feature enabled.
If you want to set your own crypto provider, we recommend copying the
implementation of this preset into your own and setting the appropriate crypto
provider there.
diff --git a/pr/4036/docs/iroh/endpoint/presets/trait.Preset.html b/pr/4036/docs/iroh/endpoint/presets/trait.Preset.html
index 59a71a95da..7e6f4bbcac 100644
--- a/pr/4036/docs/iroh/endpoint/presets/trait.Preset.html
+++ b/pr/4036/docs/iroh/endpoint/presets/trait.Preset.html
@@ -1,7 +1,7 @@
-Preset in iroh::endpoint::presets - Rust Preset
pub trait Preset {
+Preset in iroh::endpoint::presets - Rust Preset
pub trait Preset {
// Required method
fn apply(self, builder: Builder) -> Builder;
-}
Expand description
Defines a preset
+}Expand description
A reusable bundle of endpoint Builder configuration.
Required Methods§
Implementations on Foreign Types§
Source§impl Preset for Arc<TestTransport>
Available on crate feature unstable-custom-transports and (crate features test-utils) only.
Source§fn apply(self, builder: Builder) -> Builder
Configures the builder with this transport and the network’s address lookup.
§Example
diff --git a/pr/4036/docs/iroh/endpoint/struct.Builder.html b/pr/4036/docs/iroh/endpoint/struct.Builder.html
index 79894b8924..7cbb050d5e 100644
--- a/pr/4036/docs/iroh/endpoint/struct.Builder.html
+++ b/pr/4036/docs/iroh/endpoint/struct.Builder.html
@@ -92,7 +92,7 @@ is set to false explicitly.
destination addresses. It is valid to configure this, but no more than one such
socket should be bound or the routing will be non-deterministic.
To use a subnet with a non-zero prefix length as the default route in addition to
-being routed when its prefix matches, use `BindOpts::set_is_default_route.
+being routed when its prefix matches, use BindOpts::set_is_default_route.
Subnets with a prefix length of zero are always marked as default routes.
Finally note that most outgoing datagrams are part of an existing network flow. That
is, they are in response to an incoming datagram. In this case the outgoing datagram
@@ -142,7 +142,7 @@ direct addresses or relay URLs will fail.
Sourcepub fn addr_filter(self, filter: AddrFilter) -> Self
Sets the address filter applied to all address data before publishing.
This filter is applied once, at the AddressLookupServices level, before
distributing data to any individual address lookup service. This ensures
-consistent filtering regardless of how the services configured.
+consistent filtering regardless of how the services are configured.
Sourcepub fn clear_addr_filter(self) -> Self
Clears the address filter, allowing all addresses to be published.
This removes any filter previously set via Self::addr_filter, including
filters set by presets.
diff --git a/pr/4036/docs/iroh/endpoint/struct.ConnectOptions.html b/pr/4036/docs/iroh/endpoint/struct.ConnectOptions.html
index 30bf2e329e..3834b0244e 100644
--- a/pr/4036/docs/iroh/endpoint/struct.ConnectOptions.html
+++ b/pr/4036/docs/iroh/endpoint/struct.ConnectOptions.html
@@ -1,12 +1,12 @@
-ConnectOptions in iroh::endpoint - Rust ConnectOptions
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 ConnectOptions
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 QuicTransportConfig.
-Sourcepub fn with_transport_config(
+
Sourcepub fn with_transport_config(
self,
transport_config: QuicTransportConfig,
) -> Self
Sets the QUIC transport config options for this connection.
-Sourcepub fn with_additional_alpns(self, alpns: Vec<Vec<u8>>) -> Self
Sets ALPN identifiers that should be signaled as supported on connection, in
+
Sourcepub fn with_additional_alpns(self, alpns: Vec<Vec<u8>>) -> Self
Sets ALPN identifiers that should be signaled as supported on connection, in
addition to the main ALPN identifier used in Endpoint::connect_with_opts.
This allows connecting to servers that may only support older versions of your
protocol. In this case, you would add the older ALPN identifiers with this
@@ -20,7 +20,7 @@ list or the main ALPN identifiers on the accept side, see the endpoint
builder’s Builder::alpns function.
-Trait Implementations§
Source§impl Clone for ConnectOptions
Source§fn clone(&self) -> ConnectOptions
Returns a duplicate 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 duplicate 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/4036/docs/iroh/endpoint/struct.Connection.html b/pr/4036/docs/iroh/endpoint/struct.Connection.html
index ffc93497ee..74f53832af 100644
--- a/pr/4036/docs/iroh/endpoint/struct.Connection.html
+++ b/pr/4036/docs/iroh/endpoint/struct.Connection.html
@@ -8,7 +8,7 @@ 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<T: ConnectionState> Connection<T>
Implementations§
Source§impl<T: ConnectionState> Connection<T>
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.
@@ -18,13 +18,13 @@ consequence, the peer won’t be notified that a stream has been opened until th
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_bi(&self) -> AcceptBi<'_> ⓘ
Accepts 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 async fn closed(&self) -> ConnectionError
Waits 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.
@@ -97,17 +97,18 @@ strong and pseudorandom, and are suitable for use as keying material.
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)
See [noq_proto::TransportConfig::receive_window].
-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)
Sets the connection-level flow control receive window.
+See [noq_proto::TransportConfig::receive_window].
+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.
-Source§impl Connection<HandshakeCompleted>
Sourcepub fn remote_id(&self) -> EndpointId
Returns the EndpointId from the peer’s TLS certificate.
+Source§impl Connection<HandshakeCompleted>
Sourcepub fn remote_id(&self) -> EndpointId
Returns the EndpointId from the peer’s TLS certificate.
The PublicKey of an endpoint is also known as an EndpointId. This PublicKey is
included in the TLS certificate presented during the handshake when connecting.
This function allows you to get the EndpointId of the remote endpoint of this
connection.
-Sourcepub fn paths(&self) -> PathList<'_>
Returns the currently open network paths for this connection.
+Sourcepub fn paths(&self) -> PathList<'_>
Returns the currently open network paths for this connection.
A connection typically has one path via the relay server and,
once holepunching succeeds, a direct path. The returned
PathList is a snapshot taken at call time: it does not
@@ -116,14 +117,14 @@ already closed.
To observe changes over time, see Connection::paths_stream
for a stream of PathList snapshots and
Connection::path_events for individual PathEvents.
-Sourcepub fn paths_stream(&self) -> PathListStream<'_>
Returns a stream of PathList snapshots for this connection.
+Sourcepub fn paths_stream(&self) -> PathListStream<'_>
Returns a stream of PathList snapshots for this connection.
Yields the current snapshot on the first poll, and a fresh
snapshot whenever the open paths or the selected path change.
Ends when the connection closes.
The stream borrows this Connection. To consume it from a
spawned task, move a Connection clone into the task and
call this method inside.
-Sourcepub fn path_events(&self) -> PathEventStream
Returns a stream of PathEvents for this connection.
+Sourcepub fn path_events(&self) -> PathEventStream
Returns a stream of PathEvents for this connection.
Each event reports one of: a path opened, a path closed (with
final per-path statistics), the selected transmission path
changed, or the consumer fell behind. The stream ends when the
@@ -133,14 +134,14 @@ may be moved into a spawned task.
single PathEvent::Lagged; the current state of the open
paths and the selected path remains recoverable via
Connection::paths.
-Sourcepub fn weak_handle(&self) -> WeakConnectionHandle
Returns a WeakConnectionHandle for this connection.
+Sourcepub fn weak_handle(&self) -> WeakConnectionHandle
Returns a WeakConnectionHandle for this connection.
A WeakConnectionHandle does not keep the connection alive. It can be used to
wait for the connection to be closed via WeakConnectionHandle::closed and to
attempt to upgrade back to a strong Connection via
WeakConnectionHandle::upgrade.
-Source§impl Connection<IncomingZeroRtt>
Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
-Sourcepub async fn handshake_completed(&self) -> Result<Connection, ConnectingError>
Waits until the full handshake occurs and then returns a Connection.
+Source§impl Connection<IncomingZeroRtt>
Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
+Sourcepub async fn handshake_completed(&self) -> Result<Connection, ConnectingError>
Waits until the full handshake occurs and then returns a Connection.
This may fail with ConnectingError::ConnectionError, if there was
some general failure with the connection, such as a network timeout since
we accepted the connection.
@@ -149,18 +150,18 @@ doesn’t use the right TLS authentication, which usually every iroh endpoint
uses and requires.
Thus, those errors should only occur if someone connects to you with a
modified iroh endpoint or with a plain QUIC client.
-Sourcepub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError>
Returns the EndpointId from the peer’s TLS certificate.
+Sourcepub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError>
Returns the EndpointId from the peer’s TLS certificate.
The PublicKey of an endpoint is also known as an EndpointId. This PublicKey is
included in the TLS certificate presented during the handshake when connecting.
This function allows you to get the EndpointId of the remote endpoint of this
connection.
-Source§impl Connection<OutgoingZeroRtt>
Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
+Sourcepub async fn handshake_completed(
&self,
) -> Result<ZeroRttStatus, ConnectingError>
Waits until the full handshake occurs and returns a ZeroRttStatus.
-If ZeroRttStatus::Accepted is returned, than any streams created before
+
If ZeroRttStatus::Accepted is returned, then any streams created before
the handshake has completed can still be used.
-If ZeroRttStatus::Rejected is returned, than any streams created before
+
If ZeroRttStatus::Rejected is returned, then any streams created before
the handshake will error and any data sent should be re-sent on a
new stream.
This may fail with ConnectingError::ConnectionError, if there was
@@ -171,7 +172,7 @@ doesn’t use the right TLS authentication, which usually every iroh endpoint
uses and requires.
Thus, those errors should only occur if someone connects to you with a
modified iroh endpoint or with a plain QUIC client.
-Sourcepub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError>
Returns the EndpointId from the peer’s TLS certificate.
+Sourcepub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError>
Returns the EndpointId from the peer’s TLS certificate.
The PublicKey of an endpoint is also known as an EndpointId. This PublicKey is
included in the TLS certificate presented during the handshake when connecting.
This function allows you to get the EndpointId of the remote endpoint of this
diff --git a/pr/4036/docs/iroh/endpoint/struct.Endpoint.html b/pr/4036/docs/iroh/endpoint/struct.Endpoint.html
index cfd63c979e..0c6c2630b7 100644
--- a/pr/4036/docs/iroh/endpoint/struct.Endpoint.html
+++ b/pr/4036/docs/iroh/endpoint/struct.Endpoint.html
@@ -13,7 +13,7 @@ behaviour.
Endpoint::connect and Endpoint::accept methods. Once established, the
Connection gives access to most QUIC features. Individual streams to send data to
the peer are created using the Connection::open_bi, Connection::accept_bi,
-Connection::open_uni and Connection::open_bi functions.
+Connection::open_uni and Connection::accept_uni 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.
§Usage on Android
@@ -22,7 +22,7 @@ through JNI, which needs a JVM context published to DnsResolver for the supported
initialization paths.
-Implementations§
Source§impl Endpoint
Implementations§
Source§impl Endpoint
Sourcepub fn set_alpns(&self, alpns: Vec<Vec<u8>>)
Sets the list of accepted ALPN protocols.
This will only affect new incoming connections.
@@ -117,8 +117,8 @@ changes.
understand if the endpoint has ever been considered “online”. But after
that initial call to Endpoint::online, to understand if your
endpoint is no longer able to be connected to by endpoints outside
-of the private or local network, watch for changes in it’s EndpointAddr.
-If there are no addrsin the EndpointAddr, you may not be dialable by other endpoints
+of the private or local network, watch for changes in its EndpointAddr.
+If there are no addrs in the EndpointAddr, you may not be dialable by other endpoints
on the internet.
The EndpointAddr will change as:
@@ -146,7 +146,7 @@ tokio::spawn(endpoint_closed.run_until(async move {
}));
// Do fancy things, then close the endpoint.
// Our task above will stop even if there are still clones of `Endpoint` alive somewhere.
-endpoint.close().await;
Sourcepub async fn online(&self)
A convenience method that waits for the endpoint to be considered “online”.
This currently means at least one relay server has completed its
connection handshake (i.e. the endpoint is registered and reachable
via that relay). Merely selecting a relay URL is not sufficient.
@@ -167,49 +167,45 @@ entirely.
The online method does not interact with crate::address_lookup::AddressLookup
services, which means that any Address Lookup that relies on a WAN
connection is independent of the endpoint’s online status.
-§Examples
use iroh::Endpoint;
-
-#[tokio::main]
-async fn main() {
-// After this await returns, the endpoint is bound to a local socket.
-// It can be dialed, but almost certainly hasn't finished picking a
+§Examples
+// After this await returns, the endpoint is bound to a local socket.
+// It can be dialed, but almost certainly hasn't finished picking a
// relay.
-let endpoint = Endpoint::bind().await;
+let endpoint = Endpoint::bind(presets::N0).await?;
-// After this await returns we have a connection to at least one relay
+// After this await returns we have a connection to at least one relay
// and holepunching should work as expected.
-endpoint.online().await;
-}
Sourcepub fn home_relay_status(
+endpoint.online().await;
Sourcepub fn home_relay_status(
&self,
) -> impl Watcher<Value = Vec<RelayStatus>> + use<>
Returns a Watcher over the connection status of the endpoint’s home relays.
The watched value has one entry per home relay whose URL is known,
and is empty when no relays are configured or before the endpoint has
-selected one the home relay from the list of configured relays.
+selected a home relay from the list of configured relays.
The watcher updates whenever any home relay’s connection status changes.
See RelayStatus for the information available on each entry.
The returned watcher only becomes disconnected once the last clone of
the Endpoint is dropped. Closing the endpoint does not disconnect
the watcher. To stop a task once the endpoint stops, combine with
Self::closed.
-Sourcepub fn bound_sockets(&self) -> Vec<SocketAddr>
Available on non-wasm_browser only.
Returns the local socket addresses on which the underlying sockets are bound.
+Sourcepub fn bound_sockets(&self) -> Vec<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 dns_resolver(&self) -> Result<&DnsResolver, EndpointError>
Available on non-wasm_browser only.
Returns the DNS resolver used in this Endpoint.
+Sourcepub fn dns_resolver(&self) -> Result<&DnsResolver, EndpointError>
Available on non-wasm_browser only.
Sourcepub fn tls_config(&self) -> &ClientConfig
Returns the [rustls::ClientConfig] used by the endpoint for connecting to external services.
+Sourcepub fn tls_config(&self) -> &ClientConfig
Returns the [rustls::ClientConfig] used by the endpoint for connecting to external services.
This might be useful for address lookup services or other functions
that want to use the same trust anchors as iroh does for verifying the
validity of TLS certificates presented by external services.
Note that this TLS config is unrelated to how iroh validates the authenticity
of iroh connections itself.
The config is based on the trust anchors set via Builder::ca_tls_config.
-Sourcepub fn address_lookup(&self) -> Result<&AddressLookupServices, EndpointError>
Returns the Address Lookup service, if configured.
+Sourcepub fn address_lookup(&self) -> Result<&AddressLookupServices, EndpointError>
Returns the Address Lookup service, if configured.
§Errors
Returns a EndpointError::Closed error if the endpoint is closed.
-Sourcepub fn metrics(&self) -> &EndpointMetrics
Available on crate feature metrics only.
Returns metrics collected for this endpoint.
+Sourcepub fn metrics(&self) -> &EndpointMetrics
Available on crate feature metrics only.
Returns metrics collected for this endpoint.
The endpoint internally collects various metrics about its operation.
The returned EndpointMetrics struct contains all of these metrics.
You can access individual metrics directly by using the public fields:
@@ -275,13 +271,13 @@ registry.write().unwrap().register_all(endpoint.metrics());
.std_context("text")?;
assert!(res.contains(r#"TYPE socket_recv_datagrams counter"#));
-assert!(res.contains(r#"socket_recv_datagrams_total 0"#));Sourcepub async fn remote_info(&self, endpoint_id: EndpointId) -> Option<RemoteInfo>
Returns addressing information about a recently used remote endpoint.
+assert!(res.contains(r#"socket_recv_datagrams_total 0"#));Sourcepub async fn remote_info(&self, endpoint_id: EndpointId) -> Option<RemoteInfo>
Returns addressing information about a recently used remote endpoint.
The returned RemoteInfo contains a list of all transport addresses for the remote
that we know about. This is a snapshot in time and not a watcher.
Returns None if the endpoint doesn’t have information about the remote or if the endpoint is closed.
When remote endpoints are no longer used, our endpoint will keep information around
for a little while, and then drop it. Afterwards, this will return None.
-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
@@ -290,14 +286,14 @@ 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.
If the endpoint is closed, this method will log a warning and ignore the request.
-Sourcepub fn set_user_data_for_address_lookup(&self, user_data: Option<UserData>)
Sets the initial user-defined data to be published in Address Lookups for this endpoint.
+Sourcepub fn set_user_data_for_address_lookup(&self, user_data: Option<UserData>)
Sets the initial user-defined data to be published in Address Lookups for this endpoint.
If the user-defined data passed to this function is different to the previous one,
the endpoint will republish its endpoint info to the configured Address Lookups.
See also Builder::user_data_for_address_lookup for setting an initial value when
building the endpoint.
If the endpoint is closed, this method will log a warning and ignore the
request.
-Sourcepub async fn close(&self)
Closes the QUIC endpoint and the 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.
@@ -322,9 +318,9 @@ sockets. This is due to QUIC and its acknowledgments being implemented in user-l
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.
-Sourcepub fn closed(&self) -> EndpointClosed ⓘ
Returns a future that resolves once the endpoint closes.
+the respective Endpoint are dropped.
+Sourcepub fn closed(&self) -> EndpointClosed ⓘ
Returns a future that resolves once the endpoint closes.
The returned future does not contain a clone or reference to the Endpoint,
so keeping the returned future alive does not prevent the endpoint from being dropped.
To run a task and stop it once the endpoint closes, you can use
@@ -333,7 +329,7 @@ so keeping the returned future alive does not prevent the endpoint from being dr
let endpoint = Endpoint::bind(presets::N0).await?;
tokio::spawn(endpoint.closed().run_until(async move {
// the future will be aborted once the endpoint closes.
-}));
Sourcepub fn create_server_config_builder(
+}));
Sourcepub fn create_server_config_builder(
&self,
alpns: Vec<Vec<u8>>,
) -> ServerConfigBuilder
Create a ServerConfigBuilder for this endpoint that includes the given alpns.
diff --git a/pr/4036/docs/iroh/endpoint/struct.EndpointClosed.html b/pr/4036/docs/iroh/endpoint/struct.EndpointClosed.html
index 85b8fd921b..1a2b9e3683 100644
--- a/pr/4036/docs/iroh/endpoint/struct.EndpointClosed.html
+++ b/pr/4036/docs/iroh/endpoint/struct.EndpointClosed.html
@@ -1,9 +1,9 @@
-EndpointClosed in iroh::endpoint - Rust EndpointClosed
pub struct EndpointClosed { /* private fields */ }
Expand description
Future returned from Endpoint::closed.
-Implementations§
Source§impl EndpointClosed
Sourcepub async fn run_until<F: Future>(self, fut: F) -> Option<F::Output>
Runs a future to completion, or until the Endpoint is closed.
+EndpointClosed in iroh::endpoint - Rust EndpointClosed
pub struct EndpointClosed { /* private fields */ }
Expand description
Future returned from Endpoint::closed.
+Implementations§
Trait Implementations§
Source§impl Debug for EndpointClosed
Source§impl Future for EndpointClosed
Source§impl<'pin> Unpin for EndpointClosedwhere
+
Trait Implementations§
Source§impl Debug for EndpointClosed
Source§impl Future for EndpointClosed
Source§impl<'pin> Unpin for EndpointClosedwhere
PinnedFieldsOf<__EndpointClosed<'pin>>: Unpin,
Auto Trait Implementations§
§impl !Freeze for EndpointClosed
§impl !RefUnwindSafe for EndpointClosed
§impl Send for EndpointClosed
§impl Sync for EndpointClosed
§impl !UnwindSafe for EndpointClosed
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/4036/docs/iroh/endpoint/struct.Incoming.html b/pr/4036/docs/iroh/endpoint/struct.Incoming.html
index d0a2c29af8..eca1097eca 100644
--- a/pr/4036/docs/iroh/endpoint/struct.Incoming.html
+++ b/pr/4036/docs/iroh/endpoint/struct.Incoming.html
@@ -24,7 +24,7 @@ to customize a Sourcepub fn remote_addr_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_addr().
-Sourcepub fn decrypt(&self) -> Option<DecryptedInitial>
Decrypt the Initial packet payload
+Sourcepub fn decrypt(&self) -> Option<DecryptedInitial>
Decrypts the Initial packet payload.
This clones and decrypts the packet payload (~1200 bytes).
Can be used to extract information from the TLS ClientHello without completing the handshake.
Trait Implementations§
Source§impl IntoFuture for Incoming
Source§type Output = Result<Connection, ConnectingError>
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§
Source§impl<T> Any for Twhere
diff --git a/pr/4036/docs/iroh/endpoint/struct.QuicTransportConfigBuilder.html b/pr/4036/docs/iroh/endpoint/struct.QuicTransportConfigBuilder.html
index 3a193bd40a..5189f21509 100644
--- a/pr/4036/docs/iroh/endpoint/struct.QuicTransportConfigBuilder.html
+++ b/pr/4036/docs/iroh/endpoint/struct.QuicTransportConfigBuilder.html
@@ -136,7 +136,7 @@ enable multipath as well.
If the path is idle for this long the path will be abandoned. Bear in mind this will
interact with the QuicTransportConfigBuilder::max_idle_timeout, if the last path is
abandoned the entire connection will be closed.
-Note: values higher than [PATH_MAX_IDLE_TIMEOUT] are clamped and a warning is logged.
+Note: values higher than PATH_MAX_IDLE_TIMEOUT (15 seconds) are clamped and a warning is logged.
Sourcepub fn default_path_keep_alive_interval(self, interval: Duration) -> Self
Sets a default per-path keep alive interval.
Note that this does not interact with the connection-wide
QuicTransportConfigBuilder::keep_alive_interval. This setting will keep this path active,
diff --git a/pr/4036/docs/iroh/endpoint/struct.RelayStatus.html b/pr/4036/docs/iroh/endpoint/struct.RelayStatus.html
index 175b637f76..a1abba7e98 100644
--- a/pr/4036/docs/iroh/endpoint/struct.RelayStatus.html
+++ b/pr/4036/docs/iroh/endpoint/struct.RelayStatus.html
@@ -1,13 +1,13 @@
-
RelayStatus in iroh::endpoint - Rust RelayStatus
pub struct RelayStatus { /* private fields */ }
Expand description
Connection status of a single home relay.
+RelayStatus in iroh::endpoint - Rust RelayStatus
pub struct RelayStatus { /* private fields */ }
Expand description
Connection status of a single home relay.
Observed via Endpoint::home_relay_status.
-Implementations§
Source§impl RelayStatus
Sourcepub fn is_connected(&self) -> bool
Returns true if the endpoint is connected to the relay.
-Sourcepub fn last_error(&self) -> Option<&AnyError>
Returns the most recent connection error, if the relay is currently
+
Implementations§
Source§impl RelayStatus
Sourcepub fn is_connected(&self) -> bool
Returns true if the endpoint is connected to the relay.
+Sourcepub fn last_error(&self) -> Option<&AnyError>
Returns the most recent connection error, if the relay is currently
disconnected.
Returns None when the relay is connected, or when the endpoint has
not yet observed a failed connection attempt.
-Trait Implementations§
Source§impl Clone for RelayStatus
Source§fn clone(&self) -> RelayStatus
Returns a duplicate 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 RelayStatus
Source§impl PartialEq for RelayStatus
Source§impl Eq for RelayStatus
Source§impl StructuralPartialEq for RelayStatus
Auto Trait Implementations§
§impl Freeze for RelayStatus
§impl !RefUnwindSafe for RelayStatus
§impl Send for RelayStatus
§impl Sync for RelayStatus
§impl Unpin for RelayStatus
§impl !UnwindSafe for RelayStatus
Blanket Implementations§
Trait Implementations§
Source§impl Clone for RelayStatus
Source§fn clone(&self) -> RelayStatus
Returns a duplicate 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 RelayStatus
Source§impl PartialEq for RelayStatus
Source§impl Eq for RelayStatus
Source§impl StructuralPartialEq for RelayStatus
Auto Trait Implementations§
§impl Freeze for RelayStatus
§impl !RefUnwindSafe for RelayStatus
§impl Send for RelayStatus
§impl Sync for RelayStatus
§impl Unpin for RelayStatus
§impl !UnwindSafe for RelayStatus
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/4036/docs/iroh/endpoint/struct.VarInt.html b/pr/4036/docs/iroh/endpoint/struct.VarInt.html
index 0acf99654d..007540d1af 100644
--- a/pr/4036/docs/iroh/endpoint/struct.VarInt.html
+++ b/pr/4036/docs/iroh/endpoint/struct.VarInt.html
@@ -13,7 +13,7 @@ An integer less than 2^62
of overflowing.
Trait Implementations§
§impl From<VarInt> for IdleTimeout
§fn from(inner: VarInt) -> IdleTimeout
Converts to this type from the input type.§impl From<VarInt> for IdleTimeout
§fn from(inner: VarInt) -> IdleTimeout
Converts to this type from the input type.§impl Ord for VarInt
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
diff --git a/pr/4036/docs/iroh/endpoint/struct.WeakConnectionHandle.html b/pr/4036/docs/iroh/endpoint/struct.WeakConnectionHandle.html
index 47f6c23610..07bad208d7 100644
--- a/pr/4036/docs/iroh/endpoint/struct.WeakConnectionHandle.html
+++ b/pr/4036/docs/iroh/endpoint/struct.WeakConnectionHandle.html
@@ -1,18 +1,18 @@
-WeakConnectionHandle in iroh::endpoint - Rust WeakConnectionHandle
pub struct WeakConnectionHandle { /* private fields */ }
Expand description
A weak handle to a Connection.
+WeakConnectionHandle in iroh::endpoint - Rust WeakConnectionHandle
pub struct WeakConnectionHandle { /* private fields */ }
Expand description
A weak handle to a Connection.
A WeakConnectionHandle does not keep the connection alive: holding one will not
prevent the connection from being closed when the last Connection handle is dropped.
Use upgrade to obtain a strong Connection, and closed to wait for the
connection to be closed without keeping it alive.
-Implementations§
Source§impl WeakConnectionHandle
Sourcepub fn upgrade(&self) -> Option<Connection>
Attempts to upgrade this weak handle to a strong Connection.
+Implementations§
Source§impl WeakConnectionHandle
Sourcepub fn upgrade(&self) -> Option<Connection>
Attempts to upgrade this weak handle to a strong Connection.
Returns None if the connection has already been dropped.
-Sourcepub fn closed(&self) -> impl Future<Output = Option<Closed>> + Send + 'static
Returns a future that resolves once the connection has been closed.
+Sourcepub fn closed(&self) -> impl Future<Output = Option<Closed>> + Send + 'static
Returns a future that resolves once the connection has been closed.
If no strong references to the Connection exist at the time this is called,
the future resolves to None. If at least one strong reference still exists at
the time of this call, the returned future is guaranteed to receive the close
event with the close reason and final connection statistics, even if all strong
references are dropped before the future is awaited.
The future does not keep the connection alive.
-Trait Implementations§
Source§impl Clone for WeakConnectionHandle
Source§fn clone(&self) -> WeakConnectionHandle
Returns a duplicate 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 WeakConnectionHandle
§impl !RefUnwindSafe for WeakConnectionHandle
§impl Send for WeakConnectionHandle
§impl Sync for WeakConnectionHandle
§impl Unpin for WeakConnectionHandle
§impl !UnwindSafe for WeakConnectionHandle
Blanket Implementations§
Trait Implementations§
Source§impl Clone for WeakConnectionHandle
Source§fn clone(&self) -> WeakConnectionHandle
Returns a duplicate 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 WeakConnectionHandle
§impl !RefUnwindSafe for WeakConnectionHandle
§impl Send for WeakConnectionHandle
§impl Sync for WeakConnectionHandle
§impl Unpin for WeakConnectionHandle
§impl !UnwindSafe for WeakConnectionHandle
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/4036/docs/iroh/endpoint/trait.EndpointHooks.html b/pr/4036/docs/iroh/endpoint/trait.EndpointHooks.html
index 2ac883dd5d..90c7ff04fc 100644
--- a/pr/4036/docs/iroh/endpoint/trait.EndpointHooks.html
+++ b/pr/4036/docs/iroh/endpoint/trait.EndpointHooks.html
@@ -17,7 +17,7 @@
For each hook, all installed hooks are invoked in the order they were installed on
the endpoint builder. If a hook returns Accept, processing continues with the next
hook. If a hook returns Reject, processing is aborted and further hooks
-are not invoked for this hook.
+are not invoked for this hook point.
§Notes to implementers
As hooks are stored on the endpoint, you must make sure to never store an Endpoint
on the hook struct itself, as this would create reference counting loop and cause the
diff --git a/pr/4036/docs/iroh/endpoint_info/index.html b/pr/4036/docs/iroh/endpoint_info/index.html
index f27fe3b898..4a60b9fd8f 100644
--- a/pr/4036/docs/iroh/endpoint_info/index.html
+++ b/pr/4036/docs/iroh/endpoint_info/index.html
@@ -1,11 +1,11 @@
iroh::endpoint_info - Rust Module endpoint_info
Expand description
Support for handling DNS resource records for dialing by EndpointId.
Dialing by EndpointId is supported by iroh endpoints publishing Pkarr records to DNS
servers or the Mainline DHT. This module supports creating and parsing these records.
-EndpointInfo combines an iroh_base::EndpointId with EndpointData —
+
EndpointInfo combines an iroh_base::EndpointId with EndpointData:
the addressing and metadata that discovery services publish and resolve.
Discovery services use AddrFilter to control which addresses are published.
This module also provides serialization to and from pkarr signed packets and
-DNS TXT records. See the [crate::attrs] module for the on-the-wire format.
+DNS TXT records.
DNS records are published under the following names:
_iroh.<z32-endpoint-id>.<origin-domain> TXT
@@ -36,4 +36,4 @@ Each address is an IPv4 or IPv6 address with a port.
Structs§
- Addr
Filter - A filter and/or reordering function applied to transport addresses,
-typically used by AddressLookup services in iroh before publishing.
- Endpoint
Data - Data about an endpoint that may be published to and resolved from discovery services.
- Endpoint
Info - Information about an endpoint that may be published to and resolved from discovery services.
- MaxLength
ExceededError - Error returned when an input value is too long for
UserData. - User
Data - Under the hood this is a UTF-8 String is no longer than
UserData::MAX_LENGTH bytes.
\ No newline at end of file
+typically used by AddressLookup services in iroh before publishing.EndpointData Data about an endpoint that may be published to and resolved from discovery services. EndpointInfo Information about an endpoint that may be published to and resolved from discovery services. MaxLengthExceededError Error returned when an input value is too long for UserData. UserData User-defined data that can be published and resolved through endpoint discovery.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint_info/struct.EndpointData.html b/pr/4036/docs/iroh/endpoint_info/struct.EndpointData.html
index eaf2725892..2c818ea5b4 100644
--- a/pr/4036/docs/iroh/endpoint_info/struct.EndpointData.html
+++ b/pr/4036/docs/iroh/endpoint_info/struct.EndpointData.html
@@ -13,15 +13,15 @@ services, should they not fit into e.g. a single DNS packet otherwise.
See also Self::set_user_data.
Sourcepub fn add_relay_url(&mut self, relay_url: RelayUrl)
Adds the relay URL to the end of the endpoint data, unless it already existed.
Sourcepub fn add_ip_addrs(&mut self, addresses: Vec<SocketAddr>)
Adds addresses in order with duplicates or already existing addresses filtered out.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Adds addresses to the endpoint data in the given ordered, but with duplicates filtered.
-Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data and returns the updated endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Adds addresses to the endpoint data in the given order, but with duplicates filtered.
+Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data.
Sourcepub fn clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn clear_relay_urls(&mut self)
Removes all relay URLs from the endpoint data.
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses.
+Sourcepub fn filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
Returns a vec to allow re-ordering of addresses.
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
diff --git a/pr/4036/docs/iroh/endpoint_info/struct.UserData.html b/pr/4036/docs/iroh/endpoint_info/struct.UserData.html
index 3352480631..e73207e05e 100644
--- a/pr/4036/docs/iroh/endpoint_info/struct.UserData.html
+++ b/pr/4036/docs/iroh/endpoint_info/struct.UserData.html
@@ -1,4 +1,5 @@
-UserData in iroh::endpoint_info - Rust 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.
+UserData in iroh::endpoint_info - Rust UserData
pub struct UserData(/* private fields */);
Expand description
User-defined data that can be published and resolved through endpoint discovery.
+Under the hood this is a UTF-8 string 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.
diff --git a/pr/4036/docs/iroh/enum.KeyParsingError.html b/pr/4036/docs/iroh/enum.KeyParsingError.html
index 765ac27ad2..146ec05698 100644
--- a/pr/4036/docs/iroh/enum.KeyParsingError.html
+++ b/pr/4036/docs/iroh/enum.KeyParsingError.html
@@ -1,4 +1,4 @@
-KeyParsingError in iroh - Rust KeyParsingError
#[non_exhaustive]pub enum KeyParsingError {
+KeyParsingError in iroh - Rust KeyParsingError
#[non_exhaustive]pub enum KeyParsingError {
FailedToDecodeHex {
meta: Meta,
},
@@ -11,14 +11,14 @@
InvalidKeyData {
meta: Meta,
},
-}
Expand description
Error when deserialising a PublicKey or a SecretKey.
+}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§FailedToDecodeHex
The input string could not be decoded as hex.
Fields
§meta: MetaCaptured call-site metadata
§FailedToDecodeBase32
The input string could not be decoded as base32.
Fields
§meta: MetaCaptured call-site metadata
§InvalidLength
The input has invalid length.
Fields
§meta: MetaCaptured call-site metadata
-§InvalidKeyData
The decoded data is not a valid Ed25591 public key.
+§InvalidKeyData
The decoded data is not a valid Ed25519 public key.
Fields
§meta: MetaCaptured call-site metadata
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<KeyParsingError> for ParseError
Source§fn from(source: KeyParsingError) -> ParseError
Converts to this type from the input type.Source§impl StackError for KeyParsingError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<KeyParsingError>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Returns the next source in the chain, if any.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.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
diff --git a/pr/4036/docs/iroh/enum.TransportAddr.html b/pr/4036/docs/iroh/enum.TransportAddr.html
index df614a51ee..0e5f31d772 100644
--- a/pr/4036/docs/iroh/enum.TransportAddr.html
+++ b/pr/4036/docs/iroh/enum.TransportAddr.html
@@ -3,8 +3,8 @@
Ip(SocketAddr),
Custom(CustomAddr),
}Expand description
Available address types.
-Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§Relay(RelayUrl)
Relays
-§Ip(SocketAddr)
IP based addresses
+Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§Relay(RelayUrl)
A relay server address.
+§Ip(SocketAddr)
An IP based address.
§Custom(CustomAddr)
Custom transport address
Implementations§
Source§impl TransportAddr
Sourcepub fn is_ip(&self) -> bool
Whether this is an IP transport address.
diff --git a/pr/4036/docs/iroh/index.html b/pr/4036/docs/iroh/index.html
index a2ddd5617a..8c7bddcb16 100644
--- a/pr/4036/docs/iroh/index.html
+++ b/pr/4036/docs/iroh/index.html
@@ -1,5 +1,5 @@
iroh - Rust Crate iroh
Expand description
Peer-to-peer QUIC connections.
-iroh is a library to establish direct connectivity between peers. It exposes an
+
iroh is a library to establish direct connectivity between peers. It exposes an
interface to QUIC connections and streams to the user, while implementing direct
connectivity using hole punching complemented by relay servers under the hood.
An iroh endpoint is created and controlled by the Endpoint, e.g. connecting to
@@ -44,7 +44,7 @@ punching if needed. Once the direct connection is established the relay ser
longer involved in the connection.
If one of the iroh endpoints can be reached directly, connectivity can also be
established without involving a Relay server. This is done by using the endpoint’s
-listening addresses in the connection establishement instead of the RelayUrl which
+listening addresses in the connection establishment instead of the RelayUrl which
is used to identify a Relay server. Of course it is also possible to use both a
RelayUrl and direct addresses at the same time to connect.
§Encryption
@@ -179,4 +179,4 @@ connecting using only the Ok(())
}
Please see the examples directory for more nuanced examples.
-Re-exports§
Modules§
- address_
lookup - Lookup the address of an Endpoint ID.
- defaults
- Default values used in
iroh - dns
Non-wasm_browser - Configurable DNS resolver.
- endpoint
- The
Endpoint allows establishing connections to other iroh endpoints. - endpoint_
info - Support for handling DNS resource records for dialing by
EndpointId. - metrics
- Co-locating all of the iroh metrics structs
- protocol
- Tools for spawning an accept loop that routes incoming requests to the right protocol.
- test_
utils test-utils - Internal utilities to support testing.
- tls
- TLS configuration for iroh.
Structs§
- Endpoint
Addr - Network-level addressing information for an iroh endpoint.
- NetReport
- A net_report report.
- NetReport
Config - Configuration for the net report component.
- Public
Key - A public key.
- Relay
Config - Information on a specific relay server.
- Relay
Map - List of relay server configurations to be used in an iroh endpoint.
- Relay
Url - A URL identifying a relay server.
- Relay
UrlParseError - Can occur when parsing a string into a
RelayUrl. - Secret
Key - A secret key.
- Signature
- Ed25519 signature.
- Signature
Error - Verification of a signature failed.
Enums§
- KeyParsing
Error - Error when deserialising a
PublicKey or a SecretKey. - Transport
Addr - Available address types.
Constants§
- NET_
REPORT_TIMEOUT - The maximum amount of time, in seconds, the net_report will spend gathering a single report.
Traits§
- Watcher
- A handle to a value that’s represented by one or more underlying [
Watchable]s.
Type Aliases§
- Endpoint
Id - The identifier for an endpoint in the (iroh) network.
\ No newline at end of file
+Re-exports§
Modules§
- address_
lookup - Lookup the address of an Endpoint ID.
- defaults
- Default values used in
iroh - dns
Non-wasm_browser - Configurable DNS resolver.
- endpoint
- The
Endpoint allows establishing connections to other iroh endpoints. - endpoint_
info - Support for handling DNS resource records for dialing by
EndpointId. - metrics
- Co-locating all of the iroh metrics structs
- protocol
- Tools for spawning an accept loop that routes incoming requests to the right protocol.
- test_
utils test-utils - Internal utilities to support testing.
- tls
- TLS configuration for iroh.
Structs§
- Endpoint
Addr - Network-level addressing information for an iroh endpoint.
- NetReport
- A net_report report.
- NetReport
Config - Configuration for the net report component.
- Public
Key - A public key.
- Relay
Config - Information on a specific relay server.
- Relay
Map - List of relay server configurations to be used in an iroh endpoint.
- Relay
Url - A URL identifying a relay server.
- Relay
UrlParseError - Can occur when parsing a string into a
RelayUrl. - Secret
Key - A secret key.
- Signature
- Ed25519 signature.
- Signature
Error - Verification of a signature failed.
Enums§
- KeyParsing
Error - Error returned when parsing a
PublicKey or a SecretKey. - Transport
Addr - Available address types.
Constants§
- NET_
REPORT_TIMEOUT - The maximum amount of time, in seconds, the net_report will spend gathering a single report.
Traits§
- Watcher
- A handle to a value that’s represented by one or more underlying [
Watchable]s.
Type Aliases§
- Endpoint
Id - The identifier for an endpoint in the (iroh) network.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/metrics/index.html b/pr/4036/docs/iroh/metrics/index.html
index da53db7d6a..00f2275127 100644
--- a/pr/4036/docs/iroh/metrics/index.html
+++ b/pr/4036/docs/iroh/metrics/index.html
@@ -1,2 +1,2 @@
iroh::metrics - Rust Module metrics
Expand description
Co-locating all of the iroh metrics structs
-Structs§
- Endpoint
Metrics - Metrics collected by an
crate::endpoint::Endpoint. - NetReport
Metrics - Enum of metrics for the module
- Relay
Metrics test-utils - Metrics tracked for the relay server
- Socket
Metrics - Enum of metrics for the module
\ No newline at end of file
+Structs§
- Endpoint
Metrics - Metrics collected by an
crate::endpoint::Endpoint. - NetReport
Metrics - Enum of metrics for the module
- Relay
Metrics test-utils - Metrics tracked for the relay server
- Socket
Metrics - Metrics collected by the iroh socket.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/metrics/struct.RelayMetrics.html b/pr/4036/docs/iroh/metrics/struct.RelayMetrics.html
index f8768e50a1..da2588f738 100644
--- a/pr/4036/docs/iroh/metrics/struct.RelayMetrics.html
+++ b/pr/4036/docs/iroh/metrics/struct.RelayMetrics.html
@@ -26,21 +26,26 @@
pub http_connections_closed: Counter,
pub http_connections_errored: Counter,
}Available on crate feature test-utils only.Expand description
Metrics tracked for the relay server
-Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.§bytes_sent: CounterBytes sent from a FrameType::SendPacket
-§bytes_recv: CounterBytes received from a FrameType::SendPacket
-§send_packets_sent: CounterFrameType::SendPacket sent
-§send_packets_recv: CounterFrameType::SendPacket received
-§send_packets_dropped: CounterFrameType::SendPacket dropped
-§other_packets_sent: CounterPackets of other FrameTypes sent
-§other_packets_recv: CounterPackets of other FrameTypes received
-§other_packets_dropped: CounterPackets of other FrameTypes dropped
-§got_ping: CounterNumber of FrameType::Pings received
-§sent_pong: CounterNumber of FrameType::Pongs sent
-§unknown_frames: CounterNumber of FrameType::Unknown received
+Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.§bytes_sent: CounterBytes sent to a client in RelayToClientDatagram or RelayToClientDatagramBatch frames.
+§bytes_recv: CounterBytes received from a client in ClientToRelayDatagram or ClientToRelayDatagramBatch frames.
+§send_packets_sent: CounterRelayToClientDatagram or RelayToClientDatagramBatch frames sent to a client.
+§send_packets_recv: CounterClientToRelayDatagram or ClientToRelayDatagramBatch frames received from a client.
+§send_packets_dropped: CounterRelayToClientDatagram or RelayToClientDatagramBatch frames dropped instead of being
+delivered to a client, because the recipient is not connected or writing to its stream failed.
+Note that frames dropped because the recipient’s send queue is full or closed are not counted
+here.
+§other_packets_sent: CounterIntended to count sent frames other than datagrams, but currently unused (never incremented).
+§other_packets_recv: CounterIntended to count received frames other than datagrams, but currently unused (never incremented).
+§other_packets_dropped: CounterIntended to count dropped frames other than datagrams, but currently unused (never incremented).
+§got_ping: CounterNumber of FrameType::Ping frames received from a client.
+§sent_pong: CounterNumber of FrameType::Pong frames sent to a client.
+§unknown_frames: CounterIntended to count received frames with an unrecognized FrameType,
+but currently unused (never incremented).
§bytes_rx_ratelimited_total: CounterNumber of bytes received from client connection which have been rate-limited.
§conns_rx_ratelimited_total: CounterNumber of client connections which have had any frames rate-limited.
§accepts: CounterNumber of times this server has accepted a connection.
-§disconnects: CounterNumber of connections we have removed because of an error
+§disconnects: CounterNumber of times a client connection was disconnected.
+Incremented once per connection, paired with Self::accepts.
§unique_client_keys: CounterNumber of unique client keys per day
§clients_inactive_added: CounterNumber of times a client was moved into the inactive state.
A client becomes inactive when a new client connects with the same endpoint id. An inactive
diff --git a/pr/4036/docs/iroh/metrics/struct.SocketMetrics.html b/pr/4036/docs/iroh/metrics/struct.SocketMetrics.html
index 2291657920..f61d3786bb 100644
--- a/pr/4036/docs/iroh/metrics/struct.SocketMetrics.html
+++ b/pr/4036/docs/iroh/metrics/struct.SocketMetrics.html
@@ -1,4 +1,4 @@
-
SocketMetrics in iroh::metrics - Rust SocketMetrics
#[non_exhaustive]pub struct SocketMetrics {Show 31 fields
+SocketMetrics in iroh::metrics - Rust SocketMetrics
#[non_exhaustive]pub struct SocketMetrics {Show 31 fields
pub update_direct_addrs: Counter,
pub send_ipv4: Counter,
pub send_ipv6: Counter,
@@ -30,10 +30,23 @@
pub actor_tick_direct_addr_heartbeat: Counter,
pub actor_link_change: Counter,
pub actor_tick_other: Counter,
-}
Expand description
Enum of metrics for the module
-Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.§update_direct_addrs: Counter§send_ipv4: Counter§send_ipv6: Counter§send_relay: Counter§recv_data_relay: Counter§recv_data_custom: Counter§recv_data_ipv4: Counter§recv_data_ipv6: Counter§recv_datagrams: CounterNumber of QUIC datagrams received.
-§recv_gro_datagrams: CounterNumber of datagrams received using GRO
-§relay_home_change: Counter§holepunch_attempts: CounterThe number of times holepunching is initiated on a connection.
+}Expand description
Metrics collected by the iroh socket.
+Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.§update_direct_addrs: CounterIntended to count updates to the local direct address set, but currently unused
+(never incremented).
+§send_ipv4: CounterNumber of bytes sent over IPv4.
+§send_ipv6: CounterNumber of bytes sent over IPv6.
+§send_relay: CounterNumber of bytes sent over the relay transport.
+§recv_data_relay: CounterNumber of data bytes received over the relay transport.
+§recv_data_custom: CounterNumber of data bytes received over any custom transport.
+§recv_data_ipv4: CounterNumber of data bytes received over IPv4.
+§recv_data_ipv6: CounterNumber of data bytes received over IPv6.
+§recv_datagrams: CounterNumber of QUIC datagrams received.
+§recv_gro_datagrams: CounterNumber of receive events that used GRO (coalesced datagram batches).
+This counts batches, not the individual datagrams within them. See
+Self::recv_datagrams for the datagram count.
+§relay_home_change: CounterNumber of times the home relay changed to a different relay.
+This includes the initial assignment from no home relay to a home relay.
+§holepunch_attempts: CounterThe number of times holepunching is initiated on a connection.
This can be incremented multiple times for a single connection. Note that only the
client-side of a connection will increment this counter.
§paths_direct: CounterThe number of network paths to peers that are direct.
@@ -53,8 +66,15 @@ the number of opened connections.
§transport_relay_paths_removed: CounterNumber of relay transport paths closed.
§transport_custom_paths_added: CounterNumber of custom transport paths opened.
§transport_custom_paths_removed: CounterNumber of custom transport paths closed.
-§actor_tick_main: Counter§actor_tick_msg: Counter§actor_tick_re_stun: Counter§actor_tick_portmap_changed: Counter§actor_tick_direct_addr_heartbeat: Counter§actor_link_change: Counter§actor_tick_other: CounterTrait Implementations§
Source§impl<'de> Deserialize<'de> for Metrics
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Iterable for Metrics
Source§fn metric_field_count(&self) -> usize
Returns the number of metric fields in the struct.Source§fn metric_field_ref(&self, n: usize) -> Option<MetricItem<'_>>
Returns the metric field at the given index.§fn family_field_count(&self) -> usize
Returns the number of Family fields in the struct.§fn family_field_ref(&self, _n: usize) -> Option<FamilyItem<'_>>
Returns the Family field at the given index.Source§impl Serialize for Metrics
Source§fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where
+§actor_tick_main: CounterNumber of iterations of the main socket actor loop.
+§actor_tick_msg: CounterNumber of actor messages processed by the socket actor loop.
+§actor_tick_re_stun: CounterNumber of periodic re-STUN timer ticks handled by the socket actor loop.
+§actor_tick_portmap_changed: CounterNumber of port-mapping change events handled by the socket actor loop.
+§actor_tick_direct_addr_heartbeat: CounterIntended to count direct address heartbeat ticks, but currently unused (never incremented).
+§actor_link_change: CounterNumber of local network interface (link) change events handled by the socket actor loop.
+§actor_tick_other: CounterNumber of times an input watcher or receiver closed in the socket actor loop.
+Trait Implementations§
Source§impl<'de> Deserialize<'de> for Metrics
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Iterable for Metrics
Source§fn metric_field_count(&self) -> usize
Returns the number of metric fields in the struct.Source§fn metric_field_ref(&self, n: usize) -> Option<MetricItem<'_>>
Returns the metric field at the given index.§fn family_field_count(&self) -> usize
Returns the number of Family fields in the struct.§fn family_field_ref(&self, _n: usize) -> Option<FamilyItem<'_>>
Returns the Family field at the given index.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
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/4036/docs/iroh/protocol/enum.IncomingFilterOutcome.html b/pr/4036/docs/iroh/protocol/enum.IncomingFilterOutcome.html
index e11345eddc..4577fe8eaf 100644
--- a/pr/4036/docs/iroh/protocol/enum.IncomingFilterOutcome.html
+++ b/pr/4036/docs/iroh/protocol/enum.IncomingFilterOutcome.html
@@ -11,7 +11,7 @@ the source address, actively refuse the connection, or silently drop it.
What this does depends on the connection type:
-
-
Direct (UDP) connections : this is QUIC source address
+
Direct (UDP) connections: this is QUIC source address
validation. If the socket address was spoofed, the retry token is
sent to the spoofed address, so we never hear from the attacker
again. If the address was real, the client repeats the connection
@@ -20,7 +20,7 @@ attempt with the token, and the next
-
-
Relay connections : there is no source address to validate
+
Relay connections: there is no source address to validate
(the relay already vouches for the packet origin), so the
“validation” itself has no security meaning. However, the retry
still imposes a real cost on the client: an extra round trip
diff --git a/pr/4036/docs/iroh/protocol/struct.RouterBuilder.html b/pr/4036/docs/iroh/protocol/struct.RouterBuilder.html
index dfc8969679..06b2f59fad 100644
--- a/pr/4036/docs/iroh/protocol/struct.RouterBuilder.html
+++ b/pr/4036/docs/iroh/protocol/struct.RouterBuilder.html
@@ -16,7 +16,7 @@ cheaper signals (e.g. remote address) first.
with this alpn.
handler can either be a type that implements ProtocolHandler or a
Box<dyn DynProtocolHandler>.
-
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for RouterBuilder
§impl !RefUnwindSafe for RouterBuilder
§impl Send for RouterBuilder
§impl Sync for RouterBuilder
§impl Unpin for RouterBuilder
§impl !UnwindSafe for RouterBuilder
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/4036/docs/iroh/struct.EndpointAddr.html b/pr/4036/docs/iroh/struct.EndpointAddr.html
index 0aa53df633..867818d655 100644
--- a/pr/4036/docs/iroh/struct.EndpointAddr.html
+++ b/pr/4036/docs/iroh/struct.EndpointAddr.html
@@ -5,7 +5,7 @@
This combines an endpoint’s identifier with network-level addressing information of how to
contact the endpoint.
To establish a network connection to an endpoint both the EndpointId and one or more network
-paths are needed. The network paths can come from various sources, current sources can come from
+paths are needed. The network paths can come from various sources:
-
An Address Lookup service which can provide routing information for a given EndpointId.
@@ -24,7 +24,7 @@ connection without the help of a Fields§§id: PublicKeyThe endpoint’s identifier.
-§addrs: BTreeSet<TransportAddr>The endpoint’s addresses
+§addrs: BTreeSet<TransportAddr>The endpoint’s addresses.
Implementations§
Source§impl EndpointAddr
Sourcepub fn new(id: PublicKey) -> EndpointAddr
Creates a new EndpointAddr with no network level addresses.
This still is usable with e.g. an address lookup service to establish a connection,
depending on the situation.
@@ -38,9 +38,9 @@ depending on the situation.
self,
addrs: impl IntoIterator<Item = TransportAddr>,
) -> EndpointAddrAdds a list of addresses.
-Sourcepub fn is_empty(&self) -> bool
Returns true, if only a EndpointId is present.
-Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns a list of IP addresses of this peer.
-Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns a list of relay urls of this peer.
+Sourcepub fn is_empty(&self) -> bool
Returns true if only an EndpointId is present.
+Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns an iterator over the IP addresses of this endpoint address.
+Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns an iterator over the relay URLs of this endpoint address.
In practice this is expected to be zero or one home relay for all known cases currently.
Trait Implementations§
Source§impl Clone for EndpointAddr
Source§fn clone(&self) -> EndpointAddr
Returns a duplicate 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 EndpointAddr
Source§impl<'de> Deserialize<'de> for EndpointAddr
Source§fn deserialize<__D>(
__deserializer: __D,
diff --git a/pr/4036/docs/iroh/struct.NetReport.html b/pr/4036/docs/iroh/struct.NetReport.html
index 693c855529..8b8ec1aed1 100644
--- a/pr/4036/docs/iroh/struct.NetReport.html
+++ b/pr/4036/docs/iroh/struct.NetReport.html
@@ -1,4 +1,4 @@
-NetReport in iroh - Rust NetReport
pub struct NetReport {
+NetReport in iroh - Rust NetReport
pub struct NetReport {
pub udp_v4: bool,
pub udp_v6: bool,
pub mapping_varies_by_dest_ipv4: Option<bool>,
@@ -13,17 +13,16 @@
§udp_v6: boolA QAD IPv6 round trip completed.
§mapping_varies_by_dest_ipv4: Option<bool>Whether the reported public address differs when probing different servers (on IPv4).
§mapping_varies_by_dest_ipv6: Option<bool>Whether the reported public address differs when probing different servers (on IPv6).
-§preferred_relay: Option<RelayUrl>Probe indicating the presence of port mapping protocols on the LAN.
-None for unknown
-§relay_latency: RelayLatencieskeyed by relay Url
-§global_v4: Option<SocketAddrV4>ip:port of global IPv4
-§global_v6: Option<SocketAddrV6>[ip]:port of global IPv6
+§preferred_relay: Option<RelayUrl>The relay server with the lowest latency, if any.
+§relay_latency: RelayLatenciesThe measured latency to each relay, keyed by relay URL.
+§global_v4: Option<SocketAddrV4>The discovered global IPv4 address and port, if any.
+§global_v6: Option<SocketAddrV6>The discovered global IPv6 address and port, if any.
§captive_portal: Option<bool>CaptivePortal is set when we think there’s a captive portal that is
intercepting HTTP traffic.
-Implementations§
Source§impl Report
Sourcepub fn mapping_varies_by_dest(&self) -> Option<bool>
Whether the reported public address differs when probing different servers.
+Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Report
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl PartialEq for Report
Source§impl Eq for Report
Source§impl StructuralPartialEq for Report
Auto Trait Implementations§
§impl Freeze for Report
§impl RefUnwindSafe for Report
§impl Send for Report
§impl Sync for Report
§impl Unpin for Report
§impl UnwindSafe for Report
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/4036/docs/iroh/struct.PublicKey.html b/pr/4036/docs/iroh/struct.PublicKey.html
index f8fb4c5ae2..b725772ddc 100644
--- a/pr/4036/docs/iroh/struct.PublicKey.html
+++ b/pr/4036/docs/iroh/struct.PublicKey.html
@@ -1,5 +1,5 @@
PublicKey in iroh - Rust PublicKey
pub struct PublicKey(/* private fields */);
Expand description
A public key.
-The key itself is stored as the CompressedEdwards y coordinate of the public key
+
The key itself is stored as the CompressedEdwards y-coordinate of the public key.
It is verified to decompress into a valid key when created.
Implementations§
Source§impl PublicKey
Sourcepub fn as_bytes(&self) -> &[u8; 32]
Get this public key as a byte array.
@@ -12,7 +12,7 @@ See [VerifyingKey::from_bytes] for details.
&self,
message: &[u8],
signature: &Signature,
-) -> Result<(), SignatureError>Verify a signature on a message with this secret key’s public key.
+) -> Result<(), SignatureError>Verify a signature on a message with this public key.
§Return
Returns Ok(()) if the signature is valid, and Err otherwise.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PublicKey
Source§fn deserialize<D>(
deserializer: D,
) -> Result<PublicKey, <D as Deserializer<'de>>::Error>where
- D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl From<PublicKey> for EndpointAddr
Source§fn from(endpoint_id: PublicKey) -> EndpointAddr
Converts to this type from the input type.Source§impl From<PublicKey> for EndpointAddr
Source§fn from(endpoint_id: PublicKey) -> EndpointAddr
Converts to this type from the input type.Source§impl FromStr for PublicKey
Parses a PublicKey from its hex or base32 encoding.
+
Display produces the hex encoding.
Source§impl Hash for PublicKey
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
H: Hasher,
diff --git a/pr/4036/docs/iroh/tls/index.html b/pr/4036/docs/iroh/tls/index.html
index 3c1d92cf2a..16f63b088e 100644
--- a/pr/4036/docs/iroh/tls/index.html
+++ b/pr/4036/docs/iroh/tls/index.html
@@ -1,5 +1,5 @@
iroh::tls - Rust Module tls
Expand description
TLS configuration for iroh.
-Currently there is one mechanisms available
+Currently there is one mechanism available:
- Raw Public Keys, using the TLS extension described in RFC 7250
diff --git a/pr/4036/docs/iroh_base/enum.KeyParsingError.html b/pr/4036/docs/iroh_base/enum.KeyParsingError.html
index d0668a511c..7c849cddf2 100644
--- a/pr/4036/docs/iroh_base/enum.KeyParsingError.html
+++ b/pr/4036/docs/iroh_base/enum.KeyParsingError.html
@@ -1,4 +1,4 @@
-KeyParsingError in iroh_base - Rust KeyParsingError
#[non_exhaustive]pub enum KeyParsingError {
+KeyParsingError in iroh_base - Rust KeyParsingError
#[non_exhaustive]pub enum KeyParsingError {
FailedToDecodeHex {
meta: Meta,
},
@@ -11,14 +11,14 @@
InvalidKeyData {
meta: Meta,
},
-}
Available on crate feature key only.Expand description
Error when deserialising a PublicKey or a SecretKey.
+}Available on crate feature key only.Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§FailedToDecodeHex
The input string could not be decoded as hex.
Fields
§meta: MetaCaptured call-site metadata
§FailedToDecodeBase32
The input string could not be decoded as base32.
Fields
§meta: MetaCaptured call-site metadata
§InvalidLength
The input has invalid length.
Fields
§meta: MetaCaptured call-site metadata
-§InvalidKeyData
The decoded data is not a valid Ed25591 public key.
+§InvalidKeyData
The decoded data is not a valid Ed25519 public key.
Fields
§meta: MetaCaptured call-site metadata
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<KeyParsingError> for AnyError
Source§fn from(value: KeyParsingError) -> AnyError
Converts to this type from the input type.Source§impl StackError for KeyParsingError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
Returns the next source in the chain, if any.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.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§
Source§impl<T> Borrow<T> for Twhere
diff --git a/pr/4036/docs/iroh_base/enum.TransportAddr.html b/pr/4036/docs/iroh_base/enum.TransportAddr.html
index ec9989aea4..a55428eb22 100644
--- a/pr/4036/docs/iroh_base/enum.TransportAddr.html
+++ b/pr/4036/docs/iroh_base/enum.TransportAddr.html
@@ -3,8 +3,8 @@
Ip(SocketAddr),
Custom(CustomAddr),
}Available on crate feature key only.Expand description
Available address types.
-Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§Relay(RelayUrl)
Relays
-§Ip(SocketAddr)
IP based addresses
+Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§Relay(RelayUrl)
A relay server address.
+§Ip(SocketAddr)
An IP based address.
§Custom(CustomAddr)
Custom transport address
Implementations§
Source§impl TransportAddr
default_relay_mode
pub fn default_relay_mode() -> RelayModeExpand description
Returns the default relay mode.
+default_relay_mode
force_staging_infra
pub fn force_staging_infra() -> boolExpand description
Returns true if the use of staging relays is forced.
force_staging_infra
Module endpoint
Expand description
The Endpoint allows establishing connections to other iroh endpoints.
Module endpoint
Expand description
The Endpoint allows establishing connections to other iroh endpoints.
The Endpoint is the main API interface to manage a local iroh endpoint. It allows
connecting to and accepting connections from other endpoints. See the module docs for
more details on how iroh connections work.
§Example
use iroh::{Endpoint, RelayMode, Watcher, endpoint::presets};
-let endpoint = Endpoint::builder(presets::N0).bind().await?;Structs§
- Empty
- An empty preset that doesn’t set anything on the builder.
- Minimal
with_crypto_provider - A preset that is almost empty, besides setting mandatory options.
- N0
with_crypto_provider - Configures the endpoint to use the n0 defaults
- N0Disable
Relay with_crypto_provider - Configures the endpoint to use the n0 defaults, but with relay mode disabled.
Traits§
- Preset
- Defines a preset
Structs§
- Empty
- An empty preset that doesn’t set anything on the builder.
- Minimal
with_crypto_provider - A preset that is almost empty, besides setting mandatory options.
- N0
with_crypto_provider - Configures the endpoint to use the n0 defaults
- N0Disable
Relay with_crypto_provider - Configures the endpoint to use the n0 defaults, but with relay mode disabled.
Traits§
rustls::crypto::CryptoProvider] to ring or aws-lc-rs, depending
on which feature is enabled in iroh (preferring ring if both are enabled).Due to the last point, this preset is only available with the ring or
-aws-lc-rs preset installed.
+
Due to the last point, this preset is only available with the tls-ring or
+tls-aws-lc-rs feature enabled.
If you want to set your own crypto provider, we recommend copying the
implementation of this preset into your own and setting the appropriate crypto
provider there.
rustls::crypto::CryptoProvider] to ring or aws-lc-rs, depending
on which feature is enabled in iroh (preferring ring if both are enabled).Due to the last point, this preset is only available with the ring or
-aws-lc-rs preset installed.
+
Due to the last point, this preset is only available with the tls-ring or
+tls-aws-lc-rs feature enabled.
If you want to set your own crypto provider, we recommend copying the
implementation of this preset into your own and setting the appropriate crypto
provider there.
Preset
pub trait Preset {
+Preset in iroh::endpoint::presets - Rust Preset
pub trait Preset {
// Required method
fn apply(self, builder: Builder) -> Builder;
-}
Expand description
Defines a preset
+}Expand description
A reusable bundle of endpoint Builder configuration.
Required Methods§
Implementations on Foreign Types§
Source§impl Preset for Arc<TestTransport>
Available on crate feature unstable-custom-transports and (crate features test-utils) only.
Source§fn apply(self, builder: Builder) -> Builder
Configures the builder with this transport and the network’s address lookup.
§Example
diff --git a/pr/4036/docs/iroh/endpoint/struct.Builder.html b/pr/4036/docs/iroh/endpoint/struct.Builder.html
index 79894b8924..7cbb050d5e 100644
--- a/pr/4036/docs/iroh/endpoint/struct.Builder.html
+++ b/pr/4036/docs/iroh/endpoint/struct.Builder.html
@@ -92,7 +92,7 @@ is set to false explicitly.
destination addresses. It is valid to configure this, but no more than one such
socket should be bound or the routing will be non-deterministic.
To use a subnet with a non-zero prefix length as the default route in addition to
-being routed when its prefix matches, use `BindOpts::set_is_default_route.
+being routed when its prefix matches, use BindOpts::set_is_default_route.
Subnets with a prefix length of zero are always marked as default routes.
Finally note that most outgoing datagrams are part of an existing network flow. That
is, they are in response to an incoming datagram. In this case the outgoing datagram
@@ -142,7 +142,7 @@ direct addresses or relay URLs will fail.
Sourcepub fn addr_filter(self, filter: AddrFilter) -> Self
Sets the address filter applied to all address data before publishing.
This filter is applied once, at the AddressLookupServices level, before
distributing data to any individual address lookup service. This ensures
-consistent filtering regardless of how the services configured.
+consistent filtering regardless of how the services are configured.
Sourcepub fn clear_addr_filter(self) -> Self
Clears the address filter, allowing all addresses to be published.
This removes any filter previously set via Self::addr_filter, including
filters set by presets.
diff --git a/pr/4036/docs/iroh/endpoint/struct.ConnectOptions.html b/pr/4036/docs/iroh/endpoint/struct.ConnectOptions.html
index 30bf2e329e..3834b0244e 100644
--- a/pr/4036/docs/iroh/endpoint/struct.ConnectOptions.html
+++ b/pr/4036/docs/iroh/endpoint/struct.ConnectOptions.html
@@ -1,12 +1,12 @@
-ConnectOptions in iroh::endpoint - Rust ConnectOptions
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 ConnectOptions
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 QuicTransportConfig.
-Sourcepub fn with_transport_config(
+
Sourcepub fn with_transport_config(
self,
transport_config: QuicTransportConfig,
) -> Self
Sets the QUIC transport config options for this connection.
-Sourcepub fn with_additional_alpns(self, alpns: Vec<Vec<u8>>) -> Self
Sets ALPN identifiers that should be signaled as supported on connection, in
+
Sourcepub fn with_additional_alpns(self, alpns: Vec<Vec<u8>>) -> Self
Sets ALPN identifiers that should be signaled as supported on connection, in
addition to the main ALPN identifier used in Endpoint::connect_with_opts.
This allows connecting to servers that may only support older versions of your
protocol. In this case, you would add the older ALPN identifiers with this
@@ -20,7 +20,7 @@ list or the main ALPN identifiers on the accept side, see the endpoint
builder’s Builder::alpns function.
-Trait Implementations§
Source§impl Clone for ConnectOptions
Source§fn clone(&self) -> ConnectOptions
Returns a duplicate 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 duplicate 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/4036/docs/iroh/endpoint/struct.Connection.html b/pr/4036/docs/iroh/endpoint/struct.Connection.html
index ffc93497ee..74f53832af 100644
--- a/pr/4036/docs/iroh/endpoint/struct.Connection.html
+++ b/pr/4036/docs/iroh/endpoint/struct.Connection.html
@@ -8,7 +8,7 @@ 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<T: ConnectionState> Connection<T>
Implementations§
Source§impl<T: ConnectionState> Connection<T>
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.
@@ -18,13 +18,13 @@ consequence, the peer won’t be notified that a stream has been opened until th
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_bi(&self) -> AcceptBi<'_> ⓘ
Accepts 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 async fn closed(&self) -> ConnectionError
Waits 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.
@@ -97,17 +97,18 @@ strong and pseudorandom, and are suitable for use as keying material.
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)
See [noq_proto::TransportConfig::receive_window].
-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)
Sets the connection-level flow control receive window.
+See [noq_proto::TransportConfig::receive_window].
+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.
-Source§impl Connection<HandshakeCompleted>
Sourcepub fn remote_id(&self) -> EndpointId
Returns the EndpointId from the peer’s TLS certificate.
+Source§impl Connection<HandshakeCompleted>
Sourcepub fn remote_id(&self) -> EndpointId
Returns the EndpointId from the peer’s TLS certificate.
The PublicKey of an endpoint is also known as an EndpointId. This PublicKey is
included in the TLS certificate presented during the handshake when connecting.
This function allows you to get the EndpointId of the remote endpoint of this
connection.
-Sourcepub fn paths(&self) -> PathList<'_>
Returns the currently open network paths for this connection.
+Sourcepub fn paths(&self) -> PathList<'_>
Returns the currently open network paths for this connection.
A connection typically has one path via the relay server and,
once holepunching succeeds, a direct path. The returned
PathList is a snapshot taken at call time: it does not
@@ -116,14 +117,14 @@ already closed.
To observe changes over time, see Connection::paths_stream
for a stream of PathList snapshots and
Connection::path_events for individual PathEvents.
-Sourcepub fn paths_stream(&self) -> PathListStream<'_>
Returns a stream of PathList snapshots for this connection.
+Sourcepub fn paths_stream(&self) -> PathListStream<'_>
Returns a stream of PathList snapshots for this connection.
Yields the current snapshot on the first poll, and a fresh
snapshot whenever the open paths or the selected path change.
Ends when the connection closes.
The stream borrows this Connection. To consume it from a
spawned task, move a Connection clone into the task and
call this method inside.
-Sourcepub fn path_events(&self) -> PathEventStream
Returns a stream of PathEvents for this connection.
+Sourcepub fn path_events(&self) -> PathEventStream
Returns a stream of PathEvents for this connection.
Each event reports one of: a path opened, a path closed (with
final per-path statistics), the selected transmission path
changed, or the consumer fell behind. The stream ends when the
@@ -133,14 +134,14 @@ may be moved into a spawned task.
single PathEvent::Lagged; the current state of the open
paths and the selected path remains recoverable via
Connection::paths.
-Sourcepub fn weak_handle(&self) -> WeakConnectionHandle
Returns a WeakConnectionHandle for this connection.
+Sourcepub fn weak_handle(&self) -> WeakConnectionHandle
Returns a WeakConnectionHandle for this connection.
A WeakConnectionHandle does not keep the connection alive. It can be used to
wait for the connection to be closed via WeakConnectionHandle::closed and to
attempt to upgrade back to a strong Connection via
WeakConnectionHandle::upgrade.
-Source§impl Connection<IncomingZeroRtt>
Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
-Sourcepub async fn handshake_completed(&self) -> Result<Connection, ConnectingError>
Waits until the full handshake occurs and then returns a Connection.
+Source§impl Connection<IncomingZeroRtt>
Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
+Sourcepub async fn handshake_completed(&self) -> Result<Connection, ConnectingError>
Waits until the full handshake occurs and then returns a Connection.
This may fail with ConnectingError::ConnectionError, if there was
some general failure with the connection, such as a network timeout since
we accepted the connection.
@@ -149,18 +150,18 @@ doesn’t use the right TLS authentication, which usually every iroh endpoint
uses and requires.
Thus, those errors should only occur if someone connects to you with a
modified iroh endpoint or with a plain QUIC client.
-Sourcepub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError>
Returns the EndpointId from the peer’s TLS certificate.
+Sourcepub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError>
Returns the EndpointId from the peer’s TLS certificate.
The PublicKey of an endpoint is also known as an EndpointId. This PublicKey is
included in the TLS certificate presented during the handshake when connecting.
This function allows you to get the EndpointId of the remote endpoint of this
connection.
-Source§impl Connection<OutgoingZeroRtt>
Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
+Sourcepub async fn handshake_completed(
&self,
) -> Result<ZeroRttStatus, ConnectingError>
Waits until the full handshake occurs and returns a ZeroRttStatus.
-If ZeroRttStatus::Accepted is returned, than any streams created before
+
If ZeroRttStatus::Accepted is returned, then any streams created before
the handshake has completed can still be used.
-If ZeroRttStatus::Rejected is returned, than any streams created before
+
If ZeroRttStatus::Rejected is returned, then any streams created before
the handshake will error and any data sent should be re-sent on a
new stream.
This may fail with ConnectingError::ConnectionError, if there was
@@ -171,7 +172,7 @@ doesn’t use the right TLS authentication, which usually every iroh endpoint
uses and requires.
Thus, those errors should only occur if someone connects to you with a
modified iroh endpoint or with a plain QUIC client.
-Sourcepub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError>
Returns the EndpointId from the peer’s TLS certificate.
+Sourcepub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError>
Returns the EndpointId from the peer’s TLS certificate.
The PublicKey of an endpoint is also known as an EndpointId. This PublicKey is
included in the TLS certificate presented during the handshake when connecting.
This function allows you to get the EndpointId of the remote endpoint of this
diff --git a/pr/4036/docs/iroh/endpoint/struct.Endpoint.html b/pr/4036/docs/iroh/endpoint/struct.Endpoint.html
index cfd63c979e..0c6c2630b7 100644
--- a/pr/4036/docs/iroh/endpoint/struct.Endpoint.html
+++ b/pr/4036/docs/iroh/endpoint/struct.Endpoint.html
@@ -13,7 +13,7 @@ behaviour.
Endpoint::connect and Endpoint::accept methods. Once established, the
Connection gives access to most QUIC features. Individual streams to send data to
the peer are created using the Connection::open_bi, Connection::accept_bi,
-Connection::open_uni and Connection::open_bi functions.
+Connection::open_uni and Connection::accept_uni 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.
§Usage on Android
@@ -22,7 +22,7 @@ through JNI, which needs a JVM context published to DnsResolver for the supported
initialization paths.
-Implementations§
Source§impl Endpoint
Implementations§
Source§impl Endpoint
Sourcepub fn set_alpns(&self, alpns: Vec<Vec<u8>>)
Sets the list of accepted ALPN protocols.
This will only affect new incoming connections.
@@ -117,8 +117,8 @@ changes.
understand if the endpoint has ever been considered “online”. But after
that initial call to Endpoint::online, to understand if your
endpoint is no longer able to be connected to by endpoints outside
-of the private or local network, watch for changes in it’s EndpointAddr.
-If there are no addrsin the EndpointAddr, you may not be dialable by other endpoints
+of the private or local network, watch for changes in its EndpointAddr.
+If there are no addrs in the EndpointAddr, you may not be dialable by other endpoints
on the internet.
The EndpointAddr will change as:
@@ -146,7 +146,7 @@ tokio::spawn(endpoint_closed.run_until(async move {
}));
// Do fancy things, then close the endpoint.
// Our task above will stop even if there are still clones of `Endpoint` alive somewhere.
-endpoint.close().await;
Sourcepub async fn online(&self)
A convenience method that waits for the endpoint to be considered “online”.
This currently means at least one relay server has completed its
connection handshake (i.e. the endpoint is registered and reachable
via that relay). Merely selecting a relay URL is not sufficient.
@@ -167,49 +167,45 @@ entirely.
The online method does not interact with crate::address_lookup::AddressLookup
services, which means that any Address Lookup that relies on a WAN
connection is independent of the endpoint’s online status.
-§Examples
use iroh::Endpoint;
-
-#[tokio::main]
-async fn main() {
-// After this await returns, the endpoint is bound to a local socket.
-// It can be dialed, but almost certainly hasn't finished picking a
+§Examples
+// After this await returns, the endpoint is bound to a local socket.
+// It can be dialed, but almost certainly hasn't finished picking a
// relay.
-let endpoint = Endpoint::bind().await;
+let endpoint = Endpoint::bind(presets::N0).await?;
-// After this await returns we have a connection to at least one relay
+// After this await returns we have a connection to at least one relay
// and holepunching should work as expected.
-endpoint.online().await;
-}
Sourcepub fn home_relay_status(
+endpoint.online().await;
Sourcepub fn home_relay_status(
&self,
) -> impl Watcher<Value = Vec<RelayStatus>> + use<>
Returns a Watcher over the connection status of the endpoint’s home relays.
The watched value has one entry per home relay whose URL is known,
and is empty when no relays are configured or before the endpoint has
-selected one the home relay from the list of configured relays.
+selected a home relay from the list of configured relays.
The watcher updates whenever any home relay’s connection status changes.
See RelayStatus for the information available on each entry.
The returned watcher only becomes disconnected once the last clone of
the Endpoint is dropped. Closing the endpoint does not disconnect
the watcher. To stop a task once the endpoint stops, combine with
Self::closed.
-Sourcepub fn bound_sockets(&self) -> Vec<SocketAddr>
Available on non-wasm_browser only.
Returns the local socket addresses on which the underlying sockets are bound.
+Sourcepub fn bound_sockets(&self) -> Vec<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 dns_resolver(&self) -> Result<&DnsResolver, EndpointError>
Available on non-wasm_browser only.
Returns the DNS resolver used in this Endpoint.
+Sourcepub fn dns_resolver(&self) -> Result<&DnsResolver, EndpointError>
Available on non-wasm_browser only.
Sourcepub fn tls_config(&self) -> &ClientConfig
Returns the [rustls::ClientConfig] used by the endpoint for connecting to external services.
+Sourcepub fn tls_config(&self) -> &ClientConfig
Returns the [rustls::ClientConfig] used by the endpoint for connecting to external services.
This might be useful for address lookup services or other functions
that want to use the same trust anchors as iroh does for verifying the
validity of TLS certificates presented by external services.
Note that this TLS config is unrelated to how iroh validates the authenticity
of iroh connections itself.
The config is based on the trust anchors set via Builder::ca_tls_config.
-Sourcepub fn address_lookup(&self) -> Result<&AddressLookupServices, EndpointError>
Returns the Address Lookup service, if configured.
+Sourcepub fn address_lookup(&self) -> Result<&AddressLookupServices, EndpointError>
Returns the Address Lookup service, if configured.
§Errors
Returns a EndpointError::Closed error if the endpoint is closed.
-Sourcepub fn metrics(&self) -> &EndpointMetrics
Available on crate feature metrics only.
Returns metrics collected for this endpoint.
+Sourcepub fn metrics(&self) -> &EndpointMetrics
Available on crate feature metrics only.
Returns metrics collected for this endpoint.
The endpoint internally collects various metrics about its operation.
The returned EndpointMetrics struct contains all of these metrics.
You can access individual metrics directly by using the public fields:
@@ -275,13 +271,13 @@ registry.write().unwrap().register_all(endpoint.metrics());
.std_context("text")?;
assert!(res.contains(r#"TYPE socket_recv_datagrams counter"#));
-assert!(res.contains(r#"socket_recv_datagrams_total 0"#));Sourcepub async fn remote_info(&self, endpoint_id: EndpointId) -> Option<RemoteInfo>
Returns addressing information about a recently used remote endpoint.
+assert!(res.contains(r#"socket_recv_datagrams_total 0"#));Sourcepub async fn remote_info(&self, endpoint_id: EndpointId) -> Option<RemoteInfo>
Returns addressing information about a recently used remote endpoint.
The returned RemoteInfo contains a list of all transport addresses for the remote
that we know about. This is a snapshot in time and not a watcher.
Returns None if the endpoint doesn’t have information about the remote or if the endpoint is closed.
When remote endpoints are no longer used, our endpoint will keep information around
for a little while, and then drop it. Afterwards, this will return None.
-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
@@ -290,14 +286,14 @@ 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.
If the endpoint is closed, this method will log a warning and ignore the request.
-Sourcepub fn set_user_data_for_address_lookup(&self, user_data: Option<UserData>)
Sets the initial user-defined data to be published in Address Lookups for this endpoint.
+Sourcepub fn set_user_data_for_address_lookup(&self, user_data: Option<UserData>)
Sets the initial user-defined data to be published in Address Lookups for this endpoint.
If the user-defined data passed to this function is different to the previous one,
the endpoint will republish its endpoint info to the configured Address Lookups.
See also Builder::user_data_for_address_lookup for setting an initial value when
building the endpoint.
If the endpoint is closed, this method will log a warning and ignore the
request.
-Sourcepub async fn close(&self)
Closes the QUIC endpoint and the 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.
@@ -322,9 +318,9 @@ sockets. This is due to QUIC and its acknowledgments being implemented in user-l
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.
-Sourcepub fn closed(&self) -> EndpointClosed ⓘ
Returns a future that resolves once the endpoint closes.
+the respective Endpoint are dropped.
+Sourcepub fn closed(&self) -> EndpointClosed ⓘ
Returns a future that resolves once the endpoint closes.
The returned future does not contain a clone or reference to the Endpoint,
so keeping the returned future alive does not prevent the endpoint from being dropped.
To run a task and stop it once the endpoint closes, you can use
@@ -333,7 +329,7 @@ so keeping the returned future alive does not prevent the endpoint from being dr
let endpoint = Endpoint::bind(presets::N0).await?;
tokio::spawn(endpoint.closed().run_until(async move {
// the future will be aborted once the endpoint closes.
-}));
Sourcepub fn create_server_config_builder(
+}));
Sourcepub fn create_server_config_builder(
&self,
alpns: Vec<Vec<u8>>,
) -> ServerConfigBuilder
Create a ServerConfigBuilder for this endpoint that includes the given alpns.
diff --git a/pr/4036/docs/iroh/endpoint/struct.EndpointClosed.html b/pr/4036/docs/iroh/endpoint/struct.EndpointClosed.html
index 85b8fd921b..1a2b9e3683 100644
--- a/pr/4036/docs/iroh/endpoint/struct.EndpointClosed.html
+++ b/pr/4036/docs/iroh/endpoint/struct.EndpointClosed.html
@@ -1,9 +1,9 @@
-EndpointClosed in iroh::endpoint - Rust EndpointClosed
pub struct EndpointClosed { /* private fields */ }
Expand description
Future returned from Endpoint::closed.
-Implementations§
Source§impl EndpointClosed
Sourcepub async fn run_until<F: Future>(self, fut: F) -> Option<F::Output>
Runs a future to completion, or until the Endpoint is closed.
+EndpointClosed in iroh::endpoint - Rust EndpointClosed
pub struct EndpointClosed { /* private fields */ }
Expand description
Future returned from Endpoint::closed.
+Implementations§
Trait Implementations§
Source§impl Debug for EndpointClosed
Source§impl Future for EndpointClosed
Source§impl<'pin> Unpin for EndpointClosedwhere
+
Trait Implementations§
Source§impl Debug for EndpointClosed
Source§impl Future for EndpointClosed
Source§impl<'pin> Unpin for EndpointClosedwhere
PinnedFieldsOf<__EndpointClosed<'pin>>: Unpin,
Auto Trait Implementations§
§impl !Freeze for EndpointClosed
§impl !RefUnwindSafe for EndpointClosed
§impl Send for EndpointClosed
§impl Sync for EndpointClosed
§impl !UnwindSafe for EndpointClosed
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/4036/docs/iroh/endpoint/struct.Incoming.html b/pr/4036/docs/iroh/endpoint/struct.Incoming.html
index d0a2c29af8..eca1097eca 100644
--- a/pr/4036/docs/iroh/endpoint/struct.Incoming.html
+++ b/pr/4036/docs/iroh/endpoint/struct.Incoming.html
@@ -24,7 +24,7 @@ to customize a Sourcepub fn remote_addr_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_addr().
-Sourcepub fn decrypt(&self) -> Option<DecryptedInitial>
Decrypt the Initial packet payload
+Sourcepub fn decrypt(&self) -> Option<DecryptedInitial>
Decrypts the Initial packet payload.
This clones and decrypts the packet payload (~1200 bytes).
Can be used to extract information from the TLS ClientHello without completing the handshake.
Trait Implementations§
Source§impl IntoFuture for Incoming
Source§type Output = Result<Connection, ConnectingError>
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§
Source§impl<T> Any for Twhere
diff --git a/pr/4036/docs/iroh/endpoint/struct.QuicTransportConfigBuilder.html b/pr/4036/docs/iroh/endpoint/struct.QuicTransportConfigBuilder.html
index 3a193bd40a..5189f21509 100644
--- a/pr/4036/docs/iroh/endpoint/struct.QuicTransportConfigBuilder.html
+++ b/pr/4036/docs/iroh/endpoint/struct.QuicTransportConfigBuilder.html
@@ -136,7 +136,7 @@ enable multipath as well.
If the path is idle for this long the path will be abandoned. Bear in mind this will
interact with the QuicTransportConfigBuilder::max_idle_timeout, if the last path is
abandoned the entire connection will be closed.
-Note: values higher than [PATH_MAX_IDLE_TIMEOUT] are clamped and a warning is logged.
+Note: values higher than PATH_MAX_IDLE_TIMEOUT (15 seconds) are clamped and a warning is logged.
Sourcepub fn default_path_keep_alive_interval(self, interval: Duration) -> Self
Sets a default per-path keep alive interval.
Note that this does not interact with the connection-wide
QuicTransportConfigBuilder::keep_alive_interval. This setting will keep this path active,
diff --git a/pr/4036/docs/iroh/endpoint/struct.RelayStatus.html b/pr/4036/docs/iroh/endpoint/struct.RelayStatus.html
index 175b637f76..a1abba7e98 100644
--- a/pr/4036/docs/iroh/endpoint/struct.RelayStatus.html
+++ b/pr/4036/docs/iroh/endpoint/struct.RelayStatus.html
@@ -1,13 +1,13 @@
-
RelayStatus in iroh::endpoint - Rust RelayStatus
pub struct RelayStatus { /* private fields */ }
Expand description
Connection status of a single home relay.
+RelayStatus in iroh::endpoint - Rust RelayStatus
pub struct RelayStatus { /* private fields */ }
Expand description
Connection status of a single home relay.
Observed via Endpoint::home_relay_status.
-Implementations§
Source§impl RelayStatus
Sourcepub fn is_connected(&self) -> bool
Returns true if the endpoint is connected to the relay.
-Sourcepub fn last_error(&self) -> Option<&AnyError>
Returns the most recent connection error, if the relay is currently
+
Implementations§
Source§impl RelayStatus
Sourcepub fn is_connected(&self) -> bool
Returns true if the endpoint is connected to the relay.
+Sourcepub fn last_error(&self) -> Option<&AnyError>
Returns the most recent connection error, if the relay is currently
disconnected.
Returns None when the relay is connected, or when the endpoint has
not yet observed a failed connection attempt.
-Trait Implementations§
Source§impl Clone for RelayStatus
Source§fn clone(&self) -> RelayStatus
Returns a duplicate 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 RelayStatus
Source§impl PartialEq for RelayStatus
Source§impl Eq for RelayStatus
Source§impl StructuralPartialEq for RelayStatus
Auto Trait Implementations§
§impl Freeze for RelayStatus
§impl !RefUnwindSafe for RelayStatus
§impl Send for RelayStatus
§impl Sync for RelayStatus
§impl Unpin for RelayStatus
§impl !UnwindSafe for RelayStatus
Blanket Implementations§
Trait Implementations§
Source§impl Clone for RelayStatus
Source§fn clone(&self) -> RelayStatus
Returns a duplicate 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 RelayStatus
Source§impl PartialEq for RelayStatus
Source§impl Eq for RelayStatus
Source§impl StructuralPartialEq for RelayStatus
Auto Trait Implementations§
§impl Freeze for RelayStatus
§impl !RefUnwindSafe for RelayStatus
§impl Send for RelayStatus
§impl Sync for RelayStatus
§impl Unpin for RelayStatus
§impl !UnwindSafe for RelayStatus
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/4036/docs/iroh/endpoint/struct.VarInt.html b/pr/4036/docs/iroh/endpoint/struct.VarInt.html
index 0acf99654d..007540d1af 100644
--- a/pr/4036/docs/iroh/endpoint/struct.VarInt.html
+++ b/pr/4036/docs/iroh/endpoint/struct.VarInt.html
@@ -13,7 +13,7 @@ An integer less than 2^62
of overflowing.
Trait Implementations§
§impl From<VarInt> for IdleTimeout
§fn from(inner: VarInt) -> IdleTimeout
Converts to this type from the input type.§impl From<VarInt> for IdleTimeout
§fn from(inner: VarInt) -> IdleTimeout
Converts to this type from the input type.§impl Ord for VarInt
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
diff --git a/pr/4036/docs/iroh/endpoint/struct.WeakConnectionHandle.html b/pr/4036/docs/iroh/endpoint/struct.WeakConnectionHandle.html
index 47f6c23610..07bad208d7 100644
--- a/pr/4036/docs/iroh/endpoint/struct.WeakConnectionHandle.html
+++ b/pr/4036/docs/iroh/endpoint/struct.WeakConnectionHandle.html
@@ -1,18 +1,18 @@
-WeakConnectionHandle in iroh::endpoint - Rust WeakConnectionHandle
pub struct WeakConnectionHandle { /* private fields */ }
Expand description
A weak handle to a Connection.
+WeakConnectionHandle in iroh::endpoint - Rust WeakConnectionHandle
pub struct WeakConnectionHandle { /* private fields */ }
Expand description
A weak handle to a Connection.
A WeakConnectionHandle does not keep the connection alive: holding one will not
prevent the connection from being closed when the last Connection handle is dropped.
Use upgrade to obtain a strong Connection, and closed to wait for the
connection to be closed without keeping it alive.
-Implementations§
Source§impl WeakConnectionHandle
Sourcepub fn upgrade(&self) -> Option<Connection>
Attempts to upgrade this weak handle to a strong Connection.
+Implementations§
Source§impl WeakConnectionHandle
Sourcepub fn upgrade(&self) -> Option<Connection>
Attempts to upgrade this weak handle to a strong Connection.
Returns None if the connection has already been dropped.
-Sourcepub fn closed(&self) -> impl Future<Output = Option<Closed>> + Send + 'static
Returns a future that resolves once the connection has been closed.
+Sourcepub fn closed(&self) -> impl Future<Output = Option<Closed>> + Send + 'static
Returns a future that resolves once the connection has been closed.
If no strong references to the Connection exist at the time this is called,
the future resolves to None. If at least one strong reference still exists at
the time of this call, the returned future is guaranteed to receive the close
event with the close reason and final connection statistics, even if all strong
references are dropped before the future is awaited.
The future does not keep the connection alive.
-Trait Implementations§
Source§impl Clone for WeakConnectionHandle
Source§fn clone(&self) -> WeakConnectionHandle
Returns a duplicate 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 WeakConnectionHandle
§impl !RefUnwindSafe for WeakConnectionHandle
§impl Send for WeakConnectionHandle
§impl Sync for WeakConnectionHandle
§impl Unpin for WeakConnectionHandle
§impl !UnwindSafe for WeakConnectionHandle
Blanket Implementations§
Trait Implementations§
Source§impl Clone for WeakConnectionHandle
Source§fn clone(&self) -> WeakConnectionHandle
Returns a duplicate 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 WeakConnectionHandle
§impl !RefUnwindSafe for WeakConnectionHandle
§impl Send for WeakConnectionHandle
§impl Sync for WeakConnectionHandle
§impl Unpin for WeakConnectionHandle
§impl !UnwindSafe for WeakConnectionHandle
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/4036/docs/iroh/endpoint/trait.EndpointHooks.html b/pr/4036/docs/iroh/endpoint/trait.EndpointHooks.html
index 2ac883dd5d..90c7ff04fc 100644
--- a/pr/4036/docs/iroh/endpoint/trait.EndpointHooks.html
+++ b/pr/4036/docs/iroh/endpoint/trait.EndpointHooks.html
@@ -17,7 +17,7 @@
For each hook, all installed hooks are invoked in the order they were installed on
the endpoint builder. If a hook returns Accept, processing continues with the next
hook. If a hook returns Reject, processing is aborted and further hooks
-are not invoked for this hook.
+are not invoked for this hook point.
§Notes to implementers
As hooks are stored on the endpoint, you must make sure to never store an Endpoint
on the hook struct itself, as this would create reference counting loop and cause the
diff --git a/pr/4036/docs/iroh/endpoint_info/index.html b/pr/4036/docs/iroh/endpoint_info/index.html
index f27fe3b898..4a60b9fd8f 100644
--- a/pr/4036/docs/iroh/endpoint_info/index.html
+++ b/pr/4036/docs/iroh/endpoint_info/index.html
@@ -1,11 +1,11 @@
iroh::endpoint_info - Rust Module endpoint_info
Expand description
Support for handling DNS resource records for dialing by EndpointId.
Dialing by EndpointId is supported by iroh endpoints publishing Pkarr records to DNS
servers or the Mainline DHT. This module supports creating and parsing these records.
-EndpointInfo combines an iroh_base::EndpointId with EndpointData —
+
EndpointInfo combines an iroh_base::EndpointId with EndpointData:
the addressing and metadata that discovery services publish and resolve.
Discovery services use AddrFilter to control which addresses are published.
This module also provides serialization to and from pkarr signed packets and
-DNS TXT records. See the [crate::attrs] module for the on-the-wire format.
+DNS TXT records.
DNS records are published under the following names:
_iroh.<z32-endpoint-id>.<origin-domain> TXT
@@ -36,4 +36,4 @@ Each address is an IPv4 or IPv6 address with a port.
Structs§
- Addr
Filter - A filter and/or reordering function applied to transport addresses,
-typically used by AddressLookup services in iroh before publishing.
- Endpoint
Data - Data about an endpoint that may be published to and resolved from discovery services.
- Endpoint
Info - Information about an endpoint that may be published to and resolved from discovery services.
- MaxLength
ExceededError - Error returned when an input value is too long for
UserData. - User
Data - Under the hood this is a UTF-8 String is no longer than
UserData::MAX_LENGTH bytes.
\ No newline at end of file
+typically used by AddressLookup services in iroh before publishing.EndpointData Data about an endpoint that may be published to and resolved from discovery services. EndpointInfo Information about an endpoint that may be published to and resolved from discovery services. MaxLengthExceededError Error returned when an input value is too long for UserData. UserData User-defined data that can be published and resolved through endpoint discovery.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/endpoint_info/struct.EndpointData.html b/pr/4036/docs/iroh/endpoint_info/struct.EndpointData.html
index eaf2725892..2c818ea5b4 100644
--- a/pr/4036/docs/iroh/endpoint_info/struct.EndpointData.html
+++ b/pr/4036/docs/iroh/endpoint_info/struct.EndpointData.html
@@ -13,15 +13,15 @@ services, should they not fit into e.g. a single DNS packet otherwise.
See also Self::set_user_data.
Sourcepub fn add_relay_url(&mut self, relay_url: RelayUrl)
Adds the relay URL to the end of the endpoint data, unless it already existed.
Sourcepub fn add_ip_addrs(&mut self, addresses: Vec<SocketAddr>)
Adds addresses in order with duplicates or already existing addresses filtered out.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Adds addresses to the endpoint data in the given ordered, but with duplicates filtered.
-Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data and returns the updated endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Adds addresses to the endpoint data in the given order, but with duplicates filtered.
+Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data.
Sourcepub fn clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn clear_relay_urls(&mut self)
Removes all relay URLs from the endpoint data.
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses.
+Sourcepub fn filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
Returns a vec to allow re-ordering of addresses.
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
diff --git a/pr/4036/docs/iroh/endpoint_info/struct.UserData.html b/pr/4036/docs/iroh/endpoint_info/struct.UserData.html
index 3352480631..e73207e05e 100644
--- a/pr/4036/docs/iroh/endpoint_info/struct.UserData.html
+++ b/pr/4036/docs/iroh/endpoint_info/struct.UserData.html
@@ -1,4 +1,5 @@
-UserData in iroh::endpoint_info - Rust 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.
+UserData in iroh::endpoint_info - Rust UserData
pub struct UserData(/* private fields */);
Expand description
User-defined data that can be published and resolved through endpoint discovery.
+Under the hood this is a UTF-8 string 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.
diff --git a/pr/4036/docs/iroh/enum.KeyParsingError.html b/pr/4036/docs/iroh/enum.KeyParsingError.html
index 765ac27ad2..146ec05698 100644
--- a/pr/4036/docs/iroh/enum.KeyParsingError.html
+++ b/pr/4036/docs/iroh/enum.KeyParsingError.html
@@ -1,4 +1,4 @@
-KeyParsingError in iroh - Rust KeyParsingError
#[non_exhaustive]pub enum KeyParsingError {
+KeyParsingError in iroh - Rust KeyParsingError
#[non_exhaustive]pub enum KeyParsingError {
FailedToDecodeHex {
meta: Meta,
},
@@ -11,14 +11,14 @@
InvalidKeyData {
meta: Meta,
},
-}
Expand description
Error when deserialising a PublicKey or a SecretKey.
+}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§FailedToDecodeHex
The input string could not be decoded as hex.
Fields
§meta: MetaCaptured call-site metadata
§FailedToDecodeBase32
The input string could not be decoded as base32.
Fields
§meta: MetaCaptured call-site metadata
§InvalidLength
The input has invalid length.
Fields
§meta: MetaCaptured call-site metadata
-§InvalidKeyData
The decoded data is not a valid Ed25591 public key.
+§InvalidKeyData
The decoded data is not a valid Ed25519 public key.
Fields
§meta: MetaCaptured call-site metadata
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<KeyParsingError> for ParseError
Source§fn from(source: KeyParsingError) -> ParseError
Converts to this type from the input type.Source§impl StackError for KeyParsingError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<KeyParsingError>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Returns the next source in the chain, if any.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.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
diff --git a/pr/4036/docs/iroh/enum.TransportAddr.html b/pr/4036/docs/iroh/enum.TransportAddr.html
index df614a51ee..0e5f31d772 100644
--- a/pr/4036/docs/iroh/enum.TransportAddr.html
+++ b/pr/4036/docs/iroh/enum.TransportAddr.html
@@ -3,8 +3,8 @@
Ip(SocketAddr),
Custom(CustomAddr),
}Expand description
Available address types.
-Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§Relay(RelayUrl)
Relays
-§Ip(SocketAddr)
IP based addresses
+Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§Relay(RelayUrl)
A relay server address.
+§Ip(SocketAddr)
An IP based address.
§Custom(CustomAddr)
Custom transport address
Implementations§
Source§impl TransportAddr
Sourcepub fn is_ip(&self) -> bool
Whether this is an IP transport address.
diff --git a/pr/4036/docs/iroh/index.html b/pr/4036/docs/iroh/index.html
index a2ddd5617a..8c7bddcb16 100644
--- a/pr/4036/docs/iroh/index.html
+++ b/pr/4036/docs/iroh/index.html
@@ -1,5 +1,5 @@
iroh - Rust Crate iroh
Expand description
Peer-to-peer QUIC connections.
-iroh is a library to establish direct connectivity between peers. It exposes an
+
iroh is a library to establish direct connectivity between peers. It exposes an
interface to QUIC connections and streams to the user, while implementing direct
connectivity using hole punching complemented by relay servers under the hood.
An iroh endpoint is created and controlled by the Endpoint, e.g. connecting to
@@ -44,7 +44,7 @@ punching if needed. Once the direct connection is established the relay ser
longer involved in the connection.
If one of the iroh endpoints can be reached directly, connectivity can also be
established without involving a Relay server. This is done by using the endpoint’s
-listening addresses in the connection establishement instead of the RelayUrl which
+listening addresses in the connection establishment instead of the RelayUrl which
is used to identify a Relay server. Of course it is also possible to use both a
RelayUrl and direct addresses at the same time to connect.
§Encryption
@@ -179,4 +179,4 @@ connecting using only the Ok(())
}
Please see the examples directory for more nuanced examples.
-Re-exports§
Modules§
- address_
lookup - Lookup the address of an Endpoint ID.
- defaults
- Default values used in
iroh - dns
Non-wasm_browser - Configurable DNS resolver.
- endpoint
- The
Endpoint allows establishing connections to other iroh endpoints. - endpoint_
info - Support for handling DNS resource records for dialing by
EndpointId. - metrics
- Co-locating all of the iroh metrics structs
- protocol
- Tools for spawning an accept loop that routes incoming requests to the right protocol.
- test_
utils test-utils - Internal utilities to support testing.
- tls
- TLS configuration for iroh.
Structs§
- Endpoint
Addr - Network-level addressing information for an iroh endpoint.
- NetReport
- A net_report report.
- NetReport
Config - Configuration for the net report component.
- Public
Key - A public key.
- Relay
Config - Information on a specific relay server.
- Relay
Map - List of relay server configurations to be used in an iroh endpoint.
- Relay
Url - A URL identifying a relay server.
- Relay
UrlParseError - Can occur when parsing a string into a
RelayUrl. - Secret
Key - A secret key.
- Signature
- Ed25519 signature.
- Signature
Error - Verification of a signature failed.
Enums§
- KeyParsing
Error - Error when deserialising a
PublicKey or a SecretKey. - Transport
Addr - Available address types.
Constants§
- NET_
REPORT_TIMEOUT - The maximum amount of time, in seconds, the net_report will spend gathering a single report.
Traits§
- Watcher
- A handle to a value that’s represented by one or more underlying [
Watchable]s.
Type Aliases§
- Endpoint
Id - The identifier for an endpoint in the (iroh) network.
\ No newline at end of file
+Re-exports§
Modules§
- address_
lookup - Lookup the address of an Endpoint ID.
- defaults
- Default values used in
iroh - dns
Non-wasm_browser - Configurable DNS resolver.
- endpoint
- The
Endpoint allows establishing connections to other iroh endpoints. - endpoint_
info - Support for handling DNS resource records for dialing by
EndpointId. - metrics
- Co-locating all of the iroh metrics structs
- protocol
- Tools for spawning an accept loop that routes incoming requests to the right protocol.
- test_
utils test-utils - Internal utilities to support testing.
- tls
- TLS configuration for iroh.
Structs§
- Endpoint
Addr - Network-level addressing information for an iroh endpoint.
- NetReport
- A net_report report.
- NetReport
Config - Configuration for the net report component.
- Public
Key - A public key.
- Relay
Config - Information on a specific relay server.
- Relay
Map - List of relay server configurations to be used in an iroh endpoint.
- Relay
Url - A URL identifying a relay server.
- Relay
UrlParseError - Can occur when parsing a string into a
RelayUrl. - Secret
Key - A secret key.
- Signature
- Ed25519 signature.
- Signature
Error - Verification of a signature failed.
Enums§
- KeyParsing
Error - Error returned when parsing a
PublicKey or a SecretKey. - Transport
Addr - Available address types.
Constants§
- NET_
REPORT_TIMEOUT - The maximum amount of time, in seconds, the net_report will spend gathering a single report.
Traits§
- Watcher
- A handle to a value that’s represented by one or more underlying [
Watchable]s.
Type Aliases§
- Endpoint
Id - The identifier for an endpoint in the (iroh) network.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/metrics/index.html b/pr/4036/docs/iroh/metrics/index.html
index da53db7d6a..00f2275127 100644
--- a/pr/4036/docs/iroh/metrics/index.html
+++ b/pr/4036/docs/iroh/metrics/index.html
@@ -1,2 +1,2 @@
iroh::metrics - Rust Module metrics
Expand description
Co-locating all of the iroh metrics structs
-Structs§
- Endpoint
Metrics - Metrics collected by an
crate::endpoint::Endpoint. - NetReport
Metrics - Enum of metrics for the module
- Relay
Metrics test-utils - Metrics tracked for the relay server
- Socket
Metrics - Enum of metrics for the module
\ No newline at end of file
+Structs§
- Endpoint
Metrics - Metrics collected by an
crate::endpoint::Endpoint. - NetReport
Metrics - Enum of metrics for the module
- Relay
Metrics test-utils - Metrics tracked for the relay server
- Socket
Metrics - Metrics collected by the iroh socket.
\ No newline at end of file
diff --git a/pr/4036/docs/iroh/metrics/struct.RelayMetrics.html b/pr/4036/docs/iroh/metrics/struct.RelayMetrics.html
index f8768e50a1..da2588f738 100644
--- a/pr/4036/docs/iroh/metrics/struct.RelayMetrics.html
+++ b/pr/4036/docs/iroh/metrics/struct.RelayMetrics.html
@@ -26,21 +26,26 @@
pub http_connections_closed: Counter,
pub http_connections_errored: Counter,
}Available on crate feature test-utils only.Expand description
Metrics tracked for the relay server
-Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.§bytes_sent: CounterBytes sent from a FrameType::SendPacket
-§bytes_recv: CounterBytes received from a FrameType::SendPacket
-§send_packets_sent: CounterFrameType::SendPacket sent
-§send_packets_recv: CounterFrameType::SendPacket received
-§send_packets_dropped: CounterFrameType::SendPacket dropped
-§other_packets_sent: CounterPackets of other FrameTypes sent
-§other_packets_recv: CounterPackets of other FrameTypes received
-§other_packets_dropped: CounterPackets of other FrameTypes dropped
-§got_ping: CounterNumber of FrameType::Pings received
-§sent_pong: CounterNumber of FrameType::Pongs sent
-§unknown_frames: CounterNumber of FrameType::Unknown received
+Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.§bytes_sent: CounterBytes sent to a client in RelayToClientDatagram or RelayToClientDatagramBatch frames.
+§bytes_recv: CounterBytes received from a client in ClientToRelayDatagram or ClientToRelayDatagramBatch frames.
+§send_packets_sent: CounterRelayToClientDatagram or RelayToClientDatagramBatch frames sent to a client.
+§send_packets_recv: CounterClientToRelayDatagram or ClientToRelayDatagramBatch frames received from a client.
+§send_packets_dropped: CounterRelayToClientDatagram or RelayToClientDatagramBatch frames dropped instead of being
+delivered to a client, because the recipient is not connected or writing to its stream failed.
+Note that frames dropped because the recipient’s send queue is full or closed are not counted
+here.
+§other_packets_sent: CounterIntended to count sent frames other than datagrams, but currently unused (never incremented).
+§other_packets_recv: CounterIntended to count received frames other than datagrams, but currently unused (never incremented).
+§other_packets_dropped: CounterIntended to count dropped frames other than datagrams, but currently unused (never incremented).
+§got_ping: CounterNumber of FrameType::Ping frames received from a client.
+§sent_pong: CounterNumber of FrameType::Pong frames sent to a client.
+§unknown_frames: CounterIntended to count received frames with an unrecognized FrameType,
+but currently unused (never incremented).
§bytes_rx_ratelimited_total: CounterNumber of bytes received from client connection which have been rate-limited.
§conns_rx_ratelimited_total: CounterNumber of client connections which have had any frames rate-limited.
§accepts: CounterNumber of times this server has accepted a connection.
-§disconnects: CounterNumber of connections we have removed because of an error
+§disconnects: CounterNumber of times a client connection was disconnected.
+Incremented once per connection, paired with Self::accepts.
§unique_client_keys: CounterNumber of unique client keys per day
§clients_inactive_added: CounterNumber of times a client was moved into the inactive state.
A client becomes inactive when a new client connects with the same endpoint id. An inactive
diff --git a/pr/4036/docs/iroh/metrics/struct.SocketMetrics.html b/pr/4036/docs/iroh/metrics/struct.SocketMetrics.html
index 2291657920..f61d3786bb 100644
--- a/pr/4036/docs/iroh/metrics/struct.SocketMetrics.html
+++ b/pr/4036/docs/iroh/metrics/struct.SocketMetrics.html
@@ -1,4 +1,4 @@
-
SocketMetrics in iroh::metrics - Rust SocketMetrics
#[non_exhaustive]pub struct SocketMetrics {Show 31 fields
+SocketMetrics in iroh::metrics - Rust SocketMetrics
#[non_exhaustive]pub struct SocketMetrics {Show 31 fields
pub update_direct_addrs: Counter,
pub send_ipv4: Counter,
pub send_ipv6: Counter,
@@ -30,10 +30,23 @@
pub actor_tick_direct_addr_heartbeat: Counter,
pub actor_link_change: Counter,
pub actor_tick_other: Counter,
-}
Expand description
Enum of metrics for the module
-Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.§update_direct_addrs: Counter§send_ipv4: Counter§send_ipv6: Counter§send_relay: Counter§recv_data_relay: Counter§recv_data_custom: Counter§recv_data_ipv4: Counter§recv_data_ipv6: Counter§recv_datagrams: CounterNumber of QUIC datagrams received.
-§recv_gro_datagrams: CounterNumber of datagrams received using GRO
-§relay_home_change: Counter§holepunch_attempts: CounterThe number of times holepunching is initiated on a connection.
+}Expand description
Metrics collected by the iroh socket.
+Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.§update_direct_addrs: CounterIntended to count updates to the local direct address set, but currently unused
+(never incremented).
+§send_ipv4: CounterNumber of bytes sent over IPv4.
+§send_ipv6: CounterNumber of bytes sent over IPv6.
+§send_relay: CounterNumber of bytes sent over the relay transport.
+§recv_data_relay: CounterNumber of data bytes received over the relay transport.
+§recv_data_custom: CounterNumber of data bytes received over any custom transport.
+§recv_data_ipv4: CounterNumber of data bytes received over IPv4.
+§recv_data_ipv6: CounterNumber of data bytes received over IPv6.
+§recv_datagrams: CounterNumber of QUIC datagrams received.
+§recv_gro_datagrams: CounterNumber of receive events that used GRO (coalesced datagram batches).
+This counts batches, not the individual datagrams within them. See
+Self::recv_datagrams for the datagram count.
+§relay_home_change: CounterNumber of times the home relay changed to a different relay.
+This includes the initial assignment from no home relay to a home relay.
+§holepunch_attempts: CounterThe number of times holepunching is initiated on a connection.
This can be incremented multiple times for a single connection. Note that only the
client-side of a connection will increment this counter.
§paths_direct: CounterThe number of network paths to peers that are direct.
@@ -53,8 +66,15 @@ the number of opened connections.
§transport_relay_paths_removed: CounterNumber of relay transport paths closed.
§transport_custom_paths_added: CounterNumber of custom transport paths opened.
§transport_custom_paths_removed: CounterNumber of custom transport paths closed.
-§actor_tick_main: Counter§actor_tick_msg: Counter§actor_tick_re_stun: Counter§actor_tick_portmap_changed: Counter§actor_tick_direct_addr_heartbeat: Counter§actor_link_change: Counter§actor_tick_other: CounterTrait Implementations§
Source§impl<'de> Deserialize<'de> for Metrics
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Iterable for Metrics
Source§fn metric_field_count(&self) -> usize
Returns the number of metric fields in the struct.Source§fn metric_field_ref(&self, n: usize) -> Option<MetricItem<'_>>
Returns the metric field at the given index.§fn family_field_count(&self) -> usize
Returns the number of Family fields in the struct.§fn family_field_ref(&self, _n: usize) -> Option<FamilyItem<'_>>
Returns the Family field at the given index.Source§impl Serialize for Metrics
Source§fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where
+§actor_tick_main: CounterNumber of iterations of the main socket actor loop.
+§actor_tick_msg: CounterNumber of actor messages processed by the socket actor loop.
+§actor_tick_re_stun: CounterNumber of periodic re-STUN timer ticks handled by the socket actor loop.
+§actor_tick_portmap_changed: CounterNumber of port-mapping change events handled by the socket actor loop.
+§actor_tick_direct_addr_heartbeat: CounterIntended to count direct address heartbeat ticks, but currently unused (never incremented).
+§actor_link_change: CounterNumber of local network interface (link) change events handled by the socket actor loop.
+§actor_tick_other: CounterNumber of times an input watcher or receiver closed in the socket actor loop.
+Trait Implementations§
Source§impl<'de> Deserialize<'de> for Metrics
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Iterable for Metrics
Source§fn metric_field_count(&self) -> usize
Returns the number of metric fields in the struct.Source§fn metric_field_ref(&self, n: usize) -> Option<MetricItem<'_>>
Returns the metric field at the given index.§fn family_field_count(&self) -> usize
Returns the number of Family fields in the struct.§fn family_field_ref(&self, _n: usize) -> Option<FamilyItem<'_>>
Returns the Family field at the given index.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
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/4036/docs/iroh/protocol/enum.IncomingFilterOutcome.html b/pr/4036/docs/iroh/protocol/enum.IncomingFilterOutcome.html
index e11345eddc..4577fe8eaf 100644
--- a/pr/4036/docs/iroh/protocol/enum.IncomingFilterOutcome.html
+++ b/pr/4036/docs/iroh/protocol/enum.IncomingFilterOutcome.html
@@ -11,7 +11,7 @@ the source address, actively refuse the connection, or silently drop it.
What this does depends on the connection type:
-
-
Direct (UDP) connections : this is QUIC source address
+
Direct (UDP) connections: this is QUIC source address
validation. If the socket address was spoofed, the retry token is
sent to the spoofed address, so we never hear from the attacker
again. If the address was real, the client repeats the connection
@@ -20,7 +20,7 @@ attempt with the token, and the next
-
-
Relay connections : there is no source address to validate
+
Relay connections: there is no source address to validate
(the relay already vouches for the packet origin), so the
“validation” itself has no security meaning. However, the retry
still imposes a real cost on the client: an extra round trip
diff --git a/pr/4036/docs/iroh/protocol/struct.RouterBuilder.html b/pr/4036/docs/iroh/protocol/struct.RouterBuilder.html
index dfc8969679..06b2f59fad 100644
--- a/pr/4036/docs/iroh/protocol/struct.RouterBuilder.html
+++ b/pr/4036/docs/iroh/protocol/struct.RouterBuilder.html
@@ -16,7 +16,7 @@ cheaper signals (e.g. remote address) first.
with this alpn.
handler can either be a type that implements ProtocolHandler or a
Box<dyn DynProtocolHandler>.
-
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for RouterBuilder
§impl !RefUnwindSafe for RouterBuilder
§impl Send for RouterBuilder
§impl Sync for RouterBuilder
§impl Unpin for RouterBuilder
§impl !UnwindSafe for RouterBuilder
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/4036/docs/iroh/struct.EndpointAddr.html b/pr/4036/docs/iroh/struct.EndpointAddr.html
index 0aa53df633..867818d655 100644
--- a/pr/4036/docs/iroh/struct.EndpointAddr.html
+++ b/pr/4036/docs/iroh/struct.EndpointAddr.html
@@ -5,7 +5,7 @@
This combines an endpoint’s identifier with network-level addressing information of how to
contact the endpoint.
To establish a network connection to an endpoint both the EndpointId and one or more network
-paths are needed. The network paths can come from various sources, current sources can come from
+paths are needed. The network paths can come from various sources:
-
An Address Lookup service which can provide routing information for a given EndpointId.
@@ -24,7 +24,7 @@ connection without the help of a Fields§§id: PublicKeyThe endpoint’s identifier.
-§addrs: BTreeSet<TransportAddr>The endpoint’s addresses
+§addrs: BTreeSet<TransportAddr>The endpoint’s addresses.
Implementations§
Source§impl EndpointAddr
Sourcepub fn new(id: PublicKey) -> EndpointAddr
Creates a new EndpointAddr with no network level addresses.
This still is usable with e.g. an address lookup service to establish a connection,
depending on the situation.
@@ -38,9 +38,9 @@ depending on the situation.
self,
addrs: impl IntoIterator<Item = TransportAddr>,
) -> EndpointAddrAdds a list of addresses.
-Sourcepub fn is_empty(&self) -> bool
Returns true, if only a EndpointId is present.
-Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns a list of IP addresses of this peer.
-Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns a list of relay urls of this peer.
+Sourcepub fn is_empty(&self) -> bool
Returns true if only an EndpointId is present.
+Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns an iterator over the IP addresses of this endpoint address.
+Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns an iterator over the relay URLs of this endpoint address.
In practice this is expected to be zero or one home relay for all known cases currently.
Trait Implementations§
Source§impl Clone for EndpointAddr
Source§fn clone(&self) -> EndpointAddr
Returns a duplicate 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 EndpointAddr
Source§impl<'de> Deserialize<'de> for EndpointAddr
Source§fn deserialize<__D>(
__deserializer: __D,
diff --git a/pr/4036/docs/iroh/struct.NetReport.html b/pr/4036/docs/iroh/struct.NetReport.html
index 693c855529..8b8ec1aed1 100644
--- a/pr/4036/docs/iroh/struct.NetReport.html
+++ b/pr/4036/docs/iroh/struct.NetReport.html
@@ -1,4 +1,4 @@
-NetReport in iroh - Rust NetReport
pub struct NetReport {
+NetReport in iroh - Rust NetReport
pub struct NetReport {
pub udp_v4: bool,
pub udp_v6: bool,
pub mapping_varies_by_dest_ipv4: Option<bool>,
@@ -13,17 +13,16 @@
§udp_v6: boolA QAD IPv6 round trip completed.
§mapping_varies_by_dest_ipv4: Option<bool>Whether the reported public address differs when probing different servers (on IPv4).
§mapping_varies_by_dest_ipv6: Option<bool>Whether the reported public address differs when probing different servers (on IPv6).
-§preferred_relay: Option<RelayUrl>Probe indicating the presence of port mapping protocols on the LAN.
-None for unknown
-§relay_latency: RelayLatencieskeyed by relay Url
-§global_v4: Option<SocketAddrV4>ip:port of global IPv4
-§global_v6: Option<SocketAddrV6>[ip]:port of global IPv6
+§preferred_relay: Option<RelayUrl>The relay server with the lowest latency, if any.
+§relay_latency: RelayLatenciesThe measured latency to each relay, keyed by relay URL.
+§global_v4: Option<SocketAddrV4>The discovered global IPv4 address and port, if any.
+§global_v6: Option<SocketAddrV6>The discovered global IPv6 address and port, if any.
§captive_portal: Option<bool>CaptivePortal is set when we think there’s a captive portal that is
intercepting HTTP traffic.
-Implementations§
Source§impl Report
Sourcepub fn mapping_varies_by_dest(&self) -> Option<bool>
Whether the reported public address differs when probing different servers.
+Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Report
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl PartialEq for Report
Source§impl Eq for Report
Source§impl StructuralPartialEq for Report
Auto Trait Implementations§
§impl Freeze for Report
§impl RefUnwindSafe for Report
§impl Send for Report
§impl Sync for Report
§impl Unpin for Report
§impl UnwindSafe for Report
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/4036/docs/iroh/struct.PublicKey.html b/pr/4036/docs/iroh/struct.PublicKey.html
index f8fb4c5ae2..b725772ddc 100644
--- a/pr/4036/docs/iroh/struct.PublicKey.html
+++ b/pr/4036/docs/iroh/struct.PublicKey.html
@@ -1,5 +1,5 @@
PublicKey in iroh - Rust PublicKey
pub struct PublicKey(/* private fields */);
Expand description
A public key.
-The key itself is stored as the CompressedEdwards y coordinate of the public key
+
The key itself is stored as the CompressedEdwards y-coordinate of the public key.
It is verified to decompress into a valid key when created.
Implementations§
Source§impl PublicKey
Sourcepub fn as_bytes(&self) -> &[u8; 32]
Get this public key as a byte array.
@@ -12,7 +12,7 @@ See [VerifyingKey::from_bytes] for details.
&self,
message: &[u8],
signature: &Signature,
-) -> Result<(), SignatureError>Verify a signature on a message with this secret key’s public key.
+) -> Result<(), SignatureError>Verify a signature on a message with this public key.
§Return
Returns Ok(()) if the signature is valid, and Err otherwise.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PublicKey
Source§fn deserialize<D>(
deserializer: D,
) -> Result<PublicKey, <D as Deserializer<'de>>::Error>where
- D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl From<PublicKey> for EndpointAddr
Source§fn from(endpoint_id: PublicKey) -> EndpointAddr
Converts to this type from the input type.Source§impl From<PublicKey> for EndpointAddr
Source§fn from(endpoint_id: PublicKey) -> EndpointAddr
Converts to this type from the input type.Source§impl FromStr for PublicKey
Parses a PublicKey from its hex or base32 encoding.
+
Display produces the hex encoding.
Source§impl Hash for PublicKey
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
H: Hasher,
diff --git a/pr/4036/docs/iroh/tls/index.html b/pr/4036/docs/iroh/tls/index.html
index 3c1d92cf2a..16f63b088e 100644
--- a/pr/4036/docs/iroh/tls/index.html
+++ b/pr/4036/docs/iroh/tls/index.html
@@ -1,5 +1,5 @@
iroh::tls - Rust Module tls
Expand description
TLS configuration for iroh.
-Currently there is one mechanisms available
+Currently there is one mechanism available:
- Raw Public Keys, using the TLS extension described in RFC 7250
diff --git a/pr/4036/docs/iroh_base/enum.KeyParsingError.html b/pr/4036/docs/iroh_base/enum.KeyParsingError.html
index d0668a511c..7c849cddf2 100644
--- a/pr/4036/docs/iroh_base/enum.KeyParsingError.html
+++ b/pr/4036/docs/iroh_base/enum.KeyParsingError.html
@@ -1,4 +1,4 @@
-KeyParsingError in iroh_base - Rust KeyParsingError
#[non_exhaustive]pub enum KeyParsingError {
+KeyParsingError in iroh_base - Rust KeyParsingError
#[non_exhaustive]pub enum KeyParsingError {
FailedToDecodeHex {
meta: Meta,
},
@@ -11,14 +11,14 @@
InvalidKeyData {
meta: Meta,
},
-}
Available on crate feature key only.Expand description
Error when deserialising a PublicKey or a SecretKey.
+}Available on crate feature key only.Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§FailedToDecodeHex
The input string could not be decoded as hex.
Fields
§meta: MetaCaptured call-site metadata
§FailedToDecodeBase32
The input string could not be decoded as base32.
Fields
§meta: MetaCaptured call-site metadata
§InvalidLength
The input has invalid length.
Fields
§meta: MetaCaptured call-site metadata
-§InvalidKeyData
The decoded data is not a valid Ed25591 public key.
+§InvalidKeyData
The decoded data is not a valid Ed25519 public key.
Fields
§meta: MetaCaptured call-site metadata
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<KeyParsingError> for AnyError
Source§fn from(value: KeyParsingError) -> AnyError
Converts to this type from the input type.Source§impl StackError for KeyParsingError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
Returns the next source in the chain, if any.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.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§
Source§impl<T> Borrow<T> for Twhere
diff --git a/pr/4036/docs/iroh_base/enum.TransportAddr.html b/pr/4036/docs/iroh_base/enum.TransportAddr.html
index ec9989aea4..a55428eb22 100644
--- a/pr/4036/docs/iroh_base/enum.TransportAddr.html
+++ b/pr/4036/docs/iroh_base/enum.TransportAddr.html
@@ -3,8 +3,8 @@
Ip(SocketAddr),
Custom(CustomAddr),
}Available on crate feature key only.Expand description
Available address types.
-Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§Relay(RelayUrl)
Relays
-§Ip(SocketAddr)
IP based addresses
+Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§Relay(RelayUrl)
A relay server address.
+§Ip(SocketAddr)
An IP based address.
§Custom(CustomAddr)
Custom transport address
Implementations§
Source§impl TransportAddr