diff --git a/pr/3981/docs/help.html b/pr/3981/docs/help.html index 063ad7103c..f35afe481b 100644 --- a/pr/3981/docs/help.html +++ b/pr/3981/docs/help.html @@ -1 +1 @@ -
wasm_browser only.DNS endpoint discovery for iroh
+wasm_browser only.DNS endpoint discovery for iroh
DnsAddressLookup.pub struct DnsAddressLookup { /* private fields */ }wasm_browser only.DNS endpoint discovery
+pub struct DnsAddressLookup { /* private fields */ }wasm_browser only.DNS endpoint discovery
When asked to resolve a EndpointId, this service performs a lookup in the Domain Name System (DNS).
It uses the Endpoint’s DNS resolver to query for TXT records under the domain
_iroh.<z32-endpoint-id>.<origin-domain>:
The DNS resolver defaults to using the nameservers configured on the host system, but can be changed
with crate::endpoint::Builder::dns_resolver.
Creates a DnsAddressLookupBuilder that implements IntoAddressLookup.
Creates a DnsAddressLookupBuilder that implements AddressLookupBuilder.
Creates a new DNS discovery using the iroh.link domain.
This uses the N0_DNS_ENDPOINT_ORIGIN_PROD domain.
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.
EndpointData to the Address Lookup mechanism. Read moreEndpointData to the Address Lookup mechanism. Read moreself into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read morepub struct DnsAddressLookupBuilder { /* private fields */ }wasm_browser only.Builder for DnsAddressLookup.
pub struct DnsAddressLookupBuilder { /* private fields */ }wasm_browser only.Builder for DnsAddressLookup.
Sets the DNS resolver to use.
Builds a DnsAddressLookup with the passed DnsResolver.
#[non_exhaustive]pub enum IntoAddressLookupError {
+AddressLookupBuilderError in iroh::address_lookup - Rust AddressLookupBuilderError
#[non_exhaustive]pub enum AddressLookupBuilderError {
User {
provenance: &'static str,
source: AnyError,
@@ -8,18 +8,18 @@
source: EndpointError,
meta: Meta,
},
-}
Expand description
IntoAddressLookup errors
+}Expand description
AddressLookupBuilder errors
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.Implementations§
Implementations§
#[non_exhaustive]pub enum Error {
+Error in iroh::address_lookup - Rust Error
#[non_exhaustive]pub enum Error {
NoServiceConfigured {
meta: Meta,
},
@@ -14,19 +14,19 @@
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.§NoServiceConfigured
Fields
§meta: MetaCaptured call-site metadata
§NoResults
Fields
§meta: MetaCaptured call-site metadata
§User
Implementations§
Creates a new user error from an arbitrary error type that can be converted into [AnyError].
#[non_exhaustive]pub enum ParseError {
+ParseError in iroh::address_lookup - Rust ParseError
Lookup the address of an Endpoint ID.
+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
@@ -14,6 +14,14 @@ implementations to co-exist because there are many possible ways to implement th
Each Endpoint can use the address lookup mechanisms most suitable to the application.
The Builder::address_lookup method is used to add an address lookup mechanism to an
Endpoint.
Each address lookup service receives the full set of transport addresses when publishing, +but may only publish a subset of them based on its own constraints.
+To control which addresses are published to a particular service, you can supply an
+AddrFilter when configuring it via AddressLookupBuilder::with_addr_filter. The filter
+receives the full set of addresses and returns an ordered Vec, allowing you to both
+remove addresses you don’t want published and prioritize the ones you do Each service
+may apply additional filtering on top based on its own constraints, but will not publish
+addresses outside of what the filter returns. See each service’s documentation for details.
Some generally useful Address Lookup implementations are provided:
address-lookup-
To use multiple Address Lookup’ssimultaneously you can call Builder::address_lookup.
This will use ConcurrentAddressLookup under the hood, which performs lookups to all
Address Lookupsystems at the same time.
-Builder::address_lookup takes any type that implements IntoAddressLookup. You can
+
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 IntoAddressLookup::into_address_lookup, passing the finished Endpoint to your
+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
-implement AddressLookup also have a blanket implementation of IntoAddressLookup.
+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
PkarrPublisher and address_lookup::DnsAddressLookup:
@@ -73,4 +81,5 @@ implement await?;pub use dns::*;wasm_browserpub use mdns::*;address-lookup-mdnspub use memory::*;pub use pkarr::dht::*;address-lookup-pkarr-dhtpub use pkarr::*;wasm_browseraddress-lookup-mdnsAddressLookups.UserData::MAX_LENGTH bytes.super::Endpoint.AddressLookups.pub use dns::*;wasm_browserpub use mdns::*;address-lookup-mdnspub use memory::*;pub use pkarr::dht::*;address-lookup-pkarr-dhtpub use pkarr::*;wasm_browseraddress-lookup-mdnsAddressLookups.UserData::MAX_LENGTH bytes.super::Endpoint.AddressLookups.pub const NAME: &str = "mdns";address-lookup-mdns only.Name of this address lookup service.
+pub const NAME: &str = "mdns";address-lookup-mdns only.Name of this address lookup service.
Used as the provenance field in AddressLookupItems.
Used in the crate::endpoint::Source::AddressLookup enum variant as the name.
pub enum DiscoveryEvent {
+DiscoveryEvent in iroh::address_lookup::mdns - Rust DiscoveryEvent
pub enum DiscoveryEvent {
Discovered {
endpoint_info: EndpointInfo,
last_updated: Option<u64>,
@@ -13,8 +13,8 @@
A peer was expired due to being inactive, unreachable, or otherwise unavailable.
endpoint_id: EndpointIdThe id of the endpoint that expired.
-source. Read moresource. Read moreaddress-lookup-mdns only.An address lookup service that uses an mdns-like service to discover and lookup the addresses of local endpoints.
+address-lookup-mdns only.An address lookup service that uses an mdns-like service to discover and lookup the addresses of local endpoints.
This allows you to use an mdns-like swarm discovery service to find address information about endpoints that are on your local network, no relay or outside internet needed.
See the swarm-discovery crate for more details.
When MdnsAddressLookup is enabled, it’s possible to get a list of the locally discovered endpoints by filtering a list of RemoteInfos.
In order to get a list of locally discovered addresses, you must call MdnsAddressLookup::subscribe to subscribe
+to a stream of discovered addresses.
use std::time::Duration;
@@ -36,4 +38,16 @@ See the swarm-discovery
}
}
}
-}swarm-discovery, a variation on mdnsMdnsAddressLookup.MdnsAddressLookup service.By default, MdnsAddressLookup will attempt to publish all addresses it receives:
+direct IP addresses and up to one RelayUrl. The following constraints apply regardless
+of any user-supplied filter:
RelayUrl in the address set is published.RelayUrl longer than 249 bytes is silently dropped.You can supply an AddrFilter via MdnsAddressLookupBuilder::with_addr_filter to
+control which addresses are published and in what order. The filter is applied before the
+constraints above, so for example you can use it to exclude relay URLs entirely or to
+prioritize certain addresses.
swarm-discovery, a variation on mdns.MdnsAddressLookup.MdnsAddressLookup service.pub struct MdnsAddressLookup { /* private fields */ }address-lookup-mdns only.Address Lookup using swarm-discovery, a variation on mdns
Returns a MdnsAddressLookupBuilder that implements Into.
pub struct MdnsAddressLookup { /* private fields */ }address-lookup-mdns only.Address Lookup using swarm-discovery, a variation on mdns.
Returns a MdnsAddressLookupBuilder that implements Into.
Subscribe to discovered endpoints
-Subscribe to discovered endpoints.
+EndpointData to the Address Lookup mechanism. Read moresource. Read moreEndpointData to the Address Lookup mechanism. Read moresource. Read moreself into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read morepub struct MdnsAddressLookupBuilder { /* private fields */ }address-lookup-mdns only.Builder for MdnsAddressLookup.
Sets whether this endpoint should advertise its presence.
+pub struct MdnsAddressLookupBuilder { /* private fields */ }address-lookup-mdns only.Builder for MdnsAddressLookup.
Sets whether this endpoint should advertise its presence.
Default is true.
-Sets a custom service name.
+Sets a custom service name.
The default is irohv1, which will show up on a record in the
following form, for example:
7rutqynuzu65fcdgoerbt4uoh3p62wuto2mp56x3uvhitqzssxga._irohv1._udp.local
Any custom service name will take the form, for example:
7rutqynuzu65fcdgoerbt4uoh3p62wuto2mp56x3uvhitqzssxga._{service_name}._udp.local
Sets a filter to control which addresses are published by this service.
+Builds an MdnsAddressLookup instance with the configured settings.
Builds an MdnsAddressLookup instance with the configured settings.
Returns an error if the network does not allow ipv4 OR ipv6.
This relies on [tokio::runtime::Handle::current] and will panic if called outside of the context of a tokio runtime.
pub struct MemoryLookup { /* private fields */ }An in-memory address lookup system to manually add endpoint addressing information.
+pub struct MemoryLookup { /* private fields */ }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
@@ -71,7 +71,11 @@ relay URL is overwritten.
EndpointData to the Address Lookup mechanism. Read moresource. Read moresource. Read moreself into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read morepub const DEFAULT_PKARR_TTL: u32 = 30;Default TTL for the records in the pkarr signed packet.
+pub const DEFAULT_PKARR_TTL: u32 = 30;Default TTL for the records in the pkarr signed packet.
The Time To Live (TTL) tells DNS caches how long to store a record. It is ignored by the
iroh-dns-server, e.g. as running on N0_DNS_PKARR_RELAY_PROD, as the home server
keeps the records for the domain. When using the pkarr relay no DNS is involved and the
diff --git a/pr/3981/docs/iroh/address_lookup/pkarr/constant.DEFAULT_REPUBLISH_INTERVAL.html b/pr/3981/docs/iroh/address_lookup/pkarr/constant.DEFAULT_REPUBLISH_INTERVAL.html
index e22092eb60..6d9fc2f7aa 100644
--- a/pr/3981/docs/iroh/address_lookup/pkarr/constant.DEFAULT_REPUBLISH_INTERVAL.html
+++ b/pr/3981/docs/iroh/address_lookup/pkarr/constant.DEFAULT_REPUBLISH_INTERVAL.html
@@ -1,2 +1,2 @@
-
pub const DEFAULT_REPUBLISH_INTERVAL: Duration;Interval in which to republish the endpoint info even if unchanged: 5 minutes.
+pub const N0_DNS_PKARR_RELAY_PROD: &str = "https://dns.iroh.link/pkarr";The production pkarr relay run by number 0.
+pub const N0_DNS_PKARR_RELAY_PROD: &str = "https://dns.iroh.link/pkarr";The production pkarr relay run by number 0.
This server is both a pkarr relay server as well as a DNS resolver, see the module documentation. However it does not interact with the Mainline DHT, so is a more central service. It is a reliable service to use for address lookup.
diff --git a/pr/3981/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_STAGING.html b/pr/3981/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_STAGING.html index 7b0c6835c5..69f1bb5e54 100644 --- a/pr/3981/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_STAGING.html +++ b/pr/3981/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_STAGING.html @@ -1,4 +1,4 @@ -pub const N0_DNS_PKARR_RELAY_STAGING: &str = "https://staging-dns.iroh.link/pkarr";The testing pkarr relay run by number 0.
+pub const N0_DNS_PKARR_RELAY_STAGING: &str = "https://staging-dns.iroh.link/pkarr";The testing pkarr relay run by number 0.
This server operates similarly to N0_DNS_PKARR_RELAY_PROD but is not as reliable.
It is meant for more experimental use and testing purposes.
address-lookup-pkarr-dht only.Pkarr based address lookup for iroh, supporting both relay servers and the DHT.
+address-lookup-pkarr-dht only.Pkarr based address lookup for iroh, supporting both relay servers and the DHT.
This module contains pkarr-based address lookup for iroh which can use both pkarr relay servers as well as the Mainline DHT directly. See the pkarr module for an overview of pkarr.
diff --git a/pr/3981/docs/iroh/address_lookup/pkarr/dht/struct.Builder.html b/pr/3981/docs/iroh/address_lookup/pkarr/dht/struct.Builder.html index 34f9e9feba..53c1d72aa4 100644 --- a/pr/3981/docs/iroh/address_lookup/pkarr/dht/struct.Builder.html +++ b/pr/3981/docs/iroh/address_lookup/pkarr/dht/struct.Builder.html @@ -1,20 +1,20 @@ -pub struct Builder { /* private fields */ }address-lookup-pkarr-dht only.Builder for DhtAddressLookup.
pub struct Builder { /* private fields */ }address-lookup-pkarr-dht only.Builder for DhtAddressLookup.
By default, publishing to the DHT is enabled, and relay publishing is disabled.
-Sets the secret key to use for signing the DNS packets.
+Sets the secret key to use for signing the DNS packets.
Without a secret key, the endpoint will not publish its address to the DHT.
-Sets the pkarr relay URL to use.
-Uses the default number 0 pkarr relay URL.
-Sets whether to include the direct addresses in the DNS packet.
-Sets the republish delay for the DHT.
-Disables publishing even if a secret key is set.
-Builds the address lookup mechanism.
-Sets the pkarr relay URL to use.
+Uses the default number 0 pkarr relay URL.
+Sets the republish delay for the DHT.
+Disables publishing even if a secret key is set.
+Sets a filter to control which addresses are published by this service.
+Builds the address lookup mechanism.
+pub struct DhtAddressLookup(/* private fields */);address-lookup-pkarr-dht only.Pkarr Mainline DHT and relay server address lookup.
+pub struct DhtAddressLookup(/* private fields */);address-lookup-pkarr-dht only.Pkarr Mainline DHT and relay server address lookup.
It stores endpoint addresses in DNS records, signed by the endpoint’s private key, and publishes them to the BitTorrent Mainline DHT. See the pkarr module for more details.
This implements the AddressLookup trait to be used as an address lookup service which can
be used as both a publisher and resolver. Calling DhtAddressLookup::publish will start
a background task that periodically publishes the endpoint address.
Creates a new builder for DhtAddressLookup.
EndpointData to the Address Lookup mechanism. Read moreBy default, DhtAddressLookup will publish all addresses it receives:
+direct IP addresses and relay URLs. No internal address limits or truncation
+are applied.
You can supply an AddrFilter via Builder::set_addr_filter to
+control which addresses are published.
Creates a new builder for DhtAddressLookup.
EndpointData to the Address Lookup mechanism. Read moresource. Read moresource. Read moreself into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more#[non_exhaustive]pub enum PkarrError {
+PkarrError in iroh::address_lookup::pkarr - Rust PkarrError
#[non_exhaustive]pub enum PkarrError {
PublicKey {
source: PublicKeyError,
meta: Meta,
@@ -34,7 +34,7 @@
An address lookup service which publishes and resolves endpoint information using a pkarr relay.
+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
@@ -20,6 +20,10 @@ the Mainline DHT on behalf on the client as well as cache lookups performed on t
to improve performance.
PkarrPublisher publishes all addresses it receives by default, with no internal limiting.
+You can supply an AddrFilter via PkarrPublisherBuilder::set_addr_filter to limit the kinds
+and number of addresses that get published.
Note that PkarrResolver and address_lookup::DnsAddressLookup only resolve and do not publish, so filtering does not apply to them.
For address lookup in iroh the pkarr Resource Records contain the addressing information, providing endpoints which retrieve the pkarr Resource Record with enough detail to contact the iroh endpoint.
@@ -40,4 +44,4 @@ to the application’s needs: as the Mainline DHT. -address-lookup-pkarr-dhtPkarrPublisher.pkarr::SignedPacket]s to a pkarr relay.PkarrResolver.address-lookup-pkarr-dhtPkarrPublisher.pkarr::SignedPacket]s to a pkarr relay.PkarrRelayClientPkarrResolver.pub struct PkarrPublisher { /* private fields */ }Publisher of address lookup information to a pkarr relay.
+pub struct PkarrPublisher { /* private fields */ }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 ConcurrentAddressLookup.
This publisher will only publish the RelayUrl if it is set, otherwise the direct addresses are published instead.
Returns a PkarrPublisherBuilder that publishes endpoint info to a pkarr relay at pkarr_relay.
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 IntoAddressLookup, so it can be passed to address_lookup.
+
PkarrPublisherBuilder implements AddressLookupBuilder, so it can be passed to address_lookup.
It will then use the endpoint’s secret key to sign published packets.
Creates a pkarr publisher which uses the number 0 pkarr relay server.
+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.
Publishes the addressing information about this endpoint to a pkarr relay.
+Publishes the addressing information about this endpoint to a pkarr relay.
This is a nonblocking function, the actual update is performed in the background.
-EndpointData to the Address Lookup mechanism. Read moreEndpointData to the Address Lookup mechanism. Read moresource. Read moresource. Read moreself into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read morepub struct PkarrPublisherBuilder { /* private fields */ }Builder for PkarrPublisher.
pub struct PkarrPublisherBuilder { /* private fields */ }Builder for PkarrPublisher.
Sets the TTL (time-to-live) for published packets.
Default is DEFAULT_PKARR_TTL.
Sets the interval after which packets are republished even if our endpoint info did not change.
+Sets the interval after which packets are republished even if our endpoint info did not change.
Default is DEFAULT_REPUBLISH_INTERVAL.
wasm_browser only.Sets the DNS resolver to use for resolving the pkarr relay URL.
-wasm_browser only.Sets the DNS resolver to use for resolving the pkarr relay URL.
+Sets a filter to control which addresses are published by this service
+Builds the PkarrPublisher with the passed secret key for signing packets.
This publisher will be able to publish [pkarr] records for SecretKey.
pub struct PkarrRelayClient { /* private fields */ }A pkarr client to publish [pkarr::SignedPacket]s to a pkarr relay.
pub struct PkarrRelayClient { /* private fields */ }A pkarr client to publish [pkarr::SignedPacket]s to a pkarr relay.
Create a new PkarrRelayClient with default settings.
Use the PkarrRelayClient::builder to get a builder that allows for
+adding custom settings.
wasm_browser only.Creates a new client while passing a DNS resolver to use.
-Create a PkarrRelayClientBuilder.
Resolves a [SignedPacket] for the given EndpointId.
Publishes a [SignedPacket].
source. Read moresource. Read morepub struct PkarrRelayClientBuilder { /* private fields */ }A builder for the PkarrRelayClient
wasm_browser only.Passes an optional DNS resolver for the client to use.
+Build a PkarrRelayClient.
source. Read moreself into a Left variant of Either<Self, Self>
+if into_left is true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read moreself into a Left variant of Either<Self, Self>
+if into_left(&self) returns true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read moreSubscriber to this type, returning a
+[WithDispatch] wrapper. Read morepub struct PkarrResolver { /* private fields */ }Resolver of address lookup information from a pkarr relay.
+pub struct PkarrResolver { /* private fields */ }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 ConcurrentAddressLookup.
Creates a new resolver builder using the pkarr relay server at the URL.
-The builder implements IntoAddressLookup.
Creates a pkarr resolver builder which uses the number 0 pkarr relay server.
+Creates a new resolver builder using the pkarr relay server at the URL.
+The builder implements AddressLookupBuilder.
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.
EndpointData to the Address Lookup mechanism. Read moresource. Read moreEndpointData to the Address Lookup mechanism. Read moresource. Read moreself into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read morepub struct PkarrResolverBuilder { /* private fields */ }Builder for PkarrResolver.
pub struct PkarrResolverBuilder { /* private fields */ }Builder for PkarrResolver.
wasm_browser only.Sets the DNS resolver to use for resolving the pkarr relay URL.
-Creates a PkarrResolver from this builder.
wasm_browser only.Sets the DNS resolver to use for resolving the pkarr relay URL.
+Creates a PkarrResolver from this builder.
no-op: resolver does not publish
+pub struct AddrFilter(/* private fields */);A filter and/or reordering function applied to transport addresses, +typically used by AddressLookup services in iroh before publishing.
+Takes the full set of transport addresses and returns them as an ordered Vec,
+allowing both filtering (by omitting addresses) and reordering (by controlling
+the output order). A BTreeSet cannot preserve a custom order, so the return
+type is Vec to make reordering possible.
See the documentation for each address lookup implementation for details on +what additional filtering the implementation may perform on top.
+Create a new AddrFilter
Only keep relay addresses.
+Only keep direct IP addresses.
+Apply the address filter function to a set of addresses.
+source. Read moreself into a Left variant of Either<Self, Self>
+if into_left is true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read moreself into a Left variant of Either<Self, Self>
+if into_left(&self) returns true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read moreSubscriber to this type, returning a
+[WithDispatch] wrapper. Read morepub struct ConcurrentAddressLookup { /* private fields */ }An Address Lookup service that combines multiple Address Lookup sources.
+pub struct ConcurrentAddressLookup { /* private fields */ }An Address Lookup service that combines multiple Address Lookup sources.
The Address Lookup will resolve concurrently.
-Creates an empty ConcurrentAddressLookup.
Creates a new ConcurrentAddressLookup.
Adds an AddressLookup service.
Creates an empty ConcurrentAddressLookup.
Creates a new ConcurrentAddressLookup.
Adds an AddressLookup service.
If there is historical Address Lookup data, it will be published immediately on this service.
-Adds an already Boxed AddressLookup service.
Adds an already Boxed AddressLookup service.
If there is historical Address Lookup data, it will be published immediately on this service.
-EndpointData to the Address Lookup mechanism. Read moreEndpointData to the Address Lookup mechanism. Read moresource. Read moresource. Read moreself into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read morepub struct EndpointData { /* private fields */ }Data about an endpoint that may be published to and resolved from discovery services.
+pub struct EndpointData { /* private fields */ }Data about an endpoint that may be published to and resolved from discovery services.
This includes an optional RelayUrl, a set of direct addresses, and the optional
UserData, a string that can be set by applications and is not parsed or used by iroh
itself.
This struct does not include the endpoint’s EndpointId, only the data about a certain
endpoint. See EndpointInfo for a struct that contains a EndpointId with associated EndpointData.
Creates a new EndpointData with a relay URL and a set of direct addresses.
Sets the relay URL and returns the updated endpoint data.
-Sets the direct addresses and returns the updated endpoint data.
-Sets the user-defined data and returns the updated endpoint data.
-Returns the relay URL of the endpoint.
-Returns the optional user-defined data of the endpoint.
-Returns the direct addresses of the endpoint.
-Removes all direct addresses from the endpoint data.
-Removes all direct addresses from the endpoint data.
-Add addresses to the endpoint data.
-Sets the user-defined data of the endpoint data.
-Returns the full list of all known addresses
-source. Read moreCreates a new EndpointData with a relay URL and a set of direct addresses.
Sets the relay URL and returns the updated endpoint data.
+Sets the direct addresses and returns the updated endpoint data.
+Sets the user-defined data and returns the updated endpoint data.
+Returns the relay URL of the endpoint.
+Returns the optional user-defined data of the endpoint.
+Returns the direct addresses of the endpoint.
+Removes all direct addresses from the endpoint data.
+Removes all direct addresses from the endpoint data.
+Add addresses to the endpoint data.
+Sets the user-defined data of the endpoint data.
+Returns the full list of all known addresses
+Apply the given filter to the current addresses.
+Returns a vec to allow re-ordering of addresses.
+source. Read morepub struct EndpointInfo {
+EndpointInfo in iroh::address_lookup - Rust EndpointInfo
pub struct EndpointInfo {
pub endpoint_id: PublicKey,
pub data: EndpointData,
}
Expand description
Information about an endpoint that may be published to and resolved from discovery services.
This struct couples a EndpointId with its associated EndpointData.
Fields§
§endpoint_id: PublicKeyThe EndpointId of the endpoint this is about.
§data: EndpointDataThe information published about the endpoint.
-Implementations§
Source§impl EndpointInfo
Sourcepub fn new(endpoint_id: PublicKey) -> EndpointInfo
Creates a new EndpointInfo with an empty EndpointData.
-Sourcepub fn from_parts(endpoint_id: PublicKey, data: EndpointData) -> EndpointInfo
Creates a new EndpointInfo from its parts.
-Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> EndpointInfo
Sets the relay URL and returns the updated endpoint info.
-Sourcepub fn with_ip_addrs(self, addrs: BTreeSet<SocketAddr>) -> EndpointInfo
Sets the IP based addresses and returns the updated endpoint info.
-Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> EndpointInfo
Sets the user-defined data and returns the updated endpoint info.
-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 from_txt_lookup(
+
Implementations§
Source§impl EndpointInfo
Sourcepub fn new(endpoint_id: PublicKey) -> EndpointInfo
Creates a new EndpointInfo with an empty EndpointData.
+Sourcepub fn from_parts(endpoint_id: PublicKey, data: EndpointData) -> EndpointInfo
Creates a new EndpointInfo from its parts.
+Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> EndpointInfo
Sets the relay URL and returns the updated endpoint info.
+Sourcepub fn with_ip_addrs(self, addrs: BTreeSet<SocketAddr>) -> EndpointInfo
Sets the IP based addresses and returns the updated endpoint info.
+Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> EndpointInfo
Sets the user-defined data and returns the updated endpoint info.
+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 from_txt_lookup(
domain_name: String,
lookup: impl Iterator<Item = TxtRecordData>,
) -> Result<EndpointInfo, ParseError>
Parses a EndpointInfo from DNS TXT lookup.
-Sourcepub fn from_pkarr_signed_packet(
+
Sourcepub fn from_pkarr_signed_packet(
packet: &SignedPacket,
) -> Result<EndpointInfo, ParseError>
Parses a EndpointInfo from a [pkarr::SignedPacket].
-Sourcepub fn to_pkarr_signed_packet(
+
Sourcepub fn to_pkarr_signed_packet(
&self,
secret_key: &SecretKey,
ttl: u32,
) -> Result<SignedPacket, EncodingError>
Creates a [pkarr::SignedPacket].
This constructs a DNS packet and signs it with a SecretKey.
-Sourcepub fn to_txt_strings(&self) -> Vec<String>
Converts into a list of {key}={value} strings.
-Methods from Deref<Target = 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 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 add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
-Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-Trait Implementations§
Source§impl Clone for EndpointInfo
Source§fn clone(&self) -> EndpointInfo
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 EndpointInfo
Source§impl Deref for EndpointInfo
Source§type Target = EndpointData
The resulting type after dereferencing.Source§impl DerefMut for EndpointInfo
Source§impl From<&TxtAttrs<IrohAttr>> for EndpointInfo
Source§fn from(attrs: &TxtAttrs<IrohAttr>) -> EndpointInfo
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointInfo
Source§fn from(addr: EndpointAddr) -> EndpointInfo
Converts to this type from the input type.Source§impl From<EndpointInfo> for EndpointAddr
Source§fn from(value: EndpointInfo) -> EndpointAddr
Converts to this type from the input type.Source§impl From<Item> for EndpointInfo
Source§impl From<TxtAttrs<IrohAttr>> for EndpointInfo
Source§fn from(attrs: TxtAttrs<IrohAttr>) -> EndpointInfo
Converts to this type from the input type.Source§impl PartialEq for EndpointInfo
Source§impl Eq for EndpointInfo
Source§impl StructuralPartialEq for EndpointInfo
Auto Trait Implementations§
§impl Freeze for EndpointInfo
§impl RefUnwindSafe for EndpointInfo
§impl Send for EndpointInfo
§impl Sync for EndpointInfo
§impl Unpin for EndpointInfo
§impl UnwindSafe for EndpointInfo
Blanket Implementations§
Returns the relay URL of the endpoint.
+Returns the optional user-defined data of the endpoint.
+Returns the direct addresses of the endpoint.
+Removes all direct addresses from the endpoint data.
+Removes all direct addresses from the endpoint data.
+Add addresses to the endpoint data.
+Sets the user-defined data of the endpoint data.
+Returns the full list of all known addresses
+Apply the given filter to the current addresses.
+Returns a vec to allow re-ordering of addresses.
+source. Read morepub struct Item { /* private fields */ }