Expand description
Lookup the address of an Endpoint ID.
+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
diff --git a/pr/4094/docs/iroh/address_lookup/pkarr/constant.DEFAULT_PKARR_TTL.html b/pr/4094/docs/iroh/address_lookup/pkarr/constant.DEFAULT_PKARR_TTL.html
index ef10e53f93..e4a7f4a504 100644
--- a/pr/4094/docs/iroh/address_lookup/pkarr/constant.DEFAULT_PKARR_TTL.html
+++ b/pr/4094/docs/iroh/address_lookup/pkarr/constant.DEFAULT_PKARR_TTL.html
@@ -1,4 +1,4 @@
-
DEFAULT_PKARR_TTL
pub const DEFAULT_PKARR_TTL: u32 = 30;Expand description
Default TTL for the records in the pkarr signed packet.
+DEFAULT_PKARR_TTL
pub const DEFAULT_PKARR_TTL: u32 = 30;Expand description
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/4094/docs/iroh/address_lookup/pkarr/constant.DEFAULT_REPUBLISH_INTERVAL.html b/pr/4094/docs/iroh/address_lookup/pkarr/constant.DEFAULT_REPUBLISH_INTERVAL.html
index ea2d9a7153..8ea689a931 100644
--- a/pr/4094/docs/iroh/address_lookup/pkarr/constant.DEFAULT_REPUBLISH_INTERVAL.html
+++ b/pr/4094/docs/iroh/address_lookup/pkarr/constant.DEFAULT_REPUBLISH_INTERVAL.html
@@ -1,2 +1,2 @@
-
DEFAULT_REPUBLISH_INTERVAL
pub const DEFAULT_REPUBLISH_INTERVAL: Duration;Expand description
Interval in which to republish the endpoint info even if unchanged: 5 minutes.
+DEFAULT_REPUBLISH_INTERVAL
N0_DNS_PKARR_RELAY_PROD
pub const N0_DNS_PKARR_RELAY_PROD: &str = "https://dns.iroh.link/pkarr";Expand description
The production pkarr relay run by number 0.
+N0_DNS_PKARR_RELAY_PROD
pub const N0_DNS_PKARR_RELAY_PROD: &str = "https://dns.iroh.link/pkarr";Expand description
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/4094/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_STAGING.html b/pr/4094/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_STAGING.html index 9d105de601..51d9f0b989 100644 --- a/pr/4094/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_STAGING.html +++ b/pr/4094/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_STAGING.html @@ -1,4 +1,4 @@ -N0_DNS_PKARR_RELAY_STAGING
pub const N0_DNS_PKARR_RELAY_STAGING: &str = "https://staging-dns.iroh.link/pkarr";Expand description
The testing pkarr relay run by number 0.
+N0_DNS_PKARR_RELAY_STAGING
pub const N0_DNS_PKARR_RELAY_STAGING: &str = "https://staging-dns.iroh.link/pkarr";Expand description
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.
PkarrError
#[non_exhaustive]pub enum PkarrError {
+PkarrError in iroh::address_lookup::pkarr - Rust PkarrError
#[non_exhaustive]pub enum PkarrError {
PublicKey {
source: KeyParsingError,
meta: Meta,
@@ -34,7 +34,7 @@
HttpRequest
HttpPayload
Encoding
Trait Implementations§
Source§impl Debug for PkarrError
impl Debug for PkarrError
Source§impl Display for PkarrError
impl Display for PkarrError
Source§impl Error for PkarrError
impl Error for PkarrError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl From<PkarrError> for AnyError
impl From<PkarrError> for AnyError
Source§fn from(value: PkarrError) -> AnyError
fn from(value: PkarrError) -> AnyError
Source§impl From<PkarrError> for Error
impl From<PkarrError> for Error
Source§fn from(err: PkarrError) -> Self
fn from(err: PkarrError) -> Self
Source§impl StackError for PkarrError
impl StackError for PkarrError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Source§fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
Source§fn is_transparent(&self) -> bool
fn is_transparent(&self) -> bool
Auto Trait Implementations§
impl Freeze for PkarrError
impl !RefUnwindSafe for PkarrError
impl Send for PkarrError
impl Sync for PkarrError
impl Unpin for PkarrError
impl !UnwindSafe for PkarrError
Blanket Implementations§
Trait Implementations§
Source§impl Debug for PkarrError
impl Debug for PkarrError
Source§impl Display for PkarrError
impl Display for PkarrError
Source§impl Error for PkarrError
impl Error for PkarrError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl From<PkarrError> for AnyError
impl From<PkarrError> for AnyError
Source§fn from(value: PkarrError) -> AnyError
fn from(value: PkarrError) -> AnyError
Source§impl From<PkarrError> for Error
impl From<PkarrError> for Error
Source§fn from(err: PkarrError) -> Self
fn from(err: PkarrError) -> Self
Source§impl StackError for PkarrError
impl StackError for PkarrError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Source§fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
Source§fn is_transparent(&self) -> bool
fn is_transparent(&self) -> bool
Auto Trait Implementations§
impl Freeze for PkarrError
impl !RefUnwindSafe for PkarrError
impl Send for PkarrError
impl Sync for PkarrError
impl Unpin for PkarrError
impl !UnwindSafe for PkarrError
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/4094/docs/iroh/address_lookup/pkarr/index.html b/pr/4094/docs/iroh/address_lookup/pkarr/index.html
index 41648a85ab..5c4125e64d 100644
--- a/pr/4094/docs/iroh/address_lookup/pkarr/index.html
+++ b/pr/4094/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/4094/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html b/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html
index aaee5481bf..c31de3bb02 100644
--- a/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html
+++ b/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html
@@ -1,28 +1,28 @@
-
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 ConcurrentAddressLookup.
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.
+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/4094/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html b/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html
index b91fd3d89b..f0139a36f5 100644
--- a/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html
+++ b/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html
@@ -1,27 +1,27 @@
-PkarrPublisherBuilder in iroh::address_lookup::pkarr - Rust PkarrPublisherBuilder
pub struct PkarrPublisherBuilder { /* private fields */ }
Expand description
Builder for PkarrPublisher.
+PkarrPublisherBuilder in iroh::address_lookup::pkarr - Rust PkarrPublisherBuilder
pub struct PkarrPublisherBuilder { /* private fields */ }
Expand description
Builder for PkarrPublisher.
-Implementations§
Source§impl PkarrPublisherBuilder
Implementations§
Source§impl PkarrPublisherBuilder
Sourcepub fn ttl(self, ttl: u32) -> Self
Sets the TTL (time-to-live) for published packets.
Default is DEFAULT_PKARR_TTL.
-Sourcepub fn republish_interval(self, republish_interval: Duration) -> Self
Sets the interval after which packets are republished even if our endpoint info did not change.
+Sourcepub fn republish_interval(self, republish_interval: Duration) -> Self
Sets the interval after which packets are republished even if our endpoint info did not change.
Default is DEFAULT_REPUBLISH_INTERVAL.
-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 addr_filter(self, filter: AddrFilter) -> Self
Sets the address filter to control which addresses are published to the pkarr server.
+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 addr_filter(self, filter: AddrFilter) -> Self
Sets the address filter to control which addresses are published to the pkarr server.
By default AddrFilter::relay_only is used. This avoids leaking IP addresses to the
public pkarr server.
However, enabling IP address publishing can be useful, e.g. when iroh runs on a machine
connected to the internet via public IP addresses without a firewall.
In such cases, publishing them can make dialing such endpoints via DNS or Pkarr lookup
faster, potentially skipping a relay connection altogether.
-Sourcepub fn build(
self,
secret_key: SecretKey,
tls_config: ClientConfig,
) -> PkarrPublisher
Builds the PkarrPublisher with the passed secret key for signing packets.
This publisher will be able to publish pkarr records for SecretKey.
-Trait Implementations§
Trait Implementations§
Source§impl AddressLookupBuilder for PkarrPublisherBuilder
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 PkarrPublisherBuilder
§impl !RefUnwindSafe for PkarrPublisherBuilder
§impl Send for PkarrPublisherBuilder
§impl Sync for PkarrPublisherBuilder
§impl Unpin for PkarrPublisherBuilder
§impl !UnwindSafe for PkarrPublisherBuilder
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 PkarrPublisherBuilder
§impl !RefUnwindSafe for PkarrPublisherBuilder
§impl Send for PkarrPublisherBuilder
§impl Sync for PkarrPublisherBuilder
§impl Unpin for PkarrPublisherBuilder
§impl !UnwindSafe for PkarrPublisherBuilder
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/4094/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html b/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
index 38edeaf721..ee14f41996 100644
--- a/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
+++ b/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
@@ -1,20 +1,20 @@
-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) -> Self
Create a new PkarrRelayClient with default settings.
+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) -> Self
Create a new PkarrRelayClient with default settings.
Use the PkarrRelayClient::builder to get a builder that allows for
adding custom settings.
-Sourcepub fn builder(
pkarr_relay_url: Url,
tls_config: ClientConfig,
) -> PkarrRelayClientBuilder
Create a PkarrRelayClientBuilder.
-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/4094/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html b/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
index 7be1fda550..c7ed542230 100644
--- a/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
+++ b/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
@@ -1,7 +1,7 @@
-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 set_dns_resolver(self, dns_resolver: Option<DnsResolver>) -> Self
Available on non-wasm_browser only.
Passes an optional DNS resolver for the client to use.
-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 set_dns_resolver(self, dns_resolver: Option<DnsResolver>) -> Self
Available on non-wasm_browser only.
Passes an optional DNS resolver for the client to use.
+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/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html b/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
index d81b5aa864..79f15aa3e7 100644
--- a/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
+++ b/pr/4094/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 ConcurrentAddressLookup.
-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/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html b/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
index 7c0e4c9b9f..1ae4c18fe9 100644
--- a/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
+++ b/pr/4094/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/4094/docs/iroh/address_lookup/struct.AddrFilter.html b/pr/4094/docs/iroh/address_lookup/struct.AddrFilter.html
index db2443ae90..cdb8d8806e 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.AddrFilter.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.AddrFilter.html
@@ -1,4 +1,4 @@
-AddrFilter in iroh::address_lookup - Rust AddrFilter
pub struct AddrFilter(/* private fields */);
Expand description
A filter and/or reordering function applied to transport addresses,
+
AddrFilter in iroh::address_lookup - Rust AddrFilter
pub struct AddrFilter(/* private fields */);
Expand description
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
@@ -6,17 +6,17 @@ the output order). A BTreeSet cannot preserve a custom order, so th
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.
-Implementations§
Source§impl AddrFilter
Implementations§
Source§impl AddrFilter
Sourcepub fn new(
f: impl Fn(&Vec<TransportAddr>) -> Cow<'_, Vec<TransportAddr>> + Send + Sync + 'static,
) -> AddrFilter
Create a new AddrFilter
-Sourcepub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
-Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
-Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
-Sourcepub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
+Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
+Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
+Sourcepub fn apply<'a>(
&self,
addrs: &'a Vec<TransportAddr>,
) -> Cow<'a, Vec<TransportAddr>>
Apply the address filter function to a set of addresses.
-Trait Implementations§
Source§impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
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 AddrFilter
Source§impl Default for AddrFilter
Source§fn default() -> AddrFilter
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for AddrFilter
§impl !RefUnwindSafe for AddrFilter
§impl Send for AddrFilter
§impl Sync for AddrFilter
§impl Unpin for AddrFilter
§impl !UnwindSafe for AddrFilter
Blanket Implementations§
Trait Implementations§
Source§impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
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 AddrFilter
Source§impl Default for AddrFilter
Source§fn default() -> AddrFilter
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for AddrFilter
§impl !RefUnwindSafe for AddrFilter
§impl Send for AddrFilter
§impl Sync for AddrFilter
§impl Unpin for AddrFilter
§impl !UnwindSafe for AddrFilter
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/4094/docs/iroh/address_lookup/struct.EndpointData.html b/pr/4094/docs/iroh/address_lookup/struct.EndpointData.html
index bd1d6bbff0..38dc1a6616 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.EndpointData.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.EndpointData.html
@@ -1,33 +1,33 @@
-EndpointData in iroh::address_lookup - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
Data about an endpoint that may be published to and resolved from discovery services.
+EndpointData in iroh::address_lookup - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
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.
-Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
+Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
The address order is preserved, so it can encode priority for address lookup
services, should they not fit into e.g. a single DNS packet otherwise.
If the addresses contain duplicate entries, those entries are removed.
-Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
+Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
Useful for calling on construction after EndpointData::new or EndpointData::from_iter.
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 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 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 filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
+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 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 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 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.
-Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
- T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
Blanket Implementations§
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
+Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
+ T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
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/4094/docs/iroh/address_lookup/struct.EndpointInfo.html b/pr/4094/docs/iroh/address_lookup/struct.EndpointInfo.html
index a90f52320c..a1e30abf2f 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.EndpointInfo.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.EndpointInfo.html
@@ -1,39 +1,39 @@
-EndpointInfo in iroh::address_lookup - Rust EndpointInfo
pub 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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
-Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
-Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
-Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
+Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
+Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
+Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
+Sourcepub fn from_txt_lookup(
domain_name: String,
lookup: impl Iterator<Item = impl Display>,
) -> Result<EndpointInfo, ParseError>
Parses a EndpointInfo from DNS TXT lookup results.
The domain_name is the queried DNS name (e.g. _iroh.<z32>.<origin>).
The lookup iterator yields TXT record values that implement Display.
-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.
-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 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 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§
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 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 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§
§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/4094/docs/iroh/address_lookup/struct.Item.html b/pr/4094/docs/iroh/address_lookup/struct.Item.html
index 490927cf36..037465cb99 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.Item.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.Item.html
@@ -19,14 +19,14 @@ this item.
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.
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 filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
+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 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.
+Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
Trait Implementations§
Source§impl From<Item> for EndpointInfo
Source§impl Eq for Item
Source§impl StructuralPartialEq for Item
Auto Trait Implementations§
§impl Freeze for Item
§impl RefUnwindSafe for Item
§impl Send for Item
§impl Sync for Item
§impl Unpin for Item
§impl UnwindSafe for Item
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/4094/docs/iroh/address_lookup/struct.UserData.html b/pr/4094/docs/iroh/address_lookup/struct.UserData.html
index 68cc7e5b57..fa58d0aef9 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.UserData.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.UserData.html
@@ -1,24 +1,24 @@
-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
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
Iroh does not keep track of or examine the user-defined data.
UserData implements FromStr and TryFrom<String>, so you can
convert &str and String into UserData easily.
-Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
+Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
In DNS discovery services, the user-defined data is stored in a TXT record character string,
which has a max length of 255 bytes. We need to subtract the user-data= prefix,
which leaves 245 bytes for the actual user-defined data.
-Trait Implementations§
Trait Implementations§
Source§impl Ord for UserData
Source§impl PartialOrd for UserData
Source§impl Eq for UserData
Source§impl StructuralPartialEq for UserData
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html b/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html
index e1419ba359..d9845f9f06 100644
--- a/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html
+++ b/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html
@@ -34,4 +34,4 @@ work.
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 MdnsAddressLookup
Available on crate feature address-lookup-mdns only. Source§impl AddressLookup for MemoryLookup
Source§impl AddressLookup for DhtAddressLookup
Available on crate feature address-lookup-pkarr-dht only. Source§impl AddressLookup for PkarrPublisher
Source§impl AddressLookup for PkarrResolver
Source§impl AddressLookup for ConcurrentAddressLookup
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 MdnsAddressLookup
Available on crate feature address-lookup-mdns only. Source§impl AddressLookup for MemoryLookup
Source§impl AddressLookup for DhtAddressLookup
Available on crate feature address-lookup-pkarr-dht only. Source§impl AddressLookup for PkarrPublisher
Source§impl AddressLookup for PkarrResolver
Source§impl AddressLookup for ConcurrentAddressLookup
Source§impl<T: AddressLookup> AddressLookup for FilteredAddressLookup<T>
\ No newline at end of file
diff --git a/pr/4094/docs/iroh/address_lookup/trait.AddressLookupBuilder.html b/pr/4094/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
index e5994db739..1172cf753c 100644
--- a/pr/4094/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
+++ b/pr/4094/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 MdnsAddressLookupBuilder
Available on crate feature address-lookup-mdns only. Source§impl AddressLookupBuilder for Builder
Available on crate feature address-lookup-pkarr-dht 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 MdnsAddressLookupBuilder
Available on crate feature address-lookup-mdns only. Source§impl AddressLookupBuilder for Builder
Available on crate feature address-lookup-pkarr-dht 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/4094/docs/iroh/endpoint/index.html b/pr/4094/docs/iroh/endpoint/index.html
index 44ba3dde1e..cf50bc05ae 100644
--- a/pr/4094/docs/iroh/endpoint/index.html
+++ b/pr/4094/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/4094/docs/iroh/endpoint_info/index.html b/pr/4094/docs/iroh/endpoint_info/index.html
index 7669854b3d..5b7462ae8b 100644
--- a/pr/4094/docs/iroh/endpoint_info/index.html
+++ b/pr/4094/docs/iroh/endpoint_info/index.html
@@ -1,4 +1,35 @@
-iroh::endpoint_info - Rust Module endpoint_info
Expand description
Re-export of endpoint info types from iroh_dns::endpoint_info.
+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.
+DNS records are published under the following names:
+_iroh.<z32-endpoint-id>.<origin-domain> TXT
+
+-
+
_iroh is the record name as defined by IROH_TXT_NAME.
+
+-
+
<z32-endpoint-id> is the z-base-32 encoding of the EndpointId.
+
+-
+
<origin-domain> is the domain name of the publishing DNS server,
+N0_DNS_ENDPOINT_ORIGIN_PROD is the server operated by number0 for production.
+N0_DNS_ENDPOINT_ORIGIN_STAGING is the server operated by number0 for testing.
+
+-
+
TXT is the DNS record type.
+
+
+The returned TXT records must contain a string value of the form key=value as defined
+in RFC1464. The following attributes are defined:
+
+-
+
relay=<url>: The home RelayUrl of this endpoint.
+
+-
+
addr=<addr> <addr>: A space-separated list of sockets addresses for this iroh endpoint.
+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.
Enums§
Constants§
- IROH_
TXT_NAME - The DNS name for the iroh TXT record.
Traits§
- Endpoint
IdExt - Extension methods for
EndpointId to encode to and decode from z-base-32,
which is the encoding used by pkarr domain names.
\ No newline at end of file
diff --git a/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html b/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html
index 06bcf5d106..6d1ea05b51 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html
@@ -1,4 +1,4 @@
-AddrFilter in iroh::endpoint_info - Rust AddrFilter
pub struct AddrFilter(/* private fields */);
Expand description
A filter and/or reordering function applied to transport addresses,
+
AddrFilter in iroh::endpoint_info - Rust AddrFilter
pub struct AddrFilter(/* private fields */);
Expand description
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
@@ -6,17 +6,17 @@ the output order). A BTreeSet cannot preserve a custom order, so th
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.
-Implementations§
Source§impl AddrFilter
Implementations§
Source§impl AddrFilter
Sourcepub fn new(
f: impl Fn(&Vec<TransportAddr>) -> Cow<'_, Vec<TransportAddr>> + Send + Sync + 'static,
) -> AddrFilter
Create a new AddrFilter
-Sourcepub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
-Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
-Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
-Sourcepub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
+Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
+Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
+Sourcepub fn apply<'a>(
&self,
addrs: &'a Vec<TransportAddr>,
) -> Cow<'a, Vec<TransportAddr>>
Apply the address filter function to a set of addresses.
-Trait Implementations§
Source§impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
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 AddrFilter
Source§impl Default for AddrFilter
Source§fn default() -> AddrFilter
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for AddrFilter
§impl !RefUnwindSafe for AddrFilter
§impl Send for AddrFilter
§impl Sync for AddrFilter
§impl Unpin for AddrFilter
§impl !UnwindSafe for AddrFilter
Blanket Implementations§
Trait Implementations§
Source§impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
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 AddrFilter
Source§impl Default for AddrFilter
Source§fn default() -> AddrFilter
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for AddrFilter
§impl !RefUnwindSafe for AddrFilter
§impl Send for AddrFilter
§impl Sync for AddrFilter
§impl Unpin for AddrFilter
§impl !UnwindSafe for AddrFilter
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/4094/docs/iroh/endpoint_info/struct.EndpointData.html b/pr/4094/docs/iroh/endpoint_info/struct.EndpointData.html
index 593fc5cbcb..81e4a676c7 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.EndpointData.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.EndpointData.html
@@ -1,33 +1,33 @@
-EndpointData in iroh::endpoint_info - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
Data about an endpoint that may be published to and resolved from discovery services.
+EndpointData in iroh::endpoint_info - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
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.
-Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
+Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
The address order is preserved, so it can encode priority for address lookup
services, should they not fit into e.g. a single DNS packet otherwise.
If the addresses contain duplicate entries, those entries are removed.
-Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
+Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
Useful for calling on construction after EndpointData::new or EndpointData::from_iter.
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 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 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 filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
+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 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 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 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.
-Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
- T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
Blanket Implementations§
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
+Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
+ T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
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/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html b/pr/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html
index 4c4496b4f1..7e51bbc05b 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html
@@ -1,39 +1,39 @@
-EndpointInfo in iroh::endpoint_info - Rust EndpointInfo
pub struct EndpointInfo {
+EndpointInfo in iroh::endpoint_info - 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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
-Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
-Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
-Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
+Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
+Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
+Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
+Sourcepub fn from_txt_lookup(
domain_name: String,
lookup: impl Iterator<Item = impl Display>,
) -> Result<EndpointInfo, ParseError>
Parses a EndpointInfo from DNS TXT lookup results.
The domain_name is the queried DNS name (e.g. _iroh.<z32>.<origin>).
The lookup iterator yields TXT record values that implement Display.
-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.
-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 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 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§
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 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 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§
§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/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html b/pr/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html
index 239a535780..3279841835 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html
@@ -1,6 +1,6 @@
-MaxLengthExceededError in iroh::endpoint_info - Rust MaxLengthExceededError
pub struct MaxLengthExceededError { /* private fields */ }
Expand description
Error returned when an input value is too long for UserData.
-Implementations§
Source§impl MaxLengthExceededError
Sourcepub fn new() -> MaxLengthExceededError
Creates a new MaxLengthExceededError error.
-Trait Implementations§
Source§impl Debug for MaxLengthExceededError
Source§impl Display for MaxLengthExceededError
Source§impl Error for MaxLengthExceededError
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 StackError for MaxLengthExceededError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<MaxLengthExceededError>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for MaxLengthExceededError
§impl RefUnwindSafe for MaxLengthExceededError
§impl Send for MaxLengthExceededError
§impl Sync for MaxLengthExceededError
§impl Unpin for MaxLengthExceededError
§impl UnwindSafe for MaxLengthExceededError
Blanket Implementations§
Source§impl<T> Any for Twhere
+MaxLengthExceededError in iroh::endpoint_info - Rust MaxLengthExceededError
pub struct MaxLengthExceededError { /* private fields */ }
Expand description
Error returned when an input value is too long for UserData.
+Implementations§
Source§impl MaxLengthExceededError
Sourcepub fn new() -> MaxLengthExceededError
Creates a new MaxLengthExceededError error.
+Trait Implementations§
Source§impl Debug for MaxLengthExceededError
Source§impl Display for MaxLengthExceededError
Source§impl Error for MaxLengthExceededError
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 StackError for MaxLengthExceededError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<MaxLengthExceededError>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for MaxLengthExceededError
§impl RefUnwindSafe for MaxLengthExceededError
§impl Send for MaxLengthExceededError
§impl Sync for MaxLengthExceededError
§impl Unpin for MaxLengthExceededError
§impl UnwindSafe for MaxLengthExceededError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/4094/docs/iroh/endpoint_info/struct.UserData.html b/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
index 7cd4b5e549..8c9ae9c162 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
@@ -1,24 +1,24 @@
-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
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
Iroh does not keep track of or examine the user-defined data.
UserData implements FromStr and TryFrom<String>, so you can
convert &str and String into UserData easily.
-Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
+Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
In DNS discovery services, the user-defined data is stored in a TXT record character string,
which has a max length of 255 bytes. We need to subtract the user-data= prefix,
which leaves 245 bytes for the actual user-defined data.
-Trait Implementations§
Trait Implementations§
Source§impl Ord for UserData
Source§impl PartialOrd for UserData
Source§impl Eq for UserData
Source§impl StructuralPartialEq for UserData
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Trait Implementations§
Source§impl Clone for TransportAddr
Source§fn clone(&self) -> TransportAddr
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 TransportAddr
Source§impl<'de> Deserialize<'de> for TransportAddr
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TransportAddr, <__D as Deserializer<'de>>::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Display for TransportAddr
Source§impl From<Addr> for TransportAddr
Source§impl From<IncomingAddr> for TransportAddr
Source§fn from(addr: IncomingAddr) -> Self
Converts to this type from the input type.Source§impl From<TransportAddrInfo> for TransportAddr
Source§fn from(value: TransportAddrInfo) -> Self
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Display for TransportAddr
Source§impl From<Addr> for TransportAddr
Source§impl From<IncomingAddr> for TransportAddr
Source§fn from(addr: IncomingAddr) -> Self
Converts to this type from the input type.Source§impl From<TransportAddrInfo> for TransportAddr
Source§fn from(value: TransportAddrInfo) -> Self
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl Hash for TransportAddr
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
H: Hasher,
diff --git a/pr/4094/docs/iroh/index.html b/pr/4094/docs/iroh/index.html
index 7142ffa948..1a9ef7c5ab 100644
--- a/pr/4094/docs/iroh/index.html
+++ b/pr/4094/docs/iroh/index.html
@@ -1,4 +1,4 @@
-iroh - Rust Crate iroh
Expand description
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/4094/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html b/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html
index aaee5481bf..c31de3bb02 100644
--- a/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html
+++ b/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html
@@ -1,28 +1,28 @@
-
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 ConcurrentAddressLookup.
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.
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/4094/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html b/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html
index b91fd3d89b..f0139a36f5 100644
--- a/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html
+++ b/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html
@@ -1,27 +1,27 @@
-PkarrPublisherBuilder in iroh::address_lookup::pkarr - Rust PkarrPublisherBuilder
pub struct PkarrPublisherBuilder { /* private fields */ }
Expand description
Builder for PkarrPublisher.
+PkarrPublisherBuilder in iroh::address_lookup::pkarr - Rust PkarrPublisherBuilder
pub struct PkarrPublisherBuilder { /* private fields */ }
Expand description
Builder for PkarrPublisher.
-Implementations§
Source§impl PkarrPublisherBuilder
Implementations§
Source§impl PkarrPublisherBuilder
Sourcepub fn ttl(self, ttl: u32) -> Self
Sets the TTL (time-to-live) for published packets.
Default is DEFAULT_PKARR_TTL.
-Sourcepub fn republish_interval(self, republish_interval: Duration) -> Self
Sets the interval after which packets are republished even if our endpoint info did not change.
+Sourcepub fn republish_interval(self, republish_interval: Duration) -> Self
Sets the interval after which packets are republished even if our endpoint info did not change.
Default is DEFAULT_REPUBLISH_INTERVAL.
-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 addr_filter(self, filter: AddrFilter) -> Self
Sets the address filter to control which addresses are published to the pkarr server.
+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 addr_filter(self, filter: AddrFilter) -> Self
Sets the address filter to control which addresses are published to the pkarr server.
By default AddrFilter::relay_only is used. This avoids leaking IP addresses to the
public pkarr server.
However, enabling IP address publishing can be useful, e.g. when iroh runs on a machine
connected to the internet via public IP addresses without a firewall.
In such cases, publishing them can make dialing such endpoints via DNS or Pkarr lookup
faster, potentially skipping a relay connection altogether.
-Sourcepub fn build(
self,
secret_key: SecretKey,
tls_config: ClientConfig,
) -> PkarrPublisher
Builds the PkarrPublisher with the passed secret key for signing packets.
This publisher will be able to publish pkarr records for SecretKey.
-Trait Implementations§
Trait Implementations§
Source§impl AddressLookupBuilder for PkarrPublisherBuilder
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 PkarrPublisherBuilder
§impl !RefUnwindSafe for PkarrPublisherBuilder
§impl Send for PkarrPublisherBuilder
§impl Sync for PkarrPublisherBuilder
§impl Unpin for PkarrPublisherBuilder
§impl !UnwindSafe for PkarrPublisherBuilder
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 PkarrPublisherBuilder
§impl !RefUnwindSafe for PkarrPublisherBuilder
§impl Send for PkarrPublisherBuilder
§impl Sync for PkarrPublisherBuilder
§impl Unpin for PkarrPublisherBuilder
§impl !UnwindSafe for PkarrPublisherBuilder
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/4094/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html b/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
index 38edeaf721..ee14f41996 100644
--- a/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
+++ b/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
@@ -1,20 +1,20 @@
-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) -> Self
Create a new PkarrRelayClient with default settings.
+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) -> Self
Create a new PkarrRelayClient with default settings.
Use the PkarrRelayClient::builder to get a builder that allows for
adding custom settings.
-Sourcepub fn builder(
pkarr_relay_url: Url,
tls_config: ClientConfig,
) -> PkarrRelayClientBuilder
Create a PkarrRelayClientBuilder.
-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/4094/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html b/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
index 7be1fda550..c7ed542230 100644
--- a/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
+++ b/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
@@ -1,7 +1,7 @@
-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 set_dns_resolver(self, dns_resolver: Option<DnsResolver>) -> Self
Available on non-wasm_browser only.
Passes an optional DNS resolver for the client to use.
-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 set_dns_resolver(self, dns_resolver: Option<DnsResolver>) -> Self
Available on non-wasm_browser only.
Passes an optional DNS resolver for the client to use.
+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/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html b/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
index d81b5aa864..79f15aa3e7 100644
--- a/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
+++ b/pr/4094/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 ConcurrentAddressLookup.
-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/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html b/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
index 7c0e4c9b9f..1ae4c18fe9 100644
--- a/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
+++ b/pr/4094/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/4094/docs/iroh/address_lookup/struct.AddrFilter.html b/pr/4094/docs/iroh/address_lookup/struct.AddrFilter.html
index db2443ae90..cdb8d8806e 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.AddrFilter.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.AddrFilter.html
@@ -1,4 +1,4 @@
-AddrFilter in iroh::address_lookup - Rust AddrFilter
pub struct AddrFilter(/* private fields */);
Expand description
A filter and/or reordering function applied to transport addresses,
+
AddrFilter in iroh::address_lookup - Rust AddrFilter
pub struct AddrFilter(/* private fields */);
Expand description
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
@@ -6,17 +6,17 @@ the output order). A BTreeSet cannot preserve a custom order, so th
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.
-Implementations§
Source§impl AddrFilter
Implementations§
Source§impl AddrFilter
Sourcepub fn new(
f: impl Fn(&Vec<TransportAddr>) -> Cow<'_, Vec<TransportAddr>> + Send + Sync + 'static,
) -> AddrFilter
Create a new AddrFilter
-Sourcepub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
-Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
-Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
-Sourcepub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
+Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
+Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
+Sourcepub fn apply<'a>(
&self,
addrs: &'a Vec<TransportAddr>,
) -> Cow<'a, Vec<TransportAddr>>
Apply the address filter function to a set of addresses.
-Trait Implementations§
Source§impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
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 AddrFilter
Source§impl Default for AddrFilter
Source§fn default() -> AddrFilter
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for AddrFilter
§impl !RefUnwindSafe for AddrFilter
§impl Send for AddrFilter
§impl Sync for AddrFilter
§impl Unpin for AddrFilter
§impl !UnwindSafe for AddrFilter
Blanket Implementations§
Trait Implementations§
Source§impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
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 AddrFilter
Source§impl Default for AddrFilter
Source§fn default() -> AddrFilter
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for AddrFilter
§impl !RefUnwindSafe for AddrFilter
§impl Send for AddrFilter
§impl Sync for AddrFilter
§impl Unpin for AddrFilter
§impl !UnwindSafe for AddrFilter
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/4094/docs/iroh/address_lookup/struct.EndpointData.html b/pr/4094/docs/iroh/address_lookup/struct.EndpointData.html
index bd1d6bbff0..38dc1a6616 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.EndpointData.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.EndpointData.html
@@ -1,33 +1,33 @@
-EndpointData in iroh::address_lookup - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
Data about an endpoint that may be published to and resolved from discovery services.
+EndpointData in iroh::address_lookup - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
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.
-Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
+Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
The address order is preserved, so it can encode priority for address lookup
services, should they not fit into e.g. a single DNS packet otherwise.
If the addresses contain duplicate entries, those entries are removed.
-Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
+Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
Useful for calling on construction after EndpointData::new or EndpointData::from_iter.
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 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 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 filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
+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 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 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 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.
-Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
- T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
Blanket Implementations§
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
+Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
+ T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
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/4094/docs/iroh/address_lookup/struct.EndpointInfo.html b/pr/4094/docs/iroh/address_lookup/struct.EndpointInfo.html
index a90f52320c..a1e30abf2f 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.EndpointInfo.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.EndpointInfo.html
@@ -1,39 +1,39 @@
-EndpointInfo in iroh::address_lookup - Rust EndpointInfo
pub 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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
-Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
-Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
-Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
+Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
+Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
+Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
+Sourcepub fn from_txt_lookup(
domain_name: String,
lookup: impl Iterator<Item = impl Display>,
) -> Result<EndpointInfo, ParseError>
Parses a EndpointInfo from DNS TXT lookup results.
The domain_name is the queried DNS name (e.g. _iroh.<z32>.<origin>).
The lookup iterator yields TXT record values that implement Display.
-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.
-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 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 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§
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 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 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§
§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/4094/docs/iroh/address_lookup/struct.Item.html b/pr/4094/docs/iroh/address_lookup/struct.Item.html
index 490927cf36..037465cb99 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.Item.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.Item.html
@@ -19,14 +19,14 @@ this item.
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.
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 filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
+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 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.
+Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
Trait Implementations§
Source§impl From<Item> for EndpointInfo
Source§impl Eq for Item
Source§impl StructuralPartialEq for Item
Auto Trait Implementations§
§impl Freeze for Item
§impl RefUnwindSafe for Item
§impl Send for Item
§impl Sync for Item
§impl Unpin for Item
§impl UnwindSafe for Item
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/4094/docs/iroh/address_lookup/struct.UserData.html b/pr/4094/docs/iroh/address_lookup/struct.UserData.html
index 68cc7e5b57..fa58d0aef9 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.UserData.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.UserData.html
@@ -1,24 +1,24 @@
-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
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
Iroh does not keep track of or examine the user-defined data.
UserData implements FromStr and TryFrom<String>, so you can
convert &str and String into UserData easily.
-Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
+Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
In DNS discovery services, the user-defined data is stored in a TXT record character string,
which has a max length of 255 bytes. We need to subtract the user-data= prefix,
which leaves 245 bytes for the actual user-defined data.
-Trait Implementations§
Trait Implementations§
Source§impl Ord for UserData
Source§impl PartialOrd for UserData
Source§impl Eq for UserData
Source§impl StructuralPartialEq for UserData
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html b/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html
index e1419ba359..d9845f9f06 100644
--- a/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html
+++ b/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html
@@ -34,4 +34,4 @@ work.
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 MdnsAddressLookup
Available on crate feature address-lookup-mdns only. Source§impl AddressLookup for MemoryLookup
Source§impl AddressLookup for DhtAddressLookup
Available on crate feature address-lookup-pkarr-dht only. Source§impl AddressLookup for PkarrPublisher
Source§impl AddressLookup for PkarrResolver
Source§impl AddressLookup for ConcurrentAddressLookup
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 MdnsAddressLookup
Available on crate feature address-lookup-mdns only. Source§impl AddressLookup for MemoryLookup
Source§impl AddressLookup for DhtAddressLookup
Available on crate feature address-lookup-pkarr-dht only. Source§impl AddressLookup for PkarrPublisher
Source§impl AddressLookup for PkarrResolver
Source§impl AddressLookup for ConcurrentAddressLookup
Source§impl<T: AddressLookup> AddressLookup for FilteredAddressLookup<T>
\ No newline at end of file
diff --git a/pr/4094/docs/iroh/address_lookup/trait.AddressLookupBuilder.html b/pr/4094/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
index e5994db739..1172cf753c 100644
--- a/pr/4094/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
+++ b/pr/4094/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 MdnsAddressLookupBuilder
Available on crate feature address-lookup-mdns only. Source§impl AddressLookupBuilder for Builder
Available on crate feature address-lookup-pkarr-dht 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 MdnsAddressLookupBuilder
Available on crate feature address-lookup-mdns only. Source§impl AddressLookupBuilder for Builder
Available on crate feature address-lookup-pkarr-dht 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/4094/docs/iroh/endpoint/index.html b/pr/4094/docs/iroh/endpoint/index.html
index 44ba3dde1e..cf50bc05ae 100644
--- a/pr/4094/docs/iroh/endpoint/index.html
+++ b/pr/4094/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/4094/docs/iroh/endpoint_info/index.html b/pr/4094/docs/iroh/endpoint_info/index.html
index 7669854b3d..5b7462ae8b 100644
--- a/pr/4094/docs/iroh/endpoint_info/index.html
+++ b/pr/4094/docs/iroh/endpoint_info/index.html
@@ -1,4 +1,35 @@
-iroh::endpoint_info - Rust Module endpoint_info
Expand description
Re-export of endpoint info types from iroh_dns::endpoint_info.
+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.
+DNS records are published under the following names:
+_iroh.<z32-endpoint-id>.<origin-domain> TXT
+
+-
+
_iroh is the record name as defined by IROH_TXT_NAME.
+
+-
+
<z32-endpoint-id> is the z-base-32 encoding of the EndpointId.
+
+-
+
<origin-domain> is the domain name of the publishing DNS server,
+N0_DNS_ENDPOINT_ORIGIN_PROD is the server operated by number0 for production.
+N0_DNS_ENDPOINT_ORIGIN_STAGING is the server operated by number0 for testing.
+
+-
+
TXT is the DNS record type.
+
+
+The returned TXT records must contain a string value of the form key=value as defined
+in RFC1464. The following attributes are defined:
+
+-
+
relay=<url>: The home RelayUrl of this endpoint.
+
+-
+
addr=<addr> <addr>: A space-separated list of sockets addresses for this iroh endpoint.
+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.
Enums§
Constants§
- IROH_
TXT_NAME - The DNS name for the iroh TXT record.
Traits§
- Endpoint
IdExt - Extension methods for
EndpointId to encode to and decode from z-base-32,
which is the encoding used by pkarr domain names.
\ No newline at end of file
diff --git a/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html b/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html
index 06bcf5d106..6d1ea05b51 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html
@@ -1,4 +1,4 @@
-AddrFilter in iroh::endpoint_info - Rust AddrFilter
pub struct AddrFilter(/* private fields */);
Expand description
A filter and/or reordering function applied to transport addresses,
+
AddrFilter in iroh::endpoint_info - Rust AddrFilter
pub struct AddrFilter(/* private fields */);
Expand description
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
@@ -6,17 +6,17 @@ the output order). A BTreeSet cannot preserve a custom order, so th
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.
-Implementations§
Source§impl AddrFilter
Implementations§
Source§impl AddrFilter
Sourcepub fn new(
f: impl Fn(&Vec<TransportAddr>) -> Cow<'_, Vec<TransportAddr>> + Send + Sync + 'static,
) -> AddrFilter
Create a new AddrFilter
-Sourcepub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
-Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
-Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
-Sourcepub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
+Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
+Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
+Sourcepub fn apply<'a>(
&self,
addrs: &'a Vec<TransportAddr>,
) -> Cow<'a, Vec<TransportAddr>>
Apply the address filter function to a set of addresses.
-Trait Implementations§
Source§impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
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 AddrFilter
Source§impl Default for AddrFilter
Source§fn default() -> AddrFilter
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for AddrFilter
§impl !RefUnwindSafe for AddrFilter
§impl Send for AddrFilter
§impl Sync for AddrFilter
§impl Unpin for AddrFilter
§impl !UnwindSafe for AddrFilter
Blanket Implementations§
Trait Implementations§
Source§impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
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 AddrFilter
Source§impl Default for AddrFilter
Source§fn default() -> AddrFilter
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for AddrFilter
§impl !RefUnwindSafe for AddrFilter
§impl Send for AddrFilter
§impl Sync for AddrFilter
§impl Unpin for AddrFilter
§impl !UnwindSafe for AddrFilter
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/4094/docs/iroh/endpoint_info/struct.EndpointData.html b/pr/4094/docs/iroh/endpoint_info/struct.EndpointData.html
index 593fc5cbcb..81e4a676c7 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.EndpointData.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.EndpointData.html
@@ -1,33 +1,33 @@
-EndpointData in iroh::endpoint_info - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
Data about an endpoint that may be published to and resolved from discovery services.
+EndpointData in iroh::endpoint_info - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
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.
-Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
+Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
The address order is preserved, so it can encode priority for address lookup
services, should they not fit into e.g. a single DNS packet otherwise.
If the addresses contain duplicate entries, those entries are removed.
-Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
+Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
Useful for calling on construction after EndpointData::new or EndpointData::from_iter.
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 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 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 filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
+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 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 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 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.
-Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
- T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
Blanket Implementations§
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
+Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
+ T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
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/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html b/pr/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html
index 4c4496b4f1..7e51bbc05b 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html
@@ -1,39 +1,39 @@
-EndpointInfo in iroh::endpoint_info - Rust EndpointInfo
pub struct EndpointInfo {
+EndpointInfo in iroh::endpoint_info - 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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
-Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
-Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
-Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
+Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
+Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
+Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
+Sourcepub fn from_txt_lookup(
domain_name: String,
lookup: impl Iterator<Item = impl Display>,
) -> Result<EndpointInfo, ParseError>
Parses a EndpointInfo from DNS TXT lookup results.
The domain_name is the queried DNS name (e.g. _iroh.<z32>.<origin>).
The lookup iterator yields TXT record values that implement Display.
-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.
-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 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 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§
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 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 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§
§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/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html b/pr/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html
index 239a535780..3279841835 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html
@@ -1,6 +1,6 @@
-MaxLengthExceededError in iroh::endpoint_info - Rust MaxLengthExceededError
pub struct MaxLengthExceededError { /* private fields */ }
Expand description
Error returned when an input value is too long for UserData.
-Implementations§
Source§impl MaxLengthExceededError
Sourcepub fn new() -> MaxLengthExceededError
Creates a new MaxLengthExceededError error.
-Trait Implementations§
Source§impl Debug for MaxLengthExceededError
Source§impl Display for MaxLengthExceededError
Source§impl Error for MaxLengthExceededError
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 StackError for MaxLengthExceededError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<MaxLengthExceededError>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for MaxLengthExceededError
§impl RefUnwindSafe for MaxLengthExceededError
§impl Send for MaxLengthExceededError
§impl Sync for MaxLengthExceededError
§impl Unpin for MaxLengthExceededError
§impl UnwindSafe for MaxLengthExceededError
Blanket Implementations§
Source§impl<T> Any for Twhere
+MaxLengthExceededError in iroh::endpoint_info - Rust MaxLengthExceededError
pub struct MaxLengthExceededError { /* private fields */ }
Expand description
Error returned when an input value is too long for UserData.
+Implementations§
Source§impl MaxLengthExceededError
Sourcepub fn new() -> MaxLengthExceededError
Creates a new MaxLengthExceededError error.
+Trait Implementations§
Source§impl Debug for MaxLengthExceededError
Source§impl Display for MaxLengthExceededError
Source§impl Error for MaxLengthExceededError
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 StackError for MaxLengthExceededError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<MaxLengthExceededError>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for MaxLengthExceededError
§impl RefUnwindSafe for MaxLengthExceededError
§impl Send for MaxLengthExceededError
§impl Sync for MaxLengthExceededError
§impl Unpin for MaxLengthExceededError
§impl UnwindSafe for MaxLengthExceededError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/4094/docs/iroh/endpoint_info/struct.UserData.html b/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
index 7cd4b5e549..8c9ae9c162 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
@@ -1,24 +1,24 @@
-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
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
Iroh does not keep track of or examine the user-defined data.
UserData implements FromStr and TryFrom<String>, so you can
convert &str and String into UserData easily.
-Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
+Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
In DNS discovery services, the user-defined data is stored in a TXT record character string,
which has a max length of 255 bytes. We need to subtract the user-data= prefix,
which leaves 245 bytes for the actual user-defined data.
-Trait Implementations§
Trait Implementations§
Source§impl Ord for UserData
Source§impl PartialOrd for UserData
Source§impl Eq for UserData
Source§impl StructuralPartialEq for UserData
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Trait Implementations§
Source§impl Clone for TransportAddr
Source§fn clone(&self) -> TransportAddr
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 TransportAddr
Source§impl<'de> Deserialize<'de> for TransportAddr
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TransportAddr, <__D as Deserializer<'de>>::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Display for TransportAddr
Source§impl From<Addr> for TransportAddr
Source§impl From<IncomingAddr> for TransportAddr
Source§fn from(addr: IncomingAddr) -> Self
Converts to this type from the input type.Source§impl From<TransportAddrInfo> for TransportAddr
Source§fn from(value: TransportAddrInfo) -> Self
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Display for TransportAddr
Source§impl From<Addr> for TransportAddr
Source§impl From<IncomingAddr> for TransportAddr
Source§fn from(addr: IncomingAddr) -> Self
Converts to this type from the input type.Source§impl From<TransportAddrInfo> for TransportAddr
Source§fn from(value: TransportAddrInfo) -> Self
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl Hash for TransportAddr
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
H: Hasher,
diff --git a/pr/4094/docs/iroh/index.html b/pr/4094/docs/iroh/index.html
index 7142ffa948..1a9ef7c5ab 100644
--- a/pr/4094/docs/iroh/index.html
+++ b/pr/4094/docs/iroh/index.html
@@ -1,4 +1,4 @@
-iroh - Rust Crate iroh
Expand description
fn into_address_lookup(
self,
_endpoint: &Endpoint,
diff --git a/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html b/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html
index b91fd3d89b..f0139a36f5 100644
--- a/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html
+++ b/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html
@@ -1,27 +1,27 @@
-PkarrPublisherBuilder in iroh::address_lookup::pkarr - Rust PkarrPublisherBuilder
pub struct PkarrPublisherBuilder { /* private fields */ }
Expand description
Builder for PkarrPublisher.
+PkarrPublisherBuilder in iroh::address_lookup::pkarr - Rust PkarrPublisherBuilder
pub struct PkarrPublisherBuilder { /* private fields */ }
Expand description
Builder for PkarrPublisher.
-Implementations§
Source§impl PkarrPublisherBuilder
Implementations§
Source§impl PkarrPublisherBuilder
Sourcepub fn ttl(self, ttl: u32) -> Self
Sets the TTL (time-to-live) for published packets.
Default is DEFAULT_PKARR_TTL.
-Sourcepub fn republish_interval(self, republish_interval: Duration) -> Self
Sets the interval after which packets are republished even if our endpoint info did not change.
+Sourcepub fn republish_interval(self, republish_interval: Duration) -> Self
Sets the interval after which packets are republished even if our endpoint info did not change.
Default is DEFAULT_REPUBLISH_INTERVAL.
-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 addr_filter(self, filter: AddrFilter) -> Self
Sets the address filter to control which addresses are published to the pkarr server.
+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 addr_filter(self, filter: AddrFilter) -> Self
Sets the address filter to control which addresses are published to the pkarr server.
By default AddrFilter::relay_only is used. This avoids leaking IP addresses to the
public pkarr server.
However, enabling IP address publishing can be useful, e.g. when iroh runs on a machine
connected to the internet via public IP addresses without a firewall.
In such cases, publishing them can make dialing such endpoints via DNS or Pkarr lookup
faster, potentially skipping a relay connection altogether.
-Sourcepub fn build(
self,
secret_key: SecretKey,
tls_config: ClientConfig,
) -> PkarrPublisher
Builds the PkarrPublisher with the passed secret key for signing packets.
This publisher will be able to publish pkarr records for SecretKey.
-Trait Implementations§
Trait Implementations§
Source§impl AddressLookupBuilder for PkarrPublisherBuilder
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 PkarrPublisherBuilder
§impl !RefUnwindSafe for PkarrPublisherBuilder
§impl Send for PkarrPublisherBuilder
§impl Sync for PkarrPublisherBuilder
§impl Unpin for PkarrPublisherBuilder
§impl !UnwindSafe for PkarrPublisherBuilder
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 PkarrPublisherBuilder
§impl !RefUnwindSafe for PkarrPublisherBuilder
§impl Send for PkarrPublisherBuilder
§impl Sync for PkarrPublisherBuilder
§impl Unpin for PkarrPublisherBuilder
§impl !UnwindSafe for PkarrPublisherBuilder
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/4094/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html b/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
index 38edeaf721..ee14f41996 100644
--- a/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
+++ b/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
@@ -1,20 +1,20 @@
-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) -> Self
Create a new PkarrRelayClient with default settings.
+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) -> Self
Create a new PkarrRelayClient with default settings.
Use the PkarrRelayClient::builder to get a builder that allows for
adding custom settings.
-Sourcepub fn builder(
pkarr_relay_url: Url,
tls_config: ClientConfig,
) -> PkarrRelayClientBuilder
Create a PkarrRelayClientBuilder.
-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/4094/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html b/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
index 7be1fda550..c7ed542230 100644
--- a/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
+++ b/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
@@ -1,7 +1,7 @@
-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 set_dns_resolver(self, dns_resolver: Option<DnsResolver>) -> Self
Available on non-wasm_browser only.
Passes an optional DNS resolver for the client to use.
-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 set_dns_resolver(self, dns_resolver: Option<DnsResolver>) -> Self
Available on non-wasm_browser only.
Passes an optional DNS resolver for the client to use.
+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/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html b/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
index d81b5aa864..79f15aa3e7 100644
--- a/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
+++ b/pr/4094/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 ConcurrentAddressLookup.
-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/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html b/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
index 7c0e4c9b9f..1ae4c18fe9 100644
--- a/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
+++ b/pr/4094/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/4094/docs/iroh/address_lookup/struct.AddrFilter.html b/pr/4094/docs/iroh/address_lookup/struct.AddrFilter.html
index db2443ae90..cdb8d8806e 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.AddrFilter.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.AddrFilter.html
@@ -1,4 +1,4 @@
-AddrFilter in iroh::address_lookup - Rust AddrFilter
pub struct AddrFilter(/* private fields */);
Expand description
A filter and/or reordering function applied to transport addresses,
+
AddrFilter in iroh::address_lookup - Rust AddrFilter
pub struct AddrFilter(/* private fields */);
Expand description
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
@@ -6,17 +6,17 @@ the output order). A BTreeSet cannot preserve a custom order, so th
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.
-Implementations§
Source§impl AddrFilter
Implementations§
Source§impl AddrFilter
Sourcepub fn new(
f: impl Fn(&Vec<TransportAddr>) -> Cow<'_, Vec<TransportAddr>> + Send + Sync + 'static,
) -> AddrFilter
Create a new AddrFilter
-Sourcepub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
-Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
-Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
-Sourcepub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
+Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
+Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
+Sourcepub fn apply<'a>(
&self,
addrs: &'a Vec<TransportAddr>,
) -> Cow<'a, Vec<TransportAddr>>
Apply the address filter function to a set of addresses.
-Trait Implementations§
Source§impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
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 AddrFilter
Source§impl Default for AddrFilter
Source§fn default() -> AddrFilter
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for AddrFilter
§impl !RefUnwindSafe for AddrFilter
§impl Send for AddrFilter
§impl Sync for AddrFilter
§impl Unpin for AddrFilter
§impl !UnwindSafe for AddrFilter
Blanket Implementations§
Trait Implementations§
Source§impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
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 AddrFilter
Source§impl Default for AddrFilter
Source§fn default() -> AddrFilter
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for AddrFilter
§impl !RefUnwindSafe for AddrFilter
§impl Send for AddrFilter
§impl Sync for AddrFilter
§impl Unpin for AddrFilter
§impl !UnwindSafe for AddrFilter
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/4094/docs/iroh/address_lookup/struct.EndpointData.html b/pr/4094/docs/iroh/address_lookup/struct.EndpointData.html
index bd1d6bbff0..38dc1a6616 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.EndpointData.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.EndpointData.html
@@ -1,33 +1,33 @@
-EndpointData in iroh::address_lookup - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
Data about an endpoint that may be published to and resolved from discovery services.
+EndpointData in iroh::address_lookup - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
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.
-Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
+Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
The address order is preserved, so it can encode priority for address lookup
services, should they not fit into e.g. a single DNS packet otherwise.
If the addresses contain duplicate entries, those entries are removed.
-Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
+Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
Useful for calling on construction after EndpointData::new or EndpointData::from_iter.
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 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 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 filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
+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 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 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 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.
-Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
- T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
Blanket Implementations§
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
+Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
+ T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
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/4094/docs/iroh/address_lookup/struct.EndpointInfo.html b/pr/4094/docs/iroh/address_lookup/struct.EndpointInfo.html
index a90f52320c..a1e30abf2f 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.EndpointInfo.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.EndpointInfo.html
@@ -1,39 +1,39 @@
-EndpointInfo in iroh::address_lookup - Rust EndpointInfo
pub 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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
-Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
-Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
-Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
+Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
+Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
+Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
+Sourcepub fn from_txt_lookup(
domain_name: String,
lookup: impl Iterator<Item = impl Display>,
) -> Result<EndpointInfo, ParseError>
Parses a EndpointInfo from DNS TXT lookup results.
The domain_name is the queried DNS name (e.g. _iroh.<z32>.<origin>).
The lookup iterator yields TXT record values that implement Display.
-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.
-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 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 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§
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 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 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§
§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/4094/docs/iroh/address_lookup/struct.Item.html b/pr/4094/docs/iroh/address_lookup/struct.Item.html
index 490927cf36..037465cb99 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.Item.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.Item.html
@@ -19,14 +19,14 @@ this item.
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.
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 filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
+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 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.
+Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
Trait Implementations§
Source§impl From<Item> for EndpointInfo
Source§impl Eq for Item
Source§impl StructuralPartialEq for Item
Auto Trait Implementations§
§impl Freeze for Item
§impl RefUnwindSafe for Item
§impl Send for Item
§impl Sync for Item
§impl Unpin for Item
§impl UnwindSafe for Item
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/4094/docs/iroh/address_lookup/struct.UserData.html b/pr/4094/docs/iroh/address_lookup/struct.UserData.html
index 68cc7e5b57..fa58d0aef9 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.UserData.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.UserData.html
@@ -1,24 +1,24 @@
-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
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
Iroh does not keep track of or examine the user-defined data.
UserData implements FromStr and TryFrom<String>, so you can
convert &str and String into UserData easily.
-Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
+Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
In DNS discovery services, the user-defined data is stored in a TXT record character string,
which has a max length of 255 bytes. We need to subtract the user-data= prefix,
which leaves 245 bytes for the actual user-defined data.
-Trait Implementations§
Trait Implementations§
Source§impl Ord for UserData
Source§impl PartialOrd for UserData
Source§impl Eq for UserData
Source§impl StructuralPartialEq for UserData
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html b/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html
index e1419ba359..d9845f9f06 100644
--- a/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html
+++ b/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html
@@ -34,4 +34,4 @@ work.
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 MdnsAddressLookup
Available on crate feature address-lookup-mdns only. Source§impl AddressLookup for MemoryLookup
Source§impl AddressLookup for DhtAddressLookup
Available on crate feature address-lookup-pkarr-dht only. Source§impl AddressLookup for PkarrPublisher
Source§impl AddressLookup for PkarrResolver
Source§impl AddressLookup for ConcurrentAddressLookup
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 MdnsAddressLookup
Available on crate feature address-lookup-mdns only. Source§impl AddressLookup for MemoryLookup
Source§impl AddressLookup for DhtAddressLookup
Available on crate feature address-lookup-pkarr-dht only. Source§impl AddressLookup for PkarrPublisher
Source§impl AddressLookup for PkarrResolver
Source§impl AddressLookup for ConcurrentAddressLookup
Source§impl<T: AddressLookup> AddressLookup for FilteredAddressLookup<T>
\ No newline at end of file
diff --git a/pr/4094/docs/iroh/address_lookup/trait.AddressLookupBuilder.html b/pr/4094/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
index e5994db739..1172cf753c 100644
--- a/pr/4094/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
+++ b/pr/4094/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 MdnsAddressLookupBuilder
Available on crate feature address-lookup-mdns only. Source§impl AddressLookupBuilder for Builder
Available on crate feature address-lookup-pkarr-dht 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 MdnsAddressLookupBuilder
Available on crate feature address-lookup-mdns only. Source§impl AddressLookupBuilder for Builder
Available on crate feature address-lookup-pkarr-dht 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/4094/docs/iroh/endpoint/index.html b/pr/4094/docs/iroh/endpoint/index.html
index 44ba3dde1e..cf50bc05ae 100644
--- a/pr/4094/docs/iroh/endpoint/index.html
+++ b/pr/4094/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/4094/docs/iroh/endpoint_info/index.html b/pr/4094/docs/iroh/endpoint_info/index.html
index 7669854b3d..5b7462ae8b 100644
--- a/pr/4094/docs/iroh/endpoint_info/index.html
+++ b/pr/4094/docs/iroh/endpoint_info/index.html
@@ -1,4 +1,35 @@
-iroh::endpoint_info - Rust Module endpoint_info
Expand description
Re-export of endpoint info types from iroh_dns::endpoint_info.
+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.
+DNS records are published under the following names:
+_iroh.<z32-endpoint-id>.<origin-domain> TXT
+
+-
+
_iroh is the record name as defined by IROH_TXT_NAME.
+
+-
+
<z32-endpoint-id> is the z-base-32 encoding of the EndpointId.
+
+-
+
<origin-domain> is the domain name of the publishing DNS server,
+N0_DNS_ENDPOINT_ORIGIN_PROD is the server operated by number0 for production.
+N0_DNS_ENDPOINT_ORIGIN_STAGING is the server operated by number0 for testing.
+
+-
+
TXT is the DNS record type.
+
+
+The returned TXT records must contain a string value of the form key=value as defined
+in RFC1464. The following attributes are defined:
+
+-
+
relay=<url>: The home RelayUrl of this endpoint.
+
+-
+
addr=<addr> <addr>: A space-separated list of sockets addresses for this iroh endpoint.
+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.
Enums§
Constants§
- IROH_
TXT_NAME - The DNS name for the iroh TXT record.
Traits§
- Endpoint
IdExt - Extension methods for
EndpointId to encode to and decode from z-base-32,
which is the encoding used by pkarr domain names.
\ No newline at end of file
diff --git a/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html b/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html
index 06bcf5d106..6d1ea05b51 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html
@@ -1,4 +1,4 @@
-AddrFilter in iroh::endpoint_info - Rust AddrFilter
pub struct AddrFilter(/* private fields */);
Expand description
A filter and/or reordering function applied to transport addresses,
+
AddrFilter in iroh::endpoint_info - Rust AddrFilter
pub struct AddrFilter(/* private fields */);
Expand description
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
@@ -6,17 +6,17 @@ the output order). A BTreeSet cannot preserve a custom order, so th
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.
-Implementations§
Source§impl AddrFilter
Implementations§
Source§impl AddrFilter
Sourcepub fn new(
f: impl Fn(&Vec<TransportAddr>) -> Cow<'_, Vec<TransportAddr>> + Send + Sync + 'static,
) -> AddrFilter
Create a new AddrFilter
-Sourcepub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
-Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
-Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
-Sourcepub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
+Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
+Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
+Sourcepub fn apply<'a>(
&self,
addrs: &'a Vec<TransportAddr>,
) -> Cow<'a, Vec<TransportAddr>>
Apply the address filter function to a set of addresses.
-Trait Implementations§
Source§impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
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 AddrFilter
Source§impl Default for AddrFilter
Source§fn default() -> AddrFilter
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for AddrFilter
§impl !RefUnwindSafe for AddrFilter
§impl Send for AddrFilter
§impl Sync for AddrFilter
§impl Unpin for AddrFilter
§impl !UnwindSafe for AddrFilter
Blanket Implementations§
Trait Implementations§
Source§impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
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 AddrFilter
Source§impl Default for AddrFilter
Source§fn default() -> AddrFilter
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for AddrFilter
§impl !RefUnwindSafe for AddrFilter
§impl Send for AddrFilter
§impl Sync for AddrFilter
§impl Unpin for AddrFilter
§impl !UnwindSafe for AddrFilter
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/4094/docs/iroh/endpoint_info/struct.EndpointData.html b/pr/4094/docs/iroh/endpoint_info/struct.EndpointData.html
index 593fc5cbcb..81e4a676c7 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.EndpointData.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.EndpointData.html
@@ -1,33 +1,33 @@
-EndpointData in iroh::endpoint_info - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
Data about an endpoint that may be published to and resolved from discovery services.
+EndpointData in iroh::endpoint_info - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
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.
-Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
+Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
The address order is preserved, so it can encode priority for address lookup
services, should they not fit into e.g. a single DNS packet otherwise.
If the addresses contain duplicate entries, those entries are removed.
-Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
+Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
Useful for calling on construction after EndpointData::new or EndpointData::from_iter.
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 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 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 filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
+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 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 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 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.
-Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
- T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
Blanket Implementations§
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
+Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
+ T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
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/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html b/pr/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html
index 4c4496b4f1..7e51bbc05b 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html
@@ -1,39 +1,39 @@
-EndpointInfo in iroh::endpoint_info - Rust EndpointInfo
pub struct EndpointInfo {
+EndpointInfo in iroh::endpoint_info - 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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
-Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
-Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
-Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
+Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
+Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
+Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
+Sourcepub fn from_txt_lookup(
domain_name: String,
lookup: impl Iterator<Item = impl Display>,
) -> Result<EndpointInfo, ParseError>
Parses a EndpointInfo from DNS TXT lookup results.
The domain_name is the queried DNS name (e.g. _iroh.<z32>.<origin>).
The lookup iterator yields TXT record values that implement Display.
-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.
-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 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 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§
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 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 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§
§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/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html b/pr/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html
index 239a535780..3279841835 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html
@@ -1,6 +1,6 @@
-MaxLengthExceededError in iroh::endpoint_info - Rust MaxLengthExceededError
pub struct MaxLengthExceededError { /* private fields */ }
Expand description
Error returned when an input value is too long for UserData.
-Implementations§
Source§impl MaxLengthExceededError
Sourcepub fn new() -> MaxLengthExceededError
Creates a new MaxLengthExceededError error.
-Trait Implementations§
Source§impl Debug for MaxLengthExceededError
Source§impl Display for MaxLengthExceededError
Source§impl Error for MaxLengthExceededError
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 StackError for MaxLengthExceededError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<MaxLengthExceededError>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for MaxLengthExceededError
§impl RefUnwindSafe for MaxLengthExceededError
§impl Send for MaxLengthExceededError
§impl Sync for MaxLengthExceededError
§impl Unpin for MaxLengthExceededError
§impl UnwindSafe for MaxLengthExceededError
Blanket Implementations§
Source§impl<T> Any for Twhere
+MaxLengthExceededError in iroh::endpoint_info - Rust MaxLengthExceededError
pub struct MaxLengthExceededError { /* private fields */ }
Expand description
Error returned when an input value is too long for UserData.
+Implementations§
Source§impl MaxLengthExceededError
Sourcepub fn new() -> MaxLengthExceededError
Creates a new MaxLengthExceededError error.
+Trait Implementations§
Source§impl Debug for MaxLengthExceededError
Source§impl Display for MaxLengthExceededError
Source§impl Error for MaxLengthExceededError
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 StackError for MaxLengthExceededError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<MaxLengthExceededError>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for MaxLengthExceededError
§impl RefUnwindSafe for MaxLengthExceededError
§impl Send for MaxLengthExceededError
§impl Sync for MaxLengthExceededError
§impl Unpin for MaxLengthExceededError
§impl UnwindSafe for MaxLengthExceededError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/4094/docs/iroh/endpoint_info/struct.UserData.html b/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
index 7cd4b5e549..8c9ae9c162 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
@@ -1,24 +1,24 @@
-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
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
Iroh does not keep track of or examine the user-defined data.
UserData implements FromStr and TryFrom<String>, so you can
convert &str and String into UserData easily.
-Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
+Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
In DNS discovery services, the user-defined data is stored in a TXT record character string,
which has a max length of 255 bytes. We need to subtract the user-data= prefix,
which leaves 245 bytes for the actual user-defined data.
-Trait Implementations§
Trait Implementations§
Source§impl Ord for UserData
Source§impl PartialOrd for UserData
Source§impl Eq for UserData
Source§impl StructuralPartialEq for UserData
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Trait Implementations§
Source§impl Clone for TransportAddr
Source§fn clone(&self) -> TransportAddr
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 TransportAddr
Source§impl<'de> Deserialize<'de> for TransportAddr
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TransportAddr, <__D as Deserializer<'de>>::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Display for TransportAddr
Source§impl From<Addr> for TransportAddr
Source§impl From<IncomingAddr> for TransportAddr
Source§fn from(addr: IncomingAddr) -> Self
Converts to this type from the input type.Source§impl From<TransportAddrInfo> for TransportAddr
Source§fn from(value: TransportAddrInfo) -> Self
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Display for TransportAddr
Source§impl From<Addr> for TransportAddr
Source§impl From<IncomingAddr> for TransportAddr
Source§fn from(addr: IncomingAddr) -> Self
Converts to this type from the input type.Source§impl From<TransportAddrInfo> for TransportAddr
Source§fn from(value: TransportAddrInfo) -> Self
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl Hash for TransportAddr
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
H: Hasher,
diff --git a/pr/4094/docs/iroh/index.html b/pr/4094/docs/iroh/index.html
index 7142ffa948..1a9ef7c5ab 100644
--- a/pr/4094/docs/iroh/index.html
+++ b/pr/4094/docs/iroh/index.html
@@ -1,4 +1,4 @@
-iroh - Rust Crate iroh
Expand description
PkarrPublisherBuilder
pub struct PkarrPublisherBuilder { /* private fields */ }Expand description
Builder for PkarrPublisher.
PkarrPublisherBuilder
pub struct PkarrPublisherBuilder { /* private fields */ }Expand description
Builder for PkarrPublisher.
Implementations§
Source§impl PkarrPublisherBuilder
impl PkarrPublisherBuilder
Implementations§
Source§impl PkarrPublisherBuilder
impl PkarrPublisherBuilder
Sourcepub fn ttl(self, ttl: u32) -> Self
pub fn ttl(self, ttl: u32) -> Self
Sets the TTL (time-to-live) for published packets.
Default is DEFAULT_PKARR_TTL.
Sourcepub fn republish_interval(self, republish_interval: Duration) -> Self
pub fn republish_interval(self, republish_interval: Duration) -> Self
Sets the interval after which packets are republished even if our endpoint info did not change.
+Sourcepub fn republish_interval(self, republish_interval: Duration) -> Self
pub fn republish_interval(self, republish_interval: Duration) -> Self
Sets the interval after which packets are republished even if our endpoint info did not change.
Default is DEFAULT_REPUBLISH_INTERVAL.
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 addr_filter(self, filter: AddrFilter) -> Self
pub fn addr_filter(self, filter: AddrFilter) -> Self
Sets the address filter to control which addresses are published to the pkarr server.
+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 addr_filter(self, filter: AddrFilter) -> Self
pub fn addr_filter(self, filter: AddrFilter) -> Self
Sets the address filter to control which addresses are published to the pkarr server.
By default AddrFilter::relay_only is used. This avoids leaking IP addresses to the
public pkarr server.
However, enabling IP address publishing can be useful, e.g. when iroh runs on a machine connected to the internet via public IP addresses without a firewall. In such cases, publishing them can make dialing such endpoints via DNS or Pkarr lookup faster, potentially skipping a relay connection altogether.
-Sourcepub fn build(
self,
secret_key: SecretKey,
tls_config: ClientConfig,
) -> PkarrPublisher
pub fn build( self, secret_key: SecretKey, tls_config: ClientConfig, ) -> PkarrPublisher
Builds the PkarrPublisher with the passed secret key for signing packets.
This publisher will be able to publish pkarr records for SecretKey.
Trait Implementations§
Trait Implementations§
Source§impl AddressLookupBuilder for PkarrPublisherBuilder
impl AddressLookupBuilder for PkarrPublisherBuilder
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 PkarrPublisherBuilder
impl !RefUnwindSafe for PkarrPublisherBuilder
impl Send for PkarrPublisherBuilder
impl Sync for PkarrPublisherBuilder
impl Unpin for PkarrPublisherBuilder
impl !UnwindSafe for PkarrPublisherBuilder
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 PkarrPublisherBuilder
impl !RefUnwindSafe for PkarrPublisherBuilder
impl Send for PkarrPublisherBuilder
impl Sync for PkarrPublisherBuilder
impl Unpin for PkarrPublisherBuilder
impl !UnwindSafe for PkarrPublisherBuilder
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/4094/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html b/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
index 38edeaf721..ee14f41996 100644
--- a/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
+++ b/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
@@ -1,20 +1,20 @@
-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) -> Self
Create a new PkarrRelayClient with default settings.
+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) -> Self
Create a new PkarrRelayClient with default settings.
Use the PkarrRelayClient::builder to get a builder that allows for
adding custom settings.
-Sourcepub fn builder(
pkarr_relay_url: Url,
tls_config: ClientConfig,
) -> PkarrRelayClientBuilder
Create a PkarrRelayClientBuilder.
-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/4094/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html b/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
index 7be1fda550..c7ed542230 100644
--- a/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
+++ b/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
@@ -1,7 +1,7 @@
-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 set_dns_resolver(self, dns_resolver: Option<DnsResolver>) -> Self
Available on non-wasm_browser only.
Passes an optional DNS resolver for the client to use.
-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 set_dns_resolver(self, dns_resolver: Option<DnsResolver>) -> Self
Available on non-wasm_browser only.
Passes an optional DNS resolver for the client to use.
+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/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html b/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
index d81b5aa864..79f15aa3e7 100644
--- a/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
+++ b/pr/4094/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 ConcurrentAddressLookup.
-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/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html b/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
index 7c0e4c9b9f..1ae4c18fe9 100644
--- a/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
+++ b/pr/4094/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/4094/docs/iroh/address_lookup/struct.AddrFilter.html b/pr/4094/docs/iroh/address_lookup/struct.AddrFilter.html
index db2443ae90..cdb8d8806e 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.AddrFilter.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.AddrFilter.html
@@ -1,4 +1,4 @@
-AddrFilter in iroh::address_lookup - Rust AddrFilter
pub struct AddrFilter(/* private fields */);
Expand description
A filter and/or reordering function applied to transport addresses,
+
AddrFilter in iroh::address_lookup - Rust AddrFilter
pub struct AddrFilter(/* private fields */);
Expand description
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
@@ -6,17 +6,17 @@ the output order). A BTreeSet cannot preserve a custom order, so th
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.
-Implementations§
Source§impl AddrFilter
Implementations§
Source§impl AddrFilter
Sourcepub fn new(
f: impl Fn(&Vec<TransportAddr>) -> Cow<'_, Vec<TransportAddr>> + Send + Sync + 'static,
) -> AddrFilter
Create a new AddrFilter
-Sourcepub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
-Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
-Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
-Sourcepub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
+Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
+Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
+Sourcepub fn apply<'a>(
&self,
addrs: &'a Vec<TransportAddr>,
) -> Cow<'a, Vec<TransportAddr>>
Apply the address filter function to a set of addresses.
-Trait Implementations§
Source§impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
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 AddrFilter
Source§impl Default for AddrFilter
Source§fn default() -> AddrFilter
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for AddrFilter
§impl !RefUnwindSafe for AddrFilter
§impl Send for AddrFilter
§impl Sync for AddrFilter
§impl Unpin for AddrFilter
§impl !UnwindSafe for AddrFilter
Blanket Implementations§
Trait Implementations§
Source§impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
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 AddrFilter
Source§impl Default for AddrFilter
Source§fn default() -> AddrFilter
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for AddrFilter
§impl !RefUnwindSafe for AddrFilter
§impl Send for AddrFilter
§impl Sync for AddrFilter
§impl Unpin for AddrFilter
§impl !UnwindSafe for AddrFilter
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/4094/docs/iroh/address_lookup/struct.EndpointData.html b/pr/4094/docs/iroh/address_lookup/struct.EndpointData.html
index bd1d6bbff0..38dc1a6616 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.EndpointData.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.EndpointData.html
@@ -1,33 +1,33 @@
-EndpointData in iroh::address_lookup - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
Data about an endpoint that may be published to and resolved from discovery services.
+EndpointData in iroh::address_lookup - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
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.
-Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
+Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
The address order is preserved, so it can encode priority for address lookup
services, should they not fit into e.g. a single DNS packet otherwise.
If the addresses contain duplicate entries, those entries are removed.
-Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
+Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
Useful for calling on construction after EndpointData::new or EndpointData::from_iter.
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 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 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 filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
+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 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 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 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.
-Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
- T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
Blanket Implementations§
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
+Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
+ T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
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/4094/docs/iroh/address_lookup/struct.EndpointInfo.html b/pr/4094/docs/iroh/address_lookup/struct.EndpointInfo.html
index a90f52320c..a1e30abf2f 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.EndpointInfo.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.EndpointInfo.html
@@ -1,39 +1,39 @@
-EndpointInfo in iroh::address_lookup - Rust EndpointInfo
pub 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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
-Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
-Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
-Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
+Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
+Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
+Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
+Sourcepub fn from_txt_lookup(
domain_name: String,
lookup: impl Iterator<Item = impl Display>,
) -> Result<EndpointInfo, ParseError>
Parses a EndpointInfo from DNS TXT lookup results.
The domain_name is the queried DNS name (e.g. _iroh.<z32>.<origin>).
The lookup iterator yields TXT record values that implement Display.
-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.
-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 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 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§
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 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 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§
§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/4094/docs/iroh/address_lookup/struct.Item.html b/pr/4094/docs/iroh/address_lookup/struct.Item.html
index 490927cf36..037465cb99 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.Item.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.Item.html
@@ -19,14 +19,14 @@ this item.
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.
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 filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
+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 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.
+Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
Trait Implementations§
Source§impl From<Item> for EndpointInfo
Source§impl Eq for Item
Source§impl StructuralPartialEq for Item
Auto Trait Implementations§
§impl Freeze for Item
§impl RefUnwindSafe for Item
§impl Send for Item
§impl Sync for Item
§impl Unpin for Item
§impl UnwindSafe for Item
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/4094/docs/iroh/address_lookup/struct.UserData.html b/pr/4094/docs/iroh/address_lookup/struct.UserData.html
index 68cc7e5b57..fa58d0aef9 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.UserData.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.UserData.html
@@ -1,24 +1,24 @@
-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
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
Iroh does not keep track of or examine the user-defined data.
UserData implements FromStr and TryFrom<String>, so you can
convert &str and String into UserData easily.
-Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
+Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
In DNS discovery services, the user-defined data is stored in a TXT record character string,
which has a max length of 255 bytes. We need to subtract the user-data= prefix,
which leaves 245 bytes for the actual user-defined data.
-Trait Implementations§
Trait Implementations§
Source§impl Ord for UserData
Source§impl PartialOrd for UserData
Source§impl Eq for UserData
Source§impl StructuralPartialEq for UserData
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html b/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html
index e1419ba359..d9845f9f06 100644
--- a/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html
+++ b/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html
@@ -34,4 +34,4 @@ work.
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 MdnsAddressLookup
Available on crate feature address-lookup-mdns only. Source§impl AddressLookup for MemoryLookup
Source§impl AddressLookup for DhtAddressLookup
Available on crate feature address-lookup-pkarr-dht only. Source§impl AddressLookup for PkarrPublisher
Source§impl AddressLookup for PkarrResolver
Source§impl AddressLookup for ConcurrentAddressLookup
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 MdnsAddressLookup
Available on crate feature address-lookup-mdns only. Source§impl AddressLookup for MemoryLookup
Source§impl AddressLookup for DhtAddressLookup
Available on crate feature address-lookup-pkarr-dht only. Source§impl AddressLookup for PkarrPublisher
Source§impl AddressLookup for PkarrResolver
Source§impl AddressLookup for ConcurrentAddressLookup
Source§impl<T: AddressLookup> AddressLookup for FilteredAddressLookup<T>
\ No newline at end of file
diff --git a/pr/4094/docs/iroh/address_lookup/trait.AddressLookupBuilder.html b/pr/4094/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
index e5994db739..1172cf753c 100644
--- a/pr/4094/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
+++ b/pr/4094/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 MdnsAddressLookupBuilder
Available on crate feature address-lookup-mdns only. Source§impl AddressLookupBuilder for Builder
Available on crate feature address-lookup-pkarr-dht 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 MdnsAddressLookupBuilder
Available on crate feature address-lookup-mdns only. Source§impl AddressLookupBuilder for Builder
Available on crate feature address-lookup-pkarr-dht 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/4094/docs/iroh/endpoint/index.html b/pr/4094/docs/iroh/endpoint/index.html
index 44ba3dde1e..cf50bc05ae 100644
--- a/pr/4094/docs/iroh/endpoint/index.html
+++ b/pr/4094/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/4094/docs/iroh/endpoint_info/index.html b/pr/4094/docs/iroh/endpoint_info/index.html
index 7669854b3d..5b7462ae8b 100644
--- a/pr/4094/docs/iroh/endpoint_info/index.html
+++ b/pr/4094/docs/iroh/endpoint_info/index.html
@@ -1,4 +1,35 @@
-iroh::endpoint_info - Rust Module endpoint_info
Expand description
Re-export of endpoint info types from iroh_dns::endpoint_info.
+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.
+DNS records are published under the following names:
+_iroh.<z32-endpoint-id>.<origin-domain> TXT
+
+-
+
_iroh is the record name as defined by IROH_TXT_NAME.
+
+-
+
<z32-endpoint-id> is the z-base-32 encoding of the EndpointId.
+
+-
+
<origin-domain> is the domain name of the publishing DNS server,
+N0_DNS_ENDPOINT_ORIGIN_PROD is the server operated by number0 for production.
+N0_DNS_ENDPOINT_ORIGIN_STAGING is the server operated by number0 for testing.
+
+-
+
TXT is the DNS record type.
+
+
+The returned TXT records must contain a string value of the form key=value as defined
+in RFC1464. The following attributes are defined:
+
+-
+
relay=<url>: The home RelayUrl of this endpoint.
+
+-
+
addr=<addr> <addr>: A space-separated list of sockets addresses for this iroh endpoint.
+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.
Enums§
Constants§
- IROH_
TXT_NAME - The DNS name for the iroh TXT record.
Traits§
- Endpoint
IdExt - Extension methods for
EndpointId to encode to and decode from z-base-32,
which is the encoding used by pkarr domain names.
\ No newline at end of file
diff --git a/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html b/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html
index 06bcf5d106..6d1ea05b51 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html
@@ -1,4 +1,4 @@
-AddrFilter in iroh::endpoint_info - Rust AddrFilter
pub struct AddrFilter(/* private fields */);
Expand description
A filter and/or reordering function applied to transport addresses,
+
AddrFilter in iroh::endpoint_info - Rust AddrFilter
pub struct AddrFilter(/* private fields */);
Expand description
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
@@ -6,17 +6,17 @@ the output order). A BTreeSet cannot preserve a custom order, so th
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.
-Implementations§
Source§impl AddrFilter
Implementations§
Source§impl AddrFilter
Sourcepub fn new(
f: impl Fn(&Vec<TransportAddr>) -> Cow<'_, Vec<TransportAddr>> + Send + Sync + 'static,
) -> AddrFilter
Create a new AddrFilter
-Sourcepub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
-Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
-Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
-Sourcepub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
+Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
+Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
+Sourcepub fn apply<'a>(
&self,
addrs: &'a Vec<TransportAddr>,
) -> Cow<'a, Vec<TransportAddr>>
Apply the address filter function to a set of addresses.
-Trait Implementations§
Source§impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
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 AddrFilter
Source§impl Default for AddrFilter
Source§fn default() -> AddrFilter
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for AddrFilter
§impl !RefUnwindSafe for AddrFilter
§impl Send for AddrFilter
§impl Sync for AddrFilter
§impl Unpin for AddrFilter
§impl !UnwindSafe for AddrFilter
Blanket Implementations§
Trait Implementations§
Source§impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
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 AddrFilter
Source§impl Default for AddrFilter
Source§fn default() -> AddrFilter
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for AddrFilter
§impl !RefUnwindSafe for AddrFilter
§impl Send for AddrFilter
§impl Sync for AddrFilter
§impl Unpin for AddrFilter
§impl !UnwindSafe for AddrFilter
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/4094/docs/iroh/endpoint_info/struct.EndpointData.html b/pr/4094/docs/iroh/endpoint_info/struct.EndpointData.html
index 593fc5cbcb..81e4a676c7 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.EndpointData.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.EndpointData.html
@@ -1,33 +1,33 @@
-EndpointData in iroh::endpoint_info - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
Data about an endpoint that may be published to and resolved from discovery services.
+EndpointData in iroh::endpoint_info - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
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.
-Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
+Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
The address order is preserved, so it can encode priority for address lookup
services, should they not fit into e.g. a single DNS packet otherwise.
If the addresses contain duplicate entries, those entries are removed.
-Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
+Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
Useful for calling on construction after EndpointData::new or EndpointData::from_iter.
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 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 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 filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
+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 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 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 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.
-Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
- T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
Blanket Implementations§
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
+Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
+ T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
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/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html b/pr/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html
index 4c4496b4f1..7e51bbc05b 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html
@@ -1,39 +1,39 @@
-EndpointInfo in iroh::endpoint_info - Rust EndpointInfo
pub struct EndpointInfo {
+EndpointInfo in iroh::endpoint_info - 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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
-Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
-Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
-Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
+Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
+Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
+Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
+Sourcepub fn from_txt_lookup(
domain_name: String,
lookup: impl Iterator<Item = impl Display>,
) -> Result<EndpointInfo, ParseError>
Parses a EndpointInfo from DNS TXT lookup results.
The domain_name is the queried DNS name (e.g. _iroh.<z32>.<origin>).
The lookup iterator yields TXT record values that implement Display.
-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.
-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 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 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§
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 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 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§
§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/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html b/pr/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html
index 239a535780..3279841835 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html
@@ -1,6 +1,6 @@
-MaxLengthExceededError in iroh::endpoint_info - Rust MaxLengthExceededError
pub struct MaxLengthExceededError { /* private fields */ }
Expand description
Error returned when an input value is too long for UserData.
-Implementations§
Source§impl MaxLengthExceededError
Sourcepub fn new() -> MaxLengthExceededError
Creates a new MaxLengthExceededError error.
-Trait Implementations§
Source§impl Debug for MaxLengthExceededError
Source§impl Display for MaxLengthExceededError
Source§impl Error for MaxLengthExceededError
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 StackError for MaxLengthExceededError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<MaxLengthExceededError>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for MaxLengthExceededError
§impl RefUnwindSafe for MaxLengthExceededError
§impl Send for MaxLengthExceededError
§impl Sync for MaxLengthExceededError
§impl Unpin for MaxLengthExceededError
§impl UnwindSafe for MaxLengthExceededError
Blanket Implementations§
Source§impl<T> Any for Twhere
+MaxLengthExceededError in iroh::endpoint_info - Rust MaxLengthExceededError
pub struct MaxLengthExceededError { /* private fields */ }
Expand description
Error returned when an input value is too long for UserData.
+Implementations§
Source§impl MaxLengthExceededError
Sourcepub fn new() -> MaxLengthExceededError
Creates a new MaxLengthExceededError error.
+Trait Implementations§
Source§impl Debug for MaxLengthExceededError
Source§impl Display for MaxLengthExceededError
Source§impl Error for MaxLengthExceededError
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 StackError for MaxLengthExceededError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<MaxLengthExceededError>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for MaxLengthExceededError
§impl RefUnwindSafe for MaxLengthExceededError
§impl Send for MaxLengthExceededError
§impl Sync for MaxLengthExceededError
§impl Unpin for MaxLengthExceededError
§impl UnwindSafe for MaxLengthExceededError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/4094/docs/iroh/endpoint_info/struct.UserData.html b/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
index 7cd4b5e549..8c9ae9c162 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
@@ -1,24 +1,24 @@
-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
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
Iroh does not keep track of or examine the user-defined data.
UserData implements FromStr and TryFrom<String>, so you can
convert &str and String into UserData easily.
-Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
+Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
In DNS discovery services, the user-defined data is stored in a TXT record character string,
which has a max length of 255 bytes. We need to subtract the user-data= prefix,
which leaves 245 bytes for the actual user-defined data.
-Trait Implementations§
Trait Implementations§
Source§impl Ord for UserData
Source§impl PartialOrd for UserData
Source§impl Eq for UserData
Source§impl StructuralPartialEq for UserData
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Trait Implementations§
Source§impl Clone for TransportAddr
Source§fn clone(&self) -> TransportAddr
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 TransportAddr
Source§impl<'de> Deserialize<'de> for TransportAddr
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TransportAddr, <__D as Deserializer<'de>>::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Display for TransportAddr
Source§impl From<Addr> for TransportAddr
Source§impl From<IncomingAddr> for TransportAddr
Source§fn from(addr: IncomingAddr) -> Self
Converts to this type from the input type.Source§impl From<TransportAddrInfo> for TransportAddr
Source§fn from(value: TransportAddrInfo) -> Self
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Display for TransportAddr
Source§impl From<Addr> for TransportAddr
Source§impl From<IncomingAddr> for TransportAddr
Source§fn from(addr: IncomingAddr) -> Self
Converts to this type from the input type.Source§impl From<TransportAddrInfo> for TransportAddr
Source§fn from(value: TransportAddrInfo) -> Self
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl Hash for TransportAddr
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
H: Hasher,
diff --git a/pr/4094/docs/iroh/index.html b/pr/4094/docs/iroh/index.html
index 7142ffa948..1a9ef7c5ab 100644
--- a/pr/4094/docs/iroh/index.html
+++ b/pr/4094/docs/iroh/index.html
@@ -1,4 +1,4 @@
-iroh - Rust Crate iroh
Expand description
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) -> Self
pub fn new(pkarr_relay_url: Url, tls_config: ClientConfig) -> Self
Create a new PkarrRelayClient with default settings.
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) -> Self
pub fn new(pkarr_relay_url: Url, tls_config: ClientConfig) -> Self
Create a new PkarrRelayClient with default settings.
Use the PkarrRelayClient::builder to get a builder that allows for
adding custom settings.
Sourcepub fn builder(
pkarr_relay_url: Url,
tls_config: ClientConfig,
) -> PkarrRelayClientBuilder
pub fn builder( pkarr_relay_url: Url, tls_config: ClientConfig, ) -> PkarrRelayClientBuilder
Create a PkarrRelayClientBuilder.
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/4094/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html b/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
index 7be1fda550..c7ed542230 100644
--- a/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
+++ b/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
@@ -1,7 +1,7 @@
-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 set_dns_resolver(self, dns_resolver: Option<DnsResolver>) -> Self
Available on non-wasm_browser only.
Passes an optional DNS resolver for the client to use.
-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 set_dns_resolver(self, dns_resolver: Option<DnsResolver>) -> Self
Available on non-wasm_browser only.
Passes an optional DNS resolver for the client to use.
+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/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html b/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
index d81b5aa864..79f15aa3e7 100644
--- a/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
+++ b/pr/4094/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 ConcurrentAddressLookup.
-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/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html b/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
index 7c0e4c9b9f..1ae4c18fe9 100644
--- a/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
+++ b/pr/4094/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/4094/docs/iroh/address_lookup/struct.AddrFilter.html b/pr/4094/docs/iroh/address_lookup/struct.AddrFilter.html
index db2443ae90..cdb8d8806e 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.AddrFilter.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.AddrFilter.html
@@ -1,4 +1,4 @@
-AddrFilter in iroh::address_lookup - Rust AddrFilter
pub struct AddrFilter(/* private fields */);
Expand description
A filter and/or reordering function applied to transport addresses,
+
AddrFilter in iroh::address_lookup - Rust AddrFilter
pub struct AddrFilter(/* private fields */);
Expand description
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
@@ -6,17 +6,17 @@ the output order). A BTreeSet cannot preserve a custom order, so th
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.
-Implementations§
Source§impl AddrFilter
Implementations§
Source§impl AddrFilter
Sourcepub fn new(
f: impl Fn(&Vec<TransportAddr>) -> Cow<'_, Vec<TransportAddr>> + Send + Sync + 'static,
) -> AddrFilter
Create a new AddrFilter
-Sourcepub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
-Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
-Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
-Sourcepub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
+Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
+Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
+Sourcepub fn apply<'a>(
&self,
addrs: &'a Vec<TransportAddr>,
) -> Cow<'a, Vec<TransportAddr>>
Apply the address filter function to a set of addresses.
-Trait Implementations§
Source§impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
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 AddrFilter
Source§impl Default for AddrFilter
Source§fn default() -> AddrFilter
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for AddrFilter
§impl !RefUnwindSafe for AddrFilter
§impl Send for AddrFilter
§impl Sync for AddrFilter
§impl Unpin for AddrFilter
§impl !UnwindSafe for AddrFilter
Blanket Implementations§
Trait Implementations§
Source§impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
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 AddrFilter
Source§impl Default for AddrFilter
Source§fn default() -> AddrFilter
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for AddrFilter
§impl !RefUnwindSafe for AddrFilter
§impl Send for AddrFilter
§impl Sync for AddrFilter
§impl Unpin for AddrFilter
§impl !UnwindSafe for AddrFilter
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/4094/docs/iroh/address_lookup/struct.EndpointData.html b/pr/4094/docs/iroh/address_lookup/struct.EndpointData.html
index bd1d6bbff0..38dc1a6616 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.EndpointData.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.EndpointData.html
@@ -1,33 +1,33 @@
-EndpointData in iroh::address_lookup - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
Data about an endpoint that may be published to and resolved from discovery services.
+EndpointData in iroh::address_lookup - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
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.
-Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
+Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
The address order is preserved, so it can encode priority for address lookup
services, should they not fit into e.g. a single DNS packet otherwise.
If the addresses contain duplicate entries, those entries are removed.
-Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
+Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
Useful for calling on construction after EndpointData::new or EndpointData::from_iter.
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 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 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 filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
+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 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 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 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.
-Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
- T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
Blanket Implementations§
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
+Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
+ T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
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/4094/docs/iroh/address_lookup/struct.EndpointInfo.html b/pr/4094/docs/iroh/address_lookup/struct.EndpointInfo.html
index a90f52320c..a1e30abf2f 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.EndpointInfo.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.EndpointInfo.html
@@ -1,39 +1,39 @@
-EndpointInfo in iroh::address_lookup - Rust EndpointInfo
pub 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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
-Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
-Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
-Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
+Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
+Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
+Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
+Sourcepub fn from_txt_lookup(
domain_name: String,
lookup: impl Iterator<Item = impl Display>,
) -> Result<EndpointInfo, ParseError>
Parses a EndpointInfo from DNS TXT lookup results.
The domain_name is the queried DNS name (e.g. _iroh.<z32>.<origin>).
The lookup iterator yields TXT record values that implement Display.
-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.
-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 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 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§
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 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 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§
§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/4094/docs/iroh/address_lookup/struct.Item.html b/pr/4094/docs/iroh/address_lookup/struct.Item.html
index 490927cf36..037465cb99 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.Item.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.Item.html
@@ -19,14 +19,14 @@ this item.
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.
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 filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
+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 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.
+Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
Trait Implementations§
Source§impl From<Item> for EndpointInfo
Source§impl Eq for Item
Source§impl StructuralPartialEq for Item
Auto Trait Implementations§
§impl Freeze for Item
§impl RefUnwindSafe for Item
§impl Send for Item
§impl Sync for Item
§impl Unpin for Item
§impl UnwindSafe for Item
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/4094/docs/iroh/address_lookup/struct.UserData.html b/pr/4094/docs/iroh/address_lookup/struct.UserData.html
index 68cc7e5b57..fa58d0aef9 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.UserData.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.UserData.html
@@ -1,24 +1,24 @@
-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
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
Iroh does not keep track of or examine the user-defined data.
UserData implements FromStr and TryFrom<String>, so you can
convert &str and String into UserData easily.
-Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
+Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
In DNS discovery services, the user-defined data is stored in a TXT record character string,
which has a max length of 255 bytes. We need to subtract the user-data= prefix,
which leaves 245 bytes for the actual user-defined data.
-Trait Implementations§
Trait Implementations§
Source§impl Ord for UserData
Source§impl PartialOrd for UserData
Source§impl Eq for UserData
Source§impl StructuralPartialEq for UserData
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html b/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html
index e1419ba359..d9845f9f06 100644
--- a/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html
+++ b/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html
@@ -34,4 +34,4 @@ work.
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 MdnsAddressLookup
Available on crate feature address-lookup-mdns only. Source§impl AddressLookup for MemoryLookup
Source§impl AddressLookup for DhtAddressLookup
Available on crate feature address-lookup-pkarr-dht only. Source§impl AddressLookup for PkarrPublisher
Source§impl AddressLookup for PkarrResolver
Source§impl AddressLookup for ConcurrentAddressLookup
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 MdnsAddressLookup
Available on crate feature address-lookup-mdns only. Source§impl AddressLookup for MemoryLookup
Source§impl AddressLookup for DhtAddressLookup
Available on crate feature address-lookup-pkarr-dht only. Source§impl AddressLookup for PkarrPublisher
Source§impl AddressLookup for PkarrResolver
Source§impl AddressLookup for ConcurrentAddressLookup
Source§impl<T: AddressLookup> AddressLookup for FilteredAddressLookup<T>
\ No newline at end of file
diff --git a/pr/4094/docs/iroh/address_lookup/trait.AddressLookupBuilder.html b/pr/4094/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
index e5994db739..1172cf753c 100644
--- a/pr/4094/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
+++ b/pr/4094/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 MdnsAddressLookupBuilder
Available on crate feature address-lookup-mdns only. Source§impl AddressLookupBuilder for Builder
Available on crate feature address-lookup-pkarr-dht 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 MdnsAddressLookupBuilder
Available on crate feature address-lookup-mdns only. Source§impl AddressLookupBuilder for Builder
Available on crate feature address-lookup-pkarr-dht 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/4094/docs/iroh/endpoint/index.html b/pr/4094/docs/iroh/endpoint/index.html
index 44ba3dde1e..cf50bc05ae 100644
--- a/pr/4094/docs/iroh/endpoint/index.html
+++ b/pr/4094/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/4094/docs/iroh/endpoint_info/index.html b/pr/4094/docs/iroh/endpoint_info/index.html
index 7669854b3d..5b7462ae8b 100644
--- a/pr/4094/docs/iroh/endpoint_info/index.html
+++ b/pr/4094/docs/iroh/endpoint_info/index.html
@@ -1,4 +1,35 @@
-iroh::endpoint_info - Rust Module endpoint_info
Expand description
Re-export of endpoint info types from iroh_dns::endpoint_info.
+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.
+DNS records are published under the following names:
+_iroh.<z32-endpoint-id>.<origin-domain> TXT
+
+-
+
_iroh is the record name as defined by IROH_TXT_NAME.
+
+-
+
<z32-endpoint-id> is the z-base-32 encoding of the EndpointId.
+
+-
+
<origin-domain> is the domain name of the publishing DNS server,
+N0_DNS_ENDPOINT_ORIGIN_PROD is the server operated by number0 for production.
+N0_DNS_ENDPOINT_ORIGIN_STAGING is the server operated by number0 for testing.
+
+-
+
TXT is the DNS record type.
+
+
+The returned TXT records must contain a string value of the form key=value as defined
+in RFC1464. The following attributes are defined:
+
+-
+
relay=<url>: The home RelayUrl of this endpoint.
+
+-
+
addr=<addr> <addr>: A space-separated list of sockets addresses for this iroh endpoint.
+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.
Enums§
Constants§
- IROH_
TXT_NAME - The DNS name for the iroh TXT record.
Traits§
- Endpoint
IdExt - Extension methods for
EndpointId to encode to and decode from z-base-32,
which is the encoding used by pkarr domain names.
\ No newline at end of file
diff --git a/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html b/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html
index 06bcf5d106..6d1ea05b51 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html
@@ -1,4 +1,4 @@
-AddrFilter in iroh::endpoint_info - Rust AddrFilter
pub struct AddrFilter(/* private fields */);
Expand description
A filter and/or reordering function applied to transport addresses,
+
AddrFilter in iroh::endpoint_info - Rust AddrFilter
pub struct AddrFilter(/* private fields */);
Expand description
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
@@ -6,17 +6,17 @@ the output order). A BTreeSet cannot preserve a custom order, so th
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.
-Implementations§
Source§impl AddrFilter
Implementations§
Source§impl AddrFilter
Sourcepub fn new(
f: impl Fn(&Vec<TransportAddr>) -> Cow<'_, Vec<TransportAddr>> + Send + Sync + 'static,
) -> AddrFilter
Create a new AddrFilter
-Sourcepub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
-Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
-Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
-Sourcepub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
+Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
+Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
+Sourcepub fn apply<'a>(
&self,
addrs: &'a Vec<TransportAddr>,
) -> Cow<'a, Vec<TransportAddr>>
Apply the address filter function to a set of addresses.
-Trait Implementations§
Source§impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
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 AddrFilter
Source§impl Default for AddrFilter
Source§fn default() -> AddrFilter
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for AddrFilter
§impl !RefUnwindSafe for AddrFilter
§impl Send for AddrFilter
§impl Sync for AddrFilter
§impl Unpin for AddrFilter
§impl !UnwindSafe for AddrFilter
Blanket Implementations§
Trait Implementations§
Source§impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
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 AddrFilter
Source§impl Default for AddrFilter
Source§fn default() -> AddrFilter
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for AddrFilter
§impl !RefUnwindSafe for AddrFilter
§impl Send for AddrFilter
§impl Sync for AddrFilter
§impl Unpin for AddrFilter
§impl !UnwindSafe for AddrFilter
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/4094/docs/iroh/endpoint_info/struct.EndpointData.html b/pr/4094/docs/iroh/endpoint_info/struct.EndpointData.html
index 593fc5cbcb..81e4a676c7 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.EndpointData.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.EndpointData.html
@@ -1,33 +1,33 @@
-EndpointData in iroh::endpoint_info - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
Data about an endpoint that may be published to and resolved from discovery services.
+EndpointData in iroh::endpoint_info - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
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.
-Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
+Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
The address order is preserved, so it can encode priority for address lookup
services, should they not fit into e.g. a single DNS packet otherwise.
If the addresses contain duplicate entries, those entries are removed.
-Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
+Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
Useful for calling on construction after EndpointData::new or EndpointData::from_iter.
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 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 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 filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
+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 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 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 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.
-Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
- T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
Blanket Implementations§
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
+Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
+ T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
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/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html b/pr/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html
index 4c4496b4f1..7e51bbc05b 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html
@@ -1,39 +1,39 @@
-EndpointInfo in iroh::endpoint_info - Rust EndpointInfo
pub struct EndpointInfo {
+EndpointInfo in iroh::endpoint_info - 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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
-Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
-Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
-Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
+Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
+Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
+Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
+Sourcepub fn from_txt_lookup(
domain_name: String,
lookup: impl Iterator<Item = impl Display>,
) -> Result<EndpointInfo, ParseError>
Parses a EndpointInfo from DNS TXT lookup results.
The domain_name is the queried DNS name (e.g. _iroh.<z32>.<origin>).
The lookup iterator yields TXT record values that implement Display.
-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.
-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 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 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§
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 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 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§
§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/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html b/pr/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html
index 239a535780..3279841835 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html
@@ -1,6 +1,6 @@
-MaxLengthExceededError in iroh::endpoint_info - Rust MaxLengthExceededError
pub struct MaxLengthExceededError { /* private fields */ }
Expand description
Error returned when an input value is too long for UserData.
-Implementations§
Source§impl MaxLengthExceededError
Sourcepub fn new() -> MaxLengthExceededError
Creates a new MaxLengthExceededError error.
-Trait Implementations§
Source§impl Debug for MaxLengthExceededError
Source§impl Display for MaxLengthExceededError
Source§impl Error for MaxLengthExceededError
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 StackError for MaxLengthExceededError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<MaxLengthExceededError>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for MaxLengthExceededError
§impl RefUnwindSafe for MaxLengthExceededError
§impl Send for MaxLengthExceededError
§impl Sync for MaxLengthExceededError
§impl Unpin for MaxLengthExceededError
§impl UnwindSafe for MaxLengthExceededError
Blanket Implementations§
Source§impl<T> Any for Twhere
+MaxLengthExceededError in iroh::endpoint_info - Rust MaxLengthExceededError
pub struct MaxLengthExceededError { /* private fields */ }
Expand description
Error returned when an input value is too long for UserData.
+Implementations§
Source§impl MaxLengthExceededError
Sourcepub fn new() -> MaxLengthExceededError
Creates a new MaxLengthExceededError error.
+Trait Implementations§
Source§impl Debug for MaxLengthExceededError
Source§impl Display for MaxLengthExceededError
Source§impl Error for MaxLengthExceededError
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 StackError for MaxLengthExceededError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<MaxLengthExceededError>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for MaxLengthExceededError
§impl RefUnwindSafe for MaxLengthExceededError
§impl Send for MaxLengthExceededError
§impl Sync for MaxLengthExceededError
§impl Unpin for MaxLengthExceededError
§impl UnwindSafe for MaxLengthExceededError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/4094/docs/iroh/endpoint_info/struct.UserData.html b/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
index 7cd4b5e549..8c9ae9c162 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
@@ -1,24 +1,24 @@
-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
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
Iroh does not keep track of or examine the user-defined data.
UserData implements FromStr and TryFrom<String>, so you can
convert &str and String into UserData easily.
-Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
+Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
In DNS discovery services, the user-defined data is stored in a TXT record character string,
which has a max length of 255 bytes. We need to subtract the user-data= prefix,
which leaves 245 bytes for the actual user-defined data.
-Trait Implementations§
Trait Implementations§
Source§impl Ord for UserData
Source§impl PartialOrd for UserData
Source§impl Eq for UserData
Source§impl StructuralPartialEq for UserData
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Trait Implementations§
Source§impl Clone for TransportAddr
Source§fn clone(&self) -> TransportAddr
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 TransportAddr
Source§impl<'de> Deserialize<'de> for TransportAddr
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TransportAddr, <__D as Deserializer<'de>>::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Display for TransportAddr
Source§impl From<Addr> for TransportAddr
Source§impl From<IncomingAddr> for TransportAddr
Source§fn from(addr: IncomingAddr) -> Self
Converts to this type from the input type.Source§impl From<TransportAddrInfo> for TransportAddr
Source§fn from(value: TransportAddrInfo) -> Self
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Display for TransportAddr
Source§impl From<Addr> for TransportAddr
Source§impl From<IncomingAddr> for TransportAddr
Source§fn from(addr: IncomingAddr) -> Self
Converts to this type from the input type.Source§impl From<TransportAddrInfo> for TransportAddr
Source§fn from(value: TransportAddrInfo) -> Self
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl Hash for TransportAddr
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
H: Hasher,
diff --git a/pr/4094/docs/iroh/index.html b/pr/4094/docs/iroh/index.html
index 7142ffa948..1a9ef7c5ab 100644
--- a/pr/4094/docs/iroh/index.html
+++ b/pr/4094/docs/iroh/index.html
@@ -1,4 +1,4 @@
-iroh - Rust Crate iroh
Expand description
PkarrRelayClientBuilder
pub struct PkarrRelayClientBuilder { /* private fields */ }Expand description
A builder for the PkarrRelayClient
Implementations§
Source§impl PkarrRelayClientBuilder
impl PkarrRelayClientBuilder
Sourcepub fn set_dns_resolver(self, dns_resolver: Option<DnsResolver>) -> Self
Available on non-wasm_browser only.
pub fn set_dns_resolver(self, dns_resolver: Option<DnsResolver>) -> Self
wasm_browser only.Passes an optional DNS resolver for the client to use.
-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 set_dns_resolver(self, dns_resolver: Option<DnsResolver>) -> Self
Available on non-wasm_browser only.
Passes an optional DNS resolver for the client to use.
+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/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html b/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
index d81b5aa864..79f15aa3e7 100644
--- a/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
+++ b/pr/4094/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 ConcurrentAddressLookup.
-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/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html b/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
index 7c0e4c9b9f..1ae4c18fe9 100644
--- a/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
+++ b/pr/4094/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/4094/docs/iroh/address_lookup/struct.AddrFilter.html b/pr/4094/docs/iroh/address_lookup/struct.AddrFilter.html
index db2443ae90..cdb8d8806e 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.AddrFilter.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.AddrFilter.html
@@ -1,4 +1,4 @@
-AddrFilter in iroh::address_lookup - Rust AddrFilter
pub struct AddrFilter(/* private fields */);
Expand description
A filter and/or reordering function applied to transport addresses,
+
AddrFilter in iroh::address_lookup - Rust AddrFilter
pub struct AddrFilter(/* private fields */);
Expand description
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
@@ -6,17 +6,17 @@ the output order). A BTreeSet cannot preserve a custom order, so th
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.
-Implementations§
Source§impl AddrFilter
Implementations§
Source§impl AddrFilter
Sourcepub fn new(
f: impl Fn(&Vec<TransportAddr>) -> Cow<'_, Vec<TransportAddr>> + Send + Sync + 'static,
) -> AddrFilter
Create a new AddrFilter
-Sourcepub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
-Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
-Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
-Sourcepub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
+Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
+Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
+Sourcepub fn apply<'a>(
&self,
addrs: &'a Vec<TransportAddr>,
) -> Cow<'a, Vec<TransportAddr>>
Apply the address filter function to a set of addresses.
-Trait Implementations§
Source§impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
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 AddrFilter
Source§impl Default for AddrFilter
Source§fn default() -> AddrFilter
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for AddrFilter
§impl !RefUnwindSafe for AddrFilter
§impl Send for AddrFilter
§impl Sync for AddrFilter
§impl Unpin for AddrFilter
§impl !UnwindSafe for AddrFilter
Blanket Implementations§
Trait Implementations§
Source§impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
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 AddrFilter
Source§impl Default for AddrFilter
Source§fn default() -> AddrFilter
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for AddrFilter
§impl !RefUnwindSafe for AddrFilter
§impl Send for AddrFilter
§impl Sync for AddrFilter
§impl Unpin for AddrFilter
§impl !UnwindSafe for AddrFilter
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/4094/docs/iroh/address_lookup/struct.EndpointData.html b/pr/4094/docs/iroh/address_lookup/struct.EndpointData.html
index bd1d6bbff0..38dc1a6616 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.EndpointData.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.EndpointData.html
@@ -1,33 +1,33 @@
-EndpointData in iroh::address_lookup - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
Data about an endpoint that may be published to and resolved from discovery services.
+EndpointData in iroh::address_lookup - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
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.
-Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
+Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
The address order is preserved, so it can encode priority for address lookup
services, should they not fit into e.g. a single DNS packet otherwise.
If the addresses contain duplicate entries, those entries are removed.
-Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
+Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
Useful for calling on construction after EndpointData::new or EndpointData::from_iter.
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 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 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 filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
+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 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 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 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.
-Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
- T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
Blanket Implementations§
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
+Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
+ T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
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/4094/docs/iroh/address_lookup/struct.EndpointInfo.html b/pr/4094/docs/iroh/address_lookup/struct.EndpointInfo.html
index a90f52320c..a1e30abf2f 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.EndpointInfo.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.EndpointInfo.html
@@ -1,39 +1,39 @@
-EndpointInfo in iroh::address_lookup - Rust EndpointInfo
pub 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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
-Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
-Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
-Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
+Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
+Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
+Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
+Sourcepub fn from_txt_lookup(
domain_name: String,
lookup: impl Iterator<Item = impl Display>,
) -> Result<EndpointInfo, ParseError>
Parses a EndpointInfo from DNS TXT lookup results.
The domain_name is the queried DNS name (e.g. _iroh.<z32>.<origin>).
The lookup iterator yields TXT record values that implement Display.
-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.
-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 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 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§
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 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 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§
§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/4094/docs/iroh/address_lookup/struct.Item.html b/pr/4094/docs/iroh/address_lookup/struct.Item.html
index 490927cf36..037465cb99 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.Item.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.Item.html
@@ -19,14 +19,14 @@ this item.
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.
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 filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
+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 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.
+Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
Trait Implementations§
Source§impl From<Item> for EndpointInfo
Source§impl Eq for Item
Source§impl StructuralPartialEq for Item
Auto Trait Implementations§
§impl Freeze for Item
§impl RefUnwindSafe for Item
§impl Send for Item
§impl Sync for Item
§impl Unpin for Item
§impl UnwindSafe for Item
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/4094/docs/iroh/address_lookup/struct.UserData.html b/pr/4094/docs/iroh/address_lookup/struct.UserData.html
index 68cc7e5b57..fa58d0aef9 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.UserData.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.UserData.html
@@ -1,24 +1,24 @@
-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
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
Iroh does not keep track of or examine the user-defined data.
UserData implements FromStr and TryFrom<String>, so you can
convert &str and String into UserData easily.
-Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
+Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
In DNS discovery services, the user-defined data is stored in a TXT record character string,
which has a max length of 255 bytes. We need to subtract the user-data= prefix,
which leaves 245 bytes for the actual user-defined data.
-Trait Implementations§
Trait Implementations§
Source§impl Ord for UserData
Source§impl PartialOrd for UserData
Source§impl Eq for UserData
Source§impl StructuralPartialEq for UserData
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html b/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html
index e1419ba359..d9845f9f06 100644
--- a/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html
+++ b/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html
@@ -34,4 +34,4 @@ work.
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 MdnsAddressLookup
Available on crate feature address-lookup-mdns only. Source§impl AddressLookup for MemoryLookup
Source§impl AddressLookup for DhtAddressLookup
Available on crate feature address-lookup-pkarr-dht only. Source§impl AddressLookup for PkarrPublisher
Source§impl AddressLookup for PkarrResolver
Source§impl AddressLookup for ConcurrentAddressLookup
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 MdnsAddressLookup
Available on crate feature address-lookup-mdns only. Source§impl AddressLookup for MemoryLookup
Source§impl AddressLookup for DhtAddressLookup
Available on crate feature address-lookup-pkarr-dht only. Source§impl AddressLookup for PkarrPublisher
Source§impl AddressLookup for PkarrResolver
Source§impl AddressLookup for ConcurrentAddressLookup
Source§impl<T: AddressLookup> AddressLookup for FilteredAddressLookup<T>
\ No newline at end of file
diff --git a/pr/4094/docs/iroh/address_lookup/trait.AddressLookupBuilder.html b/pr/4094/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
index e5994db739..1172cf753c 100644
--- a/pr/4094/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
+++ b/pr/4094/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 MdnsAddressLookupBuilder
Available on crate feature address-lookup-mdns only. Source§impl AddressLookupBuilder for Builder
Available on crate feature address-lookup-pkarr-dht 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 MdnsAddressLookupBuilder
Available on crate feature address-lookup-mdns only. Source§impl AddressLookupBuilder for Builder
Available on crate feature address-lookup-pkarr-dht 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/4094/docs/iroh/endpoint/index.html b/pr/4094/docs/iroh/endpoint/index.html
index 44ba3dde1e..cf50bc05ae 100644
--- a/pr/4094/docs/iroh/endpoint/index.html
+++ b/pr/4094/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/4094/docs/iroh/endpoint_info/index.html b/pr/4094/docs/iroh/endpoint_info/index.html
index 7669854b3d..5b7462ae8b 100644
--- a/pr/4094/docs/iroh/endpoint_info/index.html
+++ b/pr/4094/docs/iroh/endpoint_info/index.html
@@ -1,4 +1,35 @@
-iroh::endpoint_info - Rust Module endpoint_info
Expand description
Re-export of endpoint info types from iroh_dns::endpoint_info.
+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.
+DNS records are published under the following names:
+_iroh.<z32-endpoint-id>.<origin-domain> TXT
+
+-
+
_iroh is the record name as defined by IROH_TXT_NAME.
+
+-
+
<z32-endpoint-id> is the z-base-32 encoding of the EndpointId.
+
+-
+
<origin-domain> is the domain name of the publishing DNS server,
+N0_DNS_ENDPOINT_ORIGIN_PROD is the server operated by number0 for production.
+N0_DNS_ENDPOINT_ORIGIN_STAGING is the server operated by number0 for testing.
+
+-
+
TXT is the DNS record type.
+
+
+The returned TXT records must contain a string value of the form key=value as defined
+in RFC1464. The following attributes are defined:
+
+-
+
relay=<url>: The home RelayUrl of this endpoint.
+
+-
+
addr=<addr> <addr>: A space-separated list of sockets addresses for this iroh endpoint.
+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.
Enums§
Constants§
- IROH_
TXT_NAME - The DNS name for the iroh TXT record.
Traits§
- Endpoint
IdExt - Extension methods for
EndpointId to encode to and decode from z-base-32,
which is the encoding used by pkarr domain names.
\ No newline at end of file
diff --git a/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html b/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html
index 06bcf5d106..6d1ea05b51 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html
@@ -1,4 +1,4 @@
-AddrFilter in iroh::endpoint_info - Rust AddrFilter
pub struct AddrFilter(/* private fields */);
Expand description
A filter and/or reordering function applied to transport addresses,
+
AddrFilter in iroh::endpoint_info - Rust AddrFilter
pub struct AddrFilter(/* private fields */);
Expand description
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
@@ -6,17 +6,17 @@ the output order). A BTreeSet cannot preserve a custom order, so th
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.
-Implementations§
Source§impl AddrFilter
Implementations§
Source§impl AddrFilter
Sourcepub fn new(
f: impl Fn(&Vec<TransportAddr>) -> Cow<'_, Vec<TransportAddr>> + Send + Sync + 'static,
) -> AddrFilter
Create a new AddrFilter
-Sourcepub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
-Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
-Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
-Sourcepub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
+Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
+Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
+Sourcepub fn apply<'a>(
&self,
addrs: &'a Vec<TransportAddr>,
) -> Cow<'a, Vec<TransportAddr>>
Apply the address filter function to a set of addresses.
-Trait Implementations§
Source§impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
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 AddrFilter
Source§impl Default for AddrFilter
Source§fn default() -> AddrFilter
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for AddrFilter
§impl !RefUnwindSafe for AddrFilter
§impl Send for AddrFilter
§impl Sync for AddrFilter
§impl Unpin for AddrFilter
§impl !UnwindSafe for AddrFilter
Blanket Implementations§
Trait Implementations§
Source§impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
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 AddrFilter
Source§impl Default for AddrFilter
Source§fn default() -> AddrFilter
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for AddrFilter
§impl !RefUnwindSafe for AddrFilter
§impl Send for AddrFilter
§impl Sync for AddrFilter
§impl Unpin for AddrFilter
§impl !UnwindSafe for AddrFilter
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/4094/docs/iroh/endpoint_info/struct.EndpointData.html b/pr/4094/docs/iroh/endpoint_info/struct.EndpointData.html
index 593fc5cbcb..81e4a676c7 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.EndpointData.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.EndpointData.html
@@ -1,33 +1,33 @@
-EndpointData in iroh::endpoint_info - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
Data about an endpoint that may be published to and resolved from discovery services.
+EndpointData in iroh::endpoint_info - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
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.
-Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
+Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
The address order is preserved, so it can encode priority for address lookup
services, should they not fit into e.g. a single DNS packet otherwise.
If the addresses contain duplicate entries, those entries are removed.
-Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
+Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
Useful for calling on construction after EndpointData::new or EndpointData::from_iter.
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 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 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 filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
+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 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 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 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.
-Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
- T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
Blanket Implementations§
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
+Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
+ T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
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/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html b/pr/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html
index 4c4496b4f1..7e51bbc05b 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html
@@ -1,39 +1,39 @@
-EndpointInfo in iroh::endpoint_info - Rust EndpointInfo
pub struct EndpointInfo {
+EndpointInfo in iroh::endpoint_info - 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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
-Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
-Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
-Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
+Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
+Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
+Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
+Sourcepub fn from_txt_lookup(
domain_name: String,
lookup: impl Iterator<Item = impl Display>,
) -> Result<EndpointInfo, ParseError>
Parses a EndpointInfo from DNS TXT lookup results.
The domain_name is the queried DNS name (e.g. _iroh.<z32>.<origin>).
The lookup iterator yields TXT record values that implement Display.
-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.
-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 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 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§
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 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 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§
§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/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html b/pr/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html
index 239a535780..3279841835 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html
@@ -1,6 +1,6 @@
-MaxLengthExceededError in iroh::endpoint_info - Rust MaxLengthExceededError
pub struct MaxLengthExceededError { /* private fields */ }
Expand description
Error returned when an input value is too long for UserData.
-Implementations§
Source§impl MaxLengthExceededError
Sourcepub fn new() -> MaxLengthExceededError
Creates a new MaxLengthExceededError error.
-Trait Implementations§
Source§impl Debug for MaxLengthExceededError
Source§impl Display for MaxLengthExceededError
Source§impl Error for MaxLengthExceededError
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 StackError for MaxLengthExceededError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<MaxLengthExceededError>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for MaxLengthExceededError
§impl RefUnwindSafe for MaxLengthExceededError
§impl Send for MaxLengthExceededError
§impl Sync for MaxLengthExceededError
§impl Unpin for MaxLengthExceededError
§impl UnwindSafe for MaxLengthExceededError
Blanket Implementations§
Source§impl<T> Any for Twhere
+MaxLengthExceededError in iroh::endpoint_info - Rust MaxLengthExceededError
pub struct MaxLengthExceededError { /* private fields */ }
Expand description
Error returned when an input value is too long for UserData.
+Implementations§
Source§impl MaxLengthExceededError
Sourcepub fn new() -> MaxLengthExceededError
Creates a new MaxLengthExceededError error.
+Trait Implementations§
Source§impl Debug for MaxLengthExceededError
Source§impl Display for MaxLengthExceededError
Source§impl Error for MaxLengthExceededError
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 StackError for MaxLengthExceededError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<MaxLengthExceededError>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for MaxLengthExceededError
§impl RefUnwindSafe for MaxLengthExceededError
§impl Send for MaxLengthExceededError
§impl Sync for MaxLengthExceededError
§impl Unpin for MaxLengthExceededError
§impl UnwindSafe for MaxLengthExceededError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/4094/docs/iroh/endpoint_info/struct.UserData.html b/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
index 7cd4b5e549..8c9ae9c162 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
@@ -1,24 +1,24 @@
-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
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
Iroh does not keep track of or examine the user-defined data.
UserData implements FromStr and TryFrom<String>, so you can
convert &str and String into UserData easily.
-Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
+Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
In DNS discovery services, the user-defined data is stored in a TXT record character string,
which has a max length of 255 bytes. We need to subtract the user-data= prefix,
which leaves 245 bytes for the actual user-defined data.
-Trait Implementations§
Trait Implementations§
Source§impl Ord for UserData
Source§impl PartialOrd for UserData
Source§impl Eq for UserData
Source§impl StructuralPartialEq for UserData
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Trait Implementations§
Source§impl Clone for TransportAddr
Source§fn clone(&self) -> TransportAddr
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 TransportAddr
Source§impl<'de> Deserialize<'de> for TransportAddr
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TransportAddr, <__D as Deserializer<'de>>::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Display for TransportAddr
Source§impl From<Addr> for TransportAddr
Source§impl From<IncomingAddr> for TransportAddr
Source§fn from(addr: IncomingAddr) -> Self
Converts to this type from the input type.Source§impl From<TransportAddrInfo> for TransportAddr
Source§fn from(value: TransportAddrInfo) -> Self
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Display for TransportAddr
Source§impl From<Addr> for TransportAddr
Source§impl From<IncomingAddr> for TransportAddr
Source§fn from(addr: IncomingAddr) -> Self
Converts to this type from the input type.Source§impl From<TransportAddrInfo> for TransportAddr
Source§fn from(value: TransportAddrInfo) -> Self
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl Hash for TransportAddr
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
H: Hasher,
diff --git a/pr/4094/docs/iroh/index.html b/pr/4094/docs/iroh/index.html
index 7142ffa948..1a9ef7c5ab 100644
--- a/pr/4094/docs/iroh/index.html
+++ b/pr/4094/docs/iroh/index.html
@@ -1,4 +1,4 @@
-iroh - Rust Crate iroh
Expand description
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 set_dns_resolver(self, dns_resolver: Option<DnsResolver>) -> Self
Available on non-wasm_browser only.
Passes an optional DNS resolver for the client to use.
+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/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html b/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
index d81b5aa864..79f15aa3e7 100644
--- a/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
+++ b/pr/4094/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 ConcurrentAddressLookup.
-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/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html b/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
index 7c0e4c9b9f..1ae4c18fe9 100644
--- a/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
+++ b/pr/4094/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/4094/docs/iroh/address_lookup/struct.AddrFilter.html b/pr/4094/docs/iroh/address_lookup/struct.AddrFilter.html
index db2443ae90..cdb8d8806e 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.AddrFilter.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.AddrFilter.html
@@ -1,4 +1,4 @@
-AddrFilter in iroh::address_lookup - Rust AddrFilter
pub struct AddrFilter(/* private fields */);
Expand description
A filter and/or reordering function applied to transport addresses,
+
AddrFilter in iroh::address_lookup - Rust AddrFilter
pub struct AddrFilter(/* private fields */);
Expand description
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
@@ -6,17 +6,17 @@ the output order). A BTreeSet cannot preserve a custom order, so th
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.
-Implementations§
Source§impl AddrFilter
Implementations§
Source§impl AddrFilter
Sourcepub fn new(
f: impl Fn(&Vec<TransportAddr>) -> Cow<'_, Vec<TransportAddr>> + Send + Sync + 'static,
) -> AddrFilter
Create a new AddrFilter
-Sourcepub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
-Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
-Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
-Sourcepub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
+Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
+Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
+Sourcepub fn apply<'a>(
&self,
addrs: &'a Vec<TransportAddr>,
) -> Cow<'a, Vec<TransportAddr>>
Apply the address filter function to a set of addresses.
-Trait Implementations§
Source§impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
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 AddrFilter
Source§impl Default for AddrFilter
Source§fn default() -> AddrFilter
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for AddrFilter
§impl !RefUnwindSafe for AddrFilter
§impl Send for AddrFilter
§impl Sync for AddrFilter
§impl Unpin for AddrFilter
§impl !UnwindSafe for AddrFilter
Blanket Implementations§
Trait Implementations§
Source§impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
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 AddrFilter
Source§impl Default for AddrFilter
Source§fn default() -> AddrFilter
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for AddrFilter
§impl !RefUnwindSafe for AddrFilter
§impl Send for AddrFilter
§impl Sync for AddrFilter
§impl Unpin for AddrFilter
§impl !UnwindSafe for AddrFilter
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/4094/docs/iroh/address_lookup/struct.EndpointData.html b/pr/4094/docs/iroh/address_lookup/struct.EndpointData.html
index bd1d6bbff0..38dc1a6616 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.EndpointData.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.EndpointData.html
@@ -1,33 +1,33 @@
-EndpointData in iroh::address_lookup - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
Data about an endpoint that may be published to and resolved from discovery services.
+EndpointData in iroh::address_lookup - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
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.
-Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
+Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
The address order is preserved, so it can encode priority for address lookup
services, should they not fit into e.g. a single DNS packet otherwise.
If the addresses contain duplicate entries, those entries are removed.
-Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
+Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
Useful for calling on construction after EndpointData::new or EndpointData::from_iter.
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 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 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 filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
+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 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 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 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.
-Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
- T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
Blanket Implementations§
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
+Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
+ T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
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/4094/docs/iroh/address_lookup/struct.EndpointInfo.html b/pr/4094/docs/iroh/address_lookup/struct.EndpointInfo.html
index a90f52320c..a1e30abf2f 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.EndpointInfo.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.EndpointInfo.html
@@ -1,39 +1,39 @@
-EndpointInfo in iroh::address_lookup - Rust EndpointInfo
pub 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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
-Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
-Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
-Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
+Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
+Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
+Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
+Sourcepub fn from_txt_lookup(
domain_name: String,
lookup: impl Iterator<Item = impl Display>,
) -> Result<EndpointInfo, ParseError>
Parses a EndpointInfo from DNS TXT lookup results.
The domain_name is the queried DNS name (e.g. _iroh.<z32>.<origin>).
The lookup iterator yields TXT record values that implement Display.
-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.
-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 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 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§
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 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 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§
§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/4094/docs/iroh/address_lookup/struct.Item.html b/pr/4094/docs/iroh/address_lookup/struct.Item.html
index 490927cf36..037465cb99 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.Item.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.Item.html
@@ -19,14 +19,14 @@ this item.
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.
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 filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
+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 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.
+Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
Trait Implementations§
Source§impl From<Item> for EndpointInfo
Source§impl Eq for Item
Source§impl StructuralPartialEq for Item
Auto Trait Implementations§
§impl Freeze for Item
§impl RefUnwindSafe for Item
§impl Send for Item
§impl Sync for Item
§impl Unpin for Item
§impl UnwindSafe for Item
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/4094/docs/iroh/address_lookup/struct.UserData.html b/pr/4094/docs/iroh/address_lookup/struct.UserData.html
index 68cc7e5b57..fa58d0aef9 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.UserData.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.UserData.html
@@ -1,24 +1,24 @@
-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
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
Iroh does not keep track of or examine the user-defined data.
UserData implements FromStr and TryFrom<String>, so you can
convert &str and String into UserData easily.
-Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
+Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
In DNS discovery services, the user-defined data is stored in a TXT record character string,
which has a max length of 255 bytes. We need to subtract the user-data= prefix,
which leaves 245 bytes for the actual user-defined data.
-Trait Implementations§
Trait Implementations§
Source§impl Ord for UserData
Source§impl PartialOrd for UserData
Source§impl Eq for UserData
Source§impl StructuralPartialEq for UserData
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html b/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html
index e1419ba359..d9845f9f06 100644
--- a/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html
+++ b/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html
@@ -34,4 +34,4 @@ work.
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 MdnsAddressLookup
Available on crate feature address-lookup-mdns only. Source§impl AddressLookup for MemoryLookup
Source§impl AddressLookup for DhtAddressLookup
Available on crate feature address-lookup-pkarr-dht only. Source§impl AddressLookup for PkarrPublisher
Source§impl AddressLookup for PkarrResolver
Source§impl AddressLookup for ConcurrentAddressLookup
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 MdnsAddressLookup
Available on crate feature address-lookup-mdns only. Source§impl AddressLookup for MemoryLookup
Source§impl AddressLookup for DhtAddressLookup
Available on crate feature address-lookup-pkarr-dht only. Source§impl AddressLookup for PkarrPublisher
Source§impl AddressLookup for PkarrResolver
Source§impl AddressLookup for ConcurrentAddressLookup
Source§impl<T: AddressLookup> AddressLookup for FilteredAddressLookup<T>
\ No newline at end of file
diff --git a/pr/4094/docs/iroh/address_lookup/trait.AddressLookupBuilder.html b/pr/4094/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
index e5994db739..1172cf753c 100644
--- a/pr/4094/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
+++ b/pr/4094/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 MdnsAddressLookupBuilder
Available on crate feature address-lookup-mdns only. Source§impl AddressLookupBuilder for Builder
Available on crate feature address-lookup-pkarr-dht 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 MdnsAddressLookupBuilder
Available on crate feature address-lookup-mdns only. Source§impl AddressLookupBuilder for Builder
Available on crate feature address-lookup-pkarr-dht 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/4094/docs/iroh/endpoint/index.html b/pr/4094/docs/iroh/endpoint/index.html
index 44ba3dde1e..cf50bc05ae 100644
--- a/pr/4094/docs/iroh/endpoint/index.html
+++ b/pr/4094/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/4094/docs/iroh/endpoint_info/index.html b/pr/4094/docs/iroh/endpoint_info/index.html
index 7669854b3d..5b7462ae8b 100644
--- a/pr/4094/docs/iroh/endpoint_info/index.html
+++ b/pr/4094/docs/iroh/endpoint_info/index.html
@@ -1,4 +1,35 @@
-iroh::endpoint_info - Rust Module endpoint_info
Expand description
Re-export of endpoint info types from iroh_dns::endpoint_info.
+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.
+DNS records are published under the following names:
+_iroh.<z32-endpoint-id>.<origin-domain> TXT
+
+-
+
_iroh is the record name as defined by IROH_TXT_NAME.
+
+-
+
<z32-endpoint-id> is the z-base-32 encoding of the EndpointId.
+
+-
+
<origin-domain> is the domain name of the publishing DNS server,
+N0_DNS_ENDPOINT_ORIGIN_PROD is the server operated by number0 for production.
+N0_DNS_ENDPOINT_ORIGIN_STAGING is the server operated by number0 for testing.
+
+-
+
TXT is the DNS record type.
+
+
+The returned TXT records must contain a string value of the form key=value as defined
+in RFC1464. The following attributes are defined:
+
+-
+
relay=<url>: The home RelayUrl of this endpoint.
+
+-
+
addr=<addr> <addr>: A space-separated list of sockets addresses for this iroh endpoint.
+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.
Enums§
Constants§
- IROH_
TXT_NAME - The DNS name for the iroh TXT record.
Traits§
- Endpoint
IdExt - Extension methods for
EndpointId to encode to and decode from z-base-32,
which is the encoding used by pkarr domain names.
\ No newline at end of file
diff --git a/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html b/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html
index 06bcf5d106..6d1ea05b51 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html
@@ -1,4 +1,4 @@
-AddrFilter in iroh::endpoint_info - Rust AddrFilter
pub struct AddrFilter(/* private fields */);
Expand description
A filter and/or reordering function applied to transport addresses,
+
AddrFilter in iroh::endpoint_info - Rust AddrFilter
pub struct AddrFilter(/* private fields */);
Expand description
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
@@ -6,17 +6,17 @@ the output order). A BTreeSet cannot preserve a custom order, so th
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.
-Implementations§
Source§impl AddrFilter
Implementations§
Source§impl AddrFilter
Sourcepub fn new(
f: impl Fn(&Vec<TransportAddr>) -> Cow<'_, Vec<TransportAddr>> + Send + Sync + 'static,
) -> AddrFilter
Create a new AddrFilter
-Sourcepub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
-Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
-Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
-Sourcepub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
+Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
+Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
+Sourcepub fn apply<'a>(
&self,
addrs: &'a Vec<TransportAddr>,
) -> Cow<'a, Vec<TransportAddr>>
Apply the address filter function to a set of addresses.
-Trait Implementations§
Source§impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
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 AddrFilter
Source§impl Default for AddrFilter
Source§fn default() -> AddrFilter
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for AddrFilter
§impl !RefUnwindSafe for AddrFilter
§impl Send for AddrFilter
§impl Sync for AddrFilter
§impl Unpin for AddrFilter
§impl !UnwindSafe for AddrFilter
Blanket Implementations§
Trait Implementations§
Source§impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
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 AddrFilter
Source§impl Default for AddrFilter
Source§fn default() -> AddrFilter
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for AddrFilter
§impl !RefUnwindSafe for AddrFilter
§impl Send for AddrFilter
§impl Sync for AddrFilter
§impl Unpin for AddrFilter
§impl !UnwindSafe for AddrFilter
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/4094/docs/iroh/endpoint_info/struct.EndpointData.html b/pr/4094/docs/iroh/endpoint_info/struct.EndpointData.html
index 593fc5cbcb..81e4a676c7 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.EndpointData.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.EndpointData.html
@@ -1,33 +1,33 @@
-EndpointData in iroh::endpoint_info - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
Data about an endpoint that may be published to and resolved from discovery services.
+EndpointData in iroh::endpoint_info - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
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.
-Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
+Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
The address order is preserved, so it can encode priority for address lookup
services, should they not fit into e.g. a single DNS packet otherwise.
If the addresses contain duplicate entries, those entries are removed.
-Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
+Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
Useful for calling on construction after EndpointData::new or EndpointData::from_iter.
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 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 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 filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
+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 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 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 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.
-Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
- T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
Blanket Implementations§
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
+Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
+ T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
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/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html b/pr/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html
index 4c4496b4f1..7e51bbc05b 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html
@@ -1,39 +1,39 @@
-EndpointInfo in iroh::endpoint_info - Rust EndpointInfo
pub struct EndpointInfo {
+EndpointInfo in iroh::endpoint_info - 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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
-Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
-Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
-Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
+Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
+Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
+Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
+Sourcepub fn from_txt_lookup(
domain_name: String,
lookup: impl Iterator<Item = impl Display>,
) -> Result<EndpointInfo, ParseError>
Parses a EndpointInfo from DNS TXT lookup results.
The domain_name is the queried DNS name (e.g. _iroh.<z32>.<origin>).
The lookup iterator yields TXT record values that implement Display.
-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.
-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 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 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§
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 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 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§
§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/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html b/pr/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html
index 239a535780..3279841835 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html
@@ -1,6 +1,6 @@
-MaxLengthExceededError in iroh::endpoint_info - Rust MaxLengthExceededError
pub struct MaxLengthExceededError { /* private fields */ }
Expand description
Error returned when an input value is too long for UserData.
-Implementations§
Source§impl MaxLengthExceededError
Sourcepub fn new() -> MaxLengthExceededError
Creates a new MaxLengthExceededError error.
-Trait Implementations§
Source§impl Debug for MaxLengthExceededError
Source§impl Display for MaxLengthExceededError
Source§impl Error for MaxLengthExceededError
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 StackError for MaxLengthExceededError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<MaxLengthExceededError>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for MaxLengthExceededError
§impl RefUnwindSafe for MaxLengthExceededError
§impl Send for MaxLengthExceededError
§impl Sync for MaxLengthExceededError
§impl Unpin for MaxLengthExceededError
§impl UnwindSafe for MaxLengthExceededError
Blanket Implementations§
Source§impl<T> Any for Twhere
+MaxLengthExceededError in iroh::endpoint_info - Rust MaxLengthExceededError
pub struct MaxLengthExceededError { /* private fields */ }
Expand description
Error returned when an input value is too long for UserData.
+Implementations§
Source§impl MaxLengthExceededError
Sourcepub fn new() -> MaxLengthExceededError
Creates a new MaxLengthExceededError error.
+Trait Implementations§
Source§impl Debug for MaxLengthExceededError
Source§impl Display for MaxLengthExceededError
Source§impl Error for MaxLengthExceededError
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 StackError for MaxLengthExceededError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<MaxLengthExceededError>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for MaxLengthExceededError
§impl RefUnwindSafe for MaxLengthExceededError
§impl Send for MaxLengthExceededError
§impl Sync for MaxLengthExceededError
§impl Unpin for MaxLengthExceededError
§impl UnwindSafe for MaxLengthExceededError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/4094/docs/iroh/endpoint_info/struct.UserData.html b/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
index 7cd4b5e549..8c9ae9c162 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
@@ -1,24 +1,24 @@
-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
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
Iroh does not keep track of or examine the user-defined data.
UserData implements FromStr and TryFrom<String>, so you can
convert &str and String into UserData easily.
-Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
+Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
In DNS discovery services, the user-defined data is stored in a TXT record character string,
which has a max length of 255 bytes. We need to subtract the user-data= prefix,
which leaves 245 bytes for the actual user-defined data.
-Trait Implementations§
Trait Implementations§
Source§impl Ord for UserData
Source§impl PartialOrd for UserData
Source§impl Eq for UserData
Source§impl StructuralPartialEq for UserData
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Trait Implementations§
Source§impl Clone for TransportAddr
Source§fn clone(&self) -> TransportAddr
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 TransportAddr
Source§impl<'de> Deserialize<'de> for TransportAddr
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TransportAddr, <__D as Deserializer<'de>>::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Display for TransportAddr
Source§impl From<Addr> for TransportAddr
Source§impl From<IncomingAddr> for TransportAddr
Source§fn from(addr: IncomingAddr) -> Self
Converts to this type from the input type.Source§impl From<TransportAddrInfo> for TransportAddr
Source§fn from(value: TransportAddrInfo) -> Self
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Display for TransportAddr
Source§impl From<Addr> for TransportAddr
Source§impl From<IncomingAddr> for TransportAddr
Source§fn from(addr: IncomingAddr) -> Self
Converts to this type from the input type.Source§impl From<TransportAddrInfo> for TransportAddr
Source§fn from(value: TransportAddrInfo) -> Self
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl Hash for TransportAddr
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
H: Hasher,
diff --git a/pr/4094/docs/iroh/index.html b/pr/4094/docs/iroh/index.html
index 7142ffa948..1a9ef7c5ab 100644
--- a/pr/4094/docs/iroh/index.html
+++ b/pr/4094/docs/iroh/index.html
@@ -1,4 +1,4 @@
-iroh - Rust Crate iroh
Expand description
PkarrRelayClientBuilder
pub struct PkarrRelayClientBuilder { /* private fields */ }Expand description
A builder for the PkarrRelayClient
Implementations§
Source§impl PkarrRelayClientBuilder
impl PkarrRelayClientBuilder
Sourcepub fn set_dns_resolver(self, dns_resolver: Option<DnsResolver>) -> Self
Available on non-wasm_browser only.
pub fn set_dns_resolver(self, dns_resolver: Option<DnsResolver>) -> Self
wasm_browser only.Passes an optional DNS resolver for the client to use.
+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/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html b/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
index d81b5aa864..79f15aa3e7 100644
--- a/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
+++ b/pr/4094/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 ConcurrentAddressLookup.
-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/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html b/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
index 7c0e4c9b9f..1ae4c18fe9 100644
--- a/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
+++ b/pr/4094/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/4094/docs/iroh/address_lookup/struct.AddrFilter.html b/pr/4094/docs/iroh/address_lookup/struct.AddrFilter.html
index db2443ae90..cdb8d8806e 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.AddrFilter.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.AddrFilter.html
@@ -1,4 +1,4 @@
-AddrFilter in iroh::address_lookup - Rust AddrFilter
pub struct AddrFilter(/* private fields */);
Expand description
A filter and/or reordering function applied to transport addresses,
+
AddrFilter in iroh::address_lookup - Rust AddrFilter
pub struct AddrFilter(/* private fields */);
Expand description
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
@@ -6,17 +6,17 @@ the output order). A BTreeSet cannot preserve a custom order, so th
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.
-Implementations§
Source§impl AddrFilter
Implementations§
Source§impl AddrFilter
Sourcepub fn new(
f: impl Fn(&Vec<TransportAddr>) -> Cow<'_, Vec<TransportAddr>> + Send + Sync + 'static,
) -> AddrFilter
Create a new AddrFilter
-Sourcepub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
-Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
-Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
-Sourcepub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
+Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
+Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
+Sourcepub fn apply<'a>(
&self,
addrs: &'a Vec<TransportAddr>,
) -> Cow<'a, Vec<TransportAddr>>
Apply the address filter function to a set of addresses.
-Trait Implementations§
Source§impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
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 AddrFilter
Source§impl Default for AddrFilter
Source§fn default() -> AddrFilter
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for AddrFilter
§impl !RefUnwindSafe for AddrFilter
§impl Send for AddrFilter
§impl Sync for AddrFilter
§impl Unpin for AddrFilter
§impl !UnwindSafe for AddrFilter
Blanket Implementations§
Trait Implementations§
Source§impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
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 AddrFilter
Source§impl Default for AddrFilter
Source§fn default() -> AddrFilter
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for AddrFilter
§impl !RefUnwindSafe for AddrFilter
§impl Send for AddrFilter
§impl Sync for AddrFilter
§impl Unpin for AddrFilter
§impl !UnwindSafe for AddrFilter
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/4094/docs/iroh/address_lookup/struct.EndpointData.html b/pr/4094/docs/iroh/address_lookup/struct.EndpointData.html
index bd1d6bbff0..38dc1a6616 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.EndpointData.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.EndpointData.html
@@ -1,33 +1,33 @@
-EndpointData in iroh::address_lookup - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
Data about an endpoint that may be published to and resolved from discovery services.
+EndpointData in iroh::address_lookup - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
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.
-Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
+Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
The address order is preserved, so it can encode priority for address lookup
services, should they not fit into e.g. a single DNS packet otherwise.
If the addresses contain duplicate entries, those entries are removed.
-Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
+Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
Useful for calling on construction after EndpointData::new or EndpointData::from_iter.
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 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 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 filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
+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 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 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 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.
-Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
- T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
Blanket Implementations§
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
+Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
+ T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
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/4094/docs/iroh/address_lookup/struct.EndpointInfo.html b/pr/4094/docs/iroh/address_lookup/struct.EndpointInfo.html
index a90f52320c..a1e30abf2f 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.EndpointInfo.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.EndpointInfo.html
@@ -1,39 +1,39 @@
-EndpointInfo in iroh::address_lookup - Rust EndpointInfo
pub 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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
-Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
-Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
-Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
+Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
+Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
+Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
+Sourcepub fn from_txt_lookup(
domain_name: String,
lookup: impl Iterator<Item = impl Display>,
) -> Result<EndpointInfo, ParseError>
Parses a EndpointInfo from DNS TXT lookup results.
The domain_name is the queried DNS name (e.g. _iroh.<z32>.<origin>).
The lookup iterator yields TXT record values that implement Display.
-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.
-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 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 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§
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 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 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§
§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/4094/docs/iroh/address_lookup/struct.Item.html b/pr/4094/docs/iroh/address_lookup/struct.Item.html
index 490927cf36..037465cb99 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.Item.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.Item.html
@@ -19,14 +19,14 @@ this item.
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.
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 filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
+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 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.
+Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
Trait Implementations§
Source§impl From<Item> for EndpointInfo
Source§impl Eq for Item
Source§impl StructuralPartialEq for Item
Auto Trait Implementations§
§impl Freeze for Item
§impl RefUnwindSafe for Item
§impl Send for Item
§impl Sync for Item
§impl Unpin for Item
§impl UnwindSafe for Item
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/4094/docs/iroh/address_lookup/struct.UserData.html b/pr/4094/docs/iroh/address_lookup/struct.UserData.html
index 68cc7e5b57..fa58d0aef9 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.UserData.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.UserData.html
@@ -1,24 +1,24 @@
-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
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
Iroh does not keep track of or examine the user-defined data.
UserData implements FromStr and TryFrom<String>, so you can
convert &str and String into UserData easily.
-Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
+Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
In DNS discovery services, the user-defined data is stored in a TXT record character string,
which has a max length of 255 bytes. We need to subtract the user-data= prefix,
which leaves 245 bytes for the actual user-defined data.
-Trait Implementations§
Trait Implementations§
Source§impl Ord for UserData
Source§impl PartialOrd for UserData
Source§impl Eq for UserData
Source§impl StructuralPartialEq for UserData
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html b/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html
index e1419ba359..d9845f9f06 100644
--- a/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html
+++ b/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html
@@ -34,4 +34,4 @@ work.
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 MdnsAddressLookup
Available on crate feature address-lookup-mdns only. Source§impl AddressLookup for MemoryLookup
Source§impl AddressLookup for DhtAddressLookup
Available on crate feature address-lookup-pkarr-dht only. Source§impl AddressLookup for PkarrPublisher
Source§impl AddressLookup for PkarrResolver
Source§impl AddressLookup for ConcurrentAddressLookup
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 MdnsAddressLookup
Available on crate feature address-lookup-mdns only. Source§impl AddressLookup for MemoryLookup
Source§impl AddressLookup for DhtAddressLookup
Available on crate feature address-lookup-pkarr-dht only. Source§impl AddressLookup for PkarrPublisher
Source§impl AddressLookup for PkarrResolver
Source§impl AddressLookup for ConcurrentAddressLookup
Source§impl<T: AddressLookup> AddressLookup for FilteredAddressLookup<T>
\ No newline at end of file
diff --git a/pr/4094/docs/iroh/address_lookup/trait.AddressLookupBuilder.html b/pr/4094/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
index e5994db739..1172cf753c 100644
--- a/pr/4094/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
+++ b/pr/4094/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 MdnsAddressLookupBuilder
Available on crate feature address-lookup-mdns only. Source§impl AddressLookupBuilder for Builder
Available on crate feature address-lookup-pkarr-dht 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 MdnsAddressLookupBuilder
Available on crate feature address-lookup-mdns only. Source§impl AddressLookupBuilder for Builder
Available on crate feature address-lookup-pkarr-dht 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/4094/docs/iroh/endpoint/index.html b/pr/4094/docs/iroh/endpoint/index.html
index 44ba3dde1e..cf50bc05ae 100644
--- a/pr/4094/docs/iroh/endpoint/index.html
+++ b/pr/4094/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/4094/docs/iroh/endpoint_info/index.html b/pr/4094/docs/iroh/endpoint_info/index.html
index 7669854b3d..5b7462ae8b 100644
--- a/pr/4094/docs/iroh/endpoint_info/index.html
+++ b/pr/4094/docs/iroh/endpoint_info/index.html
@@ -1,4 +1,35 @@
-iroh::endpoint_info - Rust Module endpoint_info
Expand description
Re-export of endpoint info types from iroh_dns::endpoint_info.
+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.
+DNS records are published under the following names:
+_iroh.<z32-endpoint-id>.<origin-domain> TXT
+
+-
+
_iroh is the record name as defined by IROH_TXT_NAME.
+
+-
+
<z32-endpoint-id> is the z-base-32 encoding of the EndpointId.
+
+-
+
<origin-domain> is the domain name of the publishing DNS server,
+N0_DNS_ENDPOINT_ORIGIN_PROD is the server operated by number0 for production.
+N0_DNS_ENDPOINT_ORIGIN_STAGING is the server operated by number0 for testing.
+
+-
+
TXT is the DNS record type.
+
+
+The returned TXT records must contain a string value of the form key=value as defined
+in RFC1464. The following attributes are defined:
+
+-
+
relay=<url>: The home RelayUrl of this endpoint.
+
+-
+
addr=<addr> <addr>: A space-separated list of sockets addresses for this iroh endpoint.
+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.
Enums§
Constants§
- IROH_
TXT_NAME - The DNS name for the iroh TXT record.
Traits§
- Endpoint
IdExt - Extension methods for
EndpointId to encode to and decode from z-base-32,
which is the encoding used by pkarr domain names.
\ No newline at end of file
diff --git a/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html b/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html
index 06bcf5d106..6d1ea05b51 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html
@@ -1,4 +1,4 @@
-AddrFilter in iroh::endpoint_info - Rust AddrFilter
pub struct AddrFilter(/* private fields */);
Expand description
A filter and/or reordering function applied to transport addresses,
+
AddrFilter in iroh::endpoint_info - Rust AddrFilter
pub struct AddrFilter(/* private fields */);
Expand description
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
@@ -6,17 +6,17 @@ the output order). A BTreeSet cannot preserve a custom order, so th
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.
-Implementations§
Source§impl AddrFilter
Implementations§
Source§impl AddrFilter
Sourcepub fn new(
f: impl Fn(&Vec<TransportAddr>) -> Cow<'_, Vec<TransportAddr>> + Send + Sync + 'static,
) -> AddrFilter
Create a new AddrFilter
-Sourcepub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
-Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
-Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
-Sourcepub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
+Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
+Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
+Sourcepub fn apply<'a>(
&self,
addrs: &'a Vec<TransportAddr>,
) -> Cow<'a, Vec<TransportAddr>>
Apply the address filter function to a set of addresses.
-Trait Implementations§
Source§impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
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 AddrFilter
Source§impl Default for AddrFilter
Source§fn default() -> AddrFilter
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for AddrFilter
§impl !RefUnwindSafe for AddrFilter
§impl Send for AddrFilter
§impl Sync for AddrFilter
§impl Unpin for AddrFilter
§impl !UnwindSafe for AddrFilter
Blanket Implementations§
Trait Implementations§
Source§impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
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 AddrFilter
Source§impl Default for AddrFilter
Source§fn default() -> AddrFilter
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for AddrFilter
§impl !RefUnwindSafe for AddrFilter
§impl Send for AddrFilter
§impl Sync for AddrFilter
§impl Unpin for AddrFilter
§impl !UnwindSafe for AddrFilter
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/4094/docs/iroh/endpoint_info/struct.EndpointData.html b/pr/4094/docs/iroh/endpoint_info/struct.EndpointData.html
index 593fc5cbcb..81e4a676c7 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.EndpointData.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.EndpointData.html
@@ -1,33 +1,33 @@
-EndpointData in iroh::endpoint_info - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
Data about an endpoint that may be published to and resolved from discovery services.
+EndpointData in iroh::endpoint_info - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
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.
-Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
+Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
The address order is preserved, so it can encode priority for address lookup
services, should they not fit into e.g. a single DNS packet otherwise.
If the addresses contain duplicate entries, those entries are removed.
-Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
+Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
Useful for calling on construction after EndpointData::new or EndpointData::from_iter.
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 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 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 filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
+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 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 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 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.
-Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
- T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
Blanket Implementations§
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
+Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
+ T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
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/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html b/pr/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html
index 4c4496b4f1..7e51bbc05b 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html
@@ -1,39 +1,39 @@
-EndpointInfo in iroh::endpoint_info - Rust EndpointInfo
pub struct EndpointInfo {
+EndpointInfo in iroh::endpoint_info - 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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
-Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
-Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
-Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
+Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
+Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
+Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
+Sourcepub fn from_txt_lookup(
domain_name: String,
lookup: impl Iterator<Item = impl Display>,
) -> Result<EndpointInfo, ParseError>
Parses a EndpointInfo from DNS TXT lookup results.
The domain_name is the queried DNS name (e.g. _iroh.<z32>.<origin>).
The lookup iterator yields TXT record values that implement Display.
-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.
-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 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 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§
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 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 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§
§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/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html b/pr/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html
index 239a535780..3279841835 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html
@@ -1,6 +1,6 @@
-MaxLengthExceededError in iroh::endpoint_info - Rust MaxLengthExceededError
pub struct MaxLengthExceededError { /* private fields */ }
Expand description
Error returned when an input value is too long for UserData.
-Implementations§
Source§impl MaxLengthExceededError
Sourcepub fn new() -> MaxLengthExceededError
Creates a new MaxLengthExceededError error.
-Trait Implementations§
Source§impl Debug for MaxLengthExceededError
Source§impl Display for MaxLengthExceededError
Source§impl Error for MaxLengthExceededError
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 StackError for MaxLengthExceededError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<MaxLengthExceededError>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for MaxLengthExceededError
§impl RefUnwindSafe for MaxLengthExceededError
§impl Send for MaxLengthExceededError
§impl Sync for MaxLengthExceededError
§impl Unpin for MaxLengthExceededError
§impl UnwindSafe for MaxLengthExceededError
Blanket Implementations§
Source§impl<T> Any for Twhere
+MaxLengthExceededError in iroh::endpoint_info - Rust MaxLengthExceededError
pub struct MaxLengthExceededError { /* private fields */ }
Expand description
Error returned when an input value is too long for UserData.
+Implementations§
Source§impl MaxLengthExceededError
Sourcepub fn new() -> MaxLengthExceededError
Creates a new MaxLengthExceededError error.
+Trait Implementations§
Source§impl Debug for MaxLengthExceededError
Source§impl Display for MaxLengthExceededError
Source§impl Error for MaxLengthExceededError
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 StackError for MaxLengthExceededError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<MaxLengthExceededError>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for MaxLengthExceededError
§impl RefUnwindSafe for MaxLengthExceededError
§impl Send for MaxLengthExceededError
§impl Sync for MaxLengthExceededError
§impl Unpin for MaxLengthExceededError
§impl UnwindSafe for MaxLengthExceededError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/4094/docs/iroh/endpoint_info/struct.UserData.html b/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
index 7cd4b5e549..8c9ae9c162 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
@@ -1,24 +1,24 @@
-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
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
Iroh does not keep track of or examine the user-defined data.
UserData implements FromStr and TryFrom<String>, so you can
convert &str and String into UserData easily.
-Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
+Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
In DNS discovery services, the user-defined data is stored in a TXT record character string,
which has a max length of 255 bytes. We need to subtract the user-data= prefix,
which leaves 245 bytes for the actual user-defined data.
-Trait Implementations§
Trait Implementations§
Source§impl Ord for UserData
Source§impl PartialOrd for UserData
Source§impl Eq for UserData
Source§impl StructuralPartialEq for UserData
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Trait Implementations§
Source§impl Clone for TransportAddr
Source§fn clone(&self) -> TransportAddr
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 TransportAddr
Source§impl<'de> Deserialize<'de> for TransportAddr
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TransportAddr, <__D as Deserializer<'de>>::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Display for TransportAddr
Source§impl From<Addr> for TransportAddr
Source§impl From<IncomingAddr> for TransportAddr
Source§fn from(addr: IncomingAddr) -> Self
Converts to this type from the input type.Source§impl From<TransportAddrInfo> for TransportAddr
Source§fn from(value: TransportAddrInfo) -> Self
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Display for TransportAddr
Source§impl From<Addr> for TransportAddr
Source§impl From<IncomingAddr> for TransportAddr
Source§fn from(addr: IncomingAddr) -> Self
Converts to this type from the input type.Source§impl From<TransportAddrInfo> for TransportAddr
Source§fn from(value: TransportAddrInfo) -> Self
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl Hash for TransportAddr
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
H: Hasher,
diff --git a/pr/4094/docs/iroh/index.html b/pr/4094/docs/iroh/index.html
index 7142ffa948..1a9ef7c5ab 100644
--- a/pr/4094/docs/iroh/index.html
+++ b/pr/4094/docs/iroh/index.html
@@ -1,4 +1,4 @@
-iroh - Rust Crate iroh
Expand description
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 ConcurrentAddressLookup.
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/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html b/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
index 7c0e4c9b9f..1ae4c18fe9 100644
--- a/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
+++ b/pr/4094/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/4094/docs/iroh/address_lookup/struct.AddrFilter.html b/pr/4094/docs/iroh/address_lookup/struct.AddrFilter.html
index db2443ae90..cdb8d8806e 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.AddrFilter.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.AddrFilter.html
@@ -1,4 +1,4 @@
-AddrFilter in iroh::address_lookup - Rust AddrFilter
pub struct AddrFilter(/* private fields */);
Expand description
A filter and/or reordering function applied to transport addresses,
+
AddrFilter in iroh::address_lookup - Rust AddrFilter
pub struct AddrFilter(/* private fields */);
Expand description
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
@@ -6,17 +6,17 @@ the output order). A BTreeSet cannot preserve a custom order, so th
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.
-Implementations§
Source§impl AddrFilter
Implementations§
Source§impl AddrFilter
Sourcepub fn new(
f: impl Fn(&Vec<TransportAddr>) -> Cow<'_, Vec<TransportAddr>> + Send + Sync + 'static,
) -> AddrFilter
Create a new AddrFilter
-Sourcepub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
-Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
-Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
-Sourcepub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
+Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
+Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
+Sourcepub fn apply<'a>(
&self,
addrs: &'a Vec<TransportAddr>,
) -> Cow<'a, Vec<TransportAddr>>
Apply the address filter function to a set of addresses.
-Trait Implementations§
Source§impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
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 AddrFilter
Source§impl Default for AddrFilter
Source§fn default() -> AddrFilter
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for AddrFilter
§impl !RefUnwindSafe for AddrFilter
§impl Send for AddrFilter
§impl Sync for AddrFilter
§impl Unpin for AddrFilter
§impl !UnwindSafe for AddrFilter
Blanket Implementations§
Trait Implementations§
Source§impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
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 AddrFilter
Source§impl Default for AddrFilter
Source§fn default() -> AddrFilter
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for AddrFilter
§impl !RefUnwindSafe for AddrFilter
§impl Send for AddrFilter
§impl Sync for AddrFilter
§impl Unpin for AddrFilter
§impl !UnwindSafe for AddrFilter
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/4094/docs/iroh/address_lookup/struct.EndpointData.html b/pr/4094/docs/iroh/address_lookup/struct.EndpointData.html
index bd1d6bbff0..38dc1a6616 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.EndpointData.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.EndpointData.html
@@ -1,33 +1,33 @@
-EndpointData in iroh::address_lookup - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
Data about an endpoint that may be published to and resolved from discovery services.
+EndpointData in iroh::address_lookup - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
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.
-Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
+Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
The address order is preserved, so it can encode priority for address lookup
services, should they not fit into e.g. a single DNS packet otherwise.
If the addresses contain duplicate entries, those entries are removed.
-Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
+Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
Useful for calling on construction after EndpointData::new or EndpointData::from_iter.
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 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 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 filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
+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 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 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 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.
-Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
- T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
Blanket Implementations§
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
+Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
+ T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
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/4094/docs/iroh/address_lookup/struct.EndpointInfo.html b/pr/4094/docs/iroh/address_lookup/struct.EndpointInfo.html
index a90f52320c..a1e30abf2f 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.EndpointInfo.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.EndpointInfo.html
@@ -1,39 +1,39 @@
-EndpointInfo in iroh::address_lookup - Rust EndpointInfo
pub 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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
-Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
-Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
-Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
+Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
+Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
+Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
+Sourcepub fn from_txt_lookup(
domain_name: String,
lookup: impl Iterator<Item = impl Display>,
) -> Result<EndpointInfo, ParseError>
Parses a EndpointInfo from DNS TXT lookup results.
The domain_name is the queried DNS name (e.g. _iroh.<z32>.<origin>).
The lookup iterator yields TXT record values that implement Display.
-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.
-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 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 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§
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 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 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§
§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/4094/docs/iroh/address_lookup/struct.Item.html b/pr/4094/docs/iroh/address_lookup/struct.Item.html
index 490927cf36..037465cb99 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.Item.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.Item.html
@@ -19,14 +19,14 @@ this item.
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.
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 filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
+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 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.
+Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
Trait Implementations§
Source§impl From<Item> for EndpointInfo
Source§impl Eq for Item
Source§impl StructuralPartialEq for Item
Auto Trait Implementations§
§impl Freeze for Item
§impl RefUnwindSafe for Item
§impl Send for Item
§impl Sync for Item
§impl Unpin for Item
§impl UnwindSafe for Item
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/4094/docs/iroh/address_lookup/struct.UserData.html b/pr/4094/docs/iroh/address_lookup/struct.UserData.html
index 68cc7e5b57..fa58d0aef9 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.UserData.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.UserData.html
@@ -1,24 +1,24 @@
-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
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
Iroh does not keep track of or examine the user-defined data.
UserData implements FromStr and TryFrom<String>, so you can
convert &str and String into UserData easily.
-Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
+Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
In DNS discovery services, the user-defined data is stored in a TXT record character string,
which has a max length of 255 bytes. We need to subtract the user-data= prefix,
which leaves 245 bytes for the actual user-defined data.
-Trait Implementations§
Trait Implementations§
Source§impl Ord for UserData
Source§impl PartialOrd for UserData
Source§impl Eq for UserData
Source§impl StructuralPartialEq for UserData
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html b/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html
index e1419ba359..d9845f9f06 100644
--- a/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html
+++ b/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html
@@ -34,4 +34,4 @@ work.
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 MdnsAddressLookup
Available on crate feature address-lookup-mdns only. Source§impl AddressLookup for MemoryLookup
Source§impl AddressLookup for DhtAddressLookup
Available on crate feature address-lookup-pkarr-dht only. Source§impl AddressLookup for PkarrPublisher
Source§impl AddressLookup for PkarrResolver
Source§impl AddressLookup for ConcurrentAddressLookup
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 MdnsAddressLookup
Available on crate feature address-lookup-mdns only. Source§impl AddressLookup for MemoryLookup
Source§impl AddressLookup for DhtAddressLookup
Available on crate feature address-lookup-pkarr-dht only. Source§impl AddressLookup for PkarrPublisher
Source§impl AddressLookup for PkarrResolver
Source§impl AddressLookup for ConcurrentAddressLookup
Source§impl<T: AddressLookup> AddressLookup for FilteredAddressLookup<T>
\ No newline at end of file
diff --git a/pr/4094/docs/iroh/address_lookup/trait.AddressLookupBuilder.html b/pr/4094/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
index e5994db739..1172cf753c 100644
--- a/pr/4094/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
+++ b/pr/4094/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 MdnsAddressLookupBuilder
Available on crate feature address-lookup-mdns only. Source§impl AddressLookupBuilder for Builder
Available on crate feature address-lookup-pkarr-dht 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 MdnsAddressLookupBuilder
Available on crate feature address-lookup-mdns only. Source§impl AddressLookupBuilder for Builder
Available on crate feature address-lookup-pkarr-dht 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/4094/docs/iroh/endpoint/index.html b/pr/4094/docs/iroh/endpoint/index.html
index 44ba3dde1e..cf50bc05ae 100644
--- a/pr/4094/docs/iroh/endpoint/index.html
+++ b/pr/4094/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/4094/docs/iroh/endpoint_info/index.html b/pr/4094/docs/iroh/endpoint_info/index.html
index 7669854b3d..5b7462ae8b 100644
--- a/pr/4094/docs/iroh/endpoint_info/index.html
+++ b/pr/4094/docs/iroh/endpoint_info/index.html
@@ -1,4 +1,35 @@
-iroh::endpoint_info - Rust Module endpoint_info
Expand description
Re-export of endpoint info types from iroh_dns::endpoint_info.
+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.
+DNS records are published under the following names:
+_iroh.<z32-endpoint-id>.<origin-domain> TXT
+
+-
+
_iroh is the record name as defined by IROH_TXT_NAME.
+
+-
+
<z32-endpoint-id> is the z-base-32 encoding of the EndpointId.
+
+-
+
<origin-domain> is the domain name of the publishing DNS server,
+N0_DNS_ENDPOINT_ORIGIN_PROD is the server operated by number0 for production.
+N0_DNS_ENDPOINT_ORIGIN_STAGING is the server operated by number0 for testing.
+
+-
+
TXT is the DNS record type.
+
+
+The returned TXT records must contain a string value of the form key=value as defined
+in RFC1464. The following attributes are defined:
+
+-
+
relay=<url>: The home RelayUrl of this endpoint.
+
+-
+
addr=<addr> <addr>: A space-separated list of sockets addresses for this iroh endpoint.
+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.
Enums§
Constants§
- IROH_
TXT_NAME - The DNS name for the iroh TXT record.
Traits§
- Endpoint
IdExt - Extension methods for
EndpointId to encode to and decode from z-base-32,
which is the encoding used by pkarr domain names.
\ No newline at end of file
diff --git a/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html b/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html
index 06bcf5d106..6d1ea05b51 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html
@@ -1,4 +1,4 @@
-AddrFilter in iroh::endpoint_info - Rust AddrFilter
pub struct AddrFilter(/* private fields */);
Expand description
A filter and/or reordering function applied to transport addresses,
+
AddrFilter in iroh::endpoint_info - Rust AddrFilter
pub struct AddrFilter(/* private fields */);
Expand description
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
@@ -6,17 +6,17 @@ the output order). A BTreeSet cannot preserve a custom order, so th
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.
-Implementations§
Source§impl AddrFilter
Implementations§
Source§impl AddrFilter
Sourcepub fn new(
f: impl Fn(&Vec<TransportAddr>) -> Cow<'_, Vec<TransportAddr>> + Send + Sync + 'static,
) -> AddrFilter
Create a new AddrFilter
-Sourcepub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
-Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
-Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
-Sourcepub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
+Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
+Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
+Sourcepub fn apply<'a>(
&self,
addrs: &'a Vec<TransportAddr>,
) -> Cow<'a, Vec<TransportAddr>>
Apply the address filter function to a set of addresses.
-Trait Implementations§
Source§impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
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 AddrFilter
Source§impl Default for AddrFilter
Source§fn default() -> AddrFilter
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for AddrFilter
§impl !RefUnwindSafe for AddrFilter
§impl Send for AddrFilter
§impl Sync for AddrFilter
§impl Unpin for AddrFilter
§impl !UnwindSafe for AddrFilter
Blanket Implementations§
Trait Implementations§
Source§impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
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 AddrFilter
Source§impl Default for AddrFilter
Source§fn default() -> AddrFilter
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for AddrFilter
§impl !RefUnwindSafe for AddrFilter
§impl Send for AddrFilter
§impl Sync for AddrFilter
§impl Unpin for AddrFilter
§impl !UnwindSafe for AddrFilter
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/4094/docs/iroh/endpoint_info/struct.EndpointData.html b/pr/4094/docs/iroh/endpoint_info/struct.EndpointData.html
index 593fc5cbcb..81e4a676c7 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.EndpointData.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.EndpointData.html
@@ -1,33 +1,33 @@
-EndpointData in iroh::endpoint_info - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
Data about an endpoint that may be published to and resolved from discovery services.
+EndpointData in iroh::endpoint_info - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
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.
-Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
+Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
The address order is preserved, so it can encode priority for address lookup
services, should they not fit into e.g. a single DNS packet otherwise.
If the addresses contain duplicate entries, those entries are removed.
-Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
+Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
Useful for calling on construction after EndpointData::new or EndpointData::from_iter.
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 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 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 filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
+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 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 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 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.
-Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
- T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
Blanket Implementations§
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
+Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
+ T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
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/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html b/pr/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html
index 4c4496b4f1..7e51bbc05b 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html
@@ -1,39 +1,39 @@
-EndpointInfo in iroh::endpoint_info - Rust EndpointInfo
pub struct EndpointInfo {
+EndpointInfo in iroh::endpoint_info - 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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
-Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
-Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
-Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
+Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
+Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
+Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
+Sourcepub fn from_txt_lookup(
domain_name: String,
lookup: impl Iterator<Item = impl Display>,
) -> Result<EndpointInfo, ParseError>
Parses a EndpointInfo from DNS TXT lookup results.
The domain_name is the queried DNS name (e.g. _iroh.<z32>.<origin>).
The lookup iterator yields TXT record values that implement Display.
-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.
-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 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 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§
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 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 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§
§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/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html b/pr/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html
index 239a535780..3279841835 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html
@@ -1,6 +1,6 @@
-MaxLengthExceededError in iroh::endpoint_info - Rust MaxLengthExceededError
pub struct MaxLengthExceededError { /* private fields */ }
Expand description
Error returned when an input value is too long for UserData.
-Implementations§
Source§impl MaxLengthExceededError
Sourcepub fn new() -> MaxLengthExceededError
Creates a new MaxLengthExceededError error.
-Trait Implementations§
Source§impl Debug for MaxLengthExceededError
Source§impl Display for MaxLengthExceededError
Source§impl Error for MaxLengthExceededError
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 StackError for MaxLengthExceededError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<MaxLengthExceededError>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for MaxLengthExceededError
§impl RefUnwindSafe for MaxLengthExceededError
§impl Send for MaxLengthExceededError
§impl Sync for MaxLengthExceededError
§impl Unpin for MaxLengthExceededError
§impl UnwindSafe for MaxLengthExceededError
Blanket Implementations§
Source§impl<T> Any for Twhere
+MaxLengthExceededError in iroh::endpoint_info - Rust MaxLengthExceededError
pub struct MaxLengthExceededError { /* private fields */ }
Expand description
Error returned when an input value is too long for UserData.
+Implementations§
Source§impl MaxLengthExceededError
Sourcepub fn new() -> MaxLengthExceededError
Creates a new MaxLengthExceededError error.
+Trait Implementations§
Source§impl Debug for MaxLengthExceededError
Source§impl Display for MaxLengthExceededError
Source§impl Error for MaxLengthExceededError
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 StackError for MaxLengthExceededError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<MaxLengthExceededError>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for MaxLengthExceededError
§impl RefUnwindSafe for MaxLengthExceededError
§impl Send for MaxLengthExceededError
§impl Sync for MaxLengthExceededError
§impl Unpin for MaxLengthExceededError
§impl UnwindSafe for MaxLengthExceededError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/4094/docs/iroh/endpoint_info/struct.UserData.html b/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
index 7cd4b5e549..8c9ae9c162 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
@@ -1,24 +1,24 @@
-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
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
Iroh does not keep track of or examine the user-defined data.
UserData implements FromStr and TryFrom<String>, so you can
convert &str and String into UserData easily.
-Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
+Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
In DNS discovery services, the user-defined data is stored in a TXT record character string,
which has a max length of 255 bytes. We need to subtract the user-data= prefix,
which leaves 245 bytes for the actual user-defined data.
-Trait Implementations§
Trait Implementations§
Source§impl Ord for UserData
Source§impl PartialOrd for UserData
Source§impl Eq for UserData
Source§impl StructuralPartialEq for UserData
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Trait Implementations§
Source§impl Clone for TransportAddr
Source§fn clone(&self) -> TransportAddr
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 TransportAddr
Source§impl<'de> Deserialize<'de> for TransportAddr
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TransportAddr, <__D as Deserializer<'de>>::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Display for TransportAddr
Source§impl From<Addr> for TransportAddr
Source§impl From<IncomingAddr> for TransportAddr
Source§fn from(addr: IncomingAddr) -> Self
Converts to this type from the input type.Source§impl From<TransportAddrInfo> for TransportAddr
Source§fn from(value: TransportAddrInfo) -> Self
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Display for TransportAddr
Source§impl From<Addr> for TransportAddr
Source§impl From<IncomingAddr> for TransportAddr
Source§fn from(addr: IncomingAddr) -> Self
Converts to this type from the input type.Source§impl From<TransportAddrInfo> for TransportAddr
Source§fn from(value: TransportAddrInfo) -> Self
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl Hash for TransportAddr
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
H: Hasher,
diff --git a/pr/4094/docs/iroh/index.html b/pr/4094/docs/iroh/index.html
index 7142ffa948..1a9ef7c5ab 100644
--- a/pr/4094/docs/iroh/index.html
+++ b/pr/4094/docs/iroh/index.html
@@ -1,4 +1,4 @@
-iroh - Rust Crate iroh
Expand description
fn into_address_lookup(
self,
_endpoint: &Endpoint,
diff --git a/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html b/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
index 7c0e4c9b9f..1ae4c18fe9 100644
--- a/pr/4094/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
+++ b/pr/4094/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/4094/docs/iroh/address_lookup/struct.AddrFilter.html b/pr/4094/docs/iroh/address_lookup/struct.AddrFilter.html
index db2443ae90..cdb8d8806e 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.AddrFilter.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.AddrFilter.html
@@ -1,4 +1,4 @@
-AddrFilter in iroh::address_lookup - Rust AddrFilter
pub struct AddrFilter(/* private fields */);
Expand description
A filter and/or reordering function applied to transport addresses,
+
AddrFilter in iroh::address_lookup - Rust AddrFilter
pub struct AddrFilter(/* private fields */);
Expand description
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
@@ -6,17 +6,17 @@ the output order). A BTreeSet cannot preserve a custom order, so th
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.
-Implementations§
Source§impl AddrFilter
Implementations§
Source§impl AddrFilter
Sourcepub fn new(
f: impl Fn(&Vec<TransportAddr>) -> Cow<'_, Vec<TransportAddr>> + Send + Sync + 'static,
) -> AddrFilter
Create a new AddrFilter
-Sourcepub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
-Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
-Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
-Sourcepub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
+Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
+Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
+Sourcepub fn apply<'a>(
&self,
addrs: &'a Vec<TransportAddr>,
) -> Cow<'a, Vec<TransportAddr>>
Apply the address filter function to a set of addresses.
-Trait Implementations§
Source§impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
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 AddrFilter
Source§impl Default for AddrFilter
Source§fn default() -> AddrFilter
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for AddrFilter
§impl !RefUnwindSafe for AddrFilter
§impl Send for AddrFilter
§impl Sync for AddrFilter
§impl Unpin for AddrFilter
§impl !UnwindSafe for AddrFilter
Blanket Implementations§
Trait Implementations§
Source§impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
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 AddrFilter
Source§impl Default for AddrFilter
Source§fn default() -> AddrFilter
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for AddrFilter
§impl !RefUnwindSafe for AddrFilter
§impl Send for AddrFilter
§impl Sync for AddrFilter
§impl Unpin for AddrFilter
§impl !UnwindSafe for AddrFilter
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/4094/docs/iroh/address_lookup/struct.EndpointData.html b/pr/4094/docs/iroh/address_lookup/struct.EndpointData.html
index bd1d6bbff0..38dc1a6616 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.EndpointData.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.EndpointData.html
@@ -1,33 +1,33 @@
-EndpointData in iroh::address_lookup - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
Data about an endpoint that may be published to and resolved from discovery services.
+EndpointData in iroh::address_lookup - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
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.
-Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
+Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
The address order is preserved, so it can encode priority for address lookup
services, should they not fit into e.g. a single DNS packet otherwise.
If the addresses contain duplicate entries, those entries are removed.
-Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
+Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
Useful for calling on construction after EndpointData::new or EndpointData::from_iter.
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 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 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 filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
+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 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 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 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.
-Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
- T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
Blanket Implementations§
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
+Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
+ T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
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/4094/docs/iroh/address_lookup/struct.EndpointInfo.html b/pr/4094/docs/iroh/address_lookup/struct.EndpointInfo.html
index a90f52320c..a1e30abf2f 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.EndpointInfo.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.EndpointInfo.html
@@ -1,39 +1,39 @@
-EndpointInfo in iroh::address_lookup - Rust EndpointInfo
pub 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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
-Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
-Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
-Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
+Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
+Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
+Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
+Sourcepub fn from_txt_lookup(
domain_name: String,
lookup: impl Iterator<Item = impl Display>,
) -> Result<EndpointInfo, ParseError>
Parses a EndpointInfo from DNS TXT lookup results.
The domain_name is the queried DNS name (e.g. _iroh.<z32>.<origin>).
The lookup iterator yields TXT record values that implement Display.
-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.
-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 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 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§
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 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 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§
§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/4094/docs/iroh/address_lookup/struct.Item.html b/pr/4094/docs/iroh/address_lookup/struct.Item.html
index 490927cf36..037465cb99 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.Item.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.Item.html
@@ -19,14 +19,14 @@ this item.
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.
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 filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
+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 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.
+Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
Trait Implementations§
Source§impl From<Item> for EndpointInfo
Source§impl Eq for Item
Source§impl StructuralPartialEq for Item
Auto Trait Implementations§
§impl Freeze for Item
§impl RefUnwindSafe for Item
§impl Send for Item
§impl Sync for Item
§impl Unpin for Item
§impl UnwindSafe for Item
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/4094/docs/iroh/address_lookup/struct.UserData.html b/pr/4094/docs/iroh/address_lookup/struct.UserData.html
index 68cc7e5b57..fa58d0aef9 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.UserData.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.UserData.html
@@ -1,24 +1,24 @@
-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
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
Iroh does not keep track of or examine the user-defined data.
UserData implements FromStr and TryFrom<String>, so you can
convert &str and String into UserData easily.
-Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
+Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
In DNS discovery services, the user-defined data is stored in a TXT record character string,
which has a max length of 255 bytes. We need to subtract the user-data= prefix,
which leaves 245 bytes for the actual user-defined data.
-Trait Implementations§
Trait Implementations§
Source§impl Ord for UserData
Source§impl PartialOrd for UserData
Source§impl Eq for UserData
Source§impl StructuralPartialEq for UserData
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html b/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html
index e1419ba359..d9845f9f06 100644
--- a/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html
+++ b/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html
@@ -34,4 +34,4 @@ work.
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 MdnsAddressLookup
Available on crate feature address-lookup-mdns only. Source§impl AddressLookup for MemoryLookup
Source§impl AddressLookup for DhtAddressLookup
Available on crate feature address-lookup-pkarr-dht only. Source§impl AddressLookup for PkarrPublisher
Source§impl AddressLookup for PkarrResolver
Source§impl AddressLookup for ConcurrentAddressLookup
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 MdnsAddressLookup
Available on crate feature address-lookup-mdns only. Source§impl AddressLookup for MemoryLookup
Source§impl AddressLookup for DhtAddressLookup
Available on crate feature address-lookup-pkarr-dht only. Source§impl AddressLookup for PkarrPublisher
Source§impl AddressLookup for PkarrResolver
Source§impl AddressLookup for ConcurrentAddressLookup
Source§impl<T: AddressLookup> AddressLookup for FilteredAddressLookup<T>
\ No newline at end of file
diff --git a/pr/4094/docs/iroh/address_lookup/trait.AddressLookupBuilder.html b/pr/4094/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
index e5994db739..1172cf753c 100644
--- a/pr/4094/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
+++ b/pr/4094/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 MdnsAddressLookupBuilder
Available on crate feature address-lookup-mdns only. Source§impl AddressLookupBuilder for Builder
Available on crate feature address-lookup-pkarr-dht 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 MdnsAddressLookupBuilder
Available on crate feature address-lookup-mdns only. Source§impl AddressLookupBuilder for Builder
Available on crate feature address-lookup-pkarr-dht 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/4094/docs/iroh/endpoint/index.html b/pr/4094/docs/iroh/endpoint/index.html
index 44ba3dde1e..cf50bc05ae 100644
--- a/pr/4094/docs/iroh/endpoint/index.html
+++ b/pr/4094/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/4094/docs/iroh/endpoint_info/index.html b/pr/4094/docs/iroh/endpoint_info/index.html
index 7669854b3d..5b7462ae8b 100644
--- a/pr/4094/docs/iroh/endpoint_info/index.html
+++ b/pr/4094/docs/iroh/endpoint_info/index.html
@@ -1,4 +1,35 @@
-iroh::endpoint_info - Rust Module endpoint_info
Expand description
Re-export of endpoint info types from iroh_dns::endpoint_info.
+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.
+DNS records are published under the following names:
+_iroh.<z32-endpoint-id>.<origin-domain> TXT
+
+-
+
_iroh is the record name as defined by IROH_TXT_NAME.
+
+-
+
<z32-endpoint-id> is the z-base-32 encoding of the EndpointId.
+
+-
+
<origin-domain> is the domain name of the publishing DNS server,
+N0_DNS_ENDPOINT_ORIGIN_PROD is the server operated by number0 for production.
+N0_DNS_ENDPOINT_ORIGIN_STAGING is the server operated by number0 for testing.
+
+-
+
TXT is the DNS record type.
+
+
+The returned TXT records must contain a string value of the form key=value as defined
+in RFC1464. The following attributes are defined:
+
+-
+
relay=<url>: The home RelayUrl of this endpoint.
+
+-
+
addr=<addr> <addr>: A space-separated list of sockets addresses for this iroh endpoint.
+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.
Enums§
Constants§
- IROH_
TXT_NAME - The DNS name for the iroh TXT record.
Traits§
- Endpoint
IdExt - Extension methods for
EndpointId to encode to and decode from z-base-32,
which is the encoding used by pkarr domain names.
\ No newline at end of file
diff --git a/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html b/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html
index 06bcf5d106..6d1ea05b51 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html
@@ -1,4 +1,4 @@
-AddrFilter in iroh::endpoint_info - Rust AddrFilter
pub struct AddrFilter(/* private fields */);
Expand description
A filter and/or reordering function applied to transport addresses,
+
AddrFilter in iroh::endpoint_info - Rust AddrFilter
pub struct AddrFilter(/* private fields */);
Expand description
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
@@ -6,17 +6,17 @@ the output order). A BTreeSet cannot preserve a custom order, so th
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.
-Implementations§
Source§impl AddrFilter
Implementations§
Source§impl AddrFilter
Sourcepub fn new(
f: impl Fn(&Vec<TransportAddr>) -> Cow<'_, Vec<TransportAddr>> + Send + Sync + 'static,
) -> AddrFilter
Create a new AddrFilter
-Sourcepub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
-Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
-Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
-Sourcepub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
+Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
+Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
+Sourcepub fn apply<'a>(
&self,
addrs: &'a Vec<TransportAddr>,
) -> Cow<'a, Vec<TransportAddr>>
Apply the address filter function to a set of addresses.
-Trait Implementations§
Source§impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
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 AddrFilter
Source§impl Default for AddrFilter
Source§fn default() -> AddrFilter
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for AddrFilter
§impl !RefUnwindSafe for AddrFilter
§impl Send for AddrFilter
§impl Sync for AddrFilter
§impl Unpin for AddrFilter
§impl !UnwindSafe for AddrFilter
Blanket Implementations§
Trait Implementations§
Source§impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
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 AddrFilter
Source§impl Default for AddrFilter
Source§fn default() -> AddrFilter
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for AddrFilter
§impl !RefUnwindSafe for AddrFilter
§impl Send for AddrFilter
§impl Sync for AddrFilter
§impl Unpin for AddrFilter
§impl !UnwindSafe for AddrFilter
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/4094/docs/iroh/endpoint_info/struct.EndpointData.html b/pr/4094/docs/iroh/endpoint_info/struct.EndpointData.html
index 593fc5cbcb..81e4a676c7 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.EndpointData.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.EndpointData.html
@@ -1,33 +1,33 @@
-EndpointData in iroh::endpoint_info - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
Data about an endpoint that may be published to and resolved from discovery services.
+EndpointData in iroh::endpoint_info - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
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.
-Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
+Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
The address order is preserved, so it can encode priority for address lookup
services, should they not fit into e.g. a single DNS packet otherwise.
If the addresses contain duplicate entries, those entries are removed.
-Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
+Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
Useful for calling on construction after EndpointData::new or EndpointData::from_iter.
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 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 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 filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
+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 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 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 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.
-Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
- T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
Blanket Implementations§
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
+Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
+ T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
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/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html b/pr/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html
index 4c4496b4f1..7e51bbc05b 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html
@@ -1,39 +1,39 @@
-EndpointInfo in iroh::endpoint_info - Rust EndpointInfo
pub struct EndpointInfo {
+EndpointInfo in iroh::endpoint_info - 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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
-Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
-Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
-Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
+Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
+Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
+Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
+Sourcepub fn from_txt_lookup(
domain_name: String,
lookup: impl Iterator<Item = impl Display>,
) -> Result<EndpointInfo, ParseError>
Parses a EndpointInfo from DNS TXT lookup results.
The domain_name is the queried DNS name (e.g. _iroh.<z32>.<origin>).
The lookup iterator yields TXT record values that implement Display.
-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.
-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 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 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§
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 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 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§
§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/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html b/pr/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html
index 239a535780..3279841835 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html
@@ -1,6 +1,6 @@
-MaxLengthExceededError in iroh::endpoint_info - Rust MaxLengthExceededError
pub struct MaxLengthExceededError { /* private fields */ }
Expand description
Error returned when an input value is too long for UserData.
-Implementations§
Source§impl MaxLengthExceededError
Sourcepub fn new() -> MaxLengthExceededError
Creates a new MaxLengthExceededError error.
-Trait Implementations§
Source§impl Debug for MaxLengthExceededError
Source§impl Display for MaxLengthExceededError
Source§impl Error for MaxLengthExceededError
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 StackError for MaxLengthExceededError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<MaxLengthExceededError>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for MaxLengthExceededError
§impl RefUnwindSafe for MaxLengthExceededError
§impl Send for MaxLengthExceededError
§impl Sync for MaxLengthExceededError
§impl Unpin for MaxLengthExceededError
§impl UnwindSafe for MaxLengthExceededError
Blanket Implementations§
Source§impl<T> Any for Twhere
+MaxLengthExceededError in iroh::endpoint_info - Rust MaxLengthExceededError
pub struct MaxLengthExceededError { /* private fields */ }
Expand description
Error returned when an input value is too long for UserData.
+Implementations§
Source§impl MaxLengthExceededError
Sourcepub fn new() -> MaxLengthExceededError
Creates a new MaxLengthExceededError error.
+Trait Implementations§
Source§impl Debug for MaxLengthExceededError
Source§impl Display for MaxLengthExceededError
Source§impl Error for MaxLengthExceededError
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 StackError for MaxLengthExceededError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<MaxLengthExceededError>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for MaxLengthExceededError
§impl RefUnwindSafe for MaxLengthExceededError
§impl Send for MaxLengthExceededError
§impl Sync for MaxLengthExceededError
§impl Unpin for MaxLengthExceededError
§impl UnwindSafe for MaxLengthExceededError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/4094/docs/iroh/endpoint_info/struct.UserData.html b/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
index 7cd4b5e549..8c9ae9c162 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
@@ -1,24 +1,24 @@
-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
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
Iroh does not keep track of or examine the user-defined data.
UserData implements FromStr and TryFrom<String>, so you can
convert &str and String into UserData easily.
-Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
+Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
In DNS discovery services, the user-defined data is stored in a TXT record character string,
which has a max length of 255 bytes. We need to subtract the user-data= prefix,
which leaves 245 bytes for the actual user-defined data.
-Trait Implementations§
Trait Implementations§
Source§impl Ord for UserData
Source§impl PartialOrd for UserData
Source§impl Eq for UserData
Source§impl StructuralPartialEq for UserData
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Trait Implementations§
Source§impl Clone for TransportAddr
Source§fn clone(&self) -> TransportAddr
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 TransportAddr
Source§impl<'de> Deserialize<'de> for TransportAddr
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TransportAddr, <__D as Deserializer<'de>>::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Display for TransportAddr
Source§impl From<Addr> for TransportAddr
Source§impl From<IncomingAddr> for TransportAddr
Source§fn from(addr: IncomingAddr) -> Self
Converts to this type from the input type.Source§impl From<TransportAddrInfo> for TransportAddr
Source§fn from(value: TransportAddrInfo) -> Self
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Display for TransportAddr
Source§impl From<Addr> for TransportAddr
Source§impl From<IncomingAddr> for TransportAddr
Source§fn from(addr: IncomingAddr) -> Self
Converts to this type from the input type.Source§impl From<TransportAddrInfo> for TransportAddr
Source§fn from(value: TransportAddrInfo) -> Self
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl Hash for TransportAddr
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
H: Hasher,
diff --git a/pr/4094/docs/iroh/index.html b/pr/4094/docs/iroh/index.html
index 7142ffa948..1a9ef7c5ab 100644
--- a/pr/4094/docs/iroh/index.html
+++ b/pr/4094/docs/iroh/index.html
@@ -1,4 +1,4 @@
-iroh - Rust Crate iroh
Expand description
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/4094/docs/iroh/address_lookup/struct.AddrFilter.html b/pr/4094/docs/iroh/address_lookup/struct.AddrFilter.html
index db2443ae90..cdb8d8806e 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.AddrFilter.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.AddrFilter.html
@@ -1,4 +1,4 @@
-AddrFilter in iroh::address_lookup - Rust AddrFilter
pub struct AddrFilter(/* private fields */);
Expand description
A filter and/or reordering function applied to transport addresses,
+
AddrFilter in iroh::address_lookup - Rust AddrFilter
pub struct AddrFilter(/* private fields */);
Expand description
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
@@ -6,17 +6,17 @@ the output order). A BTreeSet cannot preserve a custom order, so th
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.
-Implementations§
Source§impl AddrFilter
Implementations§
Source§impl AddrFilter
Sourcepub fn new(
f: impl Fn(&Vec<TransportAddr>) -> Cow<'_, Vec<TransportAddr>> + Send + Sync + 'static,
) -> AddrFilter
Create a new AddrFilter
-Sourcepub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
-Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
-Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
-Sourcepub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
+Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
+Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
+Sourcepub fn apply<'a>(
&self,
addrs: &'a Vec<TransportAddr>,
) -> Cow<'a, Vec<TransportAddr>>
Apply the address filter function to a set of addresses.
-Trait Implementations§
Source§impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
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 AddrFilter
Source§impl Default for AddrFilter
Source§fn default() -> AddrFilter
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for AddrFilter
§impl !RefUnwindSafe for AddrFilter
§impl Send for AddrFilter
§impl Sync for AddrFilter
§impl Unpin for AddrFilter
§impl !UnwindSafe for AddrFilter
Blanket Implementations§
Trait Implementations§
Source§impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
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 AddrFilter
Source§impl Default for AddrFilter
Source§fn default() -> AddrFilter
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for AddrFilter
§impl !RefUnwindSafe for AddrFilter
§impl Send for AddrFilter
§impl Sync for AddrFilter
§impl Unpin for AddrFilter
§impl !UnwindSafe for AddrFilter
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/4094/docs/iroh/address_lookup/struct.EndpointData.html b/pr/4094/docs/iroh/address_lookup/struct.EndpointData.html
index bd1d6bbff0..38dc1a6616 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.EndpointData.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.EndpointData.html
@@ -1,33 +1,33 @@
-EndpointData in iroh::address_lookup - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
Data about an endpoint that may be published to and resolved from discovery services.
+EndpointData in iroh::address_lookup - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
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.
-Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
+Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
The address order is preserved, so it can encode priority for address lookup
services, should they not fit into e.g. a single DNS packet otherwise.
If the addresses contain duplicate entries, those entries are removed.
-Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
+Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
Useful for calling on construction after EndpointData::new or EndpointData::from_iter.
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 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 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 filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
+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 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 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 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.
-Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
- T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
Blanket Implementations§
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
+Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
+ T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
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/4094/docs/iroh/address_lookup/struct.EndpointInfo.html b/pr/4094/docs/iroh/address_lookup/struct.EndpointInfo.html
index a90f52320c..a1e30abf2f 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.EndpointInfo.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.EndpointInfo.html
@@ -1,39 +1,39 @@
-EndpointInfo in iroh::address_lookup - Rust EndpointInfo
pub 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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
-Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
-Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
-Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
+Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
+Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
+Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
+Sourcepub fn from_txt_lookup(
domain_name: String,
lookup: impl Iterator<Item = impl Display>,
) -> Result<EndpointInfo, ParseError>
Parses a EndpointInfo from DNS TXT lookup results.
The domain_name is the queried DNS name (e.g. _iroh.<z32>.<origin>).
The lookup iterator yields TXT record values that implement Display.
-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.
-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 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 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§
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 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 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§
§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/4094/docs/iroh/address_lookup/struct.Item.html b/pr/4094/docs/iroh/address_lookup/struct.Item.html
index 490927cf36..037465cb99 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.Item.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.Item.html
@@ -19,14 +19,14 @@ this item.
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.
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 filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
+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 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.
+Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
Trait Implementations§
Source§impl From<Item> for EndpointInfo
Source§impl Eq for Item
Source§impl StructuralPartialEq for Item
Auto Trait Implementations§
§impl Freeze for Item
§impl RefUnwindSafe for Item
§impl Send for Item
§impl Sync for Item
§impl Unpin for Item
§impl UnwindSafe for Item
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/4094/docs/iroh/address_lookup/struct.UserData.html b/pr/4094/docs/iroh/address_lookup/struct.UserData.html
index 68cc7e5b57..fa58d0aef9 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.UserData.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.UserData.html
@@ -1,24 +1,24 @@
-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
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
Iroh does not keep track of or examine the user-defined data.
UserData implements FromStr and TryFrom<String>, so you can
convert &str and String into UserData easily.
-Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
+Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
In DNS discovery services, the user-defined data is stored in a TXT record character string,
which has a max length of 255 bytes. We need to subtract the user-data= prefix,
which leaves 245 bytes for the actual user-defined data.
-Trait Implementations§
Trait Implementations§
Source§impl Ord for UserData
Source§impl PartialOrd for UserData
Source§impl Eq for UserData
Source§impl StructuralPartialEq for UserData
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html b/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html
index e1419ba359..d9845f9f06 100644
--- a/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html
+++ b/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html
@@ -34,4 +34,4 @@ work.
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 MdnsAddressLookup
Available on crate feature address-lookup-mdns only. Source§impl AddressLookup for MemoryLookup
Source§impl AddressLookup for DhtAddressLookup
Available on crate feature address-lookup-pkarr-dht only. Source§impl AddressLookup for PkarrPublisher
Source§impl AddressLookup for PkarrResolver
Source§impl AddressLookup for ConcurrentAddressLookup
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 MdnsAddressLookup
Available on crate feature address-lookup-mdns only. Source§impl AddressLookup for MemoryLookup
Source§impl AddressLookup for DhtAddressLookup
Available on crate feature address-lookup-pkarr-dht only. Source§impl AddressLookup for PkarrPublisher
Source§impl AddressLookup for PkarrResolver
Source§impl AddressLookup for ConcurrentAddressLookup
Source§impl<T: AddressLookup> AddressLookup for FilteredAddressLookup<T>
\ No newline at end of file
diff --git a/pr/4094/docs/iroh/address_lookup/trait.AddressLookupBuilder.html b/pr/4094/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
index e5994db739..1172cf753c 100644
--- a/pr/4094/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
+++ b/pr/4094/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 MdnsAddressLookupBuilder
Available on crate feature address-lookup-mdns only. Source§impl AddressLookupBuilder for Builder
Available on crate feature address-lookup-pkarr-dht 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 MdnsAddressLookupBuilder
Available on crate feature address-lookup-mdns only. Source§impl AddressLookupBuilder for Builder
Available on crate feature address-lookup-pkarr-dht 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/4094/docs/iroh/endpoint/index.html b/pr/4094/docs/iroh/endpoint/index.html
index 44ba3dde1e..cf50bc05ae 100644
--- a/pr/4094/docs/iroh/endpoint/index.html
+++ b/pr/4094/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/4094/docs/iroh/endpoint_info/index.html b/pr/4094/docs/iroh/endpoint_info/index.html
index 7669854b3d..5b7462ae8b 100644
--- a/pr/4094/docs/iroh/endpoint_info/index.html
+++ b/pr/4094/docs/iroh/endpoint_info/index.html
@@ -1,4 +1,35 @@
-iroh::endpoint_info - Rust Module endpoint_info
Expand description
Re-export of endpoint info types from iroh_dns::endpoint_info.
+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.
+DNS records are published under the following names:
+_iroh.<z32-endpoint-id>.<origin-domain> TXT
+
+-
+
_iroh is the record name as defined by IROH_TXT_NAME.
+
+-
+
<z32-endpoint-id> is the z-base-32 encoding of the EndpointId.
+
+-
+
<origin-domain> is the domain name of the publishing DNS server,
+N0_DNS_ENDPOINT_ORIGIN_PROD is the server operated by number0 for production.
+N0_DNS_ENDPOINT_ORIGIN_STAGING is the server operated by number0 for testing.
+
+-
+
TXT is the DNS record type.
+
+
+The returned TXT records must contain a string value of the form key=value as defined
+in RFC1464. The following attributes are defined:
+
+-
+
relay=<url>: The home RelayUrl of this endpoint.
+
+-
+
addr=<addr> <addr>: A space-separated list of sockets addresses for this iroh endpoint.
+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.
Enums§
Constants§
- IROH_
TXT_NAME - The DNS name for the iroh TXT record.
Traits§
- Endpoint
IdExt - Extension methods for
EndpointId to encode to and decode from z-base-32,
which is the encoding used by pkarr domain names.
\ No newline at end of file
diff --git a/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html b/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html
index 06bcf5d106..6d1ea05b51 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html
@@ -1,4 +1,4 @@
-AddrFilter in iroh::endpoint_info - Rust AddrFilter
pub struct AddrFilter(/* private fields */);
Expand description
A filter and/or reordering function applied to transport addresses,
+
AddrFilter in iroh::endpoint_info - Rust AddrFilter
pub struct AddrFilter(/* private fields */);
Expand description
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
@@ -6,17 +6,17 @@ the output order). A BTreeSet cannot preserve a custom order, so th
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.
-Implementations§
Source§impl AddrFilter
Implementations§
Source§impl AddrFilter
Sourcepub fn new(
f: impl Fn(&Vec<TransportAddr>) -> Cow<'_, Vec<TransportAddr>> + Send + Sync + 'static,
) -> AddrFilter
Create a new AddrFilter
-Sourcepub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
-Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
-Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
-Sourcepub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
+Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
+Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
+Sourcepub fn apply<'a>(
&self,
addrs: &'a Vec<TransportAddr>,
) -> Cow<'a, Vec<TransportAddr>>
Apply the address filter function to a set of addresses.
-Trait Implementations§
Source§impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
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 AddrFilter
Source§impl Default for AddrFilter
Source§fn default() -> AddrFilter
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for AddrFilter
§impl !RefUnwindSafe for AddrFilter
§impl Send for AddrFilter
§impl Sync for AddrFilter
§impl Unpin for AddrFilter
§impl !UnwindSafe for AddrFilter
Blanket Implementations§
Trait Implementations§
Source§impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
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 AddrFilter
Source§impl Default for AddrFilter
Source§fn default() -> AddrFilter
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for AddrFilter
§impl !RefUnwindSafe for AddrFilter
§impl Send for AddrFilter
§impl Sync for AddrFilter
§impl Unpin for AddrFilter
§impl !UnwindSafe for AddrFilter
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/4094/docs/iroh/endpoint_info/struct.EndpointData.html b/pr/4094/docs/iroh/endpoint_info/struct.EndpointData.html
index 593fc5cbcb..81e4a676c7 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.EndpointData.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.EndpointData.html
@@ -1,33 +1,33 @@
-EndpointData in iroh::endpoint_info - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
Data about an endpoint that may be published to and resolved from discovery services.
+EndpointData in iroh::endpoint_info - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
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.
-Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
+Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
The address order is preserved, so it can encode priority for address lookup
services, should they not fit into e.g. a single DNS packet otherwise.
If the addresses contain duplicate entries, those entries are removed.
-Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
+Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
Useful for calling on construction after EndpointData::new or EndpointData::from_iter.
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 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 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 filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
+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 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 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 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.
-Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
- T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
Blanket Implementations§
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
+Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
+ T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
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/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html b/pr/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html
index 4c4496b4f1..7e51bbc05b 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html
@@ -1,39 +1,39 @@
-EndpointInfo in iroh::endpoint_info - Rust EndpointInfo
pub struct EndpointInfo {
+EndpointInfo in iroh::endpoint_info - 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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
-Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
-Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
-Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
+Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
+Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
+Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
+Sourcepub fn from_txt_lookup(
domain_name: String,
lookup: impl Iterator<Item = impl Display>,
) -> Result<EndpointInfo, ParseError>
Parses a EndpointInfo from DNS TXT lookup results.
The domain_name is the queried DNS name (e.g. _iroh.<z32>.<origin>).
The lookup iterator yields TXT record values that implement Display.
-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.
-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 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 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§
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 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 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§
§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/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html b/pr/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html
index 239a535780..3279841835 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html
@@ -1,6 +1,6 @@
-MaxLengthExceededError in iroh::endpoint_info - Rust MaxLengthExceededError
pub struct MaxLengthExceededError { /* private fields */ }
Expand description
Error returned when an input value is too long for UserData.
-Implementations§
Source§impl MaxLengthExceededError
Sourcepub fn new() -> MaxLengthExceededError
Creates a new MaxLengthExceededError error.
-Trait Implementations§
Source§impl Debug for MaxLengthExceededError
Source§impl Display for MaxLengthExceededError
Source§impl Error for MaxLengthExceededError
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 StackError for MaxLengthExceededError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<MaxLengthExceededError>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for MaxLengthExceededError
§impl RefUnwindSafe for MaxLengthExceededError
§impl Send for MaxLengthExceededError
§impl Sync for MaxLengthExceededError
§impl Unpin for MaxLengthExceededError
§impl UnwindSafe for MaxLengthExceededError
Blanket Implementations§
Source§impl<T> Any for Twhere
+MaxLengthExceededError in iroh::endpoint_info - Rust MaxLengthExceededError
pub struct MaxLengthExceededError { /* private fields */ }
Expand description
Error returned when an input value is too long for UserData.
+Implementations§
Source§impl MaxLengthExceededError
Sourcepub fn new() -> MaxLengthExceededError
Creates a new MaxLengthExceededError error.
+Trait Implementations§
Source§impl Debug for MaxLengthExceededError
Source§impl Display for MaxLengthExceededError
Source§impl Error for MaxLengthExceededError
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 StackError for MaxLengthExceededError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<MaxLengthExceededError>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for MaxLengthExceededError
§impl RefUnwindSafe for MaxLengthExceededError
§impl Send for MaxLengthExceededError
§impl Sync for MaxLengthExceededError
§impl Unpin for MaxLengthExceededError
§impl UnwindSafe for MaxLengthExceededError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/4094/docs/iroh/endpoint_info/struct.UserData.html b/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
index 7cd4b5e549..8c9ae9c162 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
@@ -1,24 +1,24 @@
-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
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
Iroh does not keep track of or examine the user-defined data.
UserData implements FromStr and TryFrom<String>, so you can
convert &str and String into UserData easily.
-Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
+Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
In DNS discovery services, the user-defined data is stored in a TXT record character string,
which has a max length of 255 bytes. We need to subtract the user-data= prefix,
which leaves 245 bytes for the actual user-defined data.
-Trait Implementations§
Trait Implementations§
Source§impl Ord for UserData
Source§impl PartialOrd for UserData
Source§impl Eq for UserData
Source§impl StructuralPartialEq for UserData
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Trait Implementations§
Source§impl Clone for TransportAddr
Source§fn clone(&self) -> TransportAddr
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 TransportAddr
Source§impl<'de> Deserialize<'de> for TransportAddr
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TransportAddr, <__D as Deserializer<'de>>::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Display for TransportAddr
Source§impl From<Addr> for TransportAddr
Source§impl From<IncomingAddr> for TransportAddr
Source§fn from(addr: IncomingAddr) -> Self
Converts to this type from the input type.Source§impl From<TransportAddrInfo> for TransportAddr
Source§fn from(value: TransportAddrInfo) -> Self
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Display for TransportAddr
Source§impl From<Addr> for TransportAddr
Source§impl From<IncomingAddr> for TransportAddr
Source§fn from(addr: IncomingAddr) -> Self
Converts to this type from the input type.Source§impl From<TransportAddrInfo> for TransportAddr
Source§fn from(value: TransportAddrInfo) -> Self
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl Hash for TransportAddr
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
H: Hasher,
diff --git a/pr/4094/docs/iroh/index.html b/pr/4094/docs/iroh/index.html
index 7142ffa948..1a9ef7c5ab 100644
--- a/pr/4094/docs/iroh/index.html
+++ b/pr/4094/docs/iroh/index.html
@@ -1,4 +1,4 @@
-iroh - Rust Crate iroh
Expand description
AddrFilter
pub struct AddrFilter(/* private fields */);Expand description
A filter and/or reordering function applied to transport addresses, +
AddrFilter
pub struct AddrFilter(/* private fields */);Expand description
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
@@ -6,17 +6,17 @@ the output order). A BTreeSet cannot preserve a custom order, so th
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.
-Implementations§
Source§impl AddrFilter
impl AddrFilter
Implementations§
Source§impl AddrFilter
impl AddrFilter
Sourcepub fn new(
f: impl Fn(&Vec<TransportAddr>) -> Cow<'_, Vec<TransportAddr>> + Send + Sync + 'static,
) -> AddrFilter
pub fn new( f: impl Fn(&Vec<TransportAddr>) -> Cow<'_, Vec<TransportAddr>> + Send + Sync + 'static, ) -> AddrFilter
Create a new AddrFilter
Sourcepub fn unfiltered() -> AddrFilter
pub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
-Sourcepub fn relay_only() -> AddrFilter
pub fn relay_only() -> AddrFilter
Only keep relay addresses.
-Sourcepub fn ip_only() -> AddrFilter
pub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
-Sourcepub fn unfiltered() -> AddrFilter
pub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
+Sourcepub fn relay_only() -> AddrFilter
pub fn relay_only() -> AddrFilter
Only keep relay addresses.
+Sourcepub fn ip_only() -> AddrFilter
pub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
+Sourcepub fn apply<'a>(
&self,
addrs: &'a Vec<TransportAddr>,
) -> Cow<'a, Vec<TransportAddr>>
pub fn apply<'a>( &self, addrs: &'a Vec<TransportAddr>, ) -> Cow<'a, Vec<TransportAddr>>
Apply the address filter function to a set of addresses.
-Trait Implementations§
Source§impl Clone for AddrFilter
impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
fn clone(&self) -> AddrFilter
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AddrFilter
impl Debug for AddrFilter
Source§impl Default for AddrFilter
impl Default for AddrFilter
Source§fn default() -> AddrFilter
fn default() -> AddrFilter
Auto Trait Implementations§
impl Freeze for AddrFilter
impl !RefUnwindSafe for AddrFilter
impl Send for AddrFilter
impl Sync for AddrFilter
impl Unpin for AddrFilter
impl !UnwindSafe for AddrFilter
Blanket Implementations§
Trait Implementations§
Source§impl Clone for AddrFilter
impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
fn clone(&self) -> AddrFilter
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AddrFilter
impl Debug for AddrFilter
Source§impl Default for AddrFilter
impl Default for AddrFilter
Source§fn default() -> AddrFilter
fn default() -> AddrFilter
Auto Trait Implementations§
impl Freeze for AddrFilter
impl !RefUnwindSafe for AddrFilter
impl Send for AddrFilter
impl Sync for AddrFilter
impl Unpin for AddrFilter
impl !UnwindSafe for AddrFilter
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/4094/docs/iroh/address_lookup/struct.EndpointData.html b/pr/4094/docs/iroh/address_lookup/struct.EndpointData.html
index bd1d6bbff0..38dc1a6616 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.EndpointData.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.EndpointData.html
@@ -1,33 +1,33 @@
-EndpointData in iroh::address_lookup - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
Data about an endpoint that may be published to and resolved from discovery services.
+EndpointData in iroh::address_lookup - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
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.
-Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
+Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
The address order is preserved, so it can encode priority for address lookup
services, should they not fit into e.g. a single DNS packet otherwise.
If the addresses contain duplicate entries, those entries are removed.
-Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
+Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
Useful for calling on construction after EndpointData::new or EndpointData::from_iter.
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 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 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 filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
+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 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 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 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.
-Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
- T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
Blanket Implementations§
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
+Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
+ T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
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/4094/docs/iroh/address_lookup/struct.EndpointInfo.html b/pr/4094/docs/iroh/address_lookup/struct.EndpointInfo.html
index a90f52320c..a1e30abf2f 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.EndpointInfo.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.EndpointInfo.html
@@ -1,39 +1,39 @@
-EndpointInfo in iroh::address_lookup - Rust EndpointInfo
pub 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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
-Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
-Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
-Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
+Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
+Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
+Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
+Sourcepub fn from_txt_lookup(
domain_name: String,
lookup: impl Iterator<Item = impl Display>,
) -> Result<EndpointInfo, ParseError>
Parses a EndpointInfo from DNS TXT lookup results.
The domain_name is the queried DNS name (e.g. _iroh.<z32>.<origin>).
The lookup iterator yields TXT record values that implement Display.
-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.
-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 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 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§
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 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 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§
§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/4094/docs/iroh/address_lookup/struct.Item.html b/pr/4094/docs/iroh/address_lookup/struct.Item.html
index 490927cf36..037465cb99 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.Item.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.Item.html
@@ -19,14 +19,14 @@ this item.
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.
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 filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
+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 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.
+Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
Trait Implementations§
Source§impl From<Item> for EndpointInfo
Source§impl Eq for Item
Source§impl StructuralPartialEq for Item
Auto Trait Implementations§
§impl Freeze for Item
§impl RefUnwindSafe for Item
§impl Send for Item
§impl Sync for Item
§impl Unpin for Item
§impl UnwindSafe for Item
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/4094/docs/iroh/address_lookup/struct.UserData.html b/pr/4094/docs/iroh/address_lookup/struct.UserData.html
index 68cc7e5b57..fa58d0aef9 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.UserData.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.UserData.html
@@ -1,24 +1,24 @@
-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
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
Iroh does not keep track of or examine the user-defined data.
UserData implements FromStr and TryFrom<String>, so you can
convert &str and String into UserData easily.
-Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
+Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
In DNS discovery services, the user-defined data is stored in a TXT record character string,
which has a max length of 255 bytes. We need to subtract the user-data= prefix,
which leaves 245 bytes for the actual user-defined data.
-Trait Implementations§
Trait Implementations§
Source§impl Ord for UserData
Source§impl PartialOrd for UserData
Source§impl Eq for UserData
Source§impl StructuralPartialEq for UserData
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html b/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html
index e1419ba359..d9845f9f06 100644
--- a/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html
+++ b/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html
@@ -34,4 +34,4 @@ work.
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 MdnsAddressLookup
Available on crate feature address-lookup-mdns only. Source§impl AddressLookup for MemoryLookup
Source§impl AddressLookup for DhtAddressLookup
Available on crate feature address-lookup-pkarr-dht only. Source§impl AddressLookup for PkarrPublisher
Source§impl AddressLookup for PkarrResolver
Source§impl AddressLookup for ConcurrentAddressLookup
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 MdnsAddressLookup
Available on crate feature address-lookup-mdns only. Source§impl AddressLookup for MemoryLookup
Source§impl AddressLookup for DhtAddressLookup
Available on crate feature address-lookup-pkarr-dht only. Source§impl AddressLookup for PkarrPublisher
Source§impl AddressLookup for PkarrResolver
Source§impl AddressLookup for ConcurrentAddressLookup
Source§impl<T: AddressLookup> AddressLookup for FilteredAddressLookup<T>
\ No newline at end of file
diff --git a/pr/4094/docs/iroh/address_lookup/trait.AddressLookupBuilder.html b/pr/4094/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
index e5994db739..1172cf753c 100644
--- a/pr/4094/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
+++ b/pr/4094/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 MdnsAddressLookupBuilder
Available on crate feature address-lookup-mdns only. Source§impl AddressLookupBuilder for Builder
Available on crate feature address-lookup-pkarr-dht 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 MdnsAddressLookupBuilder
Available on crate feature address-lookup-mdns only. Source§impl AddressLookupBuilder for Builder
Available on crate feature address-lookup-pkarr-dht 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/4094/docs/iroh/endpoint/index.html b/pr/4094/docs/iroh/endpoint/index.html
index 44ba3dde1e..cf50bc05ae 100644
--- a/pr/4094/docs/iroh/endpoint/index.html
+++ b/pr/4094/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/4094/docs/iroh/endpoint_info/index.html b/pr/4094/docs/iroh/endpoint_info/index.html
index 7669854b3d..5b7462ae8b 100644
--- a/pr/4094/docs/iroh/endpoint_info/index.html
+++ b/pr/4094/docs/iroh/endpoint_info/index.html
@@ -1,4 +1,35 @@
-iroh::endpoint_info - Rust Module endpoint_info
Expand description
Re-export of endpoint info types from iroh_dns::endpoint_info.
+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.
+DNS records are published under the following names:
+_iroh.<z32-endpoint-id>.<origin-domain> TXT
+
+-
+
_iroh is the record name as defined by IROH_TXT_NAME.
+
+-
+
<z32-endpoint-id> is the z-base-32 encoding of the EndpointId.
+
+-
+
<origin-domain> is the domain name of the publishing DNS server,
+N0_DNS_ENDPOINT_ORIGIN_PROD is the server operated by number0 for production.
+N0_DNS_ENDPOINT_ORIGIN_STAGING is the server operated by number0 for testing.
+
+-
+
TXT is the DNS record type.
+
+
+The returned TXT records must contain a string value of the form key=value as defined
+in RFC1464. The following attributes are defined:
+
+-
+
relay=<url>: The home RelayUrl of this endpoint.
+
+-
+
addr=<addr> <addr>: A space-separated list of sockets addresses for this iroh endpoint.
+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.
Enums§
Constants§
- IROH_
TXT_NAME - The DNS name for the iroh TXT record.
Traits§
- Endpoint
IdExt - Extension methods for
EndpointId to encode to and decode from z-base-32,
which is the encoding used by pkarr domain names.
\ No newline at end of file
diff --git a/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html b/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html
index 06bcf5d106..6d1ea05b51 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html
@@ -1,4 +1,4 @@
-AddrFilter in iroh::endpoint_info - Rust AddrFilter
pub struct AddrFilter(/* private fields */);
Expand description
A filter and/or reordering function applied to transport addresses,
+
AddrFilter in iroh::endpoint_info - Rust AddrFilter
pub struct AddrFilter(/* private fields */);
Expand description
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
@@ -6,17 +6,17 @@ the output order). A BTreeSet cannot preserve a custom order, so th
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.
-Implementations§
Source§impl AddrFilter
Implementations§
Source§impl AddrFilter
Sourcepub fn new(
f: impl Fn(&Vec<TransportAddr>) -> Cow<'_, Vec<TransportAddr>> + Send + Sync + 'static,
) -> AddrFilter
Create a new AddrFilter
-Sourcepub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
-Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
-Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
-Sourcepub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
+Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
+Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
+Sourcepub fn apply<'a>(
&self,
addrs: &'a Vec<TransportAddr>,
) -> Cow<'a, Vec<TransportAddr>>
Apply the address filter function to a set of addresses.
-Trait Implementations§
Source§impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
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 AddrFilter
Source§impl Default for AddrFilter
Source§fn default() -> AddrFilter
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for AddrFilter
§impl !RefUnwindSafe for AddrFilter
§impl Send for AddrFilter
§impl Sync for AddrFilter
§impl Unpin for AddrFilter
§impl !UnwindSafe for AddrFilter
Blanket Implementations§
Trait Implementations§
Source§impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
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 AddrFilter
Source§impl Default for AddrFilter
Source§fn default() -> AddrFilter
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for AddrFilter
§impl !RefUnwindSafe for AddrFilter
§impl Send for AddrFilter
§impl Sync for AddrFilter
§impl Unpin for AddrFilter
§impl !UnwindSafe for AddrFilter
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/4094/docs/iroh/endpoint_info/struct.EndpointData.html b/pr/4094/docs/iroh/endpoint_info/struct.EndpointData.html
index 593fc5cbcb..81e4a676c7 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.EndpointData.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.EndpointData.html
@@ -1,33 +1,33 @@
-EndpointData in iroh::endpoint_info - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
Data about an endpoint that may be published to and resolved from discovery services.
+EndpointData in iroh::endpoint_info - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
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.
-Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
+Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
The address order is preserved, so it can encode priority for address lookup
services, should they not fit into e.g. a single DNS packet otherwise.
If the addresses contain duplicate entries, those entries are removed.
-Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
+Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
Useful for calling on construction after EndpointData::new or EndpointData::from_iter.
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 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 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 filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
+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 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 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 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.
-Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
- T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
Blanket Implementations§
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
+Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
+ T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
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/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html b/pr/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html
index 4c4496b4f1..7e51bbc05b 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html
@@ -1,39 +1,39 @@
-EndpointInfo in iroh::endpoint_info - Rust EndpointInfo
pub struct EndpointInfo {
+EndpointInfo in iroh::endpoint_info - 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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
-Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
-Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
-Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
+Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
+Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
+Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
+Sourcepub fn from_txt_lookup(
domain_name: String,
lookup: impl Iterator<Item = impl Display>,
) -> Result<EndpointInfo, ParseError>
Parses a EndpointInfo from DNS TXT lookup results.
The domain_name is the queried DNS name (e.g. _iroh.<z32>.<origin>).
The lookup iterator yields TXT record values that implement Display.
-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.
-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 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 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§
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 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 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§
§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/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html b/pr/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html
index 239a535780..3279841835 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html
@@ -1,6 +1,6 @@
-MaxLengthExceededError in iroh::endpoint_info - Rust MaxLengthExceededError
pub struct MaxLengthExceededError { /* private fields */ }
Expand description
Error returned when an input value is too long for UserData.
-Implementations§
Source§impl MaxLengthExceededError
Sourcepub fn new() -> MaxLengthExceededError
Creates a new MaxLengthExceededError error.
-Trait Implementations§
Source§impl Debug for MaxLengthExceededError
Source§impl Display for MaxLengthExceededError
Source§impl Error for MaxLengthExceededError
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 StackError for MaxLengthExceededError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<MaxLengthExceededError>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for MaxLengthExceededError
§impl RefUnwindSafe for MaxLengthExceededError
§impl Send for MaxLengthExceededError
§impl Sync for MaxLengthExceededError
§impl Unpin for MaxLengthExceededError
§impl UnwindSafe for MaxLengthExceededError
Blanket Implementations§
Source§impl<T> Any for Twhere
+MaxLengthExceededError in iroh::endpoint_info - Rust MaxLengthExceededError
pub struct MaxLengthExceededError { /* private fields */ }
Expand description
Error returned when an input value is too long for UserData.
+Implementations§
Source§impl MaxLengthExceededError
Sourcepub fn new() -> MaxLengthExceededError
Creates a new MaxLengthExceededError error.
+Trait Implementations§
Source§impl Debug for MaxLengthExceededError
Source§impl Display for MaxLengthExceededError
Source§impl Error for MaxLengthExceededError
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 StackError for MaxLengthExceededError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<MaxLengthExceededError>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for MaxLengthExceededError
§impl RefUnwindSafe for MaxLengthExceededError
§impl Send for MaxLengthExceededError
§impl Sync for MaxLengthExceededError
§impl Unpin for MaxLengthExceededError
§impl UnwindSafe for MaxLengthExceededError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/4094/docs/iroh/endpoint_info/struct.UserData.html b/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
index 7cd4b5e549..8c9ae9c162 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
@@ -1,24 +1,24 @@
-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
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
Iroh does not keep track of or examine the user-defined data.
UserData implements FromStr and TryFrom<String>, so you can
convert &str and String into UserData easily.
-Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
+Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
In DNS discovery services, the user-defined data is stored in a TXT record character string,
which has a max length of 255 bytes. We need to subtract the user-data= prefix,
which leaves 245 bytes for the actual user-defined data.
-Trait Implementations§
Trait Implementations§
Source§impl Ord for UserData
Source§impl PartialOrd for UserData
Source§impl Eq for UserData
Source§impl StructuralPartialEq for UserData
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Trait Implementations§
Source§impl Clone for TransportAddr
Source§fn clone(&self) -> TransportAddr
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 TransportAddr
Source§impl<'de> Deserialize<'de> for TransportAddr
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TransportAddr, <__D as Deserializer<'de>>::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Display for TransportAddr
Source§impl From<Addr> for TransportAddr
Source§impl From<IncomingAddr> for TransportAddr
Source§fn from(addr: IncomingAddr) -> Self
Converts to this type from the input type.Source§impl From<TransportAddrInfo> for TransportAddr
Source§fn from(value: TransportAddrInfo) -> Self
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Display for TransportAddr
Source§impl From<Addr> for TransportAddr
Source§impl From<IncomingAddr> for TransportAddr
Source§fn from(addr: IncomingAddr) -> Self
Converts to this type from the input type.Source§impl From<TransportAddrInfo> for TransportAddr
Source§fn from(value: TransportAddrInfo) -> Self
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl Hash for TransportAddr
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
H: Hasher,
diff --git a/pr/4094/docs/iroh/index.html b/pr/4094/docs/iroh/index.html
index 7142ffa948..1a9ef7c5ab 100644
--- a/pr/4094/docs/iroh/index.html
+++ b/pr/4094/docs/iroh/index.html
@@ -1,4 +1,4 @@
-iroh - Rust Crate iroh
Expand description
EndpointData
pub struct EndpointData { /* private fields */ }Expand description
Data about an endpoint that may be published to and resolved from discovery services.
+EndpointData
pub struct EndpointData { /* private fields */ }Expand description
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.
Implementations§
Source§impl EndpointData
impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
pub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
Implementations§
Source§impl EndpointData
impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
pub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
The address order is preserved, so it can encode priority for address lookup services, should they not fit into e.g. a single DNS packet otherwise.
If the addresses contain duplicate entries, those entries are removed.
-Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
pub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
+Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
pub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
Useful for calling on construction after EndpointData::new or EndpointData::from_iter.
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 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 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 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.
+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 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 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 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.
Trait Implementations§
Source§impl Clone for EndpointData
impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
fn clone(&self) -> EndpointData
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EndpointData
impl Debug for EndpointData
Source§impl Default for EndpointData
impl Default for EndpointData
Source§fn default() -> EndpointData
fn default() -> EndpointData
Source§impl From<BTreeSet<SocketAddr>> for EndpointData
impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Source§impl From<BTreeSet<TransportAddr>> for EndpointData
impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Source§impl From<EndpointAddr> for EndpointData
impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
fn from(endpoint_addr: EndpointAddr) -> EndpointData
Source§impl FromIterator<TransportAddr> for EndpointData
impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
- T: IntoIterator<Item = TransportAddr>,
fn from_iter<T>(iter: T) -> EndpointDatawhere
- T: IntoIterator<Item = TransportAddr>,
Source§impl PartialEq for EndpointData
impl PartialEq for EndpointData
impl Eq for EndpointData
impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
impl Freeze for EndpointData
impl RefUnwindSafe for EndpointData
impl Send for EndpointData
impl Sync for EndpointData
impl Unpin for EndpointData
impl UnwindSafe for EndpointData
Blanket Implementations§
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.
Trait Implementations§
Source§impl Clone for EndpointData
impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
fn clone(&self) -> EndpointData
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EndpointData
impl Debug for EndpointData
Source§impl Default for EndpointData
impl Default for EndpointData
Source§fn default() -> EndpointData
fn default() -> EndpointData
Source§impl From<BTreeSet<SocketAddr>> for EndpointData
impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Source§impl From<BTreeSet<TransportAddr>> for EndpointData
impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Source§impl From<EndpointAddr> for EndpointData
impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
fn from(endpoint_addr: EndpointAddr) -> EndpointData
Source§impl FromIterator<TransportAddr> for EndpointData
impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
+ T: IntoIterator<Item = TransportAddr>,
fn from_iter<T>(iter: T) -> EndpointDatawhere
+ T: IntoIterator<Item = TransportAddr>,
Source§impl PartialEq for EndpointData
impl PartialEq for EndpointData
impl Eq for EndpointData
impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
impl Freeze for EndpointData
impl RefUnwindSafe for EndpointData
impl Send for EndpointData
impl Sync for EndpointData
impl Unpin for EndpointData
impl UnwindSafe for EndpointData
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/4094/docs/iroh/address_lookup/struct.EndpointInfo.html b/pr/4094/docs/iroh/address_lookup/struct.EndpointInfo.html
index a90f52320c..a1e30abf2f 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.EndpointInfo.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.EndpointInfo.html
@@ -1,39 +1,39 @@
-EndpointInfo in iroh::address_lookup - Rust EndpointInfo
pub 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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
-Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
-Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
-Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
+Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
+Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
+Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
+Sourcepub fn from_txt_lookup(
domain_name: String,
lookup: impl Iterator<Item = impl Display>,
) -> Result<EndpointInfo, ParseError>
Parses a EndpointInfo from DNS TXT lookup results.
The domain_name is the queried DNS name (e.g. _iroh.<z32>.<origin>).
The lookup iterator yields TXT record values that implement Display.
-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.
-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 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 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§
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 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 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§
§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/4094/docs/iroh/address_lookup/struct.Item.html b/pr/4094/docs/iroh/address_lookup/struct.Item.html
index 490927cf36..037465cb99 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.Item.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.Item.html
@@ -19,14 +19,14 @@ this item.
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.
EndpointInfo
pub 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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
-Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
-Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
-Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
+Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
+Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
+Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
+Sourcepub fn from_txt_lookup(
domain_name: String,
lookup: impl Iterator<Item = impl Display>,
) -> Result<EndpointInfo, ParseError>
Parses a EndpointInfo from DNS TXT lookup results.
The domain_name is the queried DNS name (e.g. _iroh.<z32>.<origin>).
The lookup iterator yields TXT record values that implement Display.
-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.
-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 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 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§
Trait Implementations§
Source§impl Clone for EndpointInfo
impl Clone for EndpointInfo
Source§fn clone(&self) -> EndpointInfo
fn clone(&self) -> EndpointInfo
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EndpointInfo
impl Debug for EndpointInfo
Source§impl From<EndpointAddr> for EndpointInfo
impl From<EndpointAddr> for EndpointInfo
Source§fn from(addr: EndpointAddr) -> EndpointInfo
fn from(addr: EndpointAddr) -> EndpointInfo
Source§impl From<EndpointInfo> for EndpointAddr
impl From<EndpointInfo> for EndpointAddr
Source§fn from(value: EndpointInfo) -> EndpointAddr
fn from(value: EndpointInfo) -> EndpointAddr
Source§impl From<Item> for EndpointInfo
impl From<Item> for EndpointInfo
Source§impl PartialEq for EndpointInfo
impl PartialEq for EndpointInfo
impl Eq for EndpointInfo
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§
§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/4094/docs/iroh/address_lookup/struct.Item.html b/pr/4094/docs/iroh/address_lookup/struct.Item.html index 490927cf36..037465cb99 100644 --- a/pr/4094/docs/iroh/address_lookup/struct.Item.html +++ b/pr/4094/docs/iroh/address_lookup/struct.Item.html @@ -19,14 +19,14 @@ this item.
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.
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 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.
+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 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 apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
pub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
Trait Implementations§
Source§impl From<Item> for EndpointInfo
impl From<Item> for EndpointInfo
impl Eq for Item
impl StructuralPartialEq for Item
Auto Trait Implementations§
impl Freeze for Item
impl RefUnwindSafe for Item
impl Send for Item
impl Sync for Item
impl Unpin for Item
impl UnwindSafe for Item
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/4094/docs/iroh/address_lookup/struct.UserData.html b/pr/4094/docs/iroh/address_lookup/struct.UserData.html
index 68cc7e5b57..fa58d0aef9 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.UserData.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.UserData.html
@@ -1,24 +1,24 @@
-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
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
Iroh does not keep track of or examine the user-defined data.
UserData implements FromStr and TryFrom<String>, so you can
convert &str and String into UserData easily.
-Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
+Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
In DNS discovery services, the user-defined data is stored in a TXT record character string,
which has a max length of 255 bytes. We need to subtract the user-data= prefix,
which leaves 245 bytes for the actual user-defined data.
-Trait Implementations§
Trait Implementations§
Source§impl Ord for UserData
Source§impl PartialOrd for UserData
Source§impl Eq for UserData
Source§impl StructuralPartialEq for UserData
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html b/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html
index e1419ba359..d9845f9f06 100644
--- a/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html
+++ b/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html
@@ -34,4 +34,4 @@ work.
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 MdnsAddressLookup
Available on crate feature address-lookup-mdns only. Source§impl AddressLookup for MemoryLookup
Source§impl AddressLookup for DhtAddressLookup
Available on crate feature address-lookup-pkarr-dht only. Source§impl AddressLookup for PkarrPublisher
Source§impl AddressLookup for PkarrResolver
Source§impl AddressLookup for ConcurrentAddressLookup
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 MdnsAddressLookup
Available on crate feature address-lookup-mdns only. Source§impl AddressLookup for MemoryLookup
Source§impl AddressLookup for DhtAddressLookup
Available on crate feature address-lookup-pkarr-dht only. Source§impl AddressLookup for PkarrPublisher
Source§impl AddressLookup for PkarrResolver
Source§impl AddressLookup for ConcurrentAddressLookup
Source§impl<T: AddressLookup> AddressLookup for FilteredAddressLookup<T>
\ No newline at end of file
diff --git a/pr/4094/docs/iroh/address_lookup/trait.AddressLookupBuilder.html b/pr/4094/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
index e5994db739..1172cf753c 100644
--- a/pr/4094/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
+++ b/pr/4094/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 MdnsAddressLookupBuilder
Available on crate feature address-lookup-mdns only. Source§impl AddressLookupBuilder for Builder
Available on crate feature address-lookup-pkarr-dht 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 MdnsAddressLookupBuilder
Available on crate feature address-lookup-mdns only. Source§impl AddressLookupBuilder for Builder
Available on crate feature address-lookup-pkarr-dht 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/4094/docs/iroh/endpoint/index.html b/pr/4094/docs/iroh/endpoint/index.html
index 44ba3dde1e..cf50bc05ae 100644
--- a/pr/4094/docs/iroh/endpoint/index.html
+++ b/pr/4094/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/4094/docs/iroh/endpoint_info/index.html b/pr/4094/docs/iroh/endpoint_info/index.html
index 7669854b3d..5b7462ae8b 100644
--- a/pr/4094/docs/iroh/endpoint_info/index.html
+++ b/pr/4094/docs/iroh/endpoint_info/index.html
@@ -1,4 +1,35 @@
-iroh::endpoint_info - Rust Module endpoint_info
Expand description
Re-export of endpoint info types from iroh_dns::endpoint_info.
+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.
+DNS records are published under the following names:
+_iroh.<z32-endpoint-id>.<origin-domain> TXT
+
+-
+
_iroh is the record name as defined by IROH_TXT_NAME.
+
+-
+
<z32-endpoint-id> is the z-base-32 encoding of the EndpointId.
+
+-
+
<origin-domain> is the domain name of the publishing DNS server,
+N0_DNS_ENDPOINT_ORIGIN_PROD is the server operated by number0 for production.
+N0_DNS_ENDPOINT_ORIGIN_STAGING is the server operated by number0 for testing.
+
+-
+
TXT is the DNS record type.
+
+
+The returned TXT records must contain a string value of the form key=value as defined
+in RFC1464. The following attributes are defined:
+
+-
+
relay=<url>: The home RelayUrl of this endpoint.
+
+-
+
addr=<addr> <addr>: A space-separated list of sockets addresses for this iroh endpoint.
+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.
Enums§
Constants§
- IROH_
TXT_NAME - The DNS name for the iroh TXT record.
Traits§
- Endpoint
IdExt - Extension methods for
EndpointId to encode to and decode from z-base-32,
which is the encoding used by pkarr domain names.
\ No newline at end of file
diff --git a/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html b/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html
index 06bcf5d106..6d1ea05b51 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html
@@ -1,4 +1,4 @@
-AddrFilter in iroh::endpoint_info - Rust AddrFilter
pub struct AddrFilter(/* private fields */);
Expand description
A filter and/or reordering function applied to transport addresses,
+
AddrFilter in iroh::endpoint_info - Rust AddrFilter
pub struct AddrFilter(/* private fields */);
Expand description
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
@@ -6,17 +6,17 @@ the output order). A BTreeSet cannot preserve a custom order, so th
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.
-Implementations§
Source§impl AddrFilter
Implementations§
Source§impl AddrFilter
Sourcepub fn new(
f: impl Fn(&Vec<TransportAddr>) -> Cow<'_, Vec<TransportAddr>> + Send + Sync + 'static,
) -> AddrFilter
Create a new AddrFilter
-Sourcepub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
-Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
-Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
-Sourcepub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
+Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
+Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
+Sourcepub fn apply<'a>(
&self,
addrs: &'a Vec<TransportAddr>,
) -> Cow<'a, Vec<TransportAddr>>
Apply the address filter function to a set of addresses.
-Trait Implementations§
Source§impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
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 AddrFilter
Source§impl Default for AddrFilter
Source§fn default() -> AddrFilter
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for AddrFilter
§impl !RefUnwindSafe for AddrFilter
§impl Send for AddrFilter
§impl Sync for AddrFilter
§impl Unpin for AddrFilter
§impl !UnwindSafe for AddrFilter
Blanket Implementations§
Trait Implementations§
Source§impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
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 AddrFilter
Source§impl Default for AddrFilter
Source§fn default() -> AddrFilter
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for AddrFilter
§impl !RefUnwindSafe for AddrFilter
§impl Send for AddrFilter
§impl Sync for AddrFilter
§impl Unpin for AddrFilter
§impl !UnwindSafe for AddrFilter
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/4094/docs/iroh/endpoint_info/struct.EndpointData.html b/pr/4094/docs/iroh/endpoint_info/struct.EndpointData.html
index 593fc5cbcb..81e4a676c7 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.EndpointData.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.EndpointData.html
@@ -1,33 +1,33 @@
-EndpointData in iroh::endpoint_info - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
Data about an endpoint that may be published to and resolved from discovery services.
+EndpointData in iroh::endpoint_info - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
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.
-Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
+Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
The address order is preserved, so it can encode priority for address lookup
services, should they not fit into e.g. a single DNS packet otherwise.
If the addresses contain duplicate entries, those entries are removed.
-Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
+Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
Useful for calling on construction after EndpointData::new or EndpointData::from_iter.
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 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 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 filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
+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 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 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 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.
-Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
- T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
Blanket Implementations§
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
+Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
+ T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
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/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html b/pr/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html
index 4c4496b4f1..7e51bbc05b 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html
@@ -1,39 +1,39 @@
-EndpointInfo in iroh::endpoint_info - Rust EndpointInfo
pub struct EndpointInfo {
+EndpointInfo in iroh::endpoint_info - 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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
-Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
-Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
-Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
+Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
+Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
+Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
+Sourcepub fn from_txt_lookup(
domain_name: String,
lookup: impl Iterator<Item = impl Display>,
) -> Result<EndpointInfo, ParseError>
Parses a EndpointInfo from DNS TXT lookup results.
The domain_name is the queried DNS name (e.g. _iroh.<z32>.<origin>).
The lookup iterator yields TXT record values that implement Display.
-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.
-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 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 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§
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 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 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§
§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/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html b/pr/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html
index 239a535780..3279841835 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html
@@ -1,6 +1,6 @@
-MaxLengthExceededError in iroh::endpoint_info - Rust MaxLengthExceededError
pub struct MaxLengthExceededError { /* private fields */ }
Expand description
Error returned when an input value is too long for UserData.
-Implementations§
Source§impl MaxLengthExceededError
Sourcepub fn new() -> MaxLengthExceededError
Creates a new MaxLengthExceededError error.
-Trait Implementations§
Source§impl Debug for MaxLengthExceededError
Source§impl Display for MaxLengthExceededError
Source§impl Error for MaxLengthExceededError
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 StackError for MaxLengthExceededError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<MaxLengthExceededError>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for MaxLengthExceededError
§impl RefUnwindSafe for MaxLengthExceededError
§impl Send for MaxLengthExceededError
§impl Sync for MaxLengthExceededError
§impl Unpin for MaxLengthExceededError
§impl UnwindSafe for MaxLengthExceededError
Blanket Implementations§
Source§impl<T> Any for Twhere
+MaxLengthExceededError in iroh::endpoint_info - Rust MaxLengthExceededError
pub struct MaxLengthExceededError { /* private fields */ }
Expand description
Error returned when an input value is too long for UserData.
+Implementations§
Source§impl MaxLengthExceededError
Sourcepub fn new() -> MaxLengthExceededError
Creates a new MaxLengthExceededError error.
+Trait Implementations§
Source§impl Debug for MaxLengthExceededError
Source§impl Display for MaxLengthExceededError
Source§impl Error for MaxLengthExceededError
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 StackError for MaxLengthExceededError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<MaxLengthExceededError>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for MaxLengthExceededError
§impl RefUnwindSafe for MaxLengthExceededError
§impl Send for MaxLengthExceededError
§impl Sync for MaxLengthExceededError
§impl Unpin for MaxLengthExceededError
§impl UnwindSafe for MaxLengthExceededError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/4094/docs/iroh/endpoint_info/struct.UserData.html b/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
index 7cd4b5e549..8c9ae9c162 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
@@ -1,24 +1,24 @@
-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
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
Iroh does not keep track of or examine the user-defined data.
UserData implements FromStr and TryFrom<String>, so you can
convert &str and String into UserData easily.
-Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
+Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
In DNS discovery services, the user-defined data is stored in a TXT record character string,
which has a max length of 255 bytes. We need to subtract the user-data= prefix,
which leaves 245 bytes for the actual user-defined data.
-Trait Implementations§
Trait Implementations§
Source§impl Ord for UserData
Source§impl PartialOrd for UserData
Source§impl Eq for UserData
Source§impl StructuralPartialEq for UserData
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Trait Implementations§
Source§impl Clone for TransportAddr
Source§fn clone(&self) -> TransportAddr
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 TransportAddr
Source§impl<'de> Deserialize<'de> for TransportAddr
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TransportAddr, <__D as Deserializer<'de>>::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Display for TransportAddr
Source§impl From<Addr> for TransportAddr
Source§impl From<IncomingAddr> for TransportAddr
Source§fn from(addr: IncomingAddr) -> Self
Converts to this type from the input type.Source§impl From<TransportAddrInfo> for TransportAddr
Source§fn from(value: TransportAddrInfo) -> Self
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Display for TransportAddr
Source§impl From<Addr> for TransportAddr
Source§impl From<IncomingAddr> for TransportAddr
Source§fn from(addr: IncomingAddr) -> Self
Converts to this type from the input type.Source§impl From<TransportAddrInfo> for TransportAddr
Source§fn from(value: TransportAddrInfo) -> Self
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl Hash for TransportAddr
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
H: Hasher,
diff --git a/pr/4094/docs/iroh/index.html b/pr/4094/docs/iroh/index.html
index 7142ffa948..1a9ef7c5ab 100644
--- a/pr/4094/docs/iroh/index.html
+++ b/pr/4094/docs/iroh/index.html
@@ -1,4 +1,4 @@
-iroh - Rust Crate iroh
Expand description
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/4094/docs/iroh/address_lookup/struct.UserData.html b/pr/4094/docs/iroh/address_lookup/struct.UserData.html
index 68cc7e5b57..fa58d0aef9 100644
--- a/pr/4094/docs/iroh/address_lookup/struct.UserData.html
+++ b/pr/4094/docs/iroh/address_lookup/struct.UserData.html
@@ -1,24 +1,24 @@
-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
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
Iroh does not keep track of or examine the user-defined data.
UserData implements FromStr and TryFrom<String>, so you can
convert &str and String into UserData easily.
-Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
+Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
In DNS discovery services, the user-defined data is stored in a TXT record character string,
which has a max length of 255 bytes. We need to subtract the user-data= prefix,
which leaves 245 bytes for the actual user-defined data.
-Trait Implementations§
Trait Implementations§
Source§impl Ord for UserData
Source§impl PartialOrd for UserData
Source§impl Eq for UserData
Source§impl StructuralPartialEq for UserData
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html b/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html
index e1419ba359..d9845f9f06 100644
--- a/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html
+++ b/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html
@@ -34,4 +34,4 @@ work.
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 MdnsAddressLookup
Available on crate feature address-lookup-mdns only. Source§impl AddressLookup for MemoryLookup
Source§impl AddressLookup for DhtAddressLookup
Available on crate feature address-lookup-pkarr-dht only. Source§impl AddressLookup for PkarrPublisher
Source§impl AddressLookup for PkarrResolver
Source§impl AddressLookup for ConcurrentAddressLookup
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 MdnsAddressLookup
Available on crate feature address-lookup-mdns only. Source§impl AddressLookup for MemoryLookup
Source§impl AddressLookup for DhtAddressLookup
Available on crate feature address-lookup-pkarr-dht only. Source§impl AddressLookup for PkarrPublisher
Source§impl AddressLookup for PkarrResolver
Source§impl AddressLookup for ConcurrentAddressLookup
Source§impl<T: AddressLookup> AddressLookup for FilteredAddressLookup<T>
\ No newline at end of file
diff --git a/pr/4094/docs/iroh/address_lookup/trait.AddressLookupBuilder.html b/pr/4094/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
index e5994db739..1172cf753c 100644
--- a/pr/4094/docs/iroh/address_lookup/trait.AddressLookupBuilder.html
+++ b/pr/4094/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 MdnsAddressLookupBuilder
Available on crate feature address-lookup-mdns only. Source§impl AddressLookupBuilder for Builder
Available on crate feature address-lookup-pkarr-dht 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 MdnsAddressLookupBuilder
Available on crate feature address-lookup-mdns only. Source§impl AddressLookupBuilder for Builder
Available on crate feature address-lookup-pkarr-dht 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/4094/docs/iroh/endpoint/index.html b/pr/4094/docs/iroh/endpoint/index.html
index 44ba3dde1e..cf50bc05ae 100644
--- a/pr/4094/docs/iroh/endpoint/index.html
+++ b/pr/4094/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/4094/docs/iroh/endpoint_info/index.html b/pr/4094/docs/iroh/endpoint_info/index.html
index 7669854b3d..5b7462ae8b 100644
--- a/pr/4094/docs/iroh/endpoint_info/index.html
+++ b/pr/4094/docs/iroh/endpoint_info/index.html
@@ -1,4 +1,35 @@
-iroh::endpoint_info - Rust Module endpoint_info
Expand description
Re-export of endpoint info types from iroh_dns::endpoint_info.
+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.
+DNS records are published under the following names:
+_iroh.<z32-endpoint-id>.<origin-domain> TXT
+
+-
+
_iroh is the record name as defined by IROH_TXT_NAME.
+
+-
+
<z32-endpoint-id> is the z-base-32 encoding of the EndpointId.
+
+-
+
<origin-domain> is the domain name of the publishing DNS server,
+N0_DNS_ENDPOINT_ORIGIN_PROD is the server operated by number0 for production.
+N0_DNS_ENDPOINT_ORIGIN_STAGING is the server operated by number0 for testing.
+
+-
+
TXT is the DNS record type.
+
+
+The returned TXT records must contain a string value of the form key=value as defined
+in RFC1464. The following attributes are defined:
+
+-
+
relay=<url>: The home RelayUrl of this endpoint.
+
+-
+
addr=<addr> <addr>: A space-separated list of sockets addresses for this iroh endpoint.
+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.
Enums§
Constants§
- IROH_
TXT_NAME - The DNS name for the iroh TXT record.
Traits§
- Endpoint
IdExt - Extension methods for
EndpointId to encode to and decode from z-base-32,
which is the encoding used by pkarr domain names.
\ No newline at end of file
diff --git a/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html b/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html
index 06bcf5d106..6d1ea05b51 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.AddrFilter.html
@@ -1,4 +1,4 @@
-AddrFilter in iroh::endpoint_info - Rust AddrFilter
pub struct AddrFilter(/* private fields */);
Expand description
A filter and/or reordering function applied to transport addresses,
+
AddrFilter in iroh::endpoint_info - Rust AddrFilter
pub struct AddrFilter(/* private fields */);
Expand description
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
@@ -6,17 +6,17 @@ the output order). A BTreeSet cannot preserve a custom order, so th
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.
-Implementations§
Source§impl AddrFilter
Implementations§
Source§impl AddrFilter
Sourcepub fn new(
f: impl Fn(&Vec<TransportAddr>) -> Cow<'_, Vec<TransportAddr>> + Send + Sync + 'static,
) -> AddrFilter
Create a new AddrFilter
-Sourcepub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
-Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
-Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
-Sourcepub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
+Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
+Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
+Sourcepub fn apply<'a>(
&self,
addrs: &'a Vec<TransportAddr>,
) -> Cow<'a, Vec<TransportAddr>>
Apply the address filter function to a set of addresses.
-Trait Implementations§
Source§impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
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 AddrFilter
Source§impl Default for AddrFilter
Source§fn default() -> AddrFilter
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for AddrFilter
§impl !RefUnwindSafe for AddrFilter
§impl Send for AddrFilter
§impl Sync for AddrFilter
§impl Unpin for AddrFilter
§impl !UnwindSafe for AddrFilter
Blanket Implementations§
Trait Implementations§
Source§impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
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 AddrFilter
Source§impl Default for AddrFilter
Source§fn default() -> AddrFilter
Returns the “default value” for a type. Read moreAuto Trait Implementations§
§impl Freeze for AddrFilter
§impl !RefUnwindSafe for AddrFilter
§impl Send for AddrFilter
§impl Sync for AddrFilter
§impl Unpin for AddrFilter
§impl !UnwindSafe for AddrFilter
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/4094/docs/iroh/endpoint_info/struct.EndpointData.html b/pr/4094/docs/iroh/endpoint_info/struct.EndpointData.html
index 593fc5cbcb..81e4a676c7 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.EndpointData.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.EndpointData.html
@@ -1,33 +1,33 @@
-EndpointData in iroh::endpoint_info - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
Data about an endpoint that may be published to and resolved from discovery services.
+EndpointData in iroh::endpoint_info - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
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.
-Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
+Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
The address order is preserved, so it can encode priority for address lookup
services, should they not fit into e.g. a single DNS packet otherwise.
If the addresses contain duplicate entries, those entries are removed.
-Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
+Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
Useful for calling on construction after EndpointData::new or EndpointData::from_iter.
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 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 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 filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
+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 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 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 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.
-Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
- T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
Blanket Implementations§
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
+Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
+ T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
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/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html b/pr/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html
index 4c4496b4f1..7e51bbc05b 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html
@@ -1,39 +1,39 @@
-EndpointInfo in iroh::endpoint_info - Rust EndpointInfo
pub struct EndpointInfo {
+EndpointInfo in iroh::endpoint_info - 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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
-Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
-Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
-Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
+Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
+Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
+Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
+Sourcepub fn from_txt_lookup(
domain_name: String,
lookup: impl Iterator<Item = impl Display>,
) -> Result<EndpointInfo, ParseError>
Parses a EndpointInfo from DNS TXT lookup results.
The domain_name is the queried DNS name (e.g. _iroh.<z32>.<origin>).
The lookup iterator yields TXT record values that implement Display.
-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.
-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 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 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§
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 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 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§
§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/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html b/pr/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html
index 239a535780..3279841835 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html
@@ -1,6 +1,6 @@
-MaxLengthExceededError in iroh::endpoint_info - Rust MaxLengthExceededError
pub struct MaxLengthExceededError { /* private fields */ }
Expand description
Error returned when an input value is too long for UserData.
-Implementations§
Source§impl MaxLengthExceededError
Sourcepub fn new() -> MaxLengthExceededError
Creates a new MaxLengthExceededError error.
-Trait Implementations§
Source§impl Debug for MaxLengthExceededError
Source§impl Display for MaxLengthExceededError
Source§impl Error for MaxLengthExceededError
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 StackError for MaxLengthExceededError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<MaxLengthExceededError>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for MaxLengthExceededError
§impl RefUnwindSafe for MaxLengthExceededError
§impl Send for MaxLengthExceededError
§impl Sync for MaxLengthExceededError
§impl Unpin for MaxLengthExceededError
§impl UnwindSafe for MaxLengthExceededError
Blanket Implementations§
Source§impl<T> Any for Twhere
+MaxLengthExceededError in iroh::endpoint_info - Rust MaxLengthExceededError
pub struct MaxLengthExceededError { /* private fields */ }
Expand description
Error returned when an input value is too long for UserData.
+Implementations§
Source§impl MaxLengthExceededError
Sourcepub fn new() -> MaxLengthExceededError
Creates a new MaxLengthExceededError error.
+Trait Implementations§
Source§impl Debug for MaxLengthExceededError
Source§impl Display for MaxLengthExceededError
Source§impl Error for MaxLengthExceededError
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 StackError for MaxLengthExceededError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<MaxLengthExceededError>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for MaxLengthExceededError
§impl RefUnwindSafe for MaxLengthExceededError
§impl Send for MaxLengthExceededError
§impl Sync for MaxLengthExceededError
§impl Unpin for MaxLengthExceededError
§impl UnwindSafe for MaxLengthExceededError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/4094/docs/iroh/endpoint_info/struct.UserData.html b/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
index 7cd4b5e549..8c9ae9c162 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
@@ -1,24 +1,24 @@
-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
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
Iroh does not keep track of or examine the user-defined data.
UserData implements FromStr and TryFrom<String>, so you can
convert &str and String into UserData easily.
-Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
+Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
In DNS discovery services, the user-defined data is stored in a TXT record character string,
which has a max length of 255 bytes. We need to subtract the user-data= prefix,
which leaves 245 bytes for the actual user-defined data.
-Trait Implementations§
Trait Implementations§
Source§impl Ord for UserData
Source§impl PartialOrd for UserData
Source§impl Eq for UserData
Source§impl StructuralPartialEq for UserData
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Trait Implementations§
Source§impl Clone for TransportAddr
Source§fn clone(&self) -> TransportAddr
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 TransportAddr
Source§impl<'de> Deserialize<'de> for TransportAddr
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TransportAddr, <__D as Deserializer<'de>>::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Display for TransportAddr
Source§impl From<Addr> for TransportAddr
Source§impl From<IncomingAddr> for TransportAddr
Source§fn from(addr: IncomingAddr) -> Self
Converts to this type from the input type.Source§impl From<TransportAddrInfo> for TransportAddr
Source§fn from(value: TransportAddrInfo) -> Self
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Display for TransportAddr
Source§impl From<Addr> for TransportAddr
Source§impl From<IncomingAddr> for TransportAddr
Source§fn from(addr: IncomingAddr) -> Self
Converts to this type from the input type.Source§impl From<TransportAddrInfo> for TransportAddr
Source§fn from(value: TransportAddrInfo) -> Self
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl Hash for TransportAddr
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
H: Hasher,
diff --git a/pr/4094/docs/iroh/index.html b/pr/4094/docs/iroh/index.html
index 7142ffa948..1a9ef7c5ab 100644
--- a/pr/4094/docs/iroh/index.html
+++ b/pr/4094/docs/iroh/index.html
@@ -1,4 +1,4 @@
-iroh - Rust Crate iroh
Expand description
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
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
Iroh does not keep track of or examine the user-defined data.
UserData implements FromStr and TryFrom<String>, so you can
convert &str and String into UserData easily.
Implementations§
Source§impl UserData
impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
pub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
+Implementations§
Source§impl UserData
impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
pub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
In DNS discovery services, the user-defined data is stored in a TXT record character string,
which has a max length of 255 bytes. We need to subtract the user-data= prefix,
which leaves 245 bytes for the actual user-defined data.
Trait Implementations§
Trait Implementations§
Source§impl Ord for UserData
impl Ord for UserData
Source§impl PartialOrd for UserData
impl PartialOrd for UserData
impl Eq for UserData
impl StructuralPartialEq for UserData
Auto Trait Implementations§
impl Freeze for UserData
impl RefUnwindSafe for UserData
impl Send for UserData
impl Sync for UserData
impl Unpin for UserData
impl UnwindSafe for UserData
Blanket Implementations§
Auto Trait Implementations§
impl Freeze for UserData
impl RefUnwindSafe for UserData
impl Send for UserData
impl Sync for UserData
impl Unpin for UserData
impl UnwindSafe for UserData
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
fn implicit( diff --git a/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html b/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html index e1419ba359..d9845f9f06 100644 --- a/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html +++ b/pr/4094/docs/iroh/address_lookup/trait.AddressLookup.html @@ -34,4 +34,4 @@ work.
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 MdnsAddressLookup
address-lookup-mdns only.impl AddressLookup for MemoryLookup
impl AddressLookup for DhtAddressLookup
address-lookup-pkarr-dht only.impl AddressLookup for PkarrPublisher
impl AddressLookup for PkarrResolver
impl AddressLookup for ConcurrentAddressLookup
impl<T: AddressLookup> AddressLookup for FilteredAddressLookup<T>
Implementors§
impl AddressLookup for DnsAddressLookup
wasm_browser only.impl AddressLookup for MdnsAddressLookup
address-lookup-mdns only.impl AddressLookup for MemoryLookup
impl AddressLookup for DhtAddressLookup
address-lookup-pkarr-dht only.impl AddressLookup for PkarrPublisher
impl AddressLookup for PkarrResolver
impl AddressLookup for ConcurrentAddressLookup
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 MdnsAddressLookupBuilder
address-lookup-mdns only.impl AddressLookupBuilder for Builder
address-lookup-pkarr-dht 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 MdnsAddressLookupBuilder
address-lookup-mdns only.impl AddressLookupBuilder for Builder
address-lookup-pkarr-dht only.impl AddressLookupBuilder for PkarrPublisherBuilder
impl AddressLookupBuilder for PkarrResolverBuilder
impl<T: AddressLookup> AddressLookupBuilder for T
Blanket no-op impl of AddressLookupBuilder for T: AddressLookup.
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.
Module endpoint_info
Expand description
Re-export of endpoint info types from iroh_dns::endpoint_info.
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.
DNS records are published under the following names:
+_iroh.<z32-endpoint-id>.<origin-domain> TXT
-
+
-
+
+_irohis the record name as defined byIROH_TXT_NAME.
+ -
+
+<z32-endpoint-id>is the z-base-32 encoding of theEndpointId.
+ -
+
+<origin-domain>is the domain name of the publishing DNS server, +N0_DNS_ENDPOINT_ORIGIN_PRODis the server operated by number0 for production. +N0_DNS_ENDPOINT_ORIGIN_STAGINGis the server operated by number0 for testing.
+ -
+
+TXTis the DNS record type.
+
The returned TXT records must contain a string value of the form key=value as defined
+in RFC1464. The following attributes are defined:
-
+
-
+
+relay=<url>: The homeRelayUrlof this endpoint.
+ -
+
+addr=<addr> <addr>: A space-separated list of sockets addresses for this iroh endpoint. +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
Exceeded Error - 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_LENGTHbytes.
Enums§
Constants§
- IROH_
TXT_ NAME - The DNS name for the iroh TXT record.
Traits§
- Endpoint
IdExt - Extension methods for
EndpointIdto encode to and decode from z-base-32, which is the encoding used by pkarr domain names.
AddrFilter
pub struct AddrFilter(/* private fields */);Expand description
A filter and/or reordering function applied to transport addresses, +
AddrFilter
pub struct AddrFilter(/* private fields */);Expand description
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
@@ -6,17 +6,17 @@ the output order). A BTreeSet cannot preserve a custom order, so th
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.
-Implementations§
Source§impl AddrFilter
impl AddrFilter
Implementations§
Source§impl AddrFilter
impl AddrFilter
Sourcepub fn new(
f: impl Fn(&Vec<TransportAddr>) -> Cow<'_, Vec<TransportAddr>> + Send + Sync + 'static,
) -> AddrFilter
pub fn new( f: impl Fn(&Vec<TransportAddr>) -> Cow<'_, Vec<TransportAddr>> + Send + Sync + 'static, ) -> AddrFilter
Create a new AddrFilter
Sourcepub fn unfiltered() -> AddrFilter
pub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
-Sourcepub fn relay_only() -> AddrFilter
pub fn relay_only() -> AddrFilter
Only keep relay addresses.
-Sourcepub fn ip_only() -> AddrFilter
pub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
-Sourcepub fn unfiltered() -> AddrFilter
pub fn unfiltered() -> AddrFilter
Constructs a filter that doesn’t filter addresses and passes all through.
+Sourcepub fn relay_only() -> AddrFilter
pub fn relay_only() -> AddrFilter
Only keep relay addresses.
+Sourcepub fn ip_only() -> AddrFilter
pub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
+Sourcepub fn apply<'a>(
&self,
addrs: &'a Vec<TransportAddr>,
) -> Cow<'a, Vec<TransportAddr>>
pub fn apply<'a>( &self, addrs: &'a Vec<TransportAddr>, ) -> Cow<'a, Vec<TransportAddr>>
Apply the address filter function to a set of addresses.
-Trait Implementations§
Source§impl Clone for AddrFilter
impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
fn clone(&self) -> AddrFilter
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AddrFilter
impl Debug for AddrFilter
Source§impl Default for AddrFilter
impl Default for AddrFilter
Source§fn default() -> AddrFilter
fn default() -> AddrFilter
Auto Trait Implementations§
impl Freeze for AddrFilter
impl !RefUnwindSafe for AddrFilter
impl Send for AddrFilter
impl Sync for AddrFilter
impl Unpin for AddrFilter
impl !UnwindSafe for AddrFilter
Blanket Implementations§
Trait Implementations§
Source§impl Clone for AddrFilter
impl Clone for AddrFilter
Source§fn clone(&self) -> AddrFilter
fn clone(&self) -> AddrFilter
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AddrFilter
impl Debug for AddrFilter
Source§impl Default for AddrFilter
impl Default for AddrFilter
Source§fn default() -> AddrFilter
fn default() -> AddrFilter
Auto Trait Implementations§
impl Freeze for AddrFilter
impl !RefUnwindSafe for AddrFilter
impl Send for AddrFilter
impl Sync for AddrFilter
impl Unpin for AddrFilter
impl !UnwindSafe for AddrFilter
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/4094/docs/iroh/endpoint_info/struct.EndpointData.html b/pr/4094/docs/iroh/endpoint_info/struct.EndpointData.html
index 593fc5cbcb..81e4a676c7 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.EndpointData.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.EndpointData.html
@@ -1,33 +1,33 @@
-EndpointData in iroh::endpoint_info - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
Data about an endpoint that may be published to and resolved from discovery services.
+EndpointData in iroh::endpoint_info - Rust EndpointData
pub struct EndpointData { /* private fields */ }
Expand description
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.
-Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
+Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
The address order is preserved, so it can encode priority for address lookup
services, should they not fit into e.g. a single DNS packet otherwise.
If the addresses contain duplicate entries, those entries are removed.
-Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
+Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
Useful for calling on construction after EndpointData::new or EndpointData::from_iter.
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 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 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 filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>
Apply the given filter to the current addresses.
+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 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 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 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.
-Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
- T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
Blanket Implementations§
Sourcepub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>
Returns the EndpointData with given filter applied.
+Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
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 EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Converts to this type from the input type.Source§impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
+ T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl PartialEq for EndpointData
Source§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
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/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html b/pr/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html
index 4c4496b4f1..7e51bbc05b 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html
@@ -1,39 +1,39 @@
-EndpointInfo in iroh::endpoint_info - Rust EndpointInfo
pub struct EndpointInfo {
+EndpointInfo in iroh::endpoint_info - 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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
-Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
-Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
-Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
+Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
+Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
+Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
+Sourcepub fn from_txt_lookup(
domain_name: String,
lookup: impl Iterator<Item = impl Display>,
) -> Result<EndpointInfo, ParseError>
Parses a EndpointInfo from DNS TXT lookup results.
The domain_name is the queried DNS name (e.g. _iroh.<z32>.<origin>).
The lookup iterator yields TXT record values that implement Display.
-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.
-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 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 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§
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 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 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§
§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/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html b/pr/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html
index 239a535780..3279841835 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html
@@ -1,6 +1,6 @@
-MaxLengthExceededError in iroh::endpoint_info - Rust MaxLengthExceededError
pub struct MaxLengthExceededError { /* private fields */ }
Expand description
Error returned when an input value is too long for UserData.
-Implementations§
Source§impl MaxLengthExceededError
Sourcepub fn new() -> MaxLengthExceededError
Creates a new MaxLengthExceededError error.
-Trait Implementations§
Source§impl Debug for MaxLengthExceededError
Source§impl Display for MaxLengthExceededError
Source§impl Error for MaxLengthExceededError
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 StackError for MaxLengthExceededError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<MaxLengthExceededError>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for MaxLengthExceededError
§impl RefUnwindSafe for MaxLengthExceededError
§impl Send for MaxLengthExceededError
§impl Sync for MaxLengthExceededError
§impl Unpin for MaxLengthExceededError
§impl UnwindSafe for MaxLengthExceededError
Blanket Implementations§
Source§impl<T> Any for Twhere
+MaxLengthExceededError in iroh::endpoint_info - Rust MaxLengthExceededError
pub struct MaxLengthExceededError { /* private fields */ }
Expand description
Error returned when an input value is too long for UserData.
+Implementations§
Source§impl MaxLengthExceededError
Sourcepub fn new() -> MaxLengthExceededError
Creates a new MaxLengthExceededError error.
+Trait Implementations§
Source§impl Debug for MaxLengthExceededError
Source§impl Display for MaxLengthExceededError
Source§impl Error for MaxLengthExceededError
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 StackError for MaxLengthExceededError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<MaxLengthExceededError>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for MaxLengthExceededError
§impl RefUnwindSafe for MaxLengthExceededError
§impl Send for MaxLengthExceededError
§impl Sync for MaxLengthExceededError
§impl Unpin for MaxLengthExceededError
§impl UnwindSafe for MaxLengthExceededError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/4094/docs/iroh/endpoint_info/struct.UserData.html b/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
index 7cd4b5e549..8c9ae9c162 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
@@ -1,24 +1,24 @@
-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
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
Iroh does not keep track of or examine the user-defined data.
UserData implements FromStr and TryFrom<String>, so you can
convert &str and String into UserData easily.
-Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
+Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
In DNS discovery services, the user-defined data is stored in a TXT record character string,
which has a max length of 255 bytes. We need to subtract the user-data= prefix,
which leaves 245 bytes for the actual user-defined data.
-Trait Implementations§
Trait Implementations§
Source§impl Ord for UserData
Source§impl PartialOrd for UserData
Source§impl Eq for UserData
Source§impl StructuralPartialEq for UserData
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Trait Implementations§
Source§impl Clone for TransportAddr
Source§fn clone(&self) -> TransportAddr
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 TransportAddr
Source§impl<'de> Deserialize<'de> for TransportAddr
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TransportAddr, <__D as Deserializer<'de>>::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Display for TransportAddr
Source§impl From<Addr> for TransportAddr
Source§impl From<IncomingAddr> for TransportAddr
Source§fn from(addr: IncomingAddr) -> Self
Converts to this type from the input type.Source§impl From<TransportAddrInfo> for TransportAddr
Source§fn from(value: TransportAddrInfo) -> Self
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Display for TransportAddr
Source§impl From<Addr> for TransportAddr
Source§impl From<IncomingAddr> for TransportAddr
Source§fn from(addr: IncomingAddr) -> Self
Converts to this type from the input type.Source§impl From<TransportAddrInfo> for TransportAddr
Source§fn from(value: TransportAddrInfo) -> Self
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl Hash for TransportAddr
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
H: Hasher,
diff --git a/pr/4094/docs/iroh/index.html b/pr/4094/docs/iroh/index.html
index 7142ffa948..1a9ef7c5ab 100644
--- a/pr/4094/docs/iroh/index.html
+++ b/pr/4094/docs/iroh/index.html
@@ -1,4 +1,4 @@
-iroh - Rust Crate iroh
Expand description
EndpointData
pub struct EndpointData { /* private fields */ }Expand description
Data about an endpoint that may be published to and resolved from discovery services.
+EndpointData
pub struct EndpointData { /* private fields */ }Expand description
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.
Implementations§
Source§impl EndpointData
impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
pub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
Implementations§
Source§impl EndpointData
impl EndpointData
Sourcepub fn new(addrs: Vec<TransportAddr>) -> EndpointData
pub fn new(addrs: Vec<TransportAddr>) -> EndpointData
Creates a new EndpointData with given list of transport addresses.
The address order is preserved, so it can encode priority for address lookup services, should they not fit into e.g. a single DNS packet otherwise.
If the addresses contain duplicate entries, those entries are removed.
-Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
pub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
+Sourcepub fn with_user_data(self, user_data: UserData) -> EndpointData
pub fn with_user_data(self, user_data: UserData) -> EndpointData
Sets the user-defined data and returns the updated endpoint info.
Useful for calling on construction after EndpointData::new or EndpointData::from_iter.
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 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 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 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.
+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 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 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 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.
Trait Implementations§
Source§impl Clone for EndpointData
impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
fn clone(&self) -> EndpointData
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EndpointData
impl Debug for EndpointData
Source§impl Default for EndpointData
impl Default for EndpointData
Source§fn default() -> EndpointData
fn default() -> EndpointData
Source§impl From<BTreeSet<SocketAddr>> for EndpointData
impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Source§impl From<BTreeSet<TransportAddr>> for EndpointData
impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Source§impl From<EndpointAddr> for EndpointData
impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
fn from(endpoint_addr: EndpointAddr) -> EndpointData
Source§impl FromIterator<TransportAddr> for EndpointData
impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
- T: IntoIterator<Item = TransportAddr>,
fn from_iter<T>(iter: T) -> EndpointDatawhere
- T: IntoIterator<Item = TransportAddr>,
Source§impl PartialEq for EndpointData
impl PartialEq for EndpointData
impl Eq for EndpointData
impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
impl Freeze for EndpointData
impl RefUnwindSafe for EndpointData
impl Send for EndpointData
impl Sync for EndpointData
impl Unpin for EndpointData
impl UnwindSafe for EndpointData
Blanket Implementations§
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.
Trait Implementations§
Source§impl Clone for EndpointData
impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
fn clone(&self) -> EndpointData
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EndpointData
impl Debug for EndpointData
Source§impl Default for EndpointData
impl Default for EndpointData
Source§fn default() -> EndpointData
fn default() -> EndpointData
Source§impl From<BTreeSet<SocketAddr>> for EndpointData
impl From<BTreeSet<SocketAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
fn from(addrs: BTreeSet<SocketAddr>) -> EndpointData
Source§impl From<BTreeSet<TransportAddr>> for EndpointData
impl From<BTreeSet<TransportAddr>> for EndpointData
Source§fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
fn from(addrs: BTreeSet<TransportAddr>) -> EndpointData
Source§impl From<EndpointAddr> for EndpointData
impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
fn from(endpoint_addr: EndpointAddr) -> EndpointData
Source§impl FromIterator<TransportAddr> for EndpointData
impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
+ T: IntoIterator<Item = TransportAddr>,
fn from_iter<T>(iter: T) -> EndpointDatawhere
+ T: IntoIterator<Item = TransportAddr>,
Source§impl PartialEq for EndpointData
impl PartialEq for EndpointData
impl Eq for EndpointData
impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
impl Freeze for EndpointData
impl RefUnwindSafe for EndpointData
impl Send for EndpointData
impl Sync for EndpointData
impl Unpin for EndpointData
impl UnwindSafe for EndpointData
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/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html b/pr/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html
index 4c4496b4f1..7e51bbc05b 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.EndpointInfo.html
@@ -1,39 +1,39 @@
-EndpointInfo in iroh::endpoint_info - Rust EndpointInfo
pub struct EndpointInfo {
+EndpointInfo in iroh::endpoint_info - 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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
-Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
-Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
-Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
+Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
+Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
+Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
+Sourcepub fn from_txt_lookup(
domain_name: String,
lookup: impl Iterator<Item = impl Display>,
) -> Result<EndpointInfo, ParseError>
Parses a EndpointInfo from DNS TXT lookup results.
The domain_name is the queried DNS name (e.g. _iroh.<z32>.<origin>).
The lookup iterator yields TXT record values that implement Display.
-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.
-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 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 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§
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 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 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§
§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/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html b/pr/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html
index 239a535780..3279841835 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html
@@ -1,6 +1,6 @@
-MaxLengthExceededError in iroh::endpoint_info - Rust MaxLengthExceededError
pub struct MaxLengthExceededError { /* private fields */ }
Expand description
Error returned when an input value is too long for UserData.
-Implementations§
Source§impl MaxLengthExceededError
Sourcepub fn new() -> MaxLengthExceededError
Creates a new MaxLengthExceededError error.
-Trait Implementations§
Source§impl Debug for MaxLengthExceededError
Source§impl Display for MaxLengthExceededError
Source§impl Error for MaxLengthExceededError
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 StackError for MaxLengthExceededError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<MaxLengthExceededError>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for MaxLengthExceededError
§impl RefUnwindSafe for MaxLengthExceededError
§impl Send for MaxLengthExceededError
§impl Sync for MaxLengthExceededError
§impl Unpin for MaxLengthExceededError
§impl UnwindSafe for MaxLengthExceededError
Blanket Implementations§
Source§impl<T> Any for Twhere
+MaxLengthExceededError in iroh::endpoint_info - Rust MaxLengthExceededError
pub struct MaxLengthExceededError { /* private fields */ }
Expand description
Error returned when an input value is too long for UserData.
+Implementations§
Source§impl MaxLengthExceededError
Sourcepub fn new() -> MaxLengthExceededError
Creates a new MaxLengthExceededError error.
+Trait Implementations§
Source§impl Debug for MaxLengthExceededError
Source§impl Display for MaxLengthExceededError
Source§impl Error for MaxLengthExceededError
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 StackError for MaxLengthExceededError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<MaxLengthExceededError>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for MaxLengthExceededError
§impl RefUnwindSafe for MaxLengthExceededError
§impl Send for MaxLengthExceededError
§impl Sync for MaxLengthExceededError
§impl Unpin for MaxLengthExceededError
§impl UnwindSafe for MaxLengthExceededError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/4094/docs/iroh/endpoint_info/struct.UserData.html b/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
index 7cd4b5e549..8c9ae9c162 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
@@ -1,24 +1,24 @@
-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
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
Iroh does not keep track of or examine the user-defined data.
UserData implements FromStr and TryFrom<String>, so you can
convert &str and String into UserData easily.
-Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
+Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
In DNS discovery services, the user-defined data is stored in a TXT record character string,
which has a max length of 255 bytes. We need to subtract the user-data= prefix,
which leaves 245 bytes for the actual user-defined data.
-Trait Implementations§
Trait Implementations§
Source§impl Ord for UserData
Source§impl PartialOrd for UserData
Source§impl Eq for UserData
Source§impl StructuralPartialEq for UserData
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Trait Implementations§
Source§impl Clone for TransportAddr
Source§fn clone(&self) -> TransportAddr
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 TransportAddr
Source§impl<'de> Deserialize<'de> for TransportAddr
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TransportAddr, <__D as Deserializer<'de>>::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Display for TransportAddr
Source§impl From<Addr> for TransportAddr
Source§impl From<IncomingAddr> for TransportAddr
Source§fn from(addr: IncomingAddr) -> Self
Converts to this type from the input type.Source§impl From<TransportAddrInfo> for TransportAddr
Source§fn from(value: TransportAddrInfo) -> Self
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Display for TransportAddr
Source§impl From<Addr> for TransportAddr
Source§impl From<IncomingAddr> for TransportAddr
Source§fn from(addr: IncomingAddr) -> Self
Converts to this type from the input type.Source§impl From<TransportAddrInfo> for TransportAddr
Source§fn from(value: TransportAddrInfo) -> Self
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl Hash for TransportAddr
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
H: Hasher,
diff --git a/pr/4094/docs/iroh/index.html b/pr/4094/docs/iroh/index.html
index 7142ffa948..1a9ef7c5ab 100644
--- a/pr/4094/docs/iroh/index.html
+++ b/pr/4094/docs/iroh/index.html
@@ -1,4 +1,4 @@
-iroh - Rust Crate iroh
Expand description
EndpointInfo
pub struct EndpointInfo {
+EndpointInfo in iroh::endpoint_info - 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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
-Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
-Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
-Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
-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: RelayUrl) -> EndpointInfo
Adds the relay URL and returns the updated endpoint info.
+Sourcepub fn with_ip_addrs(self, addrs: Vec<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.
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the transport addr information.
+Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
+Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
+Sourcepub fn from_txt_lookup(
domain_name: String,
lookup: impl Iterator<Item = impl Display>,
) -> Result<EndpointInfo, ParseError>
Parses a EndpointInfo from DNS TXT lookup results.
The domain_name is the queried DNS name (e.g. _iroh.<z32>.<origin>).
The lookup iterator yields TXT record values that implement Display.
-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.
-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 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 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§
Trait Implementations§
Source§impl Clone for EndpointInfo
impl Clone for EndpointInfo
Source§fn clone(&self) -> EndpointInfo
fn clone(&self) -> EndpointInfo
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EndpointInfo
impl Debug for EndpointInfo
Source§impl From<EndpointAddr> for EndpointInfo
impl From<EndpointAddr> for EndpointInfo
Source§fn from(addr: EndpointAddr) -> EndpointInfo
fn from(addr: EndpointAddr) -> EndpointInfo
Source§impl From<EndpointInfo> for EndpointAddr
impl From<EndpointInfo> for EndpointAddr
Source§fn from(value: EndpointInfo) -> EndpointAddr
fn from(value: EndpointInfo) -> EndpointAddr
Source§impl From<Item> for EndpointInfo
impl From<Item> for EndpointInfo
Source§impl PartialEq for EndpointInfo
impl PartialEq for EndpointInfo
impl Eq for EndpointInfo
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§
§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/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html b/pr/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html
index 239a535780..3279841835 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.MaxLengthExceededError.html
@@ -1,6 +1,6 @@
-MaxLengthExceededError in iroh::endpoint_info - Rust MaxLengthExceededError
pub struct MaxLengthExceededError { /* private fields */ }
Expand description
Error returned when an input value is too long for UserData.
-Implementations§
Source§impl MaxLengthExceededError
Sourcepub fn new() -> MaxLengthExceededError
Creates a new MaxLengthExceededError error.
-Trait Implementations§
Source§impl Debug for MaxLengthExceededError
Source§impl Display for MaxLengthExceededError
Source§impl Error for MaxLengthExceededError
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 StackError for MaxLengthExceededError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<MaxLengthExceededError>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for MaxLengthExceededError
§impl RefUnwindSafe for MaxLengthExceededError
§impl Send for MaxLengthExceededError
§impl Sync for MaxLengthExceededError
§impl Unpin for MaxLengthExceededError
§impl UnwindSafe for MaxLengthExceededError
Blanket Implementations§
Source§impl<T> Any for Twhere
+MaxLengthExceededError in iroh::endpoint_info - Rust MaxLengthExceededError
pub struct MaxLengthExceededError { /* private fields */ }
Expand description
Error returned when an input value is too long for UserData.
+Implementations§
Source§impl MaxLengthExceededError
Sourcepub fn new() -> MaxLengthExceededError
Creates a new MaxLengthExceededError error.
+Trait Implementations§
Source§impl Debug for MaxLengthExceededError
Source§impl Display for MaxLengthExceededError
Source§impl Error for MaxLengthExceededError
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 StackError for MaxLengthExceededError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<MaxLengthExceededError>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for MaxLengthExceededError
§impl RefUnwindSafe for MaxLengthExceededError
§impl Send for MaxLengthExceededError
§impl Sync for MaxLengthExceededError
§impl Unpin for MaxLengthExceededError
§impl UnwindSafe for MaxLengthExceededError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/4094/docs/iroh/endpoint_info/struct.UserData.html b/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
index 7cd4b5e549..8c9ae9c162 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
@@ -1,24 +1,24 @@
-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
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
Iroh does not keep track of or examine the user-defined data.
UserData implements FromStr and TryFrom<String>, so you can
convert &str and String into UserData easily.
-Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
+Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
In DNS discovery services, the user-defined data is stored in a TXT record character string,
which has a max length of 255 bytes. We need to subtract the user-data= prefix,
which leaves 245 bytes for the actual user-defined data.
-Trait Implementations§
Trait Implementations§
Source§impl Ord for UserData
Source§impl PartialOrd for UserData
Source§impl Eq for UserData
Source§impl StructuralPartialEq for UserData
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Trait Implementations§
Source§impl Clone for TransportAddr
Source§fn clone(&self) -> TransportAddr
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 TransportAddr
Source§impl<'de> Deserialize<'de> for TransportAddr
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TransportAddr, <__D as Deserializer<'de>>::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Display for TransportAddr
Source§impl From<Addr> for TransportAddr
Source§impl From<IncomingAddr> for TransportAddr
Source§fn from(addr: IncomingAddr) -> Self
Converts to this type from the input type.Source§impl From<TransportAddrInfo> for TransportAddr
Source§fn from(value: TransportAddrInfo) -> Self
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Display for TransportAddr
Source§impl From<Addr> for TransportAddr
Source§impl From<IncomingAddr> for TransportAddr
Source§fn from(addr: IncomingAddr) -> Self
Converts to this type from the input type.Source§impl From<TransportAddrInfo> for TransportAddr
Source§fn from(value: TransportAddrInfo) -> Self
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl Hash for TransportAddr
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
H: Hasher,
diff --git a/pr/4094/docs/iroh/index.html b/pr/4094/docs/iroh/index.html
index 7142ffa948..1a9ef7c5ab 100644
--- a/pr/4094/docs/iroh/index.html
+++ b/pr/4094/docs/iroh/index.html
@@ -1,4 +1,4 @@
-iroh - Rust Crate iroh
Expand description
MaxLengthExceededError
pub struct MaxLengthExceededError { /* private fields */ }Expand description
Error returned when an input value is too long for UserData.
Implementations§
Source§impl MaxLengthExceededError
impl MaxLengthExceededError
Sourcepub fn new() -> MaxLengthExceededError
pub fn new() -> MaxLengthExceededError
Creates a new MaxLengthExceededError error.
Trait Implementations§
Source§impl Debug for MaxLengthExceededError
impl Debug for MaxLengthExceededError
Source§impl Display for MaxLengthExceededError
impl Display for MaxLengthExceededError
Source§impl Error for MaxLengthExceededError
impl Error for MaxLengthExceededError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl StackError for MaxLengthExceededError
impl StackError for MaxLengthExceededError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Source§fn into_std(self: Box<MaxLengthExceededError>) -> Box<dyn Error + Send + Sync>
fn into_std(self: Box<MaxLengthExceededError>) -> Box<dyn Error + Send + Sync>
Source§fn is_transparent(&self) -> bool
fn is_transparent(&self) -> bool
Auto Trait Implementations§
impl Freeze for MaxLengthExceededError
impl RefUnwindSafe for MaxLengthExceededError
impl Send for MaxLengthExceededError
impl Sync for MaxLengthExceededError
impl Unpin for MaxLengthExceededError
impl UnwindSafe for MaxLengthExceededError
Blanket Implementations§
Source§impl<T> Any for Twhere
+MaxLengthExceededError in iroh::endpoint_info - Rust MaxLengthExceededError
pub struct MaxLengthExceededError { /* private fields */ }
Expand description
Error returned when an input value is too long for UserData.
+Implementations§
Source§impl MaxLengthExceededError
Sourcepub fn new() -> MaxLengthExceededError
Creates a new MaxLengthExceededError error.
+Trait Implementations§
Source§impl Debug for MaxLengthExceededError
Source§impl Display for MaxLengthExceededError
Source§impl Error for MaxLengthExceededError
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 StackError for MaxLengthExceededError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<MaxLengthExceededError>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for MaxLengthExceededError
§impl RefUnwindSafe for MaxLengthExceededError
§impl Send for MaxLengthExceededError
§impl Sync for MaxLengthExceededError
§impl Unpin for MaxLengthExceededError
§impl UnwindSafe for MaxLengthExceededError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/4094/docs/iroh/endpoint_info/struct.UserData.html b/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
index 7cd4b5e549..8c9ae9c162 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
@@ -1,24 +1,24 @@
-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
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
Iroh does not keep track of or examine the user-defined data.
UserData implements FromStr and TryFrom<String>, so you can
convert &str and String into UserData easily.
-Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
+Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
In DNS discovery services, the user-defined data is stored in a TXT record character string,
which has a max length of 255 bytes. We need to subtract the user-data= prefix,
which leaves 245 bytes for the actual user-defined data.
-Trait Implementations§
Trait Implementations§
Source§impl Ord for UserData
Source§impl PartialOrd for UserData
Source§impl Eq for UserData
Source§impl StructuralPartialEq for UserData
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Trait Implementations§
Source§impl Clone for TransportAddr
Source§fn clone(&self) -> TransportAddr
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 TransportAddr
Source§impl<'de> Deserialize<'de> for TransportAddr
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TransportAddr, <__D as Deserializer<'de>>::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Display for TransportAddr
Source§impl From<Addr> for TransportAddr
Source§impl From<IncomingAddr> for TransportAddr
Source§fn from(addr: IncomingAddr) -> Self
Converts to this type from the input type.Source§impl From<TransportAddrInfo> for TransportAddr
Source§fn from(value: TransportAddrInfo) -> Self
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Display for TransportAddr
Source§impl From<Addr> for TransportAddr
Source§impl From<IncomingAddr> for TransportAddr
Source§fn from(addr: IncomingAddr) -> Self
Converts to this type from the input type.Source§impl From<TransportAddrInfo> for TransportAddr
Source§fn from(value: TransportAddrInfo) -> Self
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl Hash for TransportAddr
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
H: Hasher,
diff --git a/pr/4094/docs/iroh/index.html b/pr/4094/docs/iroh/index.html
index 7142ffa948..1a9ef7c5ab 100644
--- a/pr/4094/docs/iroh/index.html
+++ b/pr/4094/docs/iroh/index.html
@@ -1,4 +1,4 @@
-iroh - Rust Crate iroh
Expand description
impl<T> Any for Twhere
+MaxLengthExceededError in iroh::endpoint_info - Rust MaxLengthExceededError
pub struct MaxLengthExceededError { /* private fields */ }
Expand description
Error returned when an input value is too long for UserData.
+Implementations§
Source§impl MaxLengthExceededError
Sourcepub fn new() -> MaxLengthExceededError
Creates a new MaxLengthExceededError error.
+Trait Implementations§
Source§impl Debug for MaxLengthExceededError
Source§impl Display for MaxLengthExceededError
Source§impl Error for MaxLengthExceededError
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 StackError for MaxLengthExceededError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<MaxLengthExceededError>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for MaxLengthExceededError
§impl RefUnwindSafe for MaxLengthExceededError
§impl Send for MaxLengthExceededError
§impl Sync for MaxLengthExceededError
§impl Unpin for MaxLengthExceededError
§impl UnwindSafe for MaxLengthExceededError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/4094/docs/iroh/endpoint_info/struct.UserData.html b/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
index 7cd4b5e549..8c9ae9c162 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
@@ -1,24 +1,24 @@
-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
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
Iroh does not keep track of or examine the user-defined data.
UserData implements FromStr and TryFrom<String>, so you can
convert &str and String into UserData easily.
-Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
+Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
In DNS discovery services, the user-defined data is stored in a TXT record character string,
which has a max length of 255 bytes. We need to subtract the user-data= prefix,
which leaves 245 bytes for the actual user-defined data.
-Trait Implementations§
Trait Implementations§
Source§impl Ord for UserData
Source§impl PartialOrd for UserData
Source§impl Eq for UserData
Source§impl StructuralPartialEq for UserData
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Trait Implementations§
Source§impl Clone for TransportAddr
Source§fn clone(&self) -> TransportAddr
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 TransportAddr
Source§impl<'de> Deserialize<'de> for TransportAddr
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TransportAddr, <__D as Deserializer<'de>>::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Display for TransportAddr
Source§impl From<Addr> for TransportAddr
Source§impl From<IncomingAddr> for TransportAddr
Source§fn from(addr: IncomingAddr) -> Self
Converts to this type from the input type.Source§impl From<TransportAddrInfo> for TransportAddr
Source§fn from(value: TransportAddrInfo) -> Self
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Display for TransportAddr
Source§impl From<Addr> for TransportAddr
Source§impl From<IncomingAddr> for TransportAddr
Source§fn from(addr: IncomingAddr) -> Self
Converts to this type from the input type.Source§impl From<TransportAddrInfo> for TransportAddr
Source§fn from(value: TransportAddrInfo) -> Self
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl Hash for TransportAddr
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
H: Hasher,
diff --git a/pr/4094/docs/iroh/index.html b/pr/4094/docs/iroh/index.html
index 7142ffa948..1a9ef7c5ab 100644
--- a/pr/4094/docs/iroh/index.html
+++ b/pr/4094/docs/iroh/index.html
@@ -1,4 +1,4 @@
-iroh - Rust Crate iroh
Expand description
MaxLengthExceededError
pub struct MaxLengthExceededError { /* private fields */ }Expand description
Error returned when an input value is too long for UserData.
Implementations§
Source§impl MaxLengthExceededError
impl MaxLengthExceededError
Sourcepub fn new() -> MaxLengthExceededError
pub fn new() -> MaxLengthExceededError
Creates a new MaxLengthExceededError error.
Trait Implementations§
Source§impl Debug for MaxLengthExceededError
impl Debug for MaxLengthExceededError
Source§impl Display for MaxLengthExceededError
impl Display for MaxLengthExceededError
Source§impl Error for MaxLengthExceededError
impl Error for MaxLengthExceededError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl StackError for MaxLengthExceededError
impl StackError for MaxLengthExceededError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Source§fn into_std(self: Box<MaxLengthExceededError>) -> Box<dyn Error + Send + Sync>
fn into_std(self: Box<MaxLengthExceededError>) -> Box<dyn Error + Send + Sync>
Source§fn is_transparent(&self) -> bool
fn is_transparent(&self) -> bool
Auto Trait Implementations§
impl Freeze for MaxLengthExceededError
impl RefUnwindSafe for MaxLengthExceededError
impl Send for MaxLengthExceededError
impl Sync for MaxLengthExceededError
impl Unpin for MaxLengthExceededError
impl UnwindSafe for MaxLengthExceededError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> 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/4094/docs/iroh/endpoint_info/struct.UserData.html b/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
index 7cd4b5e549..8c9ae9c162 100644
--- a/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
+++ b/pr/4094/docs/iroh/endpoint_info/struct.UserData.html
@@ -1,24 +1,24 @@
-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
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
Iroh does not keep track of or examine the user-defined data.
UserData implements FromStr and TryFrom<String>, so you can
convert &str and String into UserData easily.
-Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
+Implementations§
Source§impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
In DNS discovery services, the user-defined data is stored in a TXT record character string,
which has a max length of 255 bytes. We need to subtract the user-data= prefix,
which leaves 245 bytes for the actual user-defined data.
-Trait Implementations§
Trait Implementations§
Source§impl Ord for UserData
Source§impl PartialOrd for UserData
Source§impl Eq for UserData
Source§impl StructuralPartialEq for UserData
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Auto Trait Implementations§
§impl Freeze for UserData
§impl RefUnwindSafe for UserData
§impl Send for UserData
§impl Sync for UserData
§impl Unpin for UserData
§impl UnwindSafe for UserData
Blanket Implementations§
Trait Implementations§
Source§impl Clone for TransportAddr
Source§fn clone(&self) -> TransportAddr
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 TransportAddr
Source§impl<'de> Deserialize<'de> for TransportAddr
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TransportAddr, <__D as Deserializer<'de>>::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Display for TransportAddr
Source§impl From<Addr> for TransportAddr
Source§impl From<IncomingAddr> for TransportAddr
Source§fn from(addr: IncomingAddr) -> Self
Converts to this type from the input type.Source§impl From<TransportAddrInfo> for TransportAddr
Source§fn from(value: TransportAddrInfo) -> Self
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl Display for TransportAddr
Source§impl From<Addr> for TransportAddr
Source§impl From<IncomingAddr> for TransportAddr
Source§fn from(addr: IncomingAddr) -> Self
Converts to this type from the input type.Source§impl From<TransportAddrInfo> for TransportAddr
Source§fn from(value: TransportAddrInfo) -> Self
Converts to this type from the input type.Source§impl FromIterator<TransportAddr> for EndpointData
Source§fn from_iter<T>(iter: T) -> EndpointDatawhere
T: IntoIterator<Item = TransportAddr>,
Creates a value from an iterator. Read moreSource§impl Hash for TransportAddr
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
H: Hasher,
diff --git a/pr/4094/docs/iroh/index.html b/pr/4094/docs/iroh/index.html
index 7142ffa948..1a9ef7c5ab 100644
--- a/pr/4094/docs/iroh/index.html
+++ b/pr/4094/docs/iroh/index.html
@@ -1,4 +1,4 @@
-iroh - Rust Crate iroh
Expand description
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
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
Iroh does not keep track of or examine the user-defined data.
UserData implements FromStr and TryFrom<String>, so you can
convert &str and String into UserData easily.
Implementations§
Source§impl UserData
impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
pub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
+Implementations§
Source§impl UserData
impl UserData
Sourcepub const MAX_LENGTH: usize = 245usize
pub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
In DNS discovery services, the user-defined data is stored in a TXT record character string,
which has a max length of 255 bytes. We need to subtract the user-data= prefix,
which leaves 245 bytes for the actual user-defined data.
Trait Implementations§
Trait Implementations§
Source§impl Ord for UserData
impl Ord for UserData
Source§impl PartialOrd for UserData
impl PartialOrd for UserData
impl Eq for UserData
impl StructuralPartialEq for UserData
Auto Trait Implementations§
impl Freeze for UserData
impl RefUnwindSafe for UserData
impl Send for UserData
impl Sync for UserData
impl Unpin for UserData
impl UnwindSafe for UserData
Blanket Implementations§
Auto Trait Implementations§
impl Freeze for UserData
impl RefUnwindSafe for UserData
impl Send for UserData
impl Sync for UserData
impl Unpin for UserData
impl UnwindSafe for UserData
Blanket Implementations§
Trait Implementations§
Source§impl Clone for TransportAddr
impl Clone for TransportAddr
Source§fn clone(&self) -> TransportAddr
fn clone(&self) -> TransportAddr
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more