pub const N0_DNS_ENDPOINT_ORIGIN_PROD: &'static str;wasm_browser only.Expand description
The n0 testing DNS endpoint origin, for production.
+N0_DNS_ENDPOINT_ORIGIN_PROD
N0_DNS_ENDPOINT_ORIGIN_STAGING
pub const N0_DNS_ENDPOINT_ORIGIN_STAGING: &'static str;wasm_browser only.Expand description
The n0 testing DNS endpoint origin, for testing.
+N0_DNS_ENDPOINT_ORIGIN_STAGING
Module dns
wasm_browser only.Expand description
DNS endpoint discovery for iroh
+Module dns
wasm_browser only.Expand description
DNS endpoint discovery for iroh
Structs§
- DnsAddress
Lookup - DNS endpoint discovery
- DnsAddress
Lookup Builder - Builder for
DnsAddressLookup.
Constants§
- N0_
DNS_ ENDPOINT_ ORIGIN_ PROD - The n0 testing DNS endpoint origin, for production.
- N0_
DNS_ ENDPOINT_ ORIGIN_ STAGING - The n0 testing DNS endpoint origin, for testing.
DnsAddressLookup
pub struct DnsAddressLookup { /* private fields */ }wasm_browser only.Expand description
DNS endpoint discovery
+DnsAddressLookup
pub struct DnsAddressLookup { /* private fields */ }wasm_browser only.Expand description
DNS endpoint discovery
When asked to resolve a EndpointId, this service performs a lookup in the Domain Name System (DNS).
It uses the Endpoint’s DNS resolver to query for TXT records under the domain
_iroh.<z32-endpoint-id>.<origin-domain>:
The DNS resolver defaults to using the nameservers configured on the host system, but can be changed
with crate::endpoint::Builder::dns_resolver.
Implementations§
Source§impl DnsAddressLookup
impl DnsAddressLookup
Sourcepub fn builder(origin_domain: String) -> DnsAddressLookupBuilder
pub fn builder(origin_domain: String) -> DnsAddressLookupBuilder
Creates a DnsAddressLookupBuilder that implements IntoAddressLookup.
Implementations§
Source§impl DnsAddressLookup
impl DnsAddressLookup
Sourcepub fn builder(origin_domain: String) -> DnsAddressLookupBuilder
pub fn builder(origin_domain: String) -> DnsAddressLookupBuilder
Creates a DnsAddressLookupBuilder that implements AddressLookupBuilder.
Sourcepub fn n0_dns() -> DnsAddressLookupBuilder
pub fn n0_dns() -> DnsAddressLookupBuilder
Creates a new DNS discovery using the iroh.link domain.
This uses the N0_DNS_ENDPOINT_ORIGIN_PROD domain.
§Usage during tests
For testing it is possible to use the N0_DNS_ENDPOINT_ORIGIN_STAGING domain
with DnsAddressLookup::builder. This would then use a hosted staging discovery
service for testing purposes.
Trait Implementations§
Source§impl AddressLookup for DnsAddressLookup
impl AddressLookup for DnsAddressLookup
Trait Implementations§
Source§impl AddressLookup for DnsAddressLookup
impl AddressLookup for DnsAddressLookup
Source§fn resolve(
&self,
endpoint_id: EndpointId,
-) -> Option<BoxStream<Result<AddressLookupItem, AddressLookupError>>>
fn resolve( &self, endpoint_id: EndpointId, -) -> Option<BoxStream<Result<AddressLookupItem, AddressLookupError>>>
Source§fn publish(&self, _data: &EndpointData)
fn publish(&self, _data: &EndpointData)
EndpointData to the Address Lookup mechanism. Read moreAuto Trait Implementations§
impl Freeze for DnsAddressLookup
impl !RefUnwindSafe for DnsAddressLookup
impl Send for DnsAddressLookup
impl Sync for DnsAddressLookup
impl Unpin for DnsAddressLookup
impl !UnwindSafe for DnsAddressLookup
Blanket Implementations§
Source§impl<T> Any 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> Any 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 moreAuto Trait Implementations§
impl Freeze for DnsAddressLookup
impl !RefUnwindSafe for DnsAddressLookup
impl Send for DnsAddressLookup
impl Sync for DnsAddressLookup
impl Unpin for DnsAddressLookup
impl !UnwindSafe for DnsAddressLookup
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
+ T: AddressLookup,
impl<T> AddressLookupBuilder for Twhere
+ T: AddressLookup,
Source§fn into_address_lookup(
+ self,
+ _endpoint: &Endpoint,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
fn into_address_lookup( + self, + _endpoint: &Endpoint, +) -> Result<impl AddressLookup, AddressLookupBuilderError>
Source§fn with_addr_filter(self, _filter: AddrFilter) -> T
fn with_addr_filter(self, _filter: AddrFilter) -> T
§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,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
fn into_address_lookup( - self, - _endpoint: &Endpoint, -) -> Result<impl AddressLookup, IntoAddressLookupError>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/dns/struct.DnsAddressLookupBuilder.html b/pr/3958/docs/iroh/address_lookup/dns/struct.DnsAddressLookupBuilder.html
index 791b87b916..75978398fb 100644
--- a/pr/3958/docs/iroh/address_lookup/dns/struct.DnsAddressLookupBuilder.html
+++ b/pr/3958/docs/iroh/address_lookup/dns/struct.DnsAddressLookupBuilder.html
@@ -1,11 +1,12 @@
-DnsAddressLookupBuilder in iroh::address_lookup::dns - Rust DnsAddressLookupBuilder
pub struct DnsAddressLookupBuilder { /* private fields */ }
Available on non-wasm_browser only.Expand description
Builder for DnsAddressLookup.
+DnsAddressLookupBuilder in iroh::address_lookup::dns - Rust DnsAddressLookupBuilder
pub struct DnsAddressLookupBuilder { /* private fields */ }
Available on non-wasm_browser only.Expand description
Builder for DnsAddressLookup.
Implementations§
Source§impl DnsAddressLookupBuilder
Sourcepub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self
Sets the DNS resolver to use.
Sourcepub fn build(self) -> DnsAddressLookup
Builds a DnsAddressLookup with the passed DnsResolver.
-Trait Implementations§
Source§impl Debug for DnsAddressLookupBuilder
Trait Implementations§
Source§impl AddressLookupBuilder for DnsAddressLookupBuilder
Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreAuto Trait Implementations§
§impl Freeze for DnsAddressLookupBuilder
§impl !RefUnwindSafe for DnsAddressLookupBuilder
§impl Send for DnsAddressLookupBuilder
§impl Sync for DnsAddressLookupBuilder
§impl Unpin for DnsAddressLookupBuilder
§impl !UnwindSafe for DnsAddressLookupBuilder
Blanket Implementations§
Source§impl<T> Any for Twhere
+) -> Result<impl AddressLookup, AddressLookupBuilderError>Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> Selfwhere
+ Self: Sized,
Sets a filter to control which addresses are published by this service Read more
Auto Trait Implementations§
§impl Freeze for DnsAddressLookupBuilder
§impl !RefUnwindSafe for DnsAddressLookupBuilder
§impl Send for DnsAddressLookupBuilder
§impl Sync for DnsAddressLookupBuilder
§impl Unpin for DnsAddressLookupBuilder
§impl !UnwindSafe for DnsAddressLookupBuilder
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3958/docs/iroh/address_lookup/enum.IntoAddressLookupError.html b/pr/3958/docs/iroh/address_lookup/enum.AddressLookupBuilderError.html
similarity index 54%
rename from pr/3958/docs/iroh/address_lookup/enum.IntoAddressLookupError.html
rename to pr/3958/docs/iroh/address_lookup/enum.AddressLookupBuilderError.html
index c3ecf7aad3..3ccc150a1f 100644
--- a/pr/3958/docs/iroh/address_lookup/enum.IntoAddressLookupError.html
+++ b/pr/3958/docs/iroh/address_lookup/enum.AddressLookupBuilderError.html
@@ -1,4 +1,4 @@
-IntoAddressLookupError in iroh::address_lookup - Rust IntoAddressLookupError
#[non_exhaustive]pub enum IntoAddressLookupError {
+AddressLookupBuilderError in iroh::address_lookup - Rust AddressLookupBuilderError
#[non_exhaustive]pub enum AddressLookupBuilderError {
User {
provenance: &'static str,
source: AnyError,
@@ -8,18 +8,18 @@
source: EndpointError,
meta: Meta,
},
-}
Expand description
IntoAddressLookup errors
+}Expand description
AddressLookupBuilder errors
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.Implementations§
Implementations§
Trait Implementations§
Source§impl Debug for IntoAddressLookupError
Source§impl Display for IntoAddressLookupError
Source§impl Error for IntoAddressLookupError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Source§impl From<AnyError> for IntoAddressLookupError
Source§impl From<EndpointError> for IntoAddressLookupError
Source§fn from(source: EndpointError) -> Self
Converts to this type from the input type.Source§impl From<IntoAddressLookupError> for AnyError
Source§fn from(value: IntoAddressLookupError) -> AnyError
Converts to this type from the input type.Source§impl From<IntoAddressLookupError> for BindError
Source§fn from(source: IntoAddressLookupError) -> Self
Converts to this type from the input type.Source§impl StackError for IntoAddressLookupError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
Returns the next source in the chain, if any.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for IntoAddressLookupError
§impl !RefUnwindSafe for IntoAddressLookupError
§impl Send for IntoAddressLookupError
§impl Sync for IntoAddressLookupError
§impl Unpin for IntoAddressLookupError
§impl !UnwindSafe for IntoAddressLookupError
Blanket Implementations§
Trait Implementations§
Source§impl Debug for AddressLookupBuilderError
Source§impl Display for AddressLookupBuilderError
Source§impl Error for AddressLookupBuilderError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Source§impl From<AddressLookupBuilderError> for AnyError
Source§fn from(value: AddressLookupBuilderError) -> AnyError
Converts to this type from the input type.Source§impl From<AddressLookupBuilderError> for BindError
Source§fn from(source: AddressLookupBuilderError) -> Self
Converts to this type from the input type.Source§impl From<AnyError> for AddressLookupBuilderError
Source§impl From<EndpointError> for AddressLookupBuilderError
Source§fn from(source: EndpointError) -> Self
Converts to this type from the input type.Source§impl StackError for AddressLookupBuilderError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
Returns the next source in the chain, if any.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for AddressLookupBuilderError
§impl !RefUnwindSafe for AddressLookupBuilderError
§impl Send for AddressLookupBuilderError
§impl Sync for AddressLookupBuilderError
§impl Unpin for AddressLookupBuilderError
§impl !UnwindSafe for AddressLookupBuilderError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3958/docs/iroh/address_lookup/enum.Error.html b/pr/3958/docs/iroh/address_lookup/enum.Error.html
index bfb791dc2d..3682629dbf 100644
--- a/pr/3958/docs/iroh/address_lookup/enum.Error.html
+++ b/pr/3958/docs/iroh/address_lookup/enum.Error.html
@@ -1,4 +1,4 @@
-Error in iroh::address_lookup - Rust Error
#[non_exhaustive]pub enum Error {
+Error in iroh::address_lookup - Rust Error
#[non_exhaustive]pub enum Error {
NoServiceConfigured {
meta: Meta,
},
@@ -14,19 +14,19 @@
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§NoServiceConfigured
Fields
§meta: MetaCaptured call-site metadata
§NoResults
Fields
§meta: MetaCaptured call-site metadata
§User
Implementations§
Implementations§
Sourcepub fn from_err_any(
provenance: &'static str,
source: impl Into<AnyError>,
) -> Self
Creates a new user error from an arbitrary error type that can be converted into [AnyError].
-Trait Implementations§
Source§impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Source§impl From<Error> for ConnectWithOptsError
Source§fn from(source: AddressLookupError) -> Self
Converts to this type from the input type.Source§impl From<PkarrError> for Error
Source§fn from(err: PkarrError) -> Self
Converts to this type from the input type.Source§impl StackError for Error
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
Returns the next source in the chain, if any.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for Error
§impl !RefUnwindSafe for Error
§impl Send for Error
§impl Sync for Error
§impl Unpin for Error
§impl !UnwindSafe for Error
Blanket Implementations§
Trait Implementations§
Source§impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Source§impl From<Error> for ConnectWithOptsError
Source§fn from(source: AddressLookupError) -> Self
Converts to this type from the input type.Source§impl From<PkarrError> for Error
Source§fn from(err: PkarrError) -> Self
Converts to this type from the input type.Source§impl StackError for Error
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
Returns the next source in the chain, if any.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for Error
§impl !RefUnwindSafe for Error
§impl Send for Error
§impl Sync for Error
§impl Unpin for Error
§impl !UnwindSafe for Error
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3958/docs/iroh/address_lookup/enum.ParseError.html b/pr/3958/docs/iroh/address_lookup/enum.ParseError.html
index 63c74591f3..508967ac26 100644
--- a/pr/3958/docs/iroh/address_lookup/enum.ParseError.html
+++ b/pr/3958/docs/iroh/address_lookup/enum.ParseError.html
@@ -1,4 +1,4 @@
-ParseError in iroh::address_lookup - Rust ParseError
#[non_exhaustive]pub enum ParseError {
+ParseError in iroh::address_lookup - Rust ParseError
§Utf8
§NotAnIrohRecord
§DecodingError
Trait Implementations§
Source§impl Debug for ParseError
Source§impl Display for ParseError
Source§impl Error for ParseError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Source§impl From<DecodingError> for ParseError
Source§fn from(source: DecodingError) -> ParseError
Converts to this type from the input type.Source§impl From<Utf8Error> for ParseError
Source§fn from(source: Utf8Error) -> ParseError
Converts to this type from the input type.Source§impl StackError for ParseError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<ParseError>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Returns the next source in the chain, if any.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for ParseError
§impl !RefUnwindSafe for ParseError
§impl Send for ParseError
§impl Sync for ParseError
§impl Unpin for ParseError
§impl !UnwindSafe for ParseError
Blanket Implementations§
Trait Implementations§
Source§impl Debug for ParseError
Source§impl Display for ParseError
Source§impl Error for ParseError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Source§impl From<DecodingError> for ParseError
Source§fn from(source: DecodingError) -> ParseError
Converts to this type from the input type.Source§impl From<Utf8Error> for ParseError
Source§fn from(source: Utf8Error) -> ParseError
Converts to this type from the input type.Source§impl StackError for ParseError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<ParseError>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Returns the next source in the chain, if any.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for ParseError
§impl !RefUnwindSafe for ParseError
§impl Send for ParseError
§impl Sync for ParseError
§impl Unpin for ParseError
§impl !UnwindSafe for ParseError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3958/docs/iroh/address_lookup/index.html b/pr/3958/docs/iroh/address_lookup/index.html
index 7a6aee18d0..3b966882fb 100644
--- a/pr/3958/docs/iroh/address_lookup/index.html
+++ b/pr/3958/docs/iroh/address_lookup/index.html
@@ -1,4 +1,4 @@
-iroh::address_lookup - Rust Module address_lookup
Expand description
Lookup the address of an Endpoint ID.
+iroh::address_lookup - Rust Module address_lookup
Expand description
Lookup the address of an Endpoint ID.
To connect to an iroh endpoint a EndpointAddr is needed, which may contain a
RelayUrl or one or more direct addresses in addition to the EndpointId.
Since there is a conversion from EndpointId to EndpointAddr, you can also use
@@ -14,6 +14,14 @@ implementations to co-exist because there are many possible ways to implement th
Each Endpoint can use the address lookup mechanisms most suitable to the application.
The Builder::address_lookup method is used to add an address lookup mechanism to an
Endpoint.
+Each address lookup service receives the full set of transport addresses when publishing,
+but may only publish a subset of them based on its own constraints.
+To control which addresses are published to a particular service, you can supply an
+AddrFilter when configuring it via AddressLookupBuilder::with_addr_filter. The filter
+receives the full set of addresses and returns an ordered Vec, allowing you to both
+remove addresses you don’t want published and prioritize the ones you do Each service
+may apply additional filtering on top based on its own constraints, but will not publish
+addresses outside of what the filter returns. See each service’s documentation for details.
Some generally useful Address Lookup implementations are provided:
-
@@ -42,14 +50,14 @@ records to/from the Mainline DHT. It requires enabling the
address-lookup-
To use multiple Address Lookup’ssimultaneously you can call Builder::address_lookup.
This will use ConcurrentAddressLookup under the hood, which performs lookups to all
Address Lookupsystems at the same time.
-Builder::address_lookup takes any type that implements IntoAddressLookup. You can
+
Builder::address_lookup takes any type that implements AddressLookupBuilder. You can
implement that trait on a builder struct if your Address Lookup needs information
from the endpoint it is mounted on. After endpoint construction, your Address Lookup
-is built by calling IntoAddressLookup::into_address_lookup, passing the finished Endpoint to your
+is built by calling AddressLookupBuilder::into_address_lookup, passing the finished Endpoint to your
builder.
If your Address Lookupdoes not need any information from its endpoint, you can
pass the Address Lookupservice directly to Builder::address_lookup: All types that
-implement AddressLookup also have a blanket implementation of IntoAddressLookup.
+implement AddressLookup also have a blanket implementation of AddressLookupBuilder.
§Examples
A very common setup is to enable DNS Address Lookup, which needs to be done in two parts as a
PkarrPublisher and address_lookup::DnsAddressLookup:
@@ -73,4 +81,5 @@ implement await?;
Re-exports§
pub use dns::*;Non-wasm_browser pub use mdns::*;address-lookup-mdnspub use memory::*;pub use pkarr::dht::*;address-lookup-pkarr-dhtpub use pkarr::*;
Modules§
- dns
Non-wasm_browser - DNS endpoint discovery for iroh
- mdns
address-lookup-mdns - An address lookup service that uses an mdns-like service to discover and lookup the addresses of local endpoints.
- memory
- An in-memory address lookup system to manually add endpoint addressing information.
- pkarr
- An address lookup service which publishes and resolves endpoint information using a pkarr relay.
Structs§
- Concurrent
AddressLookup - An Address Lookup service that combines multiple Address Lookup sources.
- 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.
- Item
- Address lookup results from
AddressLookups. - User
Data - Under the hood this is a UTF-8 String is no longer than
UserData::MAX_LENGTH bytes.
Enums§
Traits§
- Address
Lookup - AddressLookup system for
super::Endpoint. - Into
AddressLookup - Trait for structs that can be converted into
AddressLookups.
\ No newline at end of file
+ .await?;
Re-exports§
pub use dns::*;Non-wasm_browser pub use mdns::*;address-lookup-mdnspub use memory::*;pub use pkarr::dht::*;address-lookup-pkarr-dhtpub use pkarr::*;
Modules§
- dns
Non-wasm_browser - DNS endpoint discovery for iroh
- mdns
address-lookup-mdns - An address lookup service that uses an mdns-like service to discover and lookup the addresses of local endpoints.
- memory
- An in-memory address lookup system to manually add endpoint addressing information.
- pkarr
- An address lookup service which publishes and resolves endpoint information using a pkarr relay.
Structs§
- Addr
Filter - A filter and/or reordering function applied to transport addresses,
+typically used by AddressLookup services in iroh before publishing.
- Concurrent
AddressLookup - An Address Lookup service that combines multiple Address Lookup sources.
- 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.
- Item
- Address lookup results from
AddressLookups. - User
Data - Under the hood this is a UTF-8 String is no longer than
UserData::MAX_LENGTH bytes.
Enums§
Traits§
- Address
Lookup - AddressLookup system for
super::Endpoint. - Address
LookupBuilder - Trait for structs that can be converted into
AddressLookups.
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/mdns/constant.NAME.html b/pr/3958/docs/iroh/address_lookup/mdns/constant.NAME.html
index 8679039ead..0aa6f4f31e 100644
--- a/pr/3958/docs/iroh/address_lookup/mdns/constant.NAME.html
+++ b/pr/3958/docs/iroh/address_lookup/mdns/constant.NAME.html
@@ -1,4 +1,4 @@
-NAME in iroh::address_lookup::mdns - Rust NAME
pub const NAME: &str = "mdns";
Available on crate feature address-lookup-mdns only.Expand description
Name of this address lookup service.
+NAME in iroh::address_lookup::mdns - Rust NAME
pub const NAME: &str = "mdns";
Available on crate feature address-lookup-mdns only.Expand description
Name of this address lookup service.
Used as the provenance field in AddressLookupItems.
Used in the crate::endpoint::Source::AddressLookup enum variant as the name.
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/mdns/enum.DiscoveryEvent.html b/pr/3958/docs/iroh/address_lookup/mdns/enum.DiscoveryEvent.html
index c1e7c11104..8c21df22df 100644
--- a/pr/3958/docs/iroh/address_lookup/mdns/enum.DiscoveryEvent.html
+++ b/pr/3958/docs/iroh/address_lookup/mdns/enum.DiscoveryEvent.html
@@ -1,4 +1,4 @@
-DiscoveryEvent in iroh::address_lookup::mdns - Rust DiscoveryEvent
pub enum DiscoveryEvent {
+DiscoveryEvent in iroh::address_lookup::mdns - Rust DiscoveryEvent
pub enum DiscoveryEvent {
Discovered {
endpoint_info: EndpointInfo,
last_updated: Option<u64>,
@@ -13,8 +13,8 @@
§Expired
A peer was expired due to being inactive, unreachable, or otherwise
unavailable.
Fields
§endpoint_id: EndpointIdThe id of the endpoint that expired.
-Trait Implementations§
Source§impl Clone for DiscoveryEvent
Source§fn clone(&self) -> DiscoveryEvent
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 DiscoveryEvent
Source§impl PartialEq for DiscoveryEvent
Source§impl Eq for DiscoveryEvent
Source§impl StructuralPartialEq for DiscoveryEvent
Auto Trait Implementations§
§impl Freeze for DiscoveryEvent
§impl RefUnwindSafe for DiscoveryEvent
§impl Send for DiscoveryEvent
§impl Sync for DiscoveryEvent
§impl Unpin for DiscoveryEvent
§impl UnwindSafe for DiscoveryEvent
Blanket Implementations§
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/dns/struct.DnsAddressLookupBuilder.html b/pr/3958/docs/iroh/address_lookup/dns/struct.DnsAddressLookupBuilder.html
index 791b87b916..75978398fb 100644
--- a/pr/3958/docs/iroh/address_lookup/dns/struct.DnsAddressLookupBuilder.html
+++ b/pr/3958/docs/iroh/address_lookup/dns/struct.DnsAddressLookupBuilder.html
@@ -1,11 +1,12 @@
-DnsAddressLookupBuilder in iroh::address_lookup::dns - Rust DnsAddressLookupBuilder
pub struct DnsAddressLookupBuilder { /* private fields */ }
Available on non-wasm_browser only.Expand description
Builder for DnsAddressLookup.
+DnsAddressLookupBuilder in iroh::address_lookup::dns - Rust DnsAddressLookupBuilder
pub struct DnsAddressLookupBuilder { /* private fields */ }
Available on non-wasm_browser only.Expand description
Builder for DnsAddressLookup.
Implementations§
Source§impl DnsAddressLookupBuilder
Sourcepub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self
Sets the DNS resolver to use.
Sourcepub fn build(self) -> DnsAddressLookup
Builds a DnsAddressLookup with the passed DnsResolver.
-Trait Implementations§
Source§impl Debug for DnsAddressLookupBuilder
Trait Implementations§
Source§impl AddressLookupBuilder for DnsAddressLookupBuilder
Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreAuto Trait Implementations§
§impl Freeze for DnsAddressLookupBuilder
§impl !RefUnwindSafe for DnsAddressLookupBuilder
§impl Send for DnsAddressLookupBuilder
§impl Sync for DnsAddressLookupBuilder
§impl Unpin for DnsAddressLookupBuilder
§impl !UnwindSafe for DnsAddressLookupBuilder
Blanket Implementations§
Source§impl<T> Any for Twhere
+) -> Result<impl AddressLookup, AddressLookupBuilderError>Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> Selfwhere
+ Self: Sized,
Sets a filter to control which addresses are published by this service Read more
Auto Trait Implementations§
§impl Freeze for DnsAddressLookupBuilder
§impl !RefUnwindSafe for DnsAddressLookupBuilder
§impl Send for DnsAddressLookupBuilder
§impl Sync for DnsAddressLookupBuilder
§impl Unpin for DnsAddressLookupBuilder
§impl !UnwindSafe for DnsAddressLookupBuilder
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3958/docs/iroh/address_lookup/enum.IntoAddressLookupError.html b/pr/3958/docs/iroh/address_lookup/enum.AddressLookupBuilderError.html
similarity index 54%
rename from pr/3958/docs/iroh/address_lookup/enum.IntoAddressLookupError.html
rename to pr/3958/docs/iroh/address_lookup/enum.AddressLookupBuilderError.html
index c3ecf7aad3..3ccc150a1f 100644
--- a/pr/3958/docs/iroh/address_lookup/enum.IntoAddressLookupError.html
+++ b/pr/3958/docs/iroh/address_lookup/enum.AddressLookupBuilderError.html
@@ -1,4 +1,4 @@
-IntoAddressLookupError in iroh::address_lookup - Rust IntoAddressLookupError
#[non_exhaustive]pub enum IntoAddressLookupError {
+AddressLookupBuilderError in iroh::address_lookup - Rust AddressLookupBuilderError
#[non_exhaustive]pub enum AddressLookupBuilderError {
User {
provenance: &'static str,
source: AnyError,
@@ -8,18 +8,18 @@
source: EndpointError,
meta: Meta,
},
-}
Expand description
IntoAddressLookup errors
+}Expand description
AddressLookupBuilder errors
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.Implementations§
Implementations§
Trait Implementations§
Source§impl Debug for IntoAddressLookupError
Source§impl Display for IntoAddressLookupError
Source§impl Error for IntoAddressLookupError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Source§impl From<AnyError> for IntoAddressLookupError
Source§impl From<EndpointError> for IntoAddressLookupError
Source§fn from(source: EndpointError) -> Self
Converts to this type from the input type.Source§impl From<IntoAddressLookupError> for AnyError
Source§fn from(value: IntoAddressLookupError) -> AnyError
Converts to this type from the input type.Source§impl From<IntoAddressLookupError> for BindError
Source§fn from(source: IntoAddressLookupError) -> Self
Converts to this type from the input type.Source§impl StackError for IntoAddressLookupError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
Returns the next source in the chain, if any.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for IntoAddressLookupError
§impl !RefUnwindSafe for IntoAddressLookupError
§impl Send for IntoAddressLookupError
§impl Sync for IntoAddressLookupError
§impl Unpin for IntoAddressLookupError
§impl !UnwindSafe for IntoAddressLookupError
Blanket Implementations§
Trait Implementations§
Source§impl Debug for AddressLookupBuilderError
Source§impl Display for AddressLookupBuilderError
Source§impl Error for AddressLookupBuilderError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Source§impl From<AddressLookupBuilderError> for AnyError
Source§fn from(value: AddressLookupBuilderError) -> AnyError
Converts to this type from the input type.Source§impl From<AddressLookupBuilderError> for BindError
Source§fn from(source: AddressLookupBuilderError) -> Self
Converts to this type from the input type.Source§impl From<AnyError> for AddressLookupBuilderError
Source§impl From<EndpointError> for AddressLookupBuilderError
Source§fn from(source: EndpointError) -> Self
Converts to this type from the input type.Source§impl StackError for AddressLookupBuilderError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
Returns the next source in the chain, if any.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for AddressLookupBuilderError
§impl !RefUnwindSafe for AddressLookupBuilderError
§impl Send for AddressLookupBuilderError
§impl Sync for AddressLookupBuilderError
§impl Unpin for AddressLookupBuilderError
§impl !UnwindSafe for AddressLookupBuilderError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3958/docs/iroh/address_lookup/enum.Error.html b/pr/3958/docs/iroh/address_lookup/enum.Error.html
index bfb791dc2d..3682629dbf 100644
--- a/pr/3958/docs/iroh/address_lookup/enum.Error.html
+++ b/pr/3958/docs/iroh/address_lookup/enum.Error.html
@@ -1,4 +1,4 @@
-Error in iroh::address_lookup - Rust Error
#[non_exhaustive]pub enum Error {
+Error in iroh::address_lookup - Rust Error
#[non_exhaustive]pub enum Error {
NoServiceConfigured {
meta: Meta,
},
@@ -14,19 +14,19 @@
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§NoServiceConfigured
Fields
§meta: MetaCaptured call-site metadata
§NoResults
Fields
§meta: MetaCaptured call-site metadata
§User
Implementations§
Implementations§
Sourcepub fn from_err_any(
provenance: &'static str,
source: impl Into<AnyError>,
) -> Self
Creates a new user error from an arbitrary error type that can be converted into [AnyError].
-Trait Implementations§
Source§impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Source§impl From<Error> for ConnectWithOptsError
Source§fn from(source: AddressLookupError) -> Self
Converts to this type from the input type.Source§impl From<PkarrError> for Error
Source§fn from(err: PkarrError) -> Self
Converts to this type from the input type.Source§impl StackError for Error
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
Returns the next source in the chain, if any.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for Error
§impl !RefUnwindSafe for Error
§impl Send for Error
§impl Sync for Error
§impl Unpin for Error
§impl !UnwindSafe for Error
Blanket Implementations§
Trait Implementations§
Source§impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Source§impl From<Error> for ConnectWithOptsError
Source§fn from(source: AddressLookupError) -> Self
Converts to this type from the input type.Source§impl From<PkarrError> for Error
Source§fn from(err: PkarrError) -> Self
Converts to this type from the input type.Source§impl StackError for Error
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
Returns the next source in the chain, if any.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for Error
§impl !RefUnwindSafe for Error
§impl Send for Error
§impl Sync for Error
§impl Unpin for Error
§impl !UnwindSafe for Error
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3958/docs/iroh/address_lookup/enum.ParseError.html b/pr/3958/docs/iroh/address_lookup/enum.ParseError.html
index 63c74591f3..508967ac26 100644
--- a/pr/3958/docs/iroh/address_lookup/enum.ParseError.html
+++ b/pr/3958/docs/iroh/address_lookup/enum.ParseError.html
@@ -1,4 +1,4 @@
-ParseError in iroh::address_lookup - Rust ParseError
#[non_exhaustive]pub enum ParseError {
+ParseError in iroh::address_lookup - Rust ParseError
§Utf8
§NotAnIrohRecord
§DecodingError
Trait Implementations§
Source§impl Debug for ParseError
Source§impl Display for ParseError
Source§impl Error for ParseError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Source§impl From<DecodingError> for ParseError
Source§fn from(source: DecodingError) -> ParseError
Converts to this type from the input type.Source§impl From<Utf8Error> for ParseError
Source§fn from(source: Utf8Error) -> ParseError
Converts to this type from the input type.Source§impl StackError for ParseError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<ParseError>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Returns the next source in the chain, if any.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for ParseError
§impl !RefUnwindSafe for ParseError
§impl Send for ParseError
§impl Sync for ParseError
§impl Unpin for ParseError
§impl !UnwindSafe for ParseError
Blanket Implementations§
Trait Implementations§
Source§impl Debug for ParseError
Source§impl Display for ParseError
Source§impl Error for ParseError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Source§impl From<DecodingError> for ParseError
Source§fn from(source: DecodingError) -> ParseError
Converts to this type from the input type.Source§impl From<Utf8Error> for ParseError
Source§fn from(source: Utf8Error) -> ParseError
Converts to this type from the input type.Source§impl StackError for ParseError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<ParseError>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Returns the next source in the chain, if any.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for ParseError
§impl !RefUnwindSafe for ParseError
§impl Send for ParseError
§impl Sync for ParseError
§impl Unpin for ParseError
§impl !UnwindSafe for ParseError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3958/docs/iroh/address_lookup/index.html b/pr/3958/docs/iroh/address_lookup/index.html
index 7a6aee18d0..3b966882fb 100644
--- a/pr/3958/docs/iroh/address_lookup/index.html
+++ b/pr/3958/docs/iroh/address_lookup/index.html
@@ -1,4 +1,4 @@
-iroh::address_lookup - Rust Module address_lookup
Expand description
Lookup the address of an Endpoint ID.
+iroh::address_lookup - Rust Module address_lookup
Expand description
Lookup the address of an Endpoint ID.
To connect to an iroh endpoint a EndpointAddr is needed, which may contain a
RelayUrl or one or more direct addresses in addition to the EndpointId.
Since there is a conversion from EndpointId to EndpointAddr, you can also use
@@ -14,6 +14,14 @@ implementations to co-exist because there are many possible ways to implement th
Each Endpoint can use the address lookup mechanisms most suitable to the application.
The Builder::address_lookup method is used to add an address lookup mechanism to an
Endpoint.
+Each address lookup service receives the full set of transport addresses when publishing,
+but may only publish a subset of them based on its own constraints.
+To control which addresses are published to a particular service, you can supply an
+AddrFilter when configuring it via AddressLookupBuilder::with_addr_filter. The filter
+receives the full set of addresses and returns an ordered Vec, allowing you to both
+remove addresses you don’t want published and prioritize the ones you do Each service
+may apply additional filtering on top based on its own constraints, but will not publish
+addresses outside of what the filter returns. See each service’s documentation for details.
Some generally useful Address Lookup implementations are provided:
-
@@ -42,14 +50,14 @@ records to/from the Mainline DHT. It requires enabling the
address-lookup-
To use multiple Address Lookup’ssimultaneously you can call Builder::address_lookup.
This will use ConcurrentAddressLookup under the hood, which performs lookups to all
Address Lookupsystems at the same time.
-Builder::address_lookup takes any type that implements IntoAddressLookup. You can
+
Builder::address_lookup takes any type that implements AddressLookupBuilder. You can
implement that trait on a builder struct if your Address Lookup needs information
from the endpoint it is mounted on. After endpoint construction, your Address Lookup
-is built by calling IntoAddressLookup::into_address_lookup, passing the finished Endpoint to your
+is built by calling AddressLookupBuilder::into_address_lookup, passing the finished Endpoint to your
builder.
If your Address Lookupdoes not need any information from its endpoint, you can
pass the Address Lookupservice directly to Builder::address_lookup: All types that
-implement AddressLookup also have a blanket implementation of IntoAddressLookup.
+implement AddressLookup also have a blanket implementation of AddressLookupBuilder.
§Examples
A very common setup is to enable DNS Address Lookup, which needs to be done in two parts as a
PkarrPublisher and address_lookup::DnsAddressLookup:
@@ -73,4 +81,5 @@ implement await?;
Re-exports§
pub use dns::*;Non-wasm_browser pub use mdns::*;address-lookup-mdnspub use memory::*;pub use pkarr::dht::*;address-lookup-pkarr-dhtpub use pkarr::*;
Modules§
- dns
Non-wasm_browser - DNS endpoint discovery for iroh
- mdns
address-lookup-mdns - An address lookup service that uses an mdns-like service to discover and lookup the addresses of local endpoints.
- memory
- An in-memory address lookup system to manually add endpoint addressing information.
- pkarr
- An address lookup service which publishes and resolves endpoint information using a pkarr relay.
Structs§
- Concurrent
AddressLookup - An Address Lookup service that combines multiple Address Lookup sources.
- 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.
- Item
- Address lookup results from
AddressLookups. - User
Data - Under the hood this is a UTF-8 String is no longer than
UserData::MAX_LENGTH bytes.
Enums§
Traits§
- Address
Lookup - AddressLookup system for
super::Endpoint. - Into
AddressLookup - Trait for structs that can be converted into
AddressLookups.
\ No newline at end of file
+ .await?;
Re-exports§
pub use dns::*;Non-wasm_browser pub use mdns::*;address-lookup-mdnspub use memory::*;pub use pkarr::dht::*;address-lookup-pkarr-dhtpub use pkarr::*;
Modules§
- dns
Non-wasm_browser - DNS endpoint discovery for iroh
- mdns
address-lookup-mdns - An address lookup service that uses an mdns-like service to discover and lookup the addresses of local endpoints.
- memory
- An in-memory address lookup system to manually add endpoint addressing information.
- pkarr
- An address lookup service which publishes and resolves endpoint information using a pkarr relay.
Structs§
- Addr
Filter - A filter and/or reordering function applied to transport addresses,
+typically used by AddressLookup services in iroh before publishing.
- Concurrent
AddressLookup - An Address Lookup service that combines multiple Address Lookup sources.
- 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.
- Item
- Address lookup results from
AddressLookups. - User
Data - Under the hood this is a UTF-8 String is no longer than
UserData::MAX_LENGTH bytes.
Enums§
Traits§
- Address
Lookup - AddressLookup system for
super::Endpoint. - Address
LookupBuilder - Trait for structs that can be converted into
AddressLookups.
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/mdns/constant.NAME.html b/pr/3958/docs/iroh/address_lookup/mdns/constant.NAME.html
index 8679039ead..0aa6f4f31e 100644
--- a/pr/3958/docs/iroh/address_lookup/mdns/constant.NAME.html
+++ b/pr/3958/docs/iroh/address_lookup/mdns/constant.NAME.html
@@ -1,4 +1,4 @@
-NAME in iroh::address_lookup::mdns - Rust NAME
pub const NAME: &str = "mdns";
Available on crate feature address-lookup-mdns only.Expand description
Name of this address lookup service.
+NAME in iroh::address_lookup::mdns - Rust NAME
pub const NAME: &str = "mdns";
Available on crate feature address-lookup-mdns only.Expand description
Name of this address lookup service.
Used as the provenance field in AddressLookupItems.
Used in the crate::endpoint::Source::AddressLookup enum variant as the name.
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/mdns/enum.DiscoveryEvent.html b/pr/3958/docs/iroh/address_lookup/mdns/enum.DiscoveryEvent.html
index c1e7c11104..8c21df22df 100644
--- a/pr/3958/docs/iroh/address_lookup/mdns/enum.DiscoveryEvent.html
+++ b/pr/3958/docs/iroh/address_lookup/mdns/enum.DiscoveryEvent.html
@@ -1,4 +1,4 @@
-DiscoveryEvent in iroh::address_lookup::mdns - Rust DiscoveryEvent
pub enum DiscoveryEvent {
+DiscoveryEvent in iroh::address_lookup::mdns - Rust DiscoveryEvent
pub enum DiscoveryEvent {
Discovered {
endpoint_info: EndpointInfo,
last_updated: Option<u64>,
@@ -13,8 +13,8 @@
§Expired
A peer was expired due to being inactive, unreachable, or otherwise
unavailable.
Fields
§endpoint_id: EndpointIdThe id of the endpoint that expired.
-Trait Implementations§
Source§impl Clone for DiscoveryEvent
Source§fn clone(&self) -> DiscoveryEvent
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 DiscoveryEvent
Source§impl PartialEq for DiscoveryEvent
Source§impl Eq for DiscoveryEvent
Source§impl StructuralPartialEq for DiscoveryEvent
Auto Trait Implementations§
§impl Freeze for DiscoveryEvent
§impl RefUnwindSafe for DiscoveryEvent
§impl Send for DiscoveryEvent
§impl Sync for DiscoveryEvent
§impl Unpin for DiscoveryEvent
§impl UnwindSafe for DiscoveryEvent
Blanket Implementations§
DnsAddressLookupBuilder
pub struct DnsAddressLookupBuilder { /* private fields */ }wasm_browser only.Expand description
Builder for DnsAddressLookup.
DnsAddressLookupBuilder
pub struct DnsAddressLookupBuilder { /* private fields */ }wasm_browser only.Expand description
Builder for DnsAddressLookup.
Implementations§
Source§impl DnsAddressLookupBuilder
impl DnsAddressLookupBuilder
Sourcepub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self
pub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self
Sets the DNS resolver to use.
Sourcepub fn build(self) -> DnsAddressLookup
pub fn build(self) -> DnsAddressLookup
Builds a DnsAddressLookup with the passed DnsResolver.
Trait Implementations§
Source§impl Debug for DnsAddressLookupBuilder
impl Debug for DnsAddressLookupBuilder
Trait Implementations§
Source§impl AddressLookupBuilder for DnsAddressLookupBuilder
impl AddressLookupBuilder for DnsAddressLookupBuilder
Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
fn into_address_lookup( self, endpoint: &Endpoint, -) -> Result<impl AddressLookup, IntoAddressLookupError>
Auto Trait Implementations§
impl Freeze for DnsAddressLookupBuilder
impl !RefUnwindSafe for DnsAddressLookupBuilder
impl Send for DnsAddressLookupBuilder
impl Sync for DnsAddressLookupBuilder
impl Unpin for DnsAddressLookupBuilder
impl !UnwindSafe for DnsAddressLookupBuilder
Blanket Implementations§
Source§impl<T> Any for Twhere
+) -> Result<impl AddressLookup, AddressLookupBuilderError>Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> Selfwhere
+ Self: Sized,
Sets a filter to control which addresses are published by this service Read more
impl<T> Any for Twhere
+) -> Result<impl AddressLookup, AddressLookupBuilderError>Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> Selfwhere
+ Self: Sized,
Sets a filter to control which addresses are published by this service Read more
Source§fn with_addr_filter(self, _filter: AddrFilter) -> Selfwhere
+ Self: Sized,
fn with_addr_filter(self, _filter: AddrFilter) -> Selfwhere
+ Self: Sized,
Auto Trait Implementations§
impl Freeze for DnsAddressLookupBuilder
impl !RefUnwindSafe for DnsAddressLookupBuilder
impl Send for DnsAddressLookupBuilder
impl Sync for DnsAddressLookupBuilder
impl Unpin for DnsAddressLookupBuilder
impl !UnwindSafe for DnsAddressLookupBuilder
Blanket Implementations§
§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/3958/docs/iroh/address_lookup/enum.IntoAddressLookupError.html b/pr/3958/docs/iroh/address_lookup/enum.AddressLookupBuilderError.html
similarity index 54%
rename from pr/3958/docs/iroh/address_lookup/enum.IntoAddressLookupError.html
rename to pr/3958/docs/iroh/address_lookup/enum.AddressLookupBuilderError.html
index c3ecf7aad3..3ccc150a1f 100644
--- a/pr/3958/docs/iroh/address_lookup/enum.IntoAddressLookupError.html
+++ b/pr/3958/docs/iroh/address_lookup/enum.AddressLookupBuilderError.html
@@ -1,4 +1,4 @@
-IntoAddressLookupError in iroh::address_lookup - Rust IntoAddressLookupError
#[non_exhaustive]pub enum IntoAddressLookupError {
+AddressLookupBuilderError in iroh::address_lookup - Rust AddressLookupBuilderError
#[non_exhaustive]pub enum AddressLookupBuilderError {
User {
provenance: &'static str,
source: AnyError,
@@ -8,18 +8,18 @@
source: EndpointError,
meta: Meta,
},
-}
Expand description
IntoAddressLookup errors
+}Expand description
AddressLookupBuilder errors
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.Implementations§
Implementations§
Trait Implementations§
Source§impl Debug for IntoAddressLookupError
Source§impl Display for IntoAddressLookupError
Source§impl Error for IntoAddressLookupError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Source§impl From<AnyError> for IntoAddressLookupError
Source§impl From<EndpointError> for IntoAddressLookupError
Source§fn from(source: EndpointError) -> Self
Converts to this type from the input type.Source§impl From<IntoAddressLookupError> for AnyError
Source§fn from(value: IntoAddressLookupError) -> AnyError
Converts to this type from the input type.Source§impl From<IntoAddressLookupError> for BindError
Source§fn from(source: IntoAddressLookupError) -> Self
Converts to this type from the input type.Source§impl StackError for IntoAddressLookupError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
Returns the next source in the chain, if any.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for IntoAddressLookupError
§impl !RefUnwindSafe for IntoAddressLookupError
§impl Send for IntoAddressLookupError
§impl Sync for IntoAddressLookupError
§impl Unpin for IntoAddressLookupError
§impl !UnwindSafe for IntoAddressLookupError
Blanket Implementations§
IntoAddressLookupError
#[non_exhaustive]pub enum IntoAddressLookupError {
+AddressLookupBuilderError in iroh::address_lookup - Rust AddressLookupBuilderError
#[non_exhaustive]pub enum AddressLookupBuilderError {
User {
provenance: &'static str,
source: AnyError,
@@ -8,18 +8,18 @@
source: EndpointError,
meta: Meta,
},
-}
Expand description
IntoAddressLookup errors
+}Expand description
AddressLookupBuilder errors
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.Implementations§
Implementations§
Trait Implementations§
Source§impl Debug for IntoAddressLookupError
impl Debug for IntoAddressLookupError
Source§impl Display for IntoAddressLookupError
impl Display for IntoAddressLookupError
Source§impl Error for IntoAddressLookupError
impl Error for IntoAddressLookupError
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<AnyError> for IntoAddressLookupError
impl From<AnyError> for IntoAddressLookupError
Source§impl From<EndpointError> for IntoAddressLookupError
impl From<EndpointError> for IntoAddressLookupError
Source§fn from(source: EndpointError) -> Self
fn from(source: EndpointError) -> Self
Source§impl From<IntoAddressLookupError> for AnyError
impl From<IntoAddressLookupError> for AnyError
Source§fn from(value: IntoAddressLookupError) -> AnyError
fn from(value: IntoAddressLookupError) -> AnyError
Source§impl From<IntoAddressLookupError> for BindError
impl From<IntoAddressLookupError> for BindError
Source§fn from(source: IntoAddressLookupError) -> Self
fn from(source: IntoAddressLookupError) -> Self
Source§impl StackError for IntoAddressLookupError
impl StackError for IntoAddressLookupError
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 IntoAddressLookupError
impl !RefUnwindSafe for IntoAddressLookupError
impl Send for IntoAddressLookupError
impl Sync for IntoAddressLookupError
impl Unpin for IntoAddressLookupError
impl !UnwindSafe for IntoAddressLookupError
Blanket Implementations§
Trait Implementations§
Source§impl Debug for AddressLookupBuilderError
impl Debug for AddressLookupBuilderError
Source§impl Display for AddressLookupBuilderError
impl Display for AddressLookupBuilderError
Source§impl Error for AddressLookupBuilderError
impl Error for AddressLookupBuilderError
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<AddressLookupBuilderError> for AnyError
impl From<AddressLookupBuilderError> for AnyError
Source§fn from(value: AddressLookupBuilderError) -> AnyError
fn from(value: AddressLookupBuilderError) -> AnyError
Source§impl From<AddressLookupBuilderError> for BindError
impl From<AddressLookupBuilderError> for BindError
Source§fn from(source: AddressLookupBuilderError) -> Self
fn from(source: AddressLookupBuilderError) -> Self
Source§impl From<AnyError> for AddressLookupBuilderError
impl From<AnyError> for AddressLookupBuilderError
Source§impl From<EndpointError> for AddressLookupBuilderError
impl From<EndpointError> for AddressLookupBuilderError
Source§fn from(source: EndpointError) -> Self
fn from(source: EndpointError) -> Self
Source§impl StackError for AddressLookupBuilderError
impl StackError for AddressLookupBuilderError
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 AddressLookupBuilderError
impl !RefUnwindSafe for AddressLookupBuilderError
impl Send for AddressLookupBuilderError
impl Sync for AddressLookupBuilderError
impl Unpin for AddressLookupBuilderError
impl !UnwindSafe for AddressLookupBuilderError
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/3958/docs/iroh/address_lookup/enum.Error.html b/pr/3958/docs/iroh/address_lookup/enum.Error.html
index bfb791dc2d..3682629dbf 100644
--- a/pr/3958/docs/iroh/address_lookup/enum.Error.html
+++ b/pr/3958/docs/iroh/address_lookup/enum.Error.html
@@ -1,4 +1,4 @@
-Error in iroh::address_lookup - Rust Error
#[non_exhaustive]pub enum Error {
+Error in iroh::address_lookup - Rust Error
#[non_exhaustive]pub enum Error {
NoServiceConfigured {
meta: Meta,
},
@@ -14,19 +14,19 @@
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§NoServiceConfigured
Fields
§meta: MetaCaptured call-site metadata
§NoResults
Fields
§meta: MetaCaptured call-site metadata
§User
Implementations§
Error
#[non_exhaustive]pub enum Error {
+Error in iroh::address_lookup - Rust Error
#[non_exhaustive]pub enum Error {
NoServiceConfigured {
meta: Meta,
},
@@ -14,19 +14,19 @@
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.§NoServiceConfigured
Fields
§meta: MetaCaptured call-site metadata
§NoResults
Fields
§meta: MetaCaptured call-site metadata
§User
Implementations§
Implementations§
Sourcepub fn from_err_any(
provenance: &'static str,
source: impl Into<AnyError>,
) -> Self
pub fn from_err_any( provenance: &'static str, source: impl Into<AnyError>, ) -> Self
Creates a new user error from an arbitrary error type that can be converted into [AnyError].
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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<Error> for ConnectWithOptsError
impl From<Error> for ConnectWithOptsError
Source§fn from(source: AddressLookupError) -> Self
fn from(source: AddressLookupError) -> Self
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 Error
impl StackError for Error
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 Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
Blanket Implementations§
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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<Error> for ConnectWithOptsError
impl From<Error> for ConnectWithOptsError
Source§fn from(source: AddressLookupError) -> Self
fn from(source: AddressLookupError) -> Self
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 Error
impl StackError for Error
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 Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
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/3958/docs/iroh/address_lookup/enum.ParseError.html b/pr/3958/docs/iroh/address_lookup/enum.ParseError.html
index 63c74591f3..508967ac26 100644
--- a/pr/3958/docs/iroh/address_lookup/enum.ParseError.html
+++ b/pr/3958/docs/iroh/address_lookup/enum.ParseError.html
@@ -1,4 +1,4 @@
-ParseError in iroh::address_lookup - Rust ParseError
#[non_exhaustive]pub enum ParseError {
+ParseError in iroh::address_lookup - Rust ParseError
ParseError
#[non_exhaustive]pub enum ParseError {
+ParseError in iroh::address_lookup - Rust ParseError
Utf8
NotAnIrohRecord
DecodingError
Trait Implementations§
Source§impl Debug for ParseError
impl Debug for ParseError
Source§impl Display for ParseError
impl Display for ParseError
Source§impl Error for ParseError
impl Error for ParseError
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<DecodingError> for ParseError
impl From<DecodingError> for ParseError
Source§fn from(source: DecodingError) -> ParseError
fn from(source: DecodingError) -> ParseError
Source§impl From<Utf8Error> for ParseError
impl From<Utf8Error> for ParseError
Source§fn from(source: Utf8Error) -> ParseError
fn from(source: Utf8Error) -> ParseError
Source§impl StackError for ParseError
impl StackError for ParseError
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<ParseError>) -> Box<dyn Error + Send + Sync>
fn into_std(self: Box<ParseError>) -> Box<dyn Error + Send + Sync>
Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result<(), Error>
fn fmt_message(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Source§fn is_transparent(&self) -> bool
fn is_transparent(&self) -> bool
Auto Trait Implementations§
impl Freeze for ParseError
impl !RefUnwindSafe for ParseError
impl Send for ParseError
impl Sync for ParseError
impl Unpin for ParseError
impl !UnwindSafe for ParseError
Blanket Implementations§
Source§impl Debug for ParseError
impl Debug for ParseError
Source§impl Display for ParseError
impl Display for ParseError
Source§impl Error for ParseError
impl Error for ParseError
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<DecodingError> for ParseError
impl From<DecodingError> for ParseError
Source§fn from(source: DecodingError) -> ParseError
fn from(source: DecodingError) -> ParseError
Source§impl From<Utf8Error> for ParseError
impl From<Utf8Error> for ParseError
Source§fn from(source: Utf8Error) -> ParseError
fn from(source: Utf8Error) -> ParseError
Source§impl StackError for ParseError
impl StackError for ParseError
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<ParseError>) -> Box<dyn Error + Send + Sync>
fn into_std(self: Box<ParseError>) -> Box<dyn Error + Send + Sync>
Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result<(), Error>
fn fmt_message(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Source§fn is_transparent(&self) -> bool
fn is_transparent(&self) -> bool
impl Freeze for ParseError
impl !RefUnwindSafe for ParseError
impl Send for ParseError
impl Sync for ParseError
impl Unpin for ParseError
impl !UnwindSafe for ParseError
§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/3958/docs/iroh/address_lookup/index.html b/pr/3958/docs/iroh/address_lookup/index.html
index 7a6aee18d0..3b966882fb 100644
--- a/pr/3958/docs/iroh/address_lookup/index.html
+++ b/pr/3958/docs/iroh/address_lookup/index.html
@@ -1,4 +1,4 @@
-iroh::address_lookup - Rust Module address_lookup
Expand description
Lookup the address of an Endpoint ID.
+iroh::address_lookup - Rust Module address_lookup
Expand description
Lookup the address of an Endpoint ID.
To connect to an iroh endpoint a EndpointAddr is needed, which may contain a
RelayUrl or one or more direct addresses in addition to the EndpointId.
Since there is a conversion from EndpointId to EndpointAddr, you can also use
@@ -14,6 +14,14 @@ implementations to co-exist because there are many possible ways to implement th
Each Endpoint can use the address lookup mechanisms most suitable to the application.
The Builder::address_lookup method is used to add an address lookup mechanism to an
Endpoint.
+Each address lookup service receives the full set of transport addresses when publishing,
+but may only publish a subset of them based on its own constraints.
+To control which addresses are published to a particular service, you can supply an
+AddrFilter when configuring it via AddressLookupBuilder::with_addr_filter. The filter
+receives the full set of addresses and returns an ordered Vec, allowing you to both
+remove addresses you don’t want published and prioritize the ones you do Each service
+may apply additional filtering on top based on its own constraints, but will not publish
+addresses outside of what the filter returns. See each service’s documentation for details.
Some generally useful Address Lookup implementations are provided:
-
@@ -42,14 +50,14 @@ records to/from the Mainline DHT. It requires enabling the
address-lookup-
To use multiple Address Lookup’ssimultaneously you can call Builder::address_lookup.
This will use ConcurrentAddressLookup under the hood, which performs lookups to all
Address Lookupsystems at the same time.
-Builder::address_lookup takes any type that implements IntoAddressLookup. You can
+
Builder::address_lookup takes any type that implements AddressLookupBuilder. You can
implement that trait on a builder struct if your Address Lookup needs information
from the endpoint it is mounted on. After endpoint construction, your Address Lookup
-is built by calling IntoAddressLookup::into_address_lookup, passing the finished Endpoint to your
+is built by calling AddressLookupBuilder::into_address_lookup, passing the finished Endpoint to your
builder.
If your Address Lookupdoes not need any information from its endpoint, you can
pass the Address Lookupservice directly to Builder::address_lookup: All types that
-implement AddressLookup also have a blanket implementation of IntoAddressLookup.
+implement AddressLookup also have a blanket implementation of AddressLookupBuilder.
§Examples
A very common setup is to enable DNS Address Lookup, which needs to be done in two parts as a
PkarrPublisher and address_lookup::DnsAddressLookup:
@@ -73,4 +81,5 @@ implement await?;
Re-exports§
pub use dns::*;Non-wasm_browser pub use mdns::*;address-lookup-mdnspub use memory::*;pub use pkarr::dht::*;address-lookup-pkarr-dhtpub use pkarr::*;
Modules§
- dns
Non-wasm_browser - DNS endpoint discovery for iroh
- mdns
address-lookup-mdns - An address lookup service that uses an mdns-like service to discover and lookup the addresses of local endpoints.
- memory
- An in-memory address lookup system to manually add endpoint addressing information.
- pkarr
- An address lookup service which publishes and resolves endpoint information using a pkarr relay.
Structs§
- Concurrent
AddressLookup - An Address Lookup service that combines multiple Address Lookup sources.
- 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.
- Item
- Address lookup results from
AddressLookups. - User
Data - Under the hood this is a UTF-8 String is no longer than
UserData::MAX_LENGTH bytes.
Enums§
Traits§
- Address
Lookup - AddressLookup system for
super::Endpoint. - Into
AddressLookup - Trait for structs that can be converted into
AddressLookups.
\ No newline at end of file
+ .await?;
Module address_lookup
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
@@ -14,6 +14,14 @@ implementations to co-exist because there are many possible ways to implement th
Each Endpoint can use the address lookup mechanisms most suitable to the application.
The Builder::address_lookup method is used to add an address lookup mechanism to an
Endpoint.
Each address lookup service receives the full set of transport addresses when publishing, +but may only publish a subset of them based on its own constraints.
+To control which addresses are published to a particular service, you can supply an
+AddrFilter when configuring it via AddressLookupBuilder::with_addr_filter. The filter
+receives the full set of addresses and returns an ordered Vec, allowing you to both
+remove addresses you don’t want published and prioritize the ones you do Each service
+may apply additional filtering on top based on its own constraints, but will not publish
+addresses outside of what the filter returns. See each service’s documentation for details.
Some generally useful Address Lookup implementations are provided:
-
@@ -42,14 +50,14 @@ records to/from the Mainline DHT. It requires enabling the
address-lookup-To use multiple Address Lookup’ssimultaneously you can call
-Builder::address_lookup. This will useConcurrentAddressLookupunder the hood, which performs lookups to all Address Lookupsystems at the same time.Builder::address_lookuptakes any type that implementsIntoAddressLookup. You can +Builder::address_lookuptakes any type that implementsAddressLookupBuilder. You can implement that trait on a builder struct if your Address Lookup needs information from the endpoint it is mounted on. After endpoint construction, your Address Lookup -is built by callingIntoAddressLookup::into_address_lookup, passing the finishedEndpointto your +is built by callingAddressLookupBuilder::into_address_lookup, passing the finishedEndpointto your builder.If your Address Lookupdoes not need any information from its endpoint, you can pass the Address Lookupservice directly to
+implementBuilder::address_lookup: All types that -implementAddressLookupalso have a blanket implementation ofIntoAddressLookup.AddressLookupalso have a blanket implementation ofAddressLookupBuilder.§Examples
A very common setup is to enable DNS Address Lookup, which needs to be done in two parts as a
@@ -73,4 +81,5 @@ implement await?;PkarrPublisherandaddress_lookup::DnsAddressLookup:
Re-exports§
pub use dns::*;Non- wasm_browserpub use mdns::*;address-lookup-mdnspub use memory::*;pub use pkarr::dht::*;address-lookup-pkarr-dhtpub use pkarr::*;
Modules§
- dns
Non- wasm_browser - DNS endpoint discovery for iroh
- mdns
address-lookup-mdns - An address lookup service that uses an mdns-like service to discover and lookup the addresses of local endpoints.
- memory
- An in-memory address lookup system to manually add endpoint addressing information.
- pkarr
- An address lookup service which publishes and resolves endpoint information using a pkarr relay.
Structs§
- Concurrent
Address Lookup - An Address Lookup service that combines multiple Address Lookup sources.
- 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.
- Item
- Address lookup results from
AddressLookups. - User
Data - Under the hood this is a UTF-8 String is no longer than
UserData::MAX_LENGTHbytes.
Enums§
Traits§
- Address
Lookup - AddressLookup system for
super::Endpoint. - Into
Address Lookup - Trait for structs that can be converted into
AddressLookups.
Re-exports§
pub use dns::*;Non- wasm_browserpub use mdns::*;address-lookup-mdnspub use memory::*;pub use pkarr::dht::*;address-lookup-pkarr-dhtpub use pkarr::*;
Modules§
- dns
Non- wasm_browser - DNS endpoint discovery for iroh
- mdns
address-lookup-mdns - An address lookup service that uses an mdns-like service to discover and lookup the addresses of local endpoints.
- memory
- An in-memory address lookup system to manually add endpoint addressing information.
- pkarr
- An address lookup service which publishes and resolves endpoint information using a pkarr relay.
Structs§
- Addr
Filter - A filter and/or reordering function applied to transport addresses, +typically used by AddressLookup services in iroh before publishing.
- Concurrent
Address Lookup - An Address Lookup service that combines multiple Address Lookup sources.
- 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.
- Item
- Address lookup results from
AddressLookups. - User
Data - Under the hood this is a UTF-8 String is no longer than
UserData::MAX_LENGTHbytes.
Enums§
Traits§
- Address
Lookup - AddressLookup system for
super::Endpoint. - Address
Lookup Builder - Trait for structs that can be converted into
AddressLookups.
NAME
pub const NAME: &str = "mdns";address-lookup-mdns only.Expand description
Name of this address lookup service.
+NAME
pub const NAME: &str = "mdns";address-lookup-mdns only.Expand description
Name of this address lookup service.
Used as the provenance field in AddressLookupItems.
Used in the crate::endpoint::Source::AddressLookup enum variant as the name.
DiscoveryEvent
pub enum DiscoveryEvent {
+DiscoveryEvent in iroh::address_lookup::mdns - Rust DiscoveryEvent
pub enum DiscoveryEvent {
Discovered {
endpoint_info: EndpointInfo,
last_updated: Option<u64>,
@@ -13,8 +13,8 @@
Expired
A peer was expired due to being inactive, unreachable, or otherwise unavailable.
Fields
endpoint_id: EndpointIdThe id of the endpoint that expired.
-Trait Implementations§
Source§impl Clone for DiscoveryEvent
impl Clone for DiscoveryEvent
Source§fn clone(&self) -> DiscoveryEvent
fn clone(&self) -> DiscoveryEvent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DiscoveryEvent
impl Debug for DiscoveryEvent
Source§impl PartialEq for DiscoveryEvent
impl PartialEq for DiscoveryEvent
impl Eq for DiscoveryEvent
impl StructuralPartialEq for DiscoveryEvent
Auto Trait Implementations§
impl Freeze for DiscoveryEvent
impl RefUnwindSafe for DiscoveryEvent
impl Send for DiscoveryEvent
impl Sync for DiscoveryEvent
impl Unpin for DiscoveryEvent
impl UnwindSafe for DiscoveryEvent
Blanket Implementations§
Trait Implementations§
Source§impl Clone for DiscoveryEvent
impl Clone for DiscoveryEvent
Source§fn clone(&self) -> DiscoveryEvent
fn clone(&self) -> DiscoveryEvent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DiscoveryEvent
impl Debug for DiscoveryEvent
Source§impl PartialEq for DiscoveryEvent
impl PartialEq for DiscoveryEvent
impl Eq for DiscoveryEvent
impl StructuralPartialEq for DiscoveryEvent
Auto Trait Implementations§
impl Freeze for DiscoveryEvent
impl RefUnwindSafe for DiscoveryEvent
impl Send for DiscoveryEvent
impl Sync for DiscoveryEvent
impl Unpin for DiscoveryEvent
impl UnwindSafe for DiscoveryEvent
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/3958/docs/iroh/address_lookup/mdns/index.html b/pr/3958/docs/iroh/address_lookup/mdns/index.html
index 05e687fb5e..ccd48455b9 100644
--- a/pr/3958/docs/iroh/address_lookup/mdns/index.html
+++ b/pr/3958/docs/iroh/address_lookup/mdns/index.html
@@ -1,7 +1,9 @@
-iroh::address_lookup::mdns - Rust Module mdns
Available on crate feature address-lookup-mdns only.Expand description
An address lookup service that uses an mdns-like service to discover and lookup the addresses of local endpoints.
+iroh::address_lookup::mdns - Rust Module mdns
Available on crate feature address-lookup-mdns only.Expand description
An address lookup service that uses an mdns-like service to discover and lookup the addresses of local endpoints.
This allows you to use an mdns-like swarm discovery service to find address information about endpoints that are on your local network, no relay or outside internet needed.
See the swarm-discovery crate for more details.
When MdnsAddressLookup is enabled, it’s possible to get a list of the locally discovered endpoints by filtering a list of RemoteInfos.
+In order to get a list of locally discovered addresses, you must call MdnsAddressLookup::subscribe to subscribe
+to a stream of discovered addresses.
use std::time::Duration;
@@ -36,4 +38,16 @@ See the swarm-discovery
}
}
}
-}
Structs§
- Mdns
AddressLookup - Address Lookup using
swarm-discovery, a variation on mdns - Mdns
AddressLookupBuilder - Builder for
MdnsAddressLookup.
Enums§
- Discovery
Event - An event emitted from the
MdnsAddressLookup service.
Constants§
- NAME
- Name of this address lookup service.
\ No newline at end of file
+}§Filtering
+By default, MdnsAddressLookup will attempt to publish all addresses it receives:
+direct IP addresses and up to one RelayUrl. The following constraints apply regardless
+of any user-supplied filter:
+
+- Only the first
RelayUrl in the address set is published.
+- A
RelayUrl longer than 249 bytes is silently dropped.
+
+You can supply an AddrFilter via MdnsAddressLookupBuilder::with_addr_filter to
+control which addresses are published and in what order. The filter is applied before the
+constraints above, so for example you can use it to exclude relay URLs entirely or to
+prioritize certain addresses.
+ Structs§
- Mdns
AddressLookup - Address Lookup using
swarm-discovery, a variation on mdns. - Mdns
AddressLookupBuilder - Builder for
MdnsAddressLookup.
Enums§
- Discovery
Event - An event emitted from the
MdnsAddressLookup service.
Constants§
- NAME
- Name of this address lookup service.
Module mdns
address-lookup-mdns only.Expand description
An address lookup service that uses an mdns-like service to discover and lookup the addresses of local endpoints.
+Module mdns
address-lookup-mdns only.Expand description
An address lookup service that uses an mdns-like service to discover and lookup the addresses of local endpoints.
This allows you to use an mdns-like swarm discovery service to find address information about endpoints that are on your local network, no relay or outside internet needed.
See the swarm-discovery crate for more details.
When MdnsAddressLookup is enabled, it’s possible to get a list of the locally discovered endpoints by filtering a list of RemoteInfos.
In order to get a list of locally discovered addresses, you must call MdnsAddressLookup::subscribe to subscribe
+to a stream of discovered addresses.
use std::time::Duration;
@@ -36,4 +38,16 @@ See the swarm-discovery
}
}
}
-}Structs§
- Mdns
Address Lookup - Address Lookup using
swarm-discovery, a variation on mdns - Mdns
Address Lookup Builder - Builder for
MdnsAddressLookup.
Enums§
- Discovery
Event - An event emitted from the
MdnsAddressLookupservice.
Constants§
- NAME
- Name of this address lookup service.
§Filtering
+By default, MdnsAddressLookup will attempt to publish all addresses it receives:
+direct IP addresses and up to one RelayUrl. The following constraints apply regardless
+of any user-supplied filter:
-
+
- Only the first
RelayUrlin the address set is published.
+ - A
RelayUrllonger than 249 bytes is silently dropped.
+
You can supply an AddrFilter via MdnsAddressLookupBuilder::with_addr_filter to
+control which addresses are published and in what order. The filter is applied before the
+constraints above, so for example you can use it to exclude relay URLs entirely or to
+prioritize certain addresses.
Structs§
- Mdns
Address Lookup - Address Lookup using
swarm-discovery, a variation on mdns. - Mdns
Address Lookup Builder - Builder for
MdnsAddressLookup.
Enums§
- Discovery
Event - An event emitted from the
MdnsAddressLookupservice.
Constants§
- NAME
- Name of this address lookup service.
MdnsAddressLookup
pub struct MdnsAddressLookup { /* private fields */ }address-lookup-mdns only.Expand description
Address Lookup using swarm-discovery, a variation on mdns
Implementations§
Source§impl MdnsAddressLookup
impl MdnsAddressLookup
Sourcepub fn builder() -> MdnsAddressLookupBuilder
pub fn builder() -> MdnsAddressLookupBuilder
Returns a MdnsAddressLookupBuilder that implements Into.
Sourcepub async fn subscribe(
+MdnsAddressLookup in iroh::address_lookup::mdns - Rust MdnsAddressLookup
pub struct MdnsAddressLookup { /* private fields */ }
Available on crate feature address-lookup-mdns only.Expand description
Address Lookup using swarm-discovery, a variation on mdns.
+Implementations§
Source§impl MdnsAddressLookup
Sourcepub fn builder() -> MdnsAddressLookupBuilder
Returns a MdnsAddressLookupBuilder that implements Into.
+Sourcepub async fn subscribe(
&self,
-) -> impl Stream<Item = DiscoveryEvent> + Unpin + use<>
Subscribe to discovered endpoints
-Trait Implementations§
Source§impl AddressLookup for MdnsAddressLookup
Source§fn resolve(
+) -> impl Stream<Item = DiscoveryEvent> + Unpin + use<>
Subscribe to discovered endpoints.
+Trait Implementations§
Source§impl AddressLookup for MdnsAddressLookup
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 MdnsAddressLookup
Source§fn clone(&self) -> MdnsAddressLookup
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 MdnsAddressLookup
§impl RefUnwindSafe for MdnsAddressLookup
§impl Send for MdnsAddressLookup
§impl Sync for MdnsAddressLookup
§impl Unpin for MdnsAddressLookup
§impl UnwindSafe for MdnsAddressLookup
Blanket Implementations§
Source§impl<T> Any 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 MdnsAddressLookup
Source§fn clone(&self) -> MdnsAddressLookup
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 MdnsAddressLookup
§impl RefUnwindSafe for MdnsAddressLookup
§impl Send for MdnsAddressLookup
§impl Sync for MdnsAddressLookup
§impl Unpin for MdnsAddressLookup
§impl UnwindSafe for MdnsAddressLookup
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
+ T: AddressLookup,
Source§fn into_address_lookup(
+ self,
+ _endpoint: &Endpoint,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/mdns/struct.MdnsAddressLookupBuilder.html b/pr/3958/docs/iroh/address_lookup/mdns/struct.MdnsAddressLookupBuilder.html
index f3578f745d..a6bc77b9b6 100644
--- a/pr/3958/docs/iroh/address_lookup/mdns/struct.MdnsAddressLookupBuilder.html
+++ b/pr/3958/docs/iroh/address_lookup/mdns/struct.MdnsAddressLookupBuilder.html
@@ -1,24 +1,25 @@
-MdnsAddressLookupBuilder in iroh::address_lookup::mdns - Rust MdnsAddressLookupBuilder
pub struct MdnsAddressLookupBuilder { /* private fields */ }
Available on crate feature address-lookup-mdns only.Expand description
Builder for MdnsAddressLookup.
-Implementations§
Source§impl MdnsAddressLookupBuilder
Sourcepub fn advertise(self, advertise: bool) -> Self
Sets whether this endpoint should advertise its presence.
+MdnsAddressLookupBuilder in iroh::address_lookup::mdns - Rust MdnsAddressLookupBuilder
pub struct MdnsAddressLookupBuilder { /* private fields */ }
Available on crate feature address-lookup-mdns only.Expand description
Builder for MdnsAddressLookup.
+Implementations§
Source§impl MdnsAddressLookupBuilder
Sourcepub fn advertise(self, advertise: bool) -> Self
Sets whether this endpoint should advertise its presence.
Default is true.
-Sourcepub fn service_name(self, service_name: impl Into<String>) -> Self
Sets a custom service name.
+Sourcepub fn service_name(self, service_name: impl Into<String>) -> Self
Sets a custom service name.
The default is irohv1, which will show up on a record in the
following form, for example:
7rutqynuzu65fcdgoerbt4uoh3p62wuto2mp56x3uvhitqzssxga._irohv1._udp.local
Any custom service name will take the form, for example:
7rutqynuzu65fcdgoerbt4uoh3p62wuto2mp56x3uvhitqzssxga._{service_name}._udp.local
-Sourcepub fn set_addr_filter(self, filter: AddrFilter) -> Self
Sets a filter to control which addresses are published by this service.
+Sourcepub fn build(
self,
endpoint_id: EndpointId,
-) -> Result<MdnsAddressLookup, IntoAddressLookupError>
Builds an MdnsAddressLookup instance with the configured settings.
+) -> Result<MdnsAddressLookup, AddressLookupBuilderError>Builds an MdnsAddressLookup instance with the configured settings.
§Errors
Returns an error if the network does not allow ipv4 OR ipv6.
§Panics
This relies on [tokio::runtime::Handle::current] and will panic if called outside of the context of a tokio runtime.
-Trait Implementations§
Source§impl Debug for MdnsAddressLookupBuilder
Source§impl Default for MdnsAddressLookupBuilder
Trait Implementations§
Source§impl AddressLookupBuilder for MdnsAddressLookupBuilder
Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreAuto Trait Implementations§
§impl Freeze for MdnsAddressLookupBuilder
§impl RefUnwindSafe for MdnsAddressLookupBuilder
§impl Send for MdnsAddressLookupBuilder
§impl Sync for MdnsAddressLookupBuilder
§impl Unpin for MdnsAddressLookupBuilder
§impl UnwindSafe for MdnsAddressLookupBuilder
Blanket Implementations§
Source§impl<T> Any for Twhere
+) -> Result<impl AddressLookup, AddressLookupBuilderError>Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, filter: AddrFilter) -> Self
Sets a filter to control which addresses are published by this service Read more
Source§impl Debug for MdnsAddressLookupBuilder
Auto Trait Implementations§
§impl Freeze for MdnsAddressLookupBuilder
§impl !RefUnwindSafe for MdnsAddressLookupBuilder
§impl Send for MdnsAddressLookupBuilder
§impl Sync for MdnsAddressLookupBuilder
§impl Unpin for MdnsAddressLookupBuilder
§impl !UnwindSafe for MdnsAddressLookupBuilder
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3958/docs/iroh/address_lookup/memory/struct.MemoryLookup.html b/pr/3958/docs/iroh/address_lookup/memory/struct.MemoryLookup.html
index d7bd2b5528..ed3825b3d2 100644
--- a/pr/3958/docs/iroh/address_lookup/memory/struct.MemoryLookup.html
+++ b/pr/3958/docs/iroh/address_lookup/memory/struct.MemoryLookup.html
@@ -1,4 +1,4 @@
-MemoryLookup in iroh::address_lookup::memory - Rust MemoryLookup
pub struct MemoryLookup { /* private fields */ }
Expand description
An in-memory address lookup system to manually add endpoint addressing information.
+MemoryLookup in iroh::address_lookup::memory - Rust MemoryLookup
pub struct MemoryLookup { /* private fields */ }
Expand description
An in-memory address lookup system to manually add endpoint addressing information.
Often an application might get endpoint addressing information out-of-band in an
application-specific way. EndpointTicket’s are one common way used to achieve this.
This addressing information is often only usable for a limited time so needs to
@@ -71,7 +71,11 @@ relay URL is overwritten.
Trait Implementations§
Source§impl AddressLookup for MemoryLookup
Source§fn publish(&self, _data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreSource§impl Clone for MemoryLookup
Source§fn clone(&self) -> MemoryLookup
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 MemoryLookup
Auto Trait Implementations§
§impl Freeze for MemoryLookup
§impl RefUnwindSafe for MemoryLookup
§impl Send for MemoryLookup
§impl Sync for MemoryLookup
§impl Unpin for MemoryLookup
§impl UnwindSafe for MemoryLookup
Blanket Implementations§
Source§impl Clone for MemoryLookup
Source§fn clone(&self) -> MemoryLookup
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 MemoryLookup
Auto Trait Implementations§
§impl Freeze for MemoryLookup
§impl RefUnwindSafe for MemoryLookup
§impl Send for MemoryLookup
§impl Sync for MemoryLookup
§impl Unpin for MemoryLookup
§impl UnwindSafe for MemoryLookup
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
+ T: AddressLookup,
Source§fn into_address_lookup(
+ self,
+ _endpoint: &Endpoint,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_PKARR_TTL.html b/pr/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_PKARR_TTL.html
index 0f33a26465..132d13db24 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_PKARR_TTL.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_PKARR_TTL.html
@@ -1,4 +1,4 @@
-DEFAULT_PKARR_TTL in iroh::address_lookup::pkarr - Rust 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 in iroh::address_lookup::pkarr - Rust 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/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_REPUBLISH_INTERVAL.html b/pr/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_REPUBLISH_INTERVAL.html
index e22092eb60..6d9fc2f7aa 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_REPUBLISH_INTERVAL.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_REPUBLISH_INTERVAL.html
@@ -1,2 +1,2 @@
-
DEFAULT_REPUBLISH_INTERVAL in iroh::address_lookup::pkarr - Rust 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 in iroh::address_lookup::pkarr - Rust DEFAULT_REPUBLISH_INTERVAL
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_PROD.html b/pr/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_PROD.html
index 0706a5896e..53b2d1dfc9 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_PROD.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_PROD.html
@@ -1,4 +1,4 @@
-N0_DNS_PKARR_RELAY_PROD in iroh::address_lookup::pkarr - Rust 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 in iroh::address_lookup::pkarr - Rust 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/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_STAGING.html b/pr/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_STAGING.html
index 7b0c6835c5..69f1bb5e54 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_STAGING.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_STAGING.html
@@ -1,4 +1,4 @@
-N0_DNS_PKARR_RELAY_STAGING in iroh::address_lookup::pkarr - Rust 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 in iroh::address_lookup::pkarr - Rust 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.
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/dht/index.html b/pr/3958/docs/iroh/address_lookup/pkarr/dht/index.html
index c0680fc4a6..4373a5b5d6 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/dht/index.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/dht/index.html
@@ -1,4 +1,4 @@
-iroh::address_lookup::pkarr::dht - Rust Module dht
Available on crate feature address-lookup-pkarr-dht only.Expand description
Pkarr based address lookup for iroh, supporting both relay servers and the DHT.
+iroh::address_lookup::pkarr::dht - Rust Module dht
Available on crate feature address-lookup-pkarr-dht only.Expand description
Pkarr based address lookup for iroh, supporting both relay servers and the DHT.
This module contains pkarr-based address lookup for iroh which can use both pkarr
relay servers as well as the Mainline DHT directly. See the pkarr module for an
overview of pkarr.
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.Builder.html b/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.Builder.html
index 34f9e9feba..53c1d72aa4 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.Builder.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.Builder.html
@@ -1,20 +1,20 @@
-Builder in iroh::address_lookup::pkarr::dht - Rust Builder
pub struct Builder { /* private fields */ }
Available on crate feature address-lookup-pkarr-dht only.Expand description
Builder for DhtAddressLookup.
+Builder in iroh::address_lookup::pkarr::dht - Rust Builder
pub struct Builder { /* private fields */ }
Available on crate feature address-lookup-pkarr-dht only.Expand description
Builder for DhtAddressLookup.
By default, publishing to the DHT is enabled, and relay publishing is disabled.
-Implementations§
Source§impl Builder
Sourcepub fn secret_key(self, secret_key: SecretKey) -> Self
Sets the secret key to use for signing the DNS packets.
+Implementations§
Source§impl Builder
Sourcepub fn secret_key(self, secret_key: SecretKey) -> Self
Sets the secret key to use for signing the DNS packets.
Without a secret key, the endpoint will not publish its address to the DHT.
-Sourcepub fn pkarr_relay(self, pkarr_relay: Url) -> Self
Sets the pkarr relay URL to use.
-Sourcepub fn n0_dns_pkarr_relay(self) -> Self
Uses the default number 0 pkarr relay URL.
-Sourcepub fn include_direct_addresses(self, include_direct_addresses: bool) -> Self
Sets whether to include the direct addresses in the DNS packet.
-Sourcepub fn republish_delay(self, republish_delay: Duration) -> Self
Sets the republish delay for the DHT.
-Sourcepub fn no_publish(self) -> Self
Disables publishing even if a secret key is set.
-Sourcepub fn build(self) -> Result<DhtAddressLookup, IntoAddressLookupError>
Builds the address lookup mechanism.
-Trait Implementations§
Source§impl IntoAddressLookup for Builder
Sourcepub fn pkarr_relay(self, pkarr_relay: Url) -> Self
Sets the pkarr relay URL to use.
+Sourcepub fn n0_dns_pkarr_relay(self) -> Self
Uses the default number 0 pkarr relay URL.
+Sourcepub fn republish_delay(self, republish_delay: Duration) -> Self
Sets the republish delay for the DHT.
+Sourcepub fn no_publish(self) -> Self
Disables publishing even if a secret key is set.
+Sourcepub fn set_addr_filter(self, filter: AddrFilter) -> Self
Sets a filter to control which addresses are published by this service.
+Sourcepub fn build(self) -> Result<DhtAddressLookup, AddressLookupBuilderError>
Builds the address lookup mechanism.
+Trait Implementations§
Source§impl AddressLookupBuilder for Builder
Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreAuto Trait Implementations§
§impl Freeze for Builder
§impl !RefUnwindSafe for Builder
§impl Send for Builder
§impl Sync for Builder
§impl Unpin for Builder
§impl !UnwindSafe for Builder
Blanket Implementations§
Source§impl<T> Any for Twhere
+) -> Result<impl AddressLookup, AddressLookupBuilderError>Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, filter: AddrFilter) -> Self
Sets a filter to control which addresses are published by this service Read more
Auto Trait Implementations§
§impl Freeze for Builder
§impl !RefUnwindSafe for Builder
§impl Send for Builder
§impl Sync for Builder
§impl Unpin for Builder
§impl !UnwindSafe for Builder
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.DhtAddressLookup.html b/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.DhtAddressLookup.html
index 71a5720045..05dac9ca82 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.DhtAddressLookup.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.DhtAddressLookup.html
@@ -1,14 +1,23 @@
-DhtAddressLookup in iroh::address_lookup::pkarr::dht - Rust DhtAddressLookup
pub struct DhtAddressLookup(/* private fields */);
Available on crate feature address-lookup-pkarr-dht only.Expand description
Pkarr Mainline DHT and relay server address lookup.
+DhtAddressLookup in iroh::address_lookup::pkarr::dht - Rust DhtAddressLookup
pub struct DhtAddressLookup(/* private fields */);
Available on crate feature address-lookup-pkarr-dht only.Expand description
Pkarr Mainline DHT and relay server address lookup.
It stores endpoint addresses in DNS records, signed by the endpoint’s private key, and publishes
them to the BitTorrent Mainline DHT. See the pkarr module for more details.
This implements the AddressLookup trait to be used as an address lookup service which can
be used as both a publisher and resolver. Calling DhtAddressLookup::publish will start
a background task that periodically publishes the endpoint address.
-Implementations§
Source§impl DhtAddressLookup
Sourcepub fn builder() -> Builder
Creates a new builder for DhtAddressLookup.
-Trait Implementations§
Source§impl AddressLookup for DhtAddressLookup
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreSource§fn resolve(
+
By default, DhtAddressLookup will publish all addresses it receives:
+direct IP addresses and relay URLs. No internal address limits or truncation
+are applied.
+You can supply an AddrFilter via Builder::set_addr_filter to
+control which addresses are published.
+
Implementations§
Source§impl DhtAddressLookup
Sourcepub fn builder() -> Builder
Creates a new builder for DhtAddressLookup.
+Trait Implementations§
Source§impl AddressLookup for DhtAddressLookup
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreSource§fn resolve(
&self,
endpoint_id: EndpointId,
-) -> Option<BoxStream<Result<AddressLookupItem, AddressLookupError>>>
Source§impl Clone for DhtAddressLookup
Source§fn clone(&self) -> DhtAddressLookup
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 DhtAddressLookup
Auto Trait Implementations§
§impl Freeze for DhtAddressLookup
§impl !RefUnwindSafe for DhtAddressLookup
§impl Send for DhtAddressLookup
§impl Sync for DhtAddressLookup
§impl Unpin for DhtAddressLookup
§impl !UnwindSafe for DhtAddressLookup
Blanket Implementations§
Source§impl<T> Any for T
Source§impl Clone for DhtAddressLookup
Source§fn clone(&self) -> DhtAddressLookup
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 DhtAddressLookup
Auto Trait Implementations§
§impl Freeze for DhtAddressLookup
§impl !RefUnwindSafe for DhtAddressLookup
§impl Send for DhtAddressLookup
§impl Sync for DhtAddressLookup
§impl Unpin for DhtAddressLookup
§impl !UnwindSafe for DhtAddressLookup
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
+ T: AddressLookup,
Source§fn into_address_lookup(
+ self,
+ _endpoint: &Endpoint,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/enum.PkarrError.html b/pr/3958/docs/iroh/address_lookup/pkarr/enum.PkarrError.html
index 674b8ca39d..89501751b1 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/enum.PkarrError.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/enum.PkarrError.html
@@ -1,4 +1,4 @@
-PkarrError in iroh::address_lookup::pkarr - Rust PkarrError
#[non_exhaustive]pub enum PkarrError {
+PkarrError in iroh::address_lookup::pkarr - Rust PkarrError
#[non_exhaustive]pub enum PkarrError {
PublicKey {
source: PublicKeyError,
meta: Meta,
@@ -34,7 +34,7 @@
§HttpRequest
§HttpPayload
§Encoding
Trait Implementations§
Source§impl Debug for PkarrError
Source§impl Display for PkarrError
Source§impl Error for PkarrError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Source§impl From<PkarrError> for AnyError
Source§fn from(value: PkarrError) -> AnyError
Converts to this type from the input type.Source§impl From<PkarrError> for Error
Source§fn from(err: PkarrError) -> Self
Converts to this type from the input type.Source§impl StackError for PkarrError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
Returns the next source in the chain, if any.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for 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
Source§impl Display for PkarrError
Source§impl Error for PkarrError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Source§impl From<PkarrError> for AnyError
Source§fn from(value: PkarrError) -> AnyError
Converts to this type from the input type.Source§impl From<PkarrError> for Error
Source§fn from(err: PkarrError) -> Self
Converts to this type from the input type.Source§impl StackError for PkarrError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
Returns the next source in the chain, if any.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for 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> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/index.html b/pr/3958/docs/iroh/address_lookup/pkarr/index.html
index 9812c19ba2..5ae7d5f488 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/index.html
+++ b/pr/3958/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
@@ -20,6 +20,10 @@ the Mainline DHT on behalf on the client as well as cache lookups performed on t
to improve performance.
+PkarrPublisher publishes all addresses it receives by default, with no internal limiting.
+You can supply an AddrFilter via PkarrPublisherBuilder::set_addr_filter to limit the kinds
+and number of addresses that get published.
+Note that PkarrResolver and address_lookup::DnsAddressLookup only resolve and do not publish, so filtering does not apply to them.
For address lookup in iroh the pkarr Resource Records contain the addressing information,
providing endpoints which retrieve the pkarr Resource Record with enough detail
to contact the iroh endpoint.
@@ -40,4 +44,4 @@ to the application’s needs:
as the Mainline DHT.
-Modules§
- dht
address-lookup-pkarr-dht - Pkarr based address lookup for iroh, supporting both relay servers and the DHT.
Structs§
- Pkarr
Publisher - Publisher of address lookup information to a pkarr relay.
- Pkarr
PublisherBuilder - Builder for
PkarrPublisher. - Pkarr
RelayClient - A pkarr client to publish [
pkarr::SignedPacket]s to a pkarr relay. - Pkarr
Resolver - Resolver of address lookup information from a pkarr relay.
- Pkarr
ResolverBuilder - Builder for
PkarrResolver.
Enums§
Constants§
- DEFAULT_
PKARR_TTL - Default TTL for the records in the pkarr signed packet.
- DEFAULT_
REPUBLISH_INTERVAL - Interval in which to republish the endpoint info even if unchanged: 5 minutes.
- N0_
DNS_PKARR_RELAY_PROD - The production pkarr relay run by number 0.
- N0_
DNS_PKARR_RELAY_STAGING - The testing pkarr relay run by number 0.
\ No newline at end of file
+Modules§
- dht
address-lookup-pkarr-dht - Pkarr based address lookup for iroh, supporting both relay servers and the DHT.
Structs§
- Pkarr
Publisher - Publisher of address lookup information to a pkarr relay.
- Pkarr
PublisherBuilder - Builder for
PkarrPublisher. - Pkarr
RelayClient - A pkarr client to publish [
pkarr::SignedPacket]s to a pkarr relay. - Pkarr
RelayClientBuilder - A builder for the
PkarrRelayClient - Pkarr
Resolver - Resolver of address lookup information from a pkarr relay.
- Pkarr
ResolverBuilder - Builder for
PkarrResolver.
Enums§
Constants§
- DEFAULT_
PKARR_TTL - Default TTL for the records in the pkarr signed packet.
- DEFAULT_
REPUBLISH_INTERVAL - Interval in which to republish the endpoint info even if unchanged: 5 minutes.
- N0_
DNS_PKARR_RELAY_PROD - The production pkarr relay run by number 0.
- N0_
DNS_PKARR_RELAY_STAGING - The testing pkarr relay run by number 0.
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/sidebar-items.js b/pr/3958/docs/iroh/address_lookup/pkarr/sidebar-items.js
index 400a6bc7cf..46dcce1f3d 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/sidebar-items.js
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/sidebar-items.js
@@ -1 +1 @@
-window.SIDEBAR_ITEMS = {"constant":["DEFAULT_PKARR_TTL","DEFAULT_REPUBLISH_INTERVAL","N0_DNS_PKARR_RELAY_PROD","N0_DNS_PKARR_RELAY_STAGING"],"enum":["PkarrError"],"mod":["dht"],"struct":["PkarrPublisher","PkarrPublisherBuilder","PkarrRelayClient","PkarrResolver","PkarrResolverBuilder"]};
\ No newline at end of file
+window.SIDEBAR_ITEMS = {"constant":["DEFAULT_PKARR_TTL","DEFAULT_REPUBLISH_INTERVAL","N0_DNS_PKARR_RELAY_PROD","N0_DNS_PKARR_RELAY_STAGING"],"enum":["PkarrError"],"mod":["dht"],"struct":["PkarrPublisher","PkarrPublisherBuilder","PkarrRelayClient","PkarrRelayClientBuilder","PkarrResolver","PkarrResolverBuilder"]};
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html
index 95a62b4d39..02dd3d5ef6 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html
@@ -1,28 +1,32 @@
-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 IntoAddressLookup, so it can be passed to address_lookup.
+
PkarrPublisherBuilder implements AddressLookupBuilder, so it can be passed to address_lookup.
It will then use the endpoint’s secret key to sign published packets.
-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 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,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html
index e6be21376b..7dfa451886 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html
@@ -1,16 +1,22 @@
-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 build(self, secret_key: SecretKey) -> PkarrPublisher
Builds the PkarrPublisher with the passed secret key for signing packets.
+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 set_addr_filter(self, filter: AddrFilter) -> Self
Sets a filter to control which addresses are published by this service
+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§
Source§impl Debug for PkarrPublisherBuilder
Trait Implementations§
Source§impl AddressLookupBuilder for PkarrPublisherBuilder
Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. 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 AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, filter: AddrFilter) -> Selfwhere
+ Self: Sized,
Sets a filter to control which addresses are published by this service 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/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
index 1aebc073cb..a211ef5a81 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
@@ -1,18 +1,20 @@
-PkarrRelayClient in iroh::address_lookup::pkarr - Rust PkarrRelayClient
pub struct PkarrRelayClient { /* private fields */ }
Expand description
A pkarr client to publish [pkarr::SignedPacket]s to a pkarr relay.
-Implementations§
Source§impl PkarrRelayClient
Sourcepub fn with_dns_resolver(
+PkarrRelayClient in iroh::address_lookup::pkarr - Rust PkarrRelayClient
pub struct PkarrRelayClient { /* private fields */ }
Expand description
A pkarr client to publish [pkarr::SignedPacket]s 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,
- dns_resolver: DnsResolver,
-) -> Self
Available on non-wasm_browser only.
Creates a new client while passing a DNS resolver to use.
-Sourcepub async fn resolve(
+ 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/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
new file mode 100644
index 0000000000..a36791fe33
--- /dev/null
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
@@ -0,0 +1,45 @@
+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,
Source§impl<T> BorrowMut<T> for Twhere
+ T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moreSource§impl<T> CloneToUninit for Twhere
+ T: Clone,
§impl<T> CompatExt for T
§impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left is true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left(&self) returns true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read more§impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
+ T: ?Sized,
§impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
+ S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
+[WithDispatch] wrapper. Read more
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
index 7503fe7c7d..4ee7e8ed15 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
@@ -1,21 +1,25 @@
-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.
-The builder implements IntoAddressLookup.
-Sourcepub fn n0_dns() -> PkarrResolverBuilder
Creates a pkarr resolver builder which uses the number 0 pkarr relay server.
+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.
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> Any 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,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
index 32061012fe..d6a0f879d3 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
@@ -1,11 +1,12 @@
-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) -> PkarrResolver
Creates a PkarrResolver from this builder.
-Trait Implementations§
Source§impl Debug for PkarrResolverBuilder
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 with_addr_filter(self, _filter: AddrFilter) -> Self
no-op: resolver does not publish
+Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. 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 AddressLookup builder into a ready-to-use Address Lookup. 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/3958/docs/iroh/address_lookup/sidebar-items.js b/pr/3958/docs/iroh/address_lookup/sidebar-items.js
index 256a9a6580..a80ededc1c 100644
--- a/pr/3958/docs/iroh/address_lookup/sidebar-items.js
+++ b/pr/3958/docs/iroh/address_lookup/sidebar-items.js
@@ -1 +1 @@
-window.SIDEBAR_ITEMS = {"enum":["Error","IntoAddressLookupError","ParseError"],"mod":["dns","mdns","memory","pkarr"],"struct":["ConcurrentAddressLookup","EndpointData","EndpointInfo","Item","UserData"],"trait":["AddressLookup","IntoAddressLookup"]};
\ No newline at end of file
+window.SIDEBAR_ITEMS = {"enum":["AddressLookupBuilderError","Error","ParseError"],"mod":["dns","mdns","memory","pkarr"],"struct":["AddrFilter","ConcurrentAddressLookup","EndpointData","EndpointInfo","Item","UserData"],"trait":["AddressLookup","AddressLookupBuilder"]};
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/struct.AddrFilter.html b/pr/3958/docs/iroh/address_lookup/struct.AddrFilter.html
new file mode 100644
index 0000000000..18e77ad3d0
--- /dev/null
+++ b/pr/3958/docs/iroh/address_lookup/struct.AddrFilter.html
@@ -0,0 +1,56 @@
+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
+the output order). A BTreeSet cannot preserve a custom order, so the return
+type is Vec to make reordering possible.
+See the documentation for each address lookup implementation for details on
+what additional filtering the implementation may perform on top.
+Implementations§
Source§impl AddrFilter
Sourcepub fn new(
+ f: impl Fn(&BTreeSet<TransportAddr>) -> Vec<TransportAddr> + Send + Sync + 'static,
+) -> AddrFilter
Create a new AddrFilter
+Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
+Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
+Sourcepub fn apply(&self, addrs: &BTreeSet<TransportAddr>) -> 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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
+ T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
+ T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
+ T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moreSource§impl<T> CloneToUninit for Twhere
+ T: Clone,
§impl<T> CompatExt for T
§impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left is true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left(&self) returns true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read more§impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
+ T: ?Sized,
§impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
+ S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
+[WithDispatch] wrapper. Read more
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html b/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html
index 2ac53f880b..1f3c54ad49 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html
@@ -1,19 +1,23 @@
-ConcurrentAddressLookup in iroh::address_lookup - Rust ConcurrentAddressLookup
pub struct ConcurrentAddressLookup { /* private fields */ }
Expand description
An Address Lookup service that combines multiple Address Lookup sources.
+ConcurrentAddressLookup in iroh::address_lookup - Rust ConcurrentAddressLookup
pub struct ConcurrentAddressLookup { /* private fields */ }
Expand description
An Address Lookup service that combines multiple Address Lookup sources.
The Address Lookup will resolve concurrently.
-Implementations§
Source§impl ConcurrentAddressLookup
Sourcepub fn empty() -> Self
Creates an empty ConcurrentAddressLookup.
-Sourcepub fn from_services(services: Vec<Box<dyn AddressLookup>>) -> Self
Creates a new ConcurrentAddressLookup.
-Sourcepub fn add(&self, service: impl AddressLookup + 'static)
Adds an AddressLookup service.
+Implementations§
Source§impl ConcurrentAddressLookup
Sourcepub fn empty() -> Self
Creates an empty ConcurrentAddressLookup.
+Sourcepub fn from_services(services: Vec<Box<dyn AddressLookup>>) -> Self
Creates a new ConcurrentAddressLookup.
+Sourcepub fn add(&self, service: impl AddressLookup + 'static)
Adds an AddressLookup service.
If there is historical Address Lookup data, it will be published immediately on this service.
-Sourcepub fn add_boxed(&self, service: Box<dyn AddressLookup>)
Adds an already Boxed AddressLookup service.
+Sourcepub fn add_boxed(&self, service: Box<dyn AddressLookup>)
Adds an already Boxed AddressLookup service.
If there is historical Address Lookup data, it will be published immediately on this service.
-Trait Implementations§
Source§impl AddressLookup for ConcurrentAddressLookup
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreTrait Implementations§
Source§impl AddressLookup for ConcurrentAddressLookup
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreSource§impl Clone for ConcurrentAddressLookup
Source§fn clone(&self) -> ConcurrentAddressLookup
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 ConcurrentAddressLookup
Source§impl Default for ConcurrentAddressLookup
Source§fn default() -> ConcurrentAddressLookup
Returns the “default value” for a type. Read moreSource§impl<T> From<T> for ConcurrentAddressLookup
Auto Trait Implementations§
§impl Freeze for ConcurrentAddressLookup
§impl RefUnwindSafe for ConcurrentAddressLookup
§impl Send for ConcurrentAddressLookup
§impl Sync for ConcurrentAddressLookup
§impl Unpin for ConcurrentAddressLookup
§impl UnwindSafe for ConcurrentAddressLookup
Blanket Implementations§
Source§impl Clone for ConcurrentAddressLookup
Source§fn clone(&self) -> ConcurrentAddressLookup
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 ConcurrentAddressLookup
Source§impl Default for ConcurrentAddressLookup
Source§fn default() -> ConcurrentAddressLookup
Returns the “default value” for a type. Read moreSource§impl<T> From<T> for ConcurrentAddressLookup
Auto Trait Implementations§
§impl Freeze for ConcurrentAddressLookup
§impl RefUnwindSafe for ConcurrentAddressLookup
§impl Send for ConcurrentAddressLookup
§impl Sync for ConcurrentAddressLookup
§impl Unpin for ConcurrentAddressLookup
§impl UnwindSafe for ConcurrentAddressLookup
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
+ T: AddressLookup,
Source§fn into_address_lookup(
+ self,
+ _endpoint: &Endpoint,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html b/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
index d1e92d14df..d3d2a057f4 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
@@ -1,24 +1,26 @@
-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: impl IntoIterator<Item = TransportAddr>) -> EndpointData
Creates a new EndpointData with a relay URL and a set of direct addresses.
-Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> EndpointData
Sets the relay URL and returns the updated endpoint data.
-Sourcepub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> EndpointData
Sets the direct addresses and returns the updated endpoint data.
-Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> EndpointData
Sets the user-defined data and returns the updated 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 clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
-Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-Trait Implementations§
Source§impl Clone for 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<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§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§
Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: impl IntoIterator<Item = TransportAddr>) -> EndpointData
Creates a new EndpointData with a relay URL and a set of direct addresses.
+Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> EndpointData
Sets the relay URL and returns the updated endpoint data.
+Sourcepub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> EndpointData
Sets the direct addresses and returns the updated endpoint data.
+Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> EndpointData
Sets the user-defined data and returns the updated 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 clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
+Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
+Sourcepub fn filtered_addrs(&self, filter: &AddrFilter) -> Vec<TransportAddr>
Apply the given filter to the current addresses.
+Returns a vec to allow re-ordering of addresses.
+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<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§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/3958/docs/iroh/address_lookup/struct.EndpointInfo.html b/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
index 333b720b45..623c3442bf 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
@@ -1,42 +1,44 @@
-EndpointInfo in iroh::address_lookup - Rust EndpointInfo
pub async fn subscribe(
+MdnsAddressLookup in iroh::address_lookup::mdns - Rust MdnsAddressLookup
pub struct MdnsAddressLookup { /* private fields */ }
Available on crate feature address-lookup-mdns only.Expand description
Address Lookup using swarm-discovery, a variation on mdns.
+Implementations§
Source§impl MdnsAddressLookup
Sourcepub fn builder() -> MdnsAddressLookupBuilder
Returns a MdnsAddressLookupBuilder that implements Into.
+Sourcepub async fn subscribe(
&self,
-) -> impl Stream<Item = DiscoveryEvent> + Unpin + use<>
Subscribe to discovered endpoints
-Trait Implementations§
Source§impl AddressLookup for MdnsAddressLookup
Source§fn resolve(
+) -> impl Stream<Item = DiscoveryEvent> + Unpin + use<>
Subscribe to discovered endpoints.
+Trait Implementations§
Source§impl AddressLookup for MdnsAddressLookup
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 MdnsAddressLookup
Source§fn clone(&self) -> MdnsAddressLookup
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 MdnsAddressLookup
§impl RefUnwindSafe for MdnsAddressLookup
§impl Send for MdnsAddressLookup
§impl Sync for MdnsAddressLookup
§impl Unpin for MdnsAddressLookup
§impl UnwindSafe for MdnsAddressLookup
Blanket Implementations§
Source§impl<T> Any 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 MdnsAddressLookup
Source§fn clone(&self) -> MdnsAddressLookup
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 MdnsAddressLookup
§impl RefUnwindSafe for MdnsAddressLookup
§impl Send for MdnsAddressLookup
§impl Sync for MdnsAddressLookup
§impl Unpin for MdnsAddressLookup
§impl UnwindSafe for MdnsAddressLookup
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
+ T: AddressLookup,
Source§fn into_address_lookup(
+ self,
+ _endpoint: &Endpoint,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/mdns/struct.MdnsAddressLookupBuilder.html b/pr/3958/docs/iroh/address_lookup/mdns/struct.MdnsAddressLookupBuilder.html
index f3578f745d..a6bc77b9b6 100644
--- a/pr/3958/docs/iroh/address_lookup/mdns/struct.MdnsAddressLookupBuilder.html
+++ b/pr/3958/docs/iroh/address_lookup/mdns/struct.MdnsAddressLookupBuilder.html
@@ -1,24 +1,25 @@
-MdnsAddressLookupBuilder in iroh::address_lookup::mdns - Rust MdnsAddressLookupBuilder
pub struct MdnsAddressLookupBuilder { /* private fields */ }
Available on crate feature address-lookup-mdns only.Expand description
Builder for MdnsAddressLookup.
-Implementations§
Source§impl MdnsAddressLookupBuilder
Sourcepub fn advertise(self, advertise: bool) -> Self
Sets whether this endpoint should advertise its presence.
+MdnsAddressLookupBuilder in iroh::address_lookup::mdns - Rust MdnsAddressLookupBuilder
pub struct MdnsAddressLookupBuilder { /* private fields */ }
Available on crate feature address-lookup-mdns only.Expand description
Builder for MdnsAddressLookup.
+Implementations§
Source§impl MdnsAddressLookupBuilder
Sourcepub fn advertise(self, advertise: bool) -> Self
Sets whether this endpoint should advertise its presence.
Default is true.
-Sourcepub fn service_name(self, service_name: impl Into<String>) -> Self
Sets a custom service name.
+Sourcepub fn service_name(self, service_name: impl Into<String>) -> Self
Sets a custom service name.
The default is irohv1, which will show up on a record in the
following form, for example:
7rutqynuzu65fcdgoerbt4uoh3p62wuto2mp56x3uvhitqzssxga._irohv1._udp.local
Any custom service name will take the form, for example:
7rutqynuzu65fcdgoerbt4uoh3p62wuto2mp56x3uvhitqzssxga._{service_name}._udp.local
-Sourcepub fn set_addr_filter(self, filter: AddrFilter) -> Self
Sets a filter to control which addresses are published by this service.
+Sourcepub fn build(
self,
endpoint_id: EndpointId,
-) -> Result<MdnsAddressLookup, IntoAddressLookupError>
Builds an MdnsAddressLookup instance with the configured settings.
+) -> Result<MdnsAddressLookup, AddressLookupBuilderError>Builds an MdnsAddressLookup instance with the configured settings.
§Errors
Returns an error if the network does not allow ipv4 OR ipv6.
§Panics
This relies on [tokio::runtime::Handle::current] and will panic if called outside of the context of a tokio runtime.
-Trait Implementations§
Source§impl Debug for MdnsAddressLookupBuilder
Source§impl Default for MdnsAddressLookupBuilder
Trait Implementations§
Source§impl AddressLookupBuilder for MdnsAddressLookupBuilder
Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreAuto Trait Implementations§
§impl Freeze for MdnsAddressLookupBuilder
§impl RefUnwindSafe for MdnsAddressLookupBuilder
§impl Send for MdnsAddressLookupBuilder
§impl Sync for MdnsAddressLookupBuilder
§impl Unpin for MdnsAddressLookupBuilder
§impl UnwindSafe for MdnsAddressLookupBuilder
Blanket Implementations§
Source§impl<T> Any for Twhere
+) -> Result<impl AddressLookup, AddressLookupBuilderError>Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, filter: AddrFilter) -> Self
Sets a filter to control which addresses are published by this service Read more
Source§impl Debug for MdnsAddressLookupBuilder
Auto Trait Implementations§
§impl Freeze for MdnsAddressLookupBuilder
§impl !RefUnwindSafe for MdnsAddressLookupBuilder
§impl Send for MdnsAddressLookupBuilder
§impl Sync for MdnsAddressLookupBuilder
§impl Unpin for MdnsAddressLookupBuilder
§impl !UnwindSafe for MdnsAddressLookupBuilder
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3958/docs/iroh/address_lookup/memory/struct.MemoryLookup.html b/pr/3958/docs/iroh/address_lookup/memory/struct.MemoryLookup.html
index d7bd2b5528..ed3825b3d2 100644
--- a/pr/3958/docs/iroh/address_lookup/memory/struct.MemoryLookup.html
+++ b/pr/3958/docs/iroh/address_lookup/memory/struct.MemoryLookup.html
@@ -1,4 +1,4 @@
-MemoryLookup in iroh::address_lookup::memory - Rust MemoryLookup
pub struct MemoryLookup { /* private fields */ }
Expand description
An in-memory address lookup system to manually add endpoint addressing information.
+MemoryLookup in iroh::address_lookup::memory - Rust MemoryLookup
pub struct MemoryLookup { /* private fields */ }
Expand description
An in-memory address lookup system to manually add endpoint addressing information.
Often an application might get endpoint addressing information out-of-band in an
application-specific way. EndpointTicket’s are one common way used to achieve this.
This addressing information is often only usable for a limited time so needs to
@@ -71,7 +71,11 @@ relay URL is overwritten.
Trait Implementations§
Source§impl AddressLookup for MemoryLookup
Source§fn publish(&self, _data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreSource§impl Clone for MemoryLookup
Source§fn clone(&self) -> MemoryLookup
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 MemoryLookup
Auto Trait Implementations§
§impl Freeze for MemoryLookup
§impl RefUnwindSafe for MemoryLookup
§impl Send for MemoryLookup
§impl Sync for MemoryLookup
§impl Unpin for MemoryLookup
§impl UnwindSafe for MemoryLookup
Blanket Implementations§
Source§impl Clone for MemoryLookup
Source§fn clone(&self) -> MemoryLookup
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 MemoryLookup
Auto Trait Implementations§
§impl Freeze for MemoryLookup
§impl RefUnwindSafe for MemoryLookup
§impl Send for MemoryLookup
§impl Sync for MemoryLookup
§impl Unpin for MemoryLookup
§impl UnwindSafe for MemoryLookup
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
+ T: AddressLookup,
Source§fn into_address_lookup(
+ self,
+ _endpoint: &Endpoint,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_PKARR_TTL.html b/pr/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_PKARR_TTL.html
index 0f33a26465..132d13db24 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_PKARR_TTL.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_PKARR_TTL.html
@@ -1,4 +1,4 @@
-DEFAULT_PKARR_TTL in iroh::address_lookup::pkarr - Rust 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 in iroh::address_lookup::pkarr - Rust 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/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_REPUBLISH_INTERVAL.html b/pr/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_REPUBLISH_INTERVAL.html
index e22092eb60..6d9fc2f7aa 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_REPUBLISH_INTERVAL.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_REPUBLISH_INTERVAL.html
@@ -1,2 +1,2 @@
-
DEFAULT_REPUBLISH_INTERVAL in iroh::address_lookup::pkarr - Rust 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 in iroh::address_lookup::pkarr - Rust DEFAULT_REPUBLISH_INTERVAL
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_PROD.html b/pr/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_PROD.html
index 0706a5896e..53b2d1dfc9 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_PROD.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_PROD.html
@@ -1,4 +1,4 @@
-N0_DNS_PKARR_RELAY_PROD in iroh::address_lookup::pkarr - Rust 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 in iroh::address_lookup::pkarr - Rust 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/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_STAGING.html b/pr/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_STAGING.html
index 7b0c6835c5..69f1bb5e54 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_STAGING.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_STAGING.html
@@ -1,4 +1,4 @@
-N0_DNS_PKARR_RELAY_STAGING in iroh::address_lookup::pkarr - Rust 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 in iroh::address_lookup::pkarr - Rust 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.
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/dht/index.html b/pr/3958/docs/iroh/address_lookup/pkarr/dht/index.html
index c0680fc4a6..4373a5b5d6 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/dht/index.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/dht/index.html
@@ -1,4 +1,4 @@
-iroh::address_lookup::pkarr::dht - Rust Module dht
Available on crate feature address-lookup-pkarr-dht only.Expand description
Pkarr based address lookup for iroh, supporting both relay servers and the DHT.
+iroh::address_lookup::pkarr::dht - Rust Module dht
Available on crate feature address-lookup-pkarr-dht only.Expand description
Pkarr based address lookup for iroh, supporting both relay servers and the DHT.
This module contains pkarr-based address lookup for iroh which can use both pkarr
relay servers as well as the Mainline DHT directly. See the pkarr module for an
overview of pkarr.
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.Builder.html b/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.Builder.html
index 34f9e9feba..53c1d72aa4 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.Builder.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.Builder.html
@@ -1,20 +1,20 @@
-Builder in iroh::address_lookup::pkarr::dht - Rust Builder
pub struct Builder { /* private fields */ }
Available on crate feature address-lookup-pkarr-dht only.Expand description
Builder for DhtAddressLookup.
+Builder in iroh::address_lookup::pkarr::dht - Rust Builder
pub struct Builder { /* private fields */ }
Available on crate feature address-lookup-pkarr-dht only.Expand description
Builder for DhtAddressLookup.
By default, publishing to the DHT is enabled, and relay publishing is disabled.
-Implementations§
Source§impl Builder
Sourcepub fn secret_key(self, secret_key: SecretKey) -> Self
Sets the secret key to use for signing the DNS packets.
+Implementations§
Source§impl Builder
Sourcepub fn secret_key(self, secret_key: SecretKey) -> Self
Sets the secret key to use for signing the DNS packets.
Without a secret key, the endpoint will not publish its address to the DHT.
-Sourcepub fn pkarr_relay(self, pkarr_relay: Url) -> Self
Sets the pkarr relay URL to use.
-Sourcepub fn n0_dns_pkarr_relay(self) -> Self
Uses the default number 0 pkarr relay URL.
-Sourcepub fn include_direct_addresses(self, include_direct_addresses: bool) -> Self
Sets whether to include the direct addresses in the DNS packet.
-Sourcepub fn republish_delay(self, republish_delay: Duration) -> Self
Sets the republish delay for the DHT.
-Sourcepub fn no_publish(self) -> Self
Disables publishing even if a secret key is set.
-Sourcepub fn build(self) -> Result<DhtAddressLookup, IntoAddressLookupError>
Builds the address lookup mechanism.
-Trait Implementations§
Source§impl IntoAddressLookup for Builder
Sourcepub fn pkarr_relay(self, pkarr_relay: Url) -> Self
Sets the pkarr relay URL to use.
+Sourcepub fn n0_dns_pkarr_relay(self) -> Self
Uses the default number 0 pkarr relay URL.
+Sourcepub fn republish_delay(self, republish_delay: Duration) -> Self
Sets the republish delay for the DHT.
+Sourcepub fn no_publish(self) -> Self
Disables publishing even if a secret key is set.
+Sourcepub fn set_addr_filter(self, filter: AddrFilter) -> Self
Sets a filter to control which addresses are published by this service.
+Sourcepub fn build(self) -> Result<DhtAddressLookup, AddressLookupBuilderError>
Builds the address lookup mechanism.
+Trait Implementations§
Source§impl AddressLookupBuilder for Builder
Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreAuto Trait Implementations§
§impl Freeze for Builder
§impl !RefUnwindSafe for Builder
§impl Send for Builder
§impl Sync for Builder
§impl Unpin for Builder
§impl !UnwindSafe for Builder
Blanket Implementations§
Source§impl<T> Any for Twhere
+) -> Result<impl AddressLookup, AddressLookupBuilderError>Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, filter: AddrFilter) -> Self
Sets a filter to control which addresses are published by this service Read more
Auto Trait Implementations§
§impl Freeze for Builder
§impl !RefUnwindSafe for Builder
§impl Send for Builder
§impl Sync for Builder
§impl Unpin for Builder
§impl !UnwindSafe for Builder
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.DhtAddressLookup.html b/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.DhtAddressLookup.html
index 71a5720045..05dac9ca82 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.DhtAddressLookup.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.DhtAddressLookup.html
@@ -1,14 +1,23 @@
-DhtAddressLookup in iroh::address_lookup::pkarr::dht - Rust DhtAddressLookup
pub struct DhtAddressLookup(/* private fields */);
Available on crate feature address-lookup-pkarr-dht only.Expand description
Pkarr Mainline DHT and relay server address lookup.
+DhtAddressLookup in iroh::address_lookup::pkarr::dht - Rust DhtAddressLookup
pub struct DhtAddressLookup(/* private fields */);
Available on crate feature address-lookup-pkarr-dht only.Expand description
Pkarr Mainline DHT and relay server address lookup.
It stores endpoint addresses in DNS records, signed by the endpoint’s private key, and publishes
them to the BitTorrent Mainline DHT. See the pkarr module for more details.
This implements the AddressLookup trait to be used as an address lookup service which can
be used as both a publisher and resolver. Calling DhtAddressLookup::publish will start
a background task that periodically publishes the endpoint address.
-Implementations§
Source§impl DhtAddressLookup
Sourcepub fn builder() -> Builder
Creates a new builder for DhtAddressLookup.
-Trait Implementations§
Source§impl AddressLookup for DhtAddressLookup
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreSource§fn resolve(
+
By default, DhtAddressLookup will publish all addresses it receives:
+direct IP addresses and relay URLs. No internal address limits or truncation
+are applied.
+You can supply an AddrFilter via Builder::set_addr_filter to
+control which addresses are published.
+
Implementations§
Source§impl DhtAddressLookup
Sourcepub fn builder() -> Builder
Creates a new builder for DhtAddressLookup.
+Trait Implementations§
Source§impl AddressLookup for DhtAddressLookup
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreSource§fn resolve(
&self,
endpoint_id: EndpointId,
-) -> Option<BoxStream<Result<AddressLookupItem, AddressLookupError>>>
Source§impl Clone for DhtAddressLookup
Source§fn clone(&self) -> DhtAddressLookup
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 DhtAddressLookup
Auto Trait Implementations§
§impl Freeze for DhtAddressLookup
§impl !RefUnwindSafe for DhtAddressLookup
§impl Send for DhtAddressLookup
§impl Sync for DhtAddressLookup
§impl Unpin for DhtAddressLookup
§impl !UnwindSafe for DhtAddressLookup
Blanket Implementations§
Source§impl<T> Any for T
Source§impl Clone for DhtAddressLookup
Source§fn clone(&self) -> DhtAddressLookup
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 DhtAddressLookup
Auto Trait Implementations§
§impl Freeze for DhtAddressLookup
§impl !RefUnwindSafe for DhtAddressLookup
§impl Send for DhtAddressLookup
§impl Sync for DhtAddressLookup
§impl Unpin for DhtAddressLookup
§impl !UnwindSafe for DhtAddressLookup
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
+ T: AddressLookup,
Source§fn into_address_lookup(
+ self,
+ _endpoint: &Endpoint,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/enum.PkarrError.html b/pr/3958/docs/iroh/address_lookup/pkarr/enum.PkarrError.html
index 674b8ca39d..89501751b1 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/enum.PkarrError.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/enum.PkarrError.html
@@ -1,4 +1,4 @@
-PkarrError in iroh::address_lookup::pkarr - Rust PkarrError
#[non_exhaustive]pub enum PkarrError {
+PkarrError in iroh::address_lookup::pkarr - Rust PkarrError
#[non_exhaustive]pub enum PkarrError {
PublicKey {
source: PublicKeyError,
meta: Meta,
@@ -34,7 +34,7 @@
§HttpRequest
§HttpPayload
§Encoding
Trait Implementations§
Source§impl Debug for PkarrError
Source§impl Display for PkarrError
Source§impl Error for PkarrError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Source§impl From<PkarrError> for AnyError
Source§fn from(value: PkarrError) -> AnyError
Converts to this type from the input type.Source§impl From<PkarrError> for Error
Source§fn from(err: PkarrError) -> Self
Converts to this type from the input type.Source§impl StackError for PkarrError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
Returns the next source in the chain, if any.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for 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
Source§impl Display for PkarrError
Source§impl Error for PkarrError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Source§impl From<PkarrError> for AnyError
Source§fn from(value: PkarrError) -> AnyError
Converts to this type from the input type.Source§impl From<PkarrError> for Error
Source§fn from(err: PkarrError) -> Self
Converts to this type from the input type.Source§impl StackError for PkarrError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
Returns the next source in the chain, if any.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for 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> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/index.html b/pr/3958/docs/iroh/address_lookup/pkarr/index.html
index 9812c19ba2..5ae7d5f488 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/index.html
+++ b/pr/3958/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
@@ -20,6 +20,10 @@ the Mainline DHT on behalf on the client as well as cache lookups performed on t
to improve performance.
+PkarrPublisher publishes all addresses it receives by default, with no internal limiting.
+You can supply an AddrFilter via PkarrPublisherBuilder::set_addr_filter to limit the kinds
+and number of addresses that get published.
+Note that PkarrResolver and address_lookup::DnsAddressLookup only resolve and do not publish, so filtering does not apply to them.
For address lookup in iroh the pkarr Resource Records contain the addressing information,
providing endpoints which retrieve the pkarr Resource Record with enough detail
to contact the iroh endpoint.
@@ -40,4 +44,4 @@ to the application’s needs:
as the Mainline DHT.
-Modules§
- dht
address-lookup-pkarr-dht - Pkarr based address lookup for iroh, supporting both relay servers and the DHT.
Structs§
- Pkarr
Publisher - Publisher of address lookup information to a pkarr relay.
- Pkarr
PublisherBuilder - Builder for
PkarrPublisher. - Pkarr
RelayClient - A pkarr client to publish [
pkarr::SignedPacket]s to a pkarr relay. - Pkarr
Resolver - Resolver of address lookup information from a pkarr relay.
- Pkarr
ResolverBuilder - Builder for
PkarrResolver.
Enums§
Constants§
- DEFAULT_
PKARR_TTL - Default TTL for the records in the pkarr signed packet.
- DEFAULT_
REPUBLISH_INTERVAL - Interval in which to republish the endpoint info even if unchanged: 5 minutes.
- N0_
DNS_PKARR_RELAY_PROD - The production pkarr relay run by number 0.
- N0_
DNS_PKARR_RELAY_STAGING - The testing pkarr relay run by number 0.
\ No newline at end of file
+Modules§
- dht
address-lookup-pkarr-dht - Pkarr based address lookup for iroh, supporting both relay servers and the DHT.
Structs§
- Pkarr
Publisher - Publisher of address lookup information to a pkarr relay.
- Pkarr
PublisherBuilder - Builder for
PkarrPublisher. - Pkarr
RelayClient - A pkarr client to publish [
pkarr::SignedPacket]s to a pkarr relay. - Pkarr
RelayClientBuilder - A builder for the
PkarrRelayClient - Pkarr
Resolver - Resolver of address lookup information from a pkarr relay.
- Pkarr
ResolverBuilder - Builder for
PkarrResolver.
Enums§
Constants§
- DEFAULT_
PKARR_TTL - Default TTL for the records in the pkarr signed packet.
- DEFAULT_
REPUBLISH_INTERVAL - Interval in which to republish the endpoint info even if unchanged: 5 minutes.
- N0_
DNS_PKARR_RELAY_PROD - The production pkarr relay run by number 0.
- N0_
DNS_PKARR_RELAY_STAGING - The testing pkarr relay run by number 0.
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/sidebar-items.js b/pr/3958/docs/iroh/address_lookup/pkarr/sidebar-items.js
index 400a6bc7cf..46dcce1f3d 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/sidebar-items.js
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/sidebar-items.js
@@ -1 +1 @@
-window.SIDEBAR_ITEMS = {"constant":["DEFAULT_PKARR_TTL","DEFAULT_REPUBLISH_INTERVAL","N0_DNS_PKARR_RELAY_PROD","N0_DNS_PKARR_RELAY_STAGING"],"enum":["PkarrError"],"mod":["dht"],"struct":["PkarrPublisher","PkarrPublisherBuilder","PkarrRelayClient","PkarrResolver","PkarrResolverBuilder"]};
\ No newline at end of file
+window.SIDEBAR_ITEMS = {"constant":["DEFAULT_PKARR_TTL","DEFAULT_REPUBLISH_INTERVAL","N0_DNS_PKARR_RELAY_PROD","N0_DNS_PKARR_RELAY_STAGING"],"enum":["PkarrError"],"mod":["dht"],"struct":["PkarrPublisher","PkarrPublisherBuilder","PkarrRelayClient","PkarrRelayClientBuilder","PkarrResolver","PkarrResolverBuilder"]};
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html
index 95a62b4d39..02dd3d5ef6 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html
@@ -1,28 +1,32 @@
-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 IntoAddressLookup, so it can be passed to address_lookup.
+
PkarrPublisherBuilder implements AddressLookupBuilder, so it can be passed to address_lookup.
It will then use the endpoint’s secret key to sign published packets.
-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 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,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html
index e6be21376b..7dfa451886 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html
@@ -1,16 +1,22 @@
-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 build(self, secret_key: SecretKey) -> PkarrPublisher
Builds the PkarrPublisher with the passed secret key for signing packets.
+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 set_addr_filter(self, filter: AddrFilter) -> Self
Sets a filter to control which addresses are published by this service
+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§
Source§impl Debug for PkarrPublisherBuilder
Trait Implementations§
Source§impl AddressLookupBuilder for PkarrPublisherBuilder
Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. 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 AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, filter: AddrFilter) -> Selfwhere
+ Self: Sized,
Sets a filter to control which addresses are published by this service 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/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
index 1aebc073cb..a211ef5a81 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
@@ -1,18 +1,20 @@
-PkarrRelayClient in iroh::address_lookup::pkarr - Rust PkarrRelayClient
pub struct PkarrRelayClient { /* private fields */ }
Expand description
A pkarr client to publish [pkarr::SignedPacket]s to a pkarr relay.
-Implementations§
Source§impl PkarrRelayClient
Sourcepub fn with_dns_resolver(
+PkarrRelayClient in iroh::address_lookup::pkarr - Rust PkarrRelayClient
pub struct PkarrRelayClient { /* private fields */ }
Expand description
A pkarr client to publish [pkarr::SignedPacket]s 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,
- dns_resolver: DnsResolver,
-) -> Self
Available on non-wasm_browser only.
Creates a new client while passing a DNS resolver to use.
-Sourcepub async fn resolve(
+ 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/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
new file mode 100644
index 0000000000..a36791fe33
--- /dev/null
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
@@ -0,0 +1,45 @@
+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,
Source§impl<T> BorrowMut<T> for Twhere
+ T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moreSource§impl<T> CloneToUninit for Twhere
+ T: Clone,
§impl<T> CompatExt for T
§impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left is true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left(&self) returns true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read more§impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
+ T: ?Sized,
§impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
+ S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
+[WithDispatch] wrapper. Read more
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
index 7503fe7c7d..4ee7e8ed15 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
@@ -1,21 +1,25 @@
-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.
-The builder implements IntoAddressLookup.
-Sourcepub fn n0_dns() -> PkarrResolverBuilder
Creates a pkarr resolver builder which uses the number 0 pkarr relay server.
+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.
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> Any 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,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
index 32061012fe..d6a0f879d3 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
@@ -1,11 +1,12 @@
-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) -> PkarrResolver
Creates a PkarrResolver from this builder.
-Trait Implementations§
Source§impl Debug for PkarrResolverBuilder
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 with_addr_filter(self, _filter: AddrFilter) -> Self
no-op: resolver does not publish
+Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. 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 AddressLookup builder into a ready-to-use Address Lookup. 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/3958/docs/iroh/address_lookup/sidebar-items.js b/pr/3958/docs/iroh/address_lookup/sidebar-items.js
index 256a9a6580..a80ededc1c 100644
--- a/pr/3958/docs/iroh/address_lookup/sidebar-items.js
+++ b/pr/3958/docs/iroh/address_lookup/sidebar-items.js
@@ -1 +1 @@
-window.SIDEBAR_ITEMS = {"enum":["Error","IntoAddressLookupError","ParseError"],"mod":["dns","mdns","memory","pkarr"],"struct":["ConcurrentAddressLookup","EndpointData","EndpointInfo","Item","UserData"],"trait":["AddressLookup","IntoAddressLookup"]};
\ No newline at end of file
+window.SIDEBAR_ITEMS = {"enum":["AddressLookupBuilderError","Error","ParseError"],"mod":["dns","mdns","memory","pkarr"],"struct":["AddrFilter","ConcurrentAddressLookup","EndpointData","EndpointInfo","Item","UserData"],"trait":["AddressLookup","AddressLookupBuilder"]};
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/struct.AddrFilter.html b/pr/3958/docs/iroh/address_lookup/struct.AddrFilter.html
new file mode 100644
index 0000000000..18e77ad3d0
--- /dev/null
+++ b/pr/3958/docs/iroh/address_lookup/struct.AddrFilter.html
@@ -0,0 +1,56 @@
+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
+the output order). A BTreeSet cannot preserve a custom order, so the return
+type is Vec to make reordering possible.
+See the documentation for each address lookup implementation for details on
+what additional filtering the implementation may perform on top.
+Implementations§
Source§impl AddrFilter
Sourcepub fn new(
+ f: impl Fn(&BTreeSet<TransportAddr>) -> Vec<TransportAddr> + Send + Sync + 'static,
+) -> AddrFilter
Create a new AddrFilter
+Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
+Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
+Sourcepub fn apply(&self, addrs: &BTreeSet<TransportAddr>) -> 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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
+ T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
+ T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
+ T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moreSource§impl<T> CloneToUninit for Twhere
+ T: Clone,
§impl<T> CompatExt for T
§impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left is true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left(&self) returns true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read more§impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
+ T: ?Sized,
§impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
+ S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
+[WithDispatch] wrapper. Read more
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html b/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html
index 2ac53f880b..1f3c54ad49 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html
@@ -1,19 +1,23 @@
-ConcurrentAddressLookup in iroh::address_lookup - Rust ConcurrentAddressLookup
pub struct ConcurrentAddressLookup { /* private fields */ }
Expand description
An Address Lookup service that combines multiple Address Lookup sources.
+ConcurrentAddressLookup in iroh::address_lookup - Rust ConcurrentAddressLookup
pub struct ConcurrentAddressLookup { /* private fields */ }
Expand description
An Address Lookup service that combines multiple Address Lookup sources.
The Address Lookup will resolve concurrently.
-Implementations§
Source§impl ConcurrentAddressLookup
Sourcepub fn empty() -> Self
Creates an empty ConcurrentAddressLookup.
-Sourcepub fn from_services(services: Vec<Box<dyn AddressLookup>>) -> Self
Creates a new ConcurrentAddressLookup.
-Sourcepub fn add(&self, service: impl AddressLookup + 'static)
Adds an AddressLookup service.
+Implementations§
Source§impl ConcurrentAddressLookup
Sourcepub fn empty() -> Self
Creates an empty ConcurrentAddressLookup.
+Sourcepub fn from_services(services: Vec<Box<dyn AddressLookup>>) -> Self
Creates a new ConcurrentAddressLookup.
+Sourcepub fn add(&self, service: impl AddressLookup + 'static)
Adds an AddressLookup service.
If there is historical Address Lookup data, it will be published immediately on this service.
-Sourcepub fn add_boxed(&self, service: Box<dyn AddressLookup>)
Adds an already Boxed AddressLookup service.
+Sourcepub fn add_boxed(&self, service: Box<dyn AddressLookup>)
Adds an already Boxed AddressLookup service.
If there is historical Address Lookup data, it will be published immediately on this service.
-Trait Implementations§
Source§impl AddressLookup for ConcurrentAddressLookup
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreTrait Implementations§
Source§impl AddressLookup for ConcurrentAddressLookup
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreSource§impl Clone for ConcurrentAddressLookup
Source§fn clone(&self) -> ConcurrentAddressLookup
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 ConcurrentAddressLookup
Source§impl Default for ConcurrentAddressLookup
Source§fn default() -> ConcurrentAddressLookup
Returns the “default value” for a type. Read moreSource§impl<T> From<T> for ConcurrentAddressLookup
Auto Trait Implementations§
§impl Freeze for ConcurrentAddressLookup
§impl RefUnwindSafe for ConcurrentAddressLookup
§impl Send for ConcurrentAddressLookup
§impl Sync for ConcurrentAddressLookup
§impl Unpin for ConcurrentAddressLookup
§impl UnwindSafe for ConcurrentAddressLookup
Blanket Implementations§
Source§impl Clone for ConcurrentAddressLookup
Source§fn clone(&self) -> ConcurrentAddressLookup
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 ConcurrentAddressLookup
Source§impl Default for ConcurrentAddressLookup
Source§fn default() -> ConcurrentAddressLookup
Returns the “default value” for a type. Read moreSource§impl<T> From<T> for ConcurrentAddressLookup
Auto Trait Implementations§
§impl Freeze for ConcurrentAddressLookup
§impl RefUnwindSafe for ConcurrentAddressLookup
§impl Send for ConcurrentAddressLookup
§impl Sync for ConcurrentAddressLookup
§impl Unpin for ConcurrentAddressLookup
§impl UnwindSafe for ConcurrentAddressLookup
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
+ T: AddressLookup,
Source§fn into_address_lookup(
+ self,
+ _endpoint: &Endpoint,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html b/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
index d1e92d14df..d3d2a057f4 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
@@ -1,24 +1,26 @@
-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: impl IntoIterator<Item = TransportAddr>) -> EndpointData
Creates a new EndpointData with a relay URL and a set of direct addresses.
-Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> EndpointData
Sets the relay URL and returns the updated endpoint data.
-Sourcepub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> EndpointData
Sets the direct addresses and returns the updated endpoint data.
-Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> EndpointData
Sets the user-defined data and returns the updated 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 clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
-Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-Trait Implementations§
Source§impl Clone for 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<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§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§
Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: impl IntoIterator<Item = TransportAddr>) -> EndpointData
Creates a new EndpointData with a relay URL and a set of direct addresses.
+Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> EndpointData
Sets the relay URL and returns the updated endpoint data.
+Sourcepub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> EndpointData
Sets the direct addresses and returns the updated endpoint data.
+Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> EndpointData
Sets the user-defined data and returns the updated 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 clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
+Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
+Sourcepub fn filtered_addrs(&self, filter: &AddrFilter) -> Vec<TransportAddr>
Apply the given filter to the current addresses.
+Returns a vec to allow re-ordering of addresses.
+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<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§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/3958/docs/iroh/address_lookup/struct.EndpointInfo.html b/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
index 333b720b45..623c3442bf 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
@@ -1,42 +1,44 @@
-EndpointInfo in iroh::address_lookup - Rust EndpointInfo
MdnsAddressLookup
pub struct MdnsAddressLookup { /* private fields */ }address-lookup-mdns only.Expand description
Address Lookup using swarm-discovery, a variation on mdns.
Implementations§
Source§impl MdnsAddressLookup
impl MdnsAddressLookup
Sourcepub fn builder() -> MdnsAddressLookupBuilder
pub fn builder() -> MdnsAddressLookupBuilder
Returns a MdnsAddressLookupBuilder that implements Into.
Sourcepub async fn subscribe(
&self,
-) -> impl Stream<Item = DiscoveryEvent> + Unpin + use<>
pub async fn subscribe( &self, -) -> impl Stream<Item = DiscoveryEvent> + Unpin + use<>
Subscribe to discovered endpoints
-Trait Implementations§
Source§impl AddressLookup for MdnsAddressLookup
impl AddressLookup for MdnsAddressLookup
Source§fn resolve(
+) -> impl Stream<Item = DiscoveryEvent> + Unpin + use<>
fn resolve( +) -> impl Stream<Item = DiscoveryEvent> + Unpin + use<>
Subscribe to discovered endpoints.
+Trait Implementations§
Source§impl AddressLookup for MdnsAddressLookup
impl AddressLookup for MdnsAddressLookup
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 MdnsAddressLookup
impl Clone for MdnsAddressLookup
Source§fn clone(&self) -> MdnsAddressLookup
fn clone(&self) -> MdnsAddressLookup
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 MdnsAddressLookup
impl RefUnwindSafe for MdnsAddressLookup
impl Send for MdnsAddressLookup
impl Sync for MdnsAddressLookup
impl Unpin for MdnsAddressLookup
impl UnwindSafe for MdnsAddressLookup
Blanket Implementations§
Source§impl<T> Any 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> Any 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 MdnsAddressLookup
impl Clone for MdnsAddressLookup
Source§fn clone(&self) -> MdnsAddressLookup
fn clone(&self) -> MdnsAddressLookup
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 MdnsAddressLookup
impl RefUnwindSafe for MdnsAddressLookup
impl Send for MdnsAddressLookup
impl Sync for MdnsAddressLookup
impl Unpin for MdnsAddressLookup
impl UnwindSafe for MdnsAddressLookup
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,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
fn into_address_lookup( + self, + _endpoint: &Endpoint, +) -> Result<impl AddressLookup, AddressLookupBuilderError>
Source§fn with_addr_filter(self, _filter: AddrFilter) -> T
fn with_addr_filter(self, _filter: AddrFilter) -> T
§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,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
fn into_address_lookup( - self, - _endpoint: &Endpoint, -) -> Result<impl AddressLookup, IntoAddressLookupError>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/mdns/struct.MdnsAddressLookupBuilder.html b/pr/3958/docs/iroh/address_lookup/mdns/struct.MdnsAddressLookupBuilder.html
index f3578f745d..a6bc77b9b6 100644
--- a/pr/3958/docs/iroh/address_lookup/mdns/struct.MdnsAddressLookupBuilder.html
+++ b/pr/3958/docs/iroh/address_lookup/mdns/struct.MdnsAddressLookupBuilder.html
@@ -1,24 +1,25 @@
-MdnsAddressLookupBuilder in iroh::address_lookup::mdns - Rust MdnsAddressLookupBuilder
pub struct MdnsAddressLookupBuilder { /* private fields */ }
Available on crate feature address-lookup-mdns only.Expand description
Builder for MdnsAddressLookup.
-Implementations§
Source§impl MdnsAddressLookupBuilder
Sourcepub fn advertise(self, advertise: bool) -> Self
Sets whether this endpoint should advertise its presence.
+MdnsAddressLookupBuilder in iroh::address_lookup::mdns - Rust MdnsAddressLookupBuilder
pub struct MdnsAddressLookupBuilder { /* private fields */ }
Available on crate feature address-lookup-mdns only.Expand description
Builder for MdnsAddressLookup.
+Implementations§
Source§impl MdnsAddressLookupBuilder
Sourcepub fn advertise(self, advertise: bool) -> Self
Sets whether this endpoint should advertise its presence.
Default is true.
-Sourcepub fn service_name(self, service_name: impl Into<String>) -> Self
Sets a custom service name.
+Sourcepub fn service_name(self, service_name: impl Into<String>) -> Self
Sets a custom service name.
The default is irohv1, which will show up on a record in the
following form, for example:
7rutqynuzu65fcdgoerbt4uoh3p62wuto2mp56x3uvhitqzssxga._irohv1._udp.local
Any custom service name will take the form, for example:
7rutqynuzu65fcdgoerbt4uoh3p62wuto2mp56x3uvhitqzssxga._{service_name}._udp.local
-Sourcepub fn set_addr_filter(self, filter: AddrFilter) -> Self
Sets a filter to control which addresses are published by this service.
+Sourcepub fn build(
self,
endpoint_id: EndpointId,
-) -> Result<MdnsAddressLookup, IntoAddressLookupError>
Builds an MdnsAddressLookup instance with the configured settings.
+) -> Result<MdnsAddressLookup, AddressLookupBuilderError>Builds an MdnsAddressLookup instance with the configured settings.
§Errors
Returns an error if the network does not allow ipv4 OR ipv6.
§Panics
This relies on [tokio::runtime::Handle::current] and will panic if called outside of the context of a tokio runtime.
-Trait Implementations§
Source§impl Debug for MdnsAddressLookupBuilder
Source§impl Default for MdnsAddressLookupBuilder
Trait Implementations§
Source§impl AddressLookupBuilder for MdnsAddressLookupBuilder
Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreAuto Trait Implementations§
§impl Freeze for MdnsAddressLookupBuilder
§impl RefUnwindSafe for MdnsAddressLookupBuilder
§impl Send for MdnsAddressLookupBuilder
§impl Sync for MdnsAddressLookupBuilder
§impl Unpin for MdnsAddressLookupBuilder
§impl UnwindSafe for MdnsAddressLookupBuilder
Blanket Implementations§
Source§impl<T> Any for Twhere
+) -> Result<impl AddressLookup, AddressLookupBuilderError>Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, filter: AddrFilter) -> Self
Sets a filter to control which addresses are published by this service Read more
Source§impl Debug for MdnsAddressLookupBuilder
Auto Trait Implementations§
§impl Freeze for MdnsAddressLookupBuilder
§impl !RefUnwindSafe for MdnsAddressLookupBuilder
§impl Send for MdnsAddressLookupBuilder
§impl Sync for MdnsAddressLookupBuilder
§impl Unpin for MdnsAddressLookupBuilder
§impl !UnwindSafe for MdnsAddressLookupBuilder
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3958/docs/iroh/address_lookup/memory/struct.MemoryLookup.html b/pr/3958/docs/iroh/address_lookup/memory/struct.MemoryLookup.html
index d7bd2b5528..ed3825b3d2 100644
--- a/pr/3958/docs/iroh/address_lookup/memory/struct.MemoryLookup.html
+++ b/pr/3958/docs/iroh/address_lookup/memory/struct.MemoryLookup.html
@@ -1,4 +1,4 @@
-MemoryLookup in iroh::address_lookup::memory - Rust MemoryLookup
pub struct MemoryLookup { /* private fields */ }
Expand description
An in-memory address lookup system to manually add endpoint addressing information.
+MemoryLookup in iroh::address_lookup::memory - Rust MemoryLookup
pub struct MemoryLookup { /* private fields */ }
Expand description
An in-memory address lookup system to manually add endpoint addressing information.
Often an application might get endpoint addressing information out-of-band in an
application-specific way. EndpointTicket’s are one common way used to achieve this.
This addressing information is often only usable for a limited time so needs to
@@ -71,7 +71,11 @@ relay URL is overwritten.
Trait Implementations§
Source§impl AddressLookup for MemoryLookup
Source§fn publish(&self, _data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreSource§impl Clone for MemoryLookup
Source§fn clone(&self) -> MemoryLookup
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 MemoryLookup
Auto Trait Implementations§
§impl Freeze for MemoryLookup
§impl RefUnwindSafe for MemoryLookup
§impl Send for MemoryLookup
§impl Sync for MemoryLookup
§impl Unpin for MemoryLookup
§impl UnwindSafe for MemoryLookup
Blanket Implementations§
Source§impl Clone for MemoryLookup
Source§fn clone(&self) -> MemoryLookup
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 MemoryLookup
Auto Trait Implementations§
§impl Freeze for MemoryLookup
§impl RefUnwindSafe for MemoryLookup
§impl Send for MemoryLookup
§impl Sync for MemoryLookup
§impl Unpin for MemoryLookup
§impl UnwindSafe for MemoryLookup
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
+ T: AddressLookup,
Source§fn into_address_lookup(
+ self,
+ _endpoint: &Endpoint,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_PKARR_TTL.html b/pr/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_PKARR_TTL.html
index 0f33a26465..132d13db24 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_PKARR_TTL.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_PKARR_TTL.html
@@ -1,4 +1,4 @@
-DEFAULT_PKARR_TTL in iroh::address_lookup::pkarr - Rust 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 in iroh::address_lookup::pkarr - Rust 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/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_REPUBLISH_INTERVAL.html b/pr/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_REPUBLISH_INTERVAL.html
index e22092eb60..6d9fc2f7aa 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_REPUBLISH_INTERVAL.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_REPUBLISH_INTERVAL.html
@@ -1,2 +1,2 @@
-
DEFAULT_REPUBLISH_INTERVAL in iroh::address_lookup::pkarr - Rust 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 in iroh::address_lookup::pkarr - Rust DEFAULT_REPUBLISH_INTERVAL
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_PROD.html b/pr/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_PROD.html
index 0706a5896e..53b2d1dfc9 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_PROD.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_PROD.html
@@ -1,4 +1,4 @@
-N0_DNS_PKARR_RELAY_PROD in iroh::address_lookup::pkarr - Rust 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 in iroh::address_lookup::pkarr - Rust 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/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_STAGING.html b/pr/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_STAGING.html
index 7b0c6835c5..69f1bb5e54 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_STAGING.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_STAGING.html
@@ -1,4 +1,4 @@
-N0_DNS_PKARR_RELAY_STAGING in iroh::address_lookup::pkarr - Rust 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 in iroh::address_lookup::pkarr - Rust 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.
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/dht/index.html b/pr/3958/docs/iroh/address_lookup/pkarr/dht/index.html
index c0680fc4a6..4373a5b5d6 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/dht/index.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/dht/index.html
@@ -1,4 +1,4 @@
-iroh::address_lookup::pkarr::dht - Rust Module dht
Available on crate feature address-lookup-pkarr-dht only.Expand description
Pkarr based address lookup for iroh, supporting both relay servers and the DHT.
+iroh::address_lookup::pkarr::dht - Rust Module dht
Available on crate feature address-lookup-pkarr-dht only.Expand description
Pkarr based address lookup for iroh, supporting both relay servers and the DHT.
This module contains pkarr-based address lookup for iroh which can use both pkarr
relay servers as well as the Mainline DHT directly. See the pkarr module for an
overview of pkarr.
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.Builder.html b/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.Builder.html
index 34f9e9feba..53c1d72aa4 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.Builder.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.Builder.html
@@ -1,20 +1,20 @@
-Builder in iroh::address_lookup::pkarr::dht - Rust Builder
pub struct Builder { /* private fields */ }
Available on crate feature address-lookup-pkarr-dht only.Expand description
Builder for DhtAddressLookup.
+Builder in iroh::address_lookup::pkarr::dht - Rust Builder
pub struct Builder { /* private fields */ }
Available on crate feature address-lookup-pkarr-dht only.Expand description
Builder for DhtAddressLookup.
By default, publishing to the DHT is enabled, and relay publishing is disabled.
-Implementations§
Source§impl Builder
Sourcepub fn secret_key(self, secret_key: SecretKey) -> Self
Sets the secret key to use for signing the DNS packets.
+Implementations§
Source§impl Builder
Sourcepub fn secret_key(self, secret_key: SecretKey) -> Self
Sets the secret key to use for signing the DNS packets.
Without a secret key, the endpoint will not publish its address to the DHT.
-Sourcepub fn pkarr_relay(self, pkarr_relay: Url) -> Self
Sets the pkarr relay URL to use.
-Sourcepub fn n0_dns_pkarr_relay(self) -> Self
Uses the default number 0 pkarr relay URL.
-Sourcepub fn include_direct_addresses(self, include_direct_addresses: bool) -> Self
Sets whether to include the direct addresses in the DNS packet.
-Sourcepub fn republish_delay(self, republish_delay: Duration) -> Self
Sets the republish delay for the DHT.
-Sourcepub fn no_publish(self) -> Self
Disables publishing even if a secret key is set.
-Sourcepub fn build(self) -> Result<DhtAddressLookup, IntoAddressLookupError>
Builds the address lookup mechanism.
-Trait Implementations§
Source§impl IntoAddressLookup for Builder
Sourcepub fn pkarr_relay(self, pkarr_relay: Url) -> Self
Sets the pkarr relay URL to use.
+Sourcepub fn n0_dns_pkarr_relay(self) -> Self
Uses the default number 0 pkarr relay URL.
+Sourcepub fn republish_delay(self, republish_delay: Duration) -> Self
Sets the republish delay for the DHT.
+Sourcepub fn no_publish(self) -> Self
Disables publishing even if a secret key is set.
+Sourcepub fn set_addr_filter(self, filter: AddrFilter) -> Self
Sets a filter to control which addresses are published by this service.
+Sourcepub fn build(self) -> Result<DhtAddressLookup, AddressLookupBuilderError>
Builds the address lookup mechanism.
+Trait Implementations§
Source§impl AddressLookupBuilder for Builder
Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreAuto Trait Implementations§
§impl Freeze for Builder
§impl !RefUnwindSafe for Builder
§impl Send for Builder
§impl Sync for Builder
§impl Unpin for Builder
§impl !UnwindSafe for Builder
Blanket Implementations§
Source§impl<T> Any for Twhere
+) -> Result<impl AddressLookup, AddressLookupBuilderError>Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, filter: AddrFilter) -> Self
Sets a filter to control which addresses are published by this service Read more
Auto Trait Implementations§
§impl Freeze for Builder
§impl !RefUnwindSafe for Builder
§impl Send for Builder
§impl Sync for Builder
§impl Unpin for Builder
§impl !UnwindSafe for Builder
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.DhtAddressLookup.html b/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.DhtAddressLookup.html
index 71a5720045..05dac9ca82 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.DhtAddressLookup.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.DhtAddressLookup.html
@@ -1,14 +1,23 @@
-DhtAddressLookup in iroh::address_lookup::pkarr::dht - Rust DhtAddressLookup
pub struct DhtAddressLookup(/* private fields */);
Available on crate feature address-lookup-pkarr-dht only.Expand description
Pkarr Mainline DHT and relay server address lookup.
+DhtAddressLookup in iroh::address_lookup::pkarr::dht - Rust DhtAddressLookup
pub struct DhtAddressLookup(/* private fields */);
Available on crate feature address-lookup-pkarr-dht only.Expand description
Pkarr Mainline DHT and relay server address lookup.
It stores endpoint addresses in DNS records, signed by the endpoint’s private key, and publishes
them to the BitTorrent Mainline DHT. See the pkarr module for more details.
This implements the AddressLookup trait to be used as an address lookup service which can
be used as both a publisher and resolver. Calling DhtAddressLookup::publish will start
a background task that periodically publishes the endpoint address.
-Implementations§
Source§impl DhtAddressLookup
Sourcepub fn builder() -> Builder
Creates a new builder for DhtAddressLookup.
-Trait Implementations§
Source§impl AddressLookup for DhtAddressLookup
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreSource§fn resolve(
+
By default, DhtAddressLookup will publish all addresses it receives:
+direct IP addresses and relay URLs. No internal address limits or truncation
+are applied.
+You can supply an AddrFilter via Builder::set_addr_filter to
+control which addresses are published.
+
Implementations§
Source§impl DhtAddressLookup
Sourcepub fn builder() -> Builder
Creates a new builder for DhtAddressLookup.
+Trait Implementations§
Source§impl AddressLookup for DhtAddressLookup
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreSource§fn resolve(
&self,
endpoint_id: EndpointId,
-) -> Option<BoxStream<Result<AddressLookupItem, AddressLookupError>>>
Source§impl Clone for DhtAddressLookup
Source§fn clone(&self) -> DhtAddressLookup
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 DhtAddressLookup
Auto Trait Implementations§
§impl Freeze for DhtAddressLookup
§impl !RefUnwindSafe for DhtAddressLookup
§impl Send for DhtAddressLookup
§impl Sync for DhtAddressLookup
§impl Unpin for DhtAddressLookup
§impl !UnwindSafe for DhtAddressLookup
Blanket Implementations§
Source§impl<T> Any for T
Source§impl Clone for DhtAddressLookup
Source§fn clone(&self) -> DhtAddressLookup
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 DhtAddressLookup
Auto Trait Implementations§
§impl Freeze for DhtAddressLookup
§impl !RefUnwindSafe for DhtAddressLookup
§impl Send for DhtAddressLookup
§impl Sync for DhtAddressLookup
§impl Unpin for DhtAddressLookup
§impl !UnwindSafe for DhtAddressLookup
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
+ T: AddressLookup,
Source§fn into_address_lookup(
+ self,
+ _endpoint: &Endpoint,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/enum.PkarrError.html b/pr/3958/docs/iroh/address_lookup/pkarr/enum.PkarrError.html
index 674b8ca39d..89501751b1 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/enum.PkarrError.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/enum.PkarrError.html
@@ -1,4 +1,4 @@
-PkarrError in iroh::address_lookup::pkarr - Rust PkarrError
#[non_exhaustive]pub enum PkarrError {
+PkarrError in iroh::address_lookup::pkarr - Rust PkarrError
#[non_exhaustive]pub enum PkarrError {
PublicKey {
source: PublicKeyError,
meta: Meta,
@@ -34,7 +34,7 @@
§HttpRequest
§HttpPayload
§Encoding
Trait Implementations§
Source§impl Debug for PkarrError
Source§impl Display for PkarrError
Source§impl Error for PkarrError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Source§impl From<PkarrError> for AnyError
Source§fn from(value: PkarrError) -> AnyError
Converts to this type from the input type.Source§impl From<PkarrError> for Error
Source§fn from(err: PkarrError) -> Self
Converts to this type from the input type.Source§impl StackError for PkarrError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
Returns the next source in the chain, if any.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for 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
Source§impl Display for PkarrError
Source§impl Error for PkarrError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Source§impl From<PkarrError> for AnyError
Source§fn from(value: PkarrError) -> AnyError
Converts to this type from the input type.Source§impl From<PkarrError> for Error
Source§fn from(err: PkarrError) -> Self
Converts to this type from the input type.Source§impl StackError for PkarrError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
Returns the next source in the chain, if any.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for 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> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/index.html b/pr/3958/docs/iroh/address_lookup/pkarr/index.html
index 9812c19ba2..5ae7d5f488 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/index.html
+++ b/pr/3958/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
@@ -20,6 +20,10 @@ the Mainline DHT on behalf on the client as well as cache lookups performed on t
to improve performance.
+PkarrPublisher publishes all addresses it receives by default, with no internal limiting.
+You can supply an AddrFilter via PkarrPublisherBuilder::set_addr_filter to limit the kinds
+and number of addresses that get published.
+Note that PkarrResolver and address_lookup::DnsAddressLookup only resolve and do not publish, so filtering does not apply to them.
For address lookup in iroh the pkarr Resource Records contain the addressing information,
providing endpoints which retrieve the pkarr Resource Record with enough detail
to contact the iroh endpoint.
@@ -40,4 +44,4 @@ to the application’s needs:
as the Mainline DHT.
-Modules§
- dht
address-lookup-pkarr-dht - Pkarr based address lookup for iroh, supporting both relay servers and the DHT.
Structs§
- Pkarr
Publisher - Publisher of address lookup information to a pkarr relay.
- Pkarr
PublisherBuilder - Builder for
PkarrPublisher. - Pkarr
RelayClient - A pkarr client to publish [
pkarr::SignedPacket]s to a pkarr relay. - Pkarr
Resolver - Resolver of address lookup information from a pkarr relay.
- Pkarr
ResolverBuilder - Builder for
PkarrResolver.
Enums§
Constants§
- DEFAULT_
PKARR_TTL - Default TTL for the records in the pkarr signed packet.
- DEFAULT_
REPUBLISH_INTERVAL - Interval in which to republish the endpoint info even if unchanged: 5 minutes.
- N0_
DNS_PKARR_RELAY_PROD - The production pkarr relay run by number 0.
- N0_
DNS_PKARR_RELAY_STAGING - The testing pkarr relay run by number 0.
\ No newline at end of file
+Modules§
- dht
address-lookup-pkarr-dht - Pkarr based address lookup for iroh, supporting both relay servers and the DHT.
Structs§
- Pkarr
Publisher - Publisher of address lookup information to a pkarr relay.
- Pkarr
PublisherBuilder - Builder for
PkarrPublisher. - Pkarr
RelayClient - A pkarr client to publish [
pkarr::SignedPacket]s to a pkarr relay. - Pkarr
RelayClientBuilder - A builder for the
PkarrRelayClient - Pkarr
Resolver - Resolver of address lookup information from a pkarr relay.
- Pkarr
ResolverBuilder - Builder for
PkarrResolver.
Enums§
Constants§
- DEFAULT_
PKARR_TTL - Default TTL for the records in the pkarr signed packet.
- DEFAULT_
REPUBLISH_INTERVAL - Interval in which to republish the endpoint info even if unchanged: 5 minutes.
- N0_
DNS_PKARR_RELAY_PROD - The production pkarr relay run by number 0.
- N0_
DNS_PKARR_RELAY_STAGING - The testing pkarr relay run by number 0.
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/sidebar-items.js b/pr/3958/docs/iroh/address_lookup/pkarr/sidebar-items.js
index 400a6bc7cf..46dcce1f3d 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/sidebar-items.js
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/sidebar-items.js
@@ -1 +1 @@
-window.SIDEBAR_ITEMS = {"constant":["DEFAULT_PKARR_TTL","DEFAULT_REPUBLISH_INTERVAL","N0_DNS_PKARR_RELAY_PROD","N0_DNS_PKARR_RELAY_STAGING"],"enum":["PkarrError"],"mod":["dht"],"struct":["PkarrPublisher","PkarrPublisherBuilder","PkarrRelayClient","PkarrResolver","PkarrResolverBuilder"]};
\ No newline at end of file
+window.SIDEBAR_ITEMS = {"constant":["DEFAULT_PKARR_TTL","DEFAULT_REPUBLISH_INTERVAL","N0_DNS_PKARR_RELAY_PROD","N0_DNS_PKARR_RELAY_STAGING"],"enum":["PkarrError"],"mod":["dht"],"struct":["PkarrPublisher","PkarrPublisherBuilder","PkarrRelayClient","PkarrRelayClientBuilder","PkarrResolver","PkarrResolverBuilder"]};
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html
index 95a62b4d39..02dd3d5ef6 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html
@@ -1,28 +1,32 @@
-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 IntoAddressLookup, so it can be passed to address_lookup.
+
PkarrPublisherBuilder implements AddressLookupBuilder, so it can be passed to address_lookup.
It will then use the endpoint’s secret key to sign published packets.
-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 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,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html
index e6be21376b..7dfa451886 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html
@@ -1,16 +1,22 @@
-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 build(self, secret_key: SecretKey) -> PkarrPublisher
Builds the PkarrPublisher with the passed secret key for signing packets.
+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 set_addr_filter(self, filter: AddrFilter) -> Self
Sets a filter to control which addresses are published by this service
+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§
Source§impl Debug for PkarrPublisherBuilder
Trait Implementations§
Source§impl AddressLookupBuilder for PkarrPublisherBuilder
Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. 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 AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, filter: AddrFilter) -> Selfwhere
+ Self: Sized,
Sets a filter to control which addresses are published by this service 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/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
index 1aebc073cb..a211ef5a81 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
@@ -1,18 +1,20 @@
-PkarrRelayClient in iroh::address_lookup::pkarr - Rust PkarrRelayClient
pub struct PkarrRelayClient { /* private fields */ }
Expand description
A pkarr client to publish [pkarr::SignedPacket]s to a pkarr relay.
-Implementations§
Source§impl PkarrRelayClient
Sourcepub fn with_dns_resolver(
+PkarrRelayClient in iroh::address_lookup::pkarr - Rust PkarrRelayClient
pub struct PkarrRelayClient { /* private fields */ }
Expand description
A pkarr client to publish [pkarr::SignedPacket]s 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,
- dns_resolver: DnsResolver,
-) -> Self
Available on non-wasm_browser only.
Creates a new client while passing a DNS resolver to use.
-Sourcepub async fn resolve(
+ 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/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
new file mode 100644
index 0000000000..a36791fe33
--- /dev/null
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
@@ -0,0 +1,45 @@
+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,
Source§impl<T> BorrowMut<T> for Twhere
+ T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moreSource§impl<T> CloneToUninit for Twhere
+ T: Clone,
§impl<T> CompatExt for T
§impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left is true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left(&self) returns true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read more§impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
+ T: ?Sized,
§impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
+ S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
+[WithDispatch] wrapper. Read more
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
index 7503fe7c7d..4ee7e8ed15 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
@@ -1,21 +1,25 @@
-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.
-The builder implements IntoAddressLookup.
-Sourcepub fn n0_dns() -> PkarrResolverBuilder
Creates a pkarr resolver builder which uses the number 0 pkarr relay server.
+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.
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> Any 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,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
index 32061012fe..d6a0f879d3 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
@@ -1,11 +1,12 @@
-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) -> PkarrResolver
Creates a PkarrResolver from this builder.
-Trait Implementations§
Source§impl Debug for PkarrResolverBuilder
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 with_addr_filter(self, _filter: AddrFilter) -> Self
no-op: resolver does not publish
+Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. 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 AddressLookup builder into a ready-to-use Address Lookup. 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/3958/docs/iroh/address_lookup/sidebar-items.js b/pr/3958/docs/iroh/address_lookup/sidebar-items.js
index 256a9a6580..a80ededc1c 100644
--- a/pr/3958/docs/iroh/address_lookup/sidebar-items.js
+++ b/pr/3958/docs/iroh/address_lookup/sidebar-items.js
@@ -1 +1 @@
-window.SIDEBAR_ITEMS = {"enum":["Error","IntoAddressLookupError","ParseError"],"mod":["dns","mdns","memory","pkarr"],"struct":["ConcurrentAddressLookup","EndpointData","EndpointInfo","Item","UserData"],"trait":["AddressLookup","IntoAddressLookup"]};
\ No newline at end of file
+window.SIDEBAR_ITEMS = {"enum":["AddressLookupBuilderError","Error","ParseError"],"mod":["dns","mdns","memory","pkarr"],"struct":["AddrFilter","ConcurrentAddressLookup","EndpointData","EndpointInfo","Item","UserData"],"trait":["AddressLookup","AddressLookupBuilder"]};
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/struct.AddrFilter.html b/pr/3958/docs/iroh/address_lookup/struct.AddrFilter.html
new file mode 100644
index 0000000000..18e77ad3d0
--- /dev/null
+++ b/pr/3958/docs/iroh/address_lookup/struct.AddrFilter.html
@@ -0,0 +1,56 @@
+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
+the output order). A BTreeSet cannot preserve a custom order, so the return
+type is Vec to make reordering possible.
+See the documentation for each address lookup implementation for details on
+what additional filtering the implementation may perform on top.
+Implementations§
Source§impl AddrFilter
Sourcepub fn new(
+ f: impl Fn(&BTreeSet<TransportAddr>) -> Vec<TransportAddr> + Send + Sync + 'static,
+) -> AddrFilter
Create a new AddrFilter
+Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
+Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
+Sourcepub fn apply(&self, addrs: &BTreeSet<TransportAddr>) -> 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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
+ T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
+ T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
+ T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moreSource§impl<T> CloneToUninit for Twhere
+ T: Clone,
§impl<T> CompatExt for T
§impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left is true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left(&self) returns true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read more§impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
+ T: ?Sized,
§impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
+ S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
+[WithDispatch] wrapper. Read more
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html b/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html
index 2ac53f880b..1f3c54ad49 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html
@@ -1,19 +1,23 @@
-ConcurrentAddressLookup in iroh::address_lookup - Rust ConcurrentAddressLookup
pub struct ConcurrentAddressLookup { /* private fields */ }
Expand description
An Address Lookup service that combines multiple Address Lookup sources.
+ConcurrentAddressLookup in iroh::address_lookup - Rust ConcurrentAddressLookup
pub struct ConcurrentAddressLookup { /* private fields */ }
Expand description
An Address Lookup service that combines multiple Address Lookup sources.
The Address Lookup will resolve concurrently.
-Implementations§
Source§impl ConcurrentAddressLookup
Sourcepub fn empty() -> Self
Creates an empty ConcurrentAddressLookup.
-Sourcepub fn from_services(services: Vec<Box<dyn AddressLookup>>) -> Self
Creates a new ConcurrentAddressLookup.
-Sourcepub fn add(&self, service: impl AddressLookup + 'static)
Adds an AddressLookup service.
+Implementations§
Source§impl ConcurrentAddressLookup
Sourcepub fn empty() -> Self
Creates an empty ConcurrentAddressLookup.
+Sourcepub fn from_services(services: Vec<Box<dyn AddressLookup>>) -> Self
Creates a new ConcurrentAddressLookup.
+Sourcepub fn add(&self, service: impl AddressLookup + 'static)
Adds an AddressLookup service.
If there is historical Address Lookup data, it will be published immediately on this service.
-Sourcepub fn add_boxed(&self, service: Box<dyn AddressLookup>)
Adds an already Boxed AddressLookup service.
+Sourcepub fn add_boxed(&self, service: Box<dyn AddressLookup>)
Adds an already Boxed AddressLookup service.
If there is historical Address Lookup data, it will be published immediately on this service.
-Trait Implementations§
Source§impl AddressLookup for ConcurrentAddressLookup
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreTrait Implementations§
Source§impl AddressLookup for ConcurrentAddressLookup
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreSource§impl Clone for ConcurrentAddressLookup
Source§fn clone(&self) -> ConcurrentAddressLookup
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 ConcurrentAddressLookup
Source§impl Default for ConcurrentAddressLookup
Source§fn default() -> ConcurrentAddressLookup
Returns the “default value” for a type. Read moreSource§impl<T> From<T> for ConcurrentAddressLookup
Auto Trait Implementations§
§impl Freeze for ConcurrentAddressLookup
§impl RefUnwindSafe for ConcurrentAddressLookup
§impl Send for ConcurrentAddressLookup
§impl Sync for ConcurrentAddressLookup
§impl Unpin for ConcurrentAddressLookup
§impl UnwindSafe for ConcurrentAddressLookup
Blanket Implementations§
Source§impl Clone for ConcurrentAddressLookup
Source§fn clone(&self) -> ConcurrentAddressLookup
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 ConcurrentAddressLookup
Source§impl Default for ConcurrentAddressLookup
Source§fn default() -> ConcurrentAddressLookup
Returns the “default value” for a type. Read moreSource§impl<T> From<T> for ConcurrentAddressLookup
Auto Trait Implementations§
§impl Freeze for ConcurrentAddressLookup
§impl RefUnwindSafe for ConcurrentAddressLookup
§impl Send for ConcurrentAddressLookup
§impl Sync for ConcurrentAddressLookup
§impl Unpin for ConcurrentAddressLookup
§impl UnwindSafe for ConcurrentAddressLookup
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
+ T: AddressLookup,
Source§fn into_address_lookup(
+ self,
+ _endpoint: &Endpoint,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html b/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
index d1e92d14df..d3d2a057f4 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
@@ -1,24 +1,26 @@
-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: impl IntoIterator<Item = TransportAddr>) -> EndpointData
Creates a new EndpointData with a relay URL and a set of direct addresses.
-Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> EndpointData
Sets the relay URL and returns the updated endpoint data.
-Sourcepub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> EndpointData
Sets the direct addresses and returns the updated endpoint data.
-Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> EndpointData
Sets the user-defined data and returns the updated 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 clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
-Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-Trait Implementations§
Source§impl Clone for 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<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§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§
Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: impl IntoIterator<Item = TransportAddr>) -> EndpointData
Creates a new EndpointData with a relay URL and a set of direct addresses.
+Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> EndpointData
Sets the relay URL and returns the updated endpoint data.
+Sourcepub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> EndpointData
Sets the direct addresses and returns the updated endpoint data.
+Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> EndpointData
Sets the user-defined data and returns the updated 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 clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
+Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
+Sourcepub fn filtered_addrs(&self, filter: &AddrFilter) -> Vec<TransportAddr>
Apply the given filter to the current addresses.
+Returns a vec to allow re-ordering of addresses.
+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<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§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/3958/docs/iroh/address_lookup/struct.EndpointInfo.html b/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
index 333b720b45..623c3442bf 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
@@ -1,42 +1,44 @@
-EndpointInfo in iroh::address_lookup - Rust EndpointInfo
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/mdns/struct.MdnsAddressLookupBuilder.html b/pr/3958/docs/iroh/address_lookup/mdns/struct.MdnsAddressLookupBuilder.html
index f3578f745d..a6bc77b9b6 100644
--- a/pr/3958/docs/iroh/address_lookup/mdns/struct.MdnsAddressLookupBuilder.html
+++ b/pr/3958/docs/iroh/address_lookup/mdns/struct.MdnsAddressLookupBuilder.html
@@ -1,24 +1,25 @@
-MdnsAddressLookupBuilder in iroh::address_lookup::mdns - Rust MdnsAddressLookupBuilder
pub struct MdnsAddressLookupBuilder { /* private fields */ }
Available on crate feature address-lookup-mdns only.Expand description
Builder for MdnsAddressLookup.
-Implementations§
Source§impl MdnsAddressLookupBuilder
Sourcepub fn advertise(self, advertise: bool) -> Self
Sets whether this endpoint should advertise its presence.
+MdnsAddressLookupBuilder in iroh::address_lookup::mdns - Rust MdnsAddressLookupBuilder
pub struct MdnsAddressLookupBuilder { /* private fields */ }
Available on crate feature address-lookup-mdns only.Expand description
Builder for MdnsAddressLookup.
+Implementations§
Source§impl MdnsAddressLookupBuilder
Sourcepub fn advertise(self, advertise: bool) -> Self
Sets whether this endpoint should advertise its presence.
Default is true.
-Sourcepub fn service_name(self, service_name: impl Into<String>) -> Self
Sets a custom service name.
+Sourcepub fn service_name(self, service_name: impl Into<String>) -> Self
Sets a custom service name.
The default is irohv1, which will show up on a record in the
following form, for example:
7rutqynuzu65fcdgoerbt4uoh3p62wuto2mp56x3uvhitqzssxga._irohv1._udp.local
Any custom service name will take the form, for example:
7rutqynuzu65fcdgoerbt4uoh3p62wuto2mp56x3uvhitqzssxga._{service_name}._udp.local
-Sourcepub fn set_addr_filter(self, filter: AddrFilter) -> Self
Sets a filter to control which addresses are published by this service.
+Sourcepub fn build(
self,
endpoint_id: EndpointId,
-) -> Result<MdnsAddressLookup, IntoAddressLookupError>
Builds an MdnsAddressLookup instance with the configured settings.
+) -> Result<MdnsAddressLookup, AddressLookupBuilderError>Builds an MdnsAddressLookup instance with the configured settings.
§Errors
Returns an error if the network does not allow ipv4 OR ipv6.
§Panics
This relies on [tokio::runtime::Handle::current] and will panic if called outside of the context of a tokio runtime.
-Trait Implementations§
Source§impl Debug for MdnsAddressLookupBuilder
Source§impl Default for MdnsAddressLookupBuilder
Trait Implementations§
Source§impl AddressLookupBuilder for MdnsAddressLookupBuilder
Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreAuto Trait Implementations§
§impl Freeze for MdnsAddressLookupBuilder
§impl RefUnwindSafe for MdnsAddressLookupBuilder
§impl Send for MdnsAddressLookupBuilder
§impl Sync for MdnsAddressLookupBuilder
§impl Unpin for MdnsAddressLookupBuilder
§impl UnwindSafe for MdnsAddressLookupBuilder
Blanket Implementations§
Source§impl<T> Any for Twhere
+) -> Result<impl AddressLookup, AddressLookupBuilderError>Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, filter: AddrFilter) -> Self
Sets a filter to control which addresses are published by this service Read more
Source§impl Debug for MdnsAddressLookupBuilder
Auto Trait Implementations§
§impl Freeze for MdnsAddressLookupBuilder
§impl !RefUnwindSafe for MdnsAddressLookupBuilder
§impl Send for MdnsAddressLookupBuilder
§impl Sync for MdnsAddressLookupBuilder
§impl Unpin for MdnsAddressLookupBuilder
§impl !UnwindSafe for MdnsAddressLookupBuilder
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3958/docs/iroh/address_lookup/memory/struct.MemoryLookup.html b/pr/3958/docs/iroh/address_lookup/memory/struct.MemoryLookup.html
index d7bd2b5528..ed3825b3d2 100644
--- a/pr/3958/docs/iroh/address_lookup/memory/struct.MemoryLookup.html
+++ b/pr/3958/docs/iroh/address_lookup/memory/struct.MemoryLookup.html
@@ -1,4 +1,4 @@
-MemoryLookup in iroh::address_lookup::memory - Rust MemoryLookup
pub struct MemoryLookup { /* private fields */ }
Expand description
An in-memory address lookup system to manually add endpoint addressing information.
+MemoryLookup in iroh::address_lookup::memory - Rust MemoryLookup
pub struct MemoryLookup { /* private fields */ }
Expand description
An in-memory address lookup system to manually add endpoint addressing information.
Often an application might get endpoint addressing information out-of-band in an
application-specific way. EndpointTicket’s are one common way used to achieve this.
This addressing information is often only usable for a limited time so needs to
@@ -71,7 +71,11 @@ relay URL is overwritten.
Trait Implementations§
Source§impl AddressLookup for MemoryLookup
Source§fn publish(&self, _data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreSource§impl Clone for MemoryLookup
Source§fn clone(&self) -> MemoryLookup
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 MemoryLookup
Auto Trait Implementations§
§impl Freeze for MemoryLookup
§impl RefUnwindSafe for MemoryLookup
§impl Send for MemoryLookup
§impl Sync for MemoryLookup
§impl Unpin for MemoryLookup
§impl UnwindSafe for MemoryLookup
Blanket Implementations§
Source§impl Clone for MemoryLookup
Source§fn clone(&self) -> MemoryLookup
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 MemoryLookup
Auto Trait Implementations§
§impl Freeze for MemoryLookup
§impl RefUnwindSafe for MemoryLookup
§impl Send for MemoryLookup
§impl Sync for MemoryLookup
§impl Unpin for MemoryLookup
§impl UnwindSafe for MemoryLookup
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
+ T: AddressLookup,
Source§fn into_address_lookup(
+ self,
+ _endpoint: &Endpoint,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_PKARR_TTL.html b/pr/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_PKARR_TTL.html
index 0f33a26465..132d13db24 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_PKARR_TTL.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_PKARR_TTL.html
@@ -1,4 +1,4 @@
-DEFAULT_PKARR_TTL in iroh::address_lookup::pkarr - Rust 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 in iroh::address_lookup::pkarr - Rust 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/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_REPUBLISH_INTERVAL.html b/pr/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_REPUBLISH_INTERVAL.html
index e22092eb60..6d9fc2f7aa 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_REPUBLISH_INTERVAL.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_REPUBLISH_INTERVAL.html
@@ -1,2 +1,2 @@
-
DEFAULT_REPUBLISH_INTERVAL in iroh::address_lookup::pkarr - Rust 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 in iroh::address_lookup::pkarr - Rust DEFAULT_REPUBLISH_INTERVAL
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_PROD.html b/pr/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_PROD.html
index 0706a5896e..53b2d1dfc9 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_PROD.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_PROD.html
@@ -1,4 +1,4 @@
-N0_DNS_PKARR_RELAY_PROD in iroh::address_lookup::pkarr - Rust 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 in iroh::address_lookup::pkarr - Rust 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/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_STAGING.html b/pr/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_STAGING.html
index 7b0c6835c5..69f1bb5e54 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_STAGING.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_STAGING.html
@@ -1,4 +1,4 @@
-N0_DNS_PKARR_RELAY_STAGING in iroh::address_lookup::pkarr - Rust 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 in iroh::address_lookup::pkarr - Rust 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.
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/dht/index.html b/pr/3958/docs/iroh/address_lookup/pkarr/dht/index.html
index c0680fc4a6..4373a5b5d6 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/dht/index.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/dht/index.html
@@ -1,4 +1,4 @@
-iroh::address_lookup::pkarr::dht - Rust Module dht
Available on crate feature address-lookup-pkarr-dht only.Expand description
Pkarr based address lookup for iroh, supporting both relay servers and the DHT.
+iroh::address_lookup::pkarr::dht - Rust Module dht
Available on crate feature address-lookup-pkarr-dht only.Expand description
Pkarr based address lookup for iroh, supporting both relay servers and the DHT.
This module contains pkarr-based address lookup for iroh which can use both pkarr
relay servers as well as the Mainline DHT directly. See the pkarr module for an
overview of pkarr.
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.Builder.html b/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.Builder.html
index 34f9e9feba..53c1d72aa4 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.Builder.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.Builder.html
@@ -1,20 +1,20 @@
-Builder in iroh::address_lookup::pkarr::dht - Rust Builder
pub struct Builder { /* private fields */ }
Available on crate feature address-lookup-pkarr-dht only.Expand description
Builder for DhtAddressLookup.
+Builder in iroh::address_lookup::pkarr::dht - Rust Builder
pub struct Builder { /* private fields */ }
Available on crate feature address-lookup-pkarr-dht only.Expand description
Builder for DhtAddressLookup.
By default, publishing to the DHT is enabled, and relay publishing is disabled.
-Implementations§
Source§impl Builder
Sourcepub fn secret_key(self, secret_key: SecretKey) -> Self
Sets the secret key to use for signing the DNS packets.
+Implementations§
Source§impl Builder
Sourcepub fn secret_key(self, secret_key: SecretKey) -> Self
Sets the secret key to use for signing the DNS packets.
Without a secret key, the endpoint will not publish its address to the DHT.
-Sourcepub fn pkarr_relay(self, pkarr_relay: Url) -> Self
Sets the pkarr relay URL to use.
-Sourcepub fn n0_dns_pkarr_relay(self) -> Self
Uses the default number 0 pkarr relay URL.
-Sourcepub fn include_direct_addresses(self, include_direct_addresses: bool) -> Self
Sets whether to include the direct addresses in the DNS packet.
-Sourcepub fn republish_delay(self, republish_delay: Duration) -> Self
Sets the republish delay for the DHT.
-Sourcepub fn no_publish(self) -> Self
Disables publishing even if a secret key is set.
-Sourcepub fn build(self) -> Result<DhtAddressLookup, IntoAddressLookupError>
Builds the address lookup mechanism.
-Trait Implementations§
Source§impl IntoAddressLookup for Builder
Sourcepub fn pkarr_relay(self, pkarr_relay: Url) -> Self
Sets the pkarr relay URL to use.
+Sourcepub fn n0_dns_pkarr_relay(self) -> Self
Uses the default number 0 pkarr relay URL.
+Sourcepub fn republish_delay(self, republish_delay: Duration) -> Self
Sets the republish delay for the DHT.
+Sourcepub fn no_publish(self) -> Self
Disables publishing even if a secret key is set.
+Sourcepub fn set_addr_filter(self, filter: AddrFilter) -> Self
Sets a filter to control which addresses are published by this service.
+Sourcepub fn build(self) -> Result<DhtAddressLookup, AddressLookupBuilderError>
Builds the address lookup mechanism.
+Trait Implementations§
Source§impl AddressLookupBuilder for Builder
Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreAuto Trait Implementations§
§impl Freeze for Builder
§impl !RefUnwindSafe for Builder
§impl Send for Builder
§impl Sync for Builder
§impl Unpin for Builder
§impl !UnwindSafe for Builder
Blanket Implementations§
Source§impl<T> Any for Twhere
+) -> Result<impl AddressLookup, AddressLookupBuilderError>Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, filter: AddrFilter) -> Self
Sets a filter to control which addresses are published by this service Read more
Auto Trait Implementations§
§impl Freeze for Builder
§impl !RefUnwindSafe for Builder
§impl Send for Builder
§impl Sync for Builder
§impl Unpin for Builder
§impl !UnwindSafe for Builder
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.DhtAddressLookup.html b/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.DhtAddressLookup.html
index 71a5720045..05dac9ca82 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.DhtAddressLookup.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.DhtAddressLookup.html
@@ -1,14 +1,23 @@
-DhtAddressLookup in iroh::address_lookup::pkarr::dht - Rust DhtAddressLookup
pub struct DhtAddressLookup(/* private fields */);
Available on crate feature address-lookup-pkarr-dht only.Expand description
Pkarr Mainline DHT and relay server address lookup.
+DhtAddressLookup in iroh::address_lookup::pkarr::dht - Rust DhtAddressLookup
pub struct DhtAddressLookup(/* private fields */);
Available on crate feature address-lookup-pkarr-dht only.Expand description
Pkarr Mainline DHT and relay server address lookup.
It stores endpoint addresses in DNS records, signed by the endpoint’s private key, and publishes
them to the BitTorrent Mainline DHT. See the pkarr module for more details.
This implements the AddressLookup trait to be used as an address lookup service which can
be used as both a publisher and resolver. Calling DhtAddressLookup::publish will start
a background task that periodically publishes the endpoint address.
-Implementations§
Source§impl DhtAddressLookup
Sourcepub fn builder() -> Builder
Creates a new builder for DhtAddressLookup.
-Trait Implementations§
Source§impl AddressLookup for DhtAddressLookup
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreSource§fn resolve(
+
By default, DhtAddressLookup will publish all addresses it receives:
+direct IP addresses and relay URLs. No internal address limits or truncation
+are applied.
+You can supply an AddrFilter via Builder::set_addr_filter to
+control which addresses are published.
+
Implementations§
Source§impl DhtAddressLookup
Sourcepub fn builder() -> Builder
Creates a new builder for DhtAddressLookup.
+Trait Implementations§
Source§impl AddressLookup for DhtAddressLookup
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreSource§fn resolve(
&self,
endpoint_id: EndpointId,
-) -> Option<BoxStream<Result<AddressLookupItem, AddressLookupError>>>
Source§impl Clone for DhtAddressLookup
Source§fn clone(&self) -> DhtAddressLookup
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 DhtAddressLookup
Auto Trait Implementations§
§impl Freeze for DhtAddressLookup
§impl !RefUnwindSafe for DhtAddressLookup
§impl Send for DhtAddressLookup
§impl Sync for DhtAddressLookup
§impl Unpin for DhtAddressLookup
§impl !UnwindSafe for DhtAddressLookup
Blanket Implementations§
Source§impl<T> Any for T
Source§impl Clone for DhtAddressLookup
Source§fn clone(&self) -> DhtAddressLookup
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 DhtAddressLookup
Auto Trait Implementations§
§impl Freeze for DhtAddressLookup
§impl !RefUnwindSafe for DhtAddressLookup
§impl Send for DhtAddressLookup
§impl Sync for DhtAddressLookup
§impl Unpin for DhtAddressLookup
§impl !UnwindSafe for DhtAddressLookup
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
+ T: AddressLookup,
Source§fn into_address_lookup(
+ self,
+ _endpoint: &Endpoint,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/enum.PkarrError.html b/pr/3958/docs/iroh/address_lookup/pkarr/enum.PkarrError.html
index 674b8ca39d..89501751b1 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/enum.PkarrError.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/enum.PkarrError.html
@@ -1,4 +1,4 @@
-PkarrError in iroh::address_lookup::pkarr - Rust PkarrError
#[non_exhaustive]pub enum PkarrError {
+PkarrError in iroh::address_lookup::pkarr - Rust PkarrError
#[non_exhaustive]pub enum PkarrError {
PublicKey {
source: PublicKeyError,
meta: Meta,
@@ -34,7 +34,7 @@
§HttpRequest
§HttpPayload
§Encoding
Trait Implementations§
Source§impl Debug for PkarrError
Source§impl Display for PkarrError
Source§impl Error for PkarrError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Source§impl From<PkarrError> for AnyError
Source§fn from(value: PkarrError) -> AnyError
Converts to this type from the input type.Source§impl From<PkarrError> for Error
Source§fn from(err: PkarrError) -> Self
Converts to this type from the input type.Source§impl StackError for PkarrError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
Returns the next source in the chain, if any.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for 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
Source§impl Display for PkarrError
Source§impl Error for PkarrError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Source§impl From<PkarrError> for AnyError
Source§fn from(value: PkarrError) -> AnyError
Converts to this type from the input type.Source§impl From<PkarrError> for Error
Source§fn from(err: PkarrError) -> Self
Converts to this type from the input type.Source§impl StackError for PkarrError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
Returns the next source in the chain, if any.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for 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> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/index.html b/pr/3958/docs/iroh/address_lookup/pkarr/index.html
index 9812c19ba2..5ae7d5f488 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/index.html
+++ b/pr/3958/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
@@ -20,6 +20,10 @@ the Mainline DHT on behalf on the client as well as cache lookups performed on t
to improve performance.
+PkarrPublisher publishes all addresses it receives by default, with no internal limiting.
+You can supply an AddrFilter via PkarrPublisherBuilder::set_addr_filter to limit the kinds
+and number of addresses that get published.
+Note that PkarrResolver and address_lookup::DnsAddressLookup only resolve and do not publish, so filtering does not apply to them.
For address lookup in iroh the pkarr Resource Records contain the addressing information,
providing endpoints which retrieve the pkarr Resource Record with enough detail
to contact the iroh endpoint.
@@ -40,4 +44,4 @@ to the application’s needs:
as the Mainline DHT.
-Modules§
- dht
address-lookup-pkarr-dht - Pkarr based address lookup for iroh, supporting both relay servers and the DHT.
Structs§
- Pkarr
Publisher - Publisher of address lookup information to a pkarr relay.
- Pkarr
PublisherBuilder - Builder for
PkarrPublisher. - Pkarr
RelayClient - A pkarr client to publish [
pkarr::SignedPacket]s to a pkarr relay. - Pkarr
Resolver - Resolver of address lookup information from a pkarr relay.
- Pkarr
ResolverBuilder - Builder for
PkarrResolver.
Enums§
Constants§
- DEFAULT_
PKARR_TTL - Default TTL for the records in the pkarr signed packet.
- DEFAULT_
REPUBLISH_INTERVAL - Interval in which to republish the endpoint info even if unchanged: 5 minutes.
- N0_
DNS_PKARR_RELAY_PROD - The production pkarr relay run by number 0.
- N0_
DNS_PKARR_RELAY_STAGING - The testing pkarr relay run by number 0.
\ No newline at end of file
+Modules§
- dht
address-lookup-pkarr-dht - Pkarr based address lookup for iroh, supporting both relay servers and the DHT.
Structs§
- Pkarr
Publisher - Publisher of address lookup information to a pkarr relay.
- Pkarr
PublisherBuilder - Builder for
PkarrPublisher. - Pkarr
RelayClient - A pkarr client to publish [
pkarr::SignedPacket]s to a pkarr relay. - Pkarr
RelayClientBuilder - A builder for the
PkarrRelayClient - Pkarr
Resolver - Resolver of address lookup information from a pkarr relay.
- Pkarr
ResolverBuilder - Builder for
PkarrResolver.
Enums§
Constants§
- DEFAULT_
PKARR_TTL - Default TTL for the records in the pkarr signed packet.
- DEFAULT_
REPUBLISH_INTERVAL - Interval in which to republish the endpoint info even if unchanged: 5 minutes.
- N0_
DNS_PKARR_RELAY_PROD - The production pkarr relay run by number 0.
- N0_
DNS_PKARR_RELAY_STAGING - The testing pkarr relay run by number 0.
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/sidebar-items.js b/pr/3958/docs/iroh/address_lookup/pkarr/sidebar-items.js
index 400a6bc7cf..46dcce1f3d 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/sidebar-items.js
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/sidebar-items.js
@@ -1 +1 @@
-window.SIDEBAR_ITEMS = {"constant":["DEFAULT_PKARR_TTL","DEFAULT_REPUBLISH_INTERVAL","N0_DNS_PKARR_RELAY_PROD","N0_DNS_PKARR_RELAY_STAGING"],"enum":["PkarrError"],"mod":["dht"],"struct":["PkarrPublisher","PkarrPublisherBuilder","PkarrRelayClient","PkarrResolver","PkarrResolverBuilder"]};
\ No newline at end of file
+window.SIDEBAR_ITEMS = {"constant":["DEFAULT_PKARR_TTL","DEFAULT_REPUBLISH_INTERVAL","N0_DNS_PKARR_RELAY_PROD","N0_DNS_PKARR_RELAY_STAGING"],"enum":["PkarrError"],"mod":["dht"],"struct":["PkarrPublisher","PkarrPublisherBuilder","PkarrRelayClient","PkarrRelayClientBuilder","PkarrResolver","PkarrResolverBuilder"]};
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html
index 95a62b4d39..02dd3d5ef6 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html
@@ -1,28 +1,32 @@
-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 IntoAddressLookup, so it can be passed to address_lookup.
+
PkarrPublisherBuilder implements AddressLookupBuilder, so it can be passed to address_lookup.
It will then use the endpoint’s secret key to sign published packets.
-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 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,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html
index e6be21376b..7dfa451886 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html
@@ -1,16 +1,22 @@
-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 build(self, secret_key: SecretKey) -> PkarrPublisher
Builds the PkarrPublisher with the passed secret key for signing packets.
+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 set_addr_filter(self, filter: AddrFilter) -> Self
Sets a filter to control which addresses are published by this service
+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§
Source§impl Debug for PkarrPublisherBuilder
Trait Implementations§
Source§impl AddressLookupBuilder for PkarrPublisherBuilder
Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. 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 AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, filter: AddrFilter) -> Selfwhere
+ Self: Sized,
Sets a filter to control which addresses are published by this service 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/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
index 1aebc073cb..a211ef5a81 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
@@ -1,18 +1,20 @@
-PkarrRelayClient in iroh::address_lookup::pkarr - Rust PkarrRelayClient
pub struct PkarrRelayClient { /* private fields */ }
Expand description
A pkarr client to publish [pkarr::SignedPacket]s to a pkarr relay.
-Implementations§
Source§impl PkarrRelayClient
Sourcepub fn with_dns_resolver(
+PkarrRelayClient in iroh::address_lookup::pkarr - Rust PkarrRelayClient
pub struct PkarrRelayClient { /* private fields */ }
Expand description
A pkarr client to publish [pkarr::SignedPacket]s 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,
- dns_resolver: DnsResolver,
-) -> Self
Available on non-wasm_browser only.
Creates a new client while passing a DNS resolver to use.
-Sourcepub async fn resolve(
+ 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/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
new file mode 100644
index 0000000000..a36791fe33
--- /dev/null
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
@@ -0,0 +1,45 @@
+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,
Source§impl<T> BorrowMut<T> for Twhere
+ T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moreSource§impl<T> CloneToUninit for Twhere
+ T: Clone,
§impl<T> CompatExt for T
§impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left is true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left(&self) returns true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read more§impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
+ T: ?Sized,
§impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
+ S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
+[WithDispatch] wrapper. Read more
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
index 7503fe7c7d..4ee7e8ed15 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
@@ -1,21 +1,25 @@
-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.
-The builder implements IntoAddressLookup.
-Sourcepub fn n0_dns() -> PkarrResolverBuilder
Creates a pkarr resolver builder which uses the number 0 pkarr relay server.
+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.
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> Any 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,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
index 32061012fe..d6a0f879d3 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
@@ -1,11 +1,12 @@
-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) -> PkarrResolver
Creates a PkarrResolver from this builder.
-Trait Implementations§
Source§impl Debug for PkarrResolverBuilder
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 with_addr_filter(self, _filter: AddrFilter) -> Self
no-op: resolver does not publish
+Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. 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 AddressLookup builder into a ready-to-use Address Lookup. 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/3958/docs/iroh/address_lookup/sidebar-items.js b/pr/3958/docs/iroh/address_lookup/sidebar-items.js
index 256a9a6580..a80ededc1c 100644
--- a/pr/3958/docs/iroh/address_lookup/sidebar-items.js
+++ b/pr/3958/docs/iroh/address_lookup/sidebar-items.js
@@ -1 +1 @@
-window.SIDEBAR_ITEMS = {"enum":["Error","IntoAddressLookupError","ParseError"],"mod":["dns","mdns","memory","pkarr"],"struct":["ConcurrentAddressLookup","EndpointData","EndpointInfo","Item","UserData"],"trait":["AddressLookup","IntoAddressLookup"]};
\ No newline at end of file
+window.SIDEBAR_ITEMS = {"enum":["AddressLookupBuilderError","Error","ParseError"],"mod":["dns","mdns","memory","pkarr"],"struct":["AddrFilter","ConcurrentAddressLookup","EndpointData","EndpointInfo","Item","UserData"],"trait":["AddressLookup","AddressLookupBuilder"]};
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/struct.AddrFilter.html b/pr/3958/docs/iroh/address_lookup/struct.AddrFilter.html
new file mode 100644
index 0000000000..18e77ad3d0
--- /dev/null
+++ b/pr/3958/docs/iroh/address_lookup/struct.AddrFilter.html
@@ -0,0 +1,56 @@
+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
+the output order). A BTreeSet cannot preserve a custom order, so the return
+type is Vec to make reordering possible.
+See the documentation for each address lookup implementation for details on
+what additional filtering the implementation may perform on top.
+Implementations§
Source§impl AddrFilter
Sourcepub fn new(
+ f: impl Fn(&BTreeSet<TransportAddr>) -> Vec<TransportAddr> + Send + Sync + 'static,
+) -> AddrFilter
Create a new AddrFilter
+Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
+Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
+Sourcepub fn apply(&self, addrs: &BTreeSet<TransportAddr>) -> 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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
+ T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
+ T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
+ T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moreSource§impl<T> CloneToUninit for Twhere
+ T: Clone,
§impl<T> CompatExt for T
§impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left is true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left(&self) returns true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read more§impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
+ T: ?Sized,
§impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
+ S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
+[WithDispatch] wrapper. Read more
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html b/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html
index 2ac53f880b..1f3c54ad49 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html
@@ -1,19 +1,23 @@
-ConcurrentAddressLookup in iroh::address_lookup - Rust ConcurrentAddressLookup
pub struct ConcurrentAddressLookup { /* private fields */ }
Expand description
An Address Lookup service that combines multiple Address Lookup sources.
+ConcurrentAddressLookup in iroh::address_lookup - Rust ConcurrentAddressLookup
pub struct ConcurrentAddressLookup { /* private fields */ }
Expand description
An Address Lookup service that combines multiple Address Lookup sources.
The Address Lookup will resolve concurrently.
-Implementations§
Source§impl ConcurrentAddressLookup
Sourcepub fn empty() -> Self
Creates an empty ConcurrentAddressLookup.
-Sourcepub fn from_services(services: Vec<Box<dyn AddressLookup>>) -> Self
Creates a new ConcurrentAddressLookup.
-Sourcepub fn add(&self, service: impl AddressLookup + 'static)
Adds an AddressLookup service.
+Implementations§
Source§impl ConcurrentAddressLookup
Sourcepub fn empty() -> Self
Creates an empty ConcurrentAddressLookup.
+Sourcepub fn from_services(services: Vec<Box<dyn AddressLookup>>) -> Self
Creates a new ConcurrentAddressLookup.
+Sourcepub fn add(&self, service: impl AddressLookup + 'static)
Adds an AddressLookup service.
If there is historical Address Lookup data, it will be published immediately on this service.
-Sourcepub fn add_boxed(&self, service: Box<dyn AddressLookup>)
Adds an already Boxed AddressLookup service.
+Sourcepub fn add_boxed(&self, service: Box<dyn AddressLookup>)
Adds an already Boxed AddressLookup service.
If there is historical Address Lookup data, it will be published immediately on this service.
-Trait Implementations§
Source§impl AddressLookup for ConcurrentAddressLookup
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreTrait Implementations§
Source§impl AddressLookup for ConcurrentAddressLookup
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreSource§impl Clone for ConcurrentAddressLookup
Source§fn clone(&self) -> ConcurrentAddressLookup
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 ConcurrentAddressLookup
Source§impl Default for ConcurrentAddressLookup
Source§fn default() -> ConcurrentAddressLookup
Returns the “default value” for a type. Read moreSource§impl<T> From<T> for ConcurrentAddressLookup
Auto Trait Implementations§
§impl Freeze for ConcurrentAddressLookup
§impl RefUnwindSafe for ConcurrentAddressLookup
§impl Send for ConcurrentAddressLookup
§impl Sync for ConcurrentAddressLookup
§impl Unpin for ConcurrentAddressLookup
§impl UnwindSafe for ConcurrentAddressLookup
Blanket Implementations§
Source§impl Clone for ConcurrentAddressLookup
Source§fn clone(&self) -> ConcurrentAddressLookup
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 ConcurrentAddressLookup
Source§impl Default for ConcurrentAddressLookup
Source§fn default() -> ConcurrentAddressLookup
Returns the “default value” for a type. Read moreSource§impl<T> From<T> for ConcurrentAddressLookup
Auto Trait Implementations§
§impl Freeze for ConcurrentAddressLookup
§impl RefUnwindSafe for ConcurrentAddressLookup
§impl Send for ConcurrentAddressLookup
§impl Sync for ConcurrentAddressLookup
§impl Unpin for ConcurrentAddressLookup
§impl UnwindSafe for ConcurrentAddressLookup
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
+ T: AddressLookup,
Source§fn into_address_lookup(
+ self,
+ _endpoint: &Endpoint,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html b/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
index d1e92d14df..d3d2a057f4 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
@@ -1,24 +1,26 @@
-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: impl IntoIterator<Item = TransportAddr>) -> EndpointData
Creates a new EndpointData with a relay URL and a set of direct addresses.
-Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> EndpointData
Sets the relay URL and returns the updated endpoint data.
-Sourcepub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> EndpointData
Sets the direct addresses and returns the updated endpoint data.
-Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> EndpointData
Sets the user-defined data and returns the updated 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 clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
-Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-Trait Implementations§
Source§impl Clone for 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<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§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§
Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: impl IntoIterator<Item = TransportAddr>) -> EndpointData
Creates a new EndpointData with a relay URL and a set of direct addresses.
+Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> EndpointData
Sets the relay URL and returns the updated endpoint data.
+Sourcepub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> EndpointData
Sets the direct addresses and returns the updated endpoint data.
+Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> EndpointData
Sets the user-defined data and returns the updated 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 clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
+Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
+Sourcepub fn filtered_addrs(&self, filter: &AddrFilter) -> Vec<TransportAddr>
Apply the given filter to the current addresses.
+Returns a vec to allow re-ordering of addresses.
+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<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§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/3958/docs/iroh/address_lookup/struct.EndpointInfo.html b/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
index 333b720b45..623c3442bf 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
@@ -1,42 +1,44 @@
-EndpointInfo in iroh::address_lookup - Rust EndpointInfo
MdnsAddressLookupBuilder
pub struct MdnsAddressLookupBuilder { /* private fields */ }address-lookup-mdns only.Expand description
Builder for MdnsAddressLookup.
Implementations§
Source§impl MdnsAddressLookupBuilder
impl MdnsAddressLookupBuilder
Sourcepub fn advertise(self, advertise: bool) -> Self
pub fn advertise(self, advertise: bool) -> Self
Sets whether this endpoint should advertise its presence.
+MdnsAddressLookupBuilder
pub struct MdnsAddressLookupBuilder { /* private fields */ }address-lookup-mdns only.Expand description
Builder for MdnsAddressLookup.
Implementations§
Source§impl MdnsAddressLookupBuilder
impl MdnsAddressLookupBuilder
Sourcepub fn advertise(self, advertise: bool) -> Self
pub fn advertise(self, advertise: bool) -> Self
Sets whether this endpoint should advertise its presence.
Default is true.
-Sourcepub fn service_name(self, service_name: impl Into<String>) -> Self
pub fn service_name(self, service_name: impl Into<String>) -> Self
Sets a custom service name.
+Sourcepub fn service_name(self, service_name: impl Into<String>) -> Self
pub fn service_name(self, service_name: impl Into<String>) -> Self
Sets a custom service name.
The default is irohv1, which will show up on a record in the
following form, for example:
7rutqynuzu65fcdgoerbt4uoh3p62wuto2mp56x3uvhitqzssxga._irohv1._udp.local
Any custom service name will take the form, for example:
7rutqynuzu65fcdgoerbt4uoh3p62wuto2mp56x3uvhitqzssxga._{service_name}._udp.local
Sourcepub fn set_addr_filter(self, filter: AddrFilter) -> Self
pub fn set_addr_filter(self, filter: AddrFilter) -> Self
Sets a filter to control which addresses are published by this service.
+Sourcepub fn build(
self,
endpoint_id: EndpointId,
-) -> Result<MdnsAddressLookup, IntoAddressLookupError>
pub fn build( self, endpoint_id: EndpointId, -) -> Result<MdnsAddressLookup, IntoAddressLookupError>
Builds an MdnsAddressLookup instance with the configured settings.
Builds an MdnsAddressLookup instance with the configured settings.
§Errors
Returns an error if the network does not allow ipv4 OR ipv6.
§Panics
This relies on [tokio::runtime::Handle::current] and will panic if called outside of the context of a tokio runtime.
Trait Implementations§
Source§impl Debug for MdnsAddressLookupBuilder
impl Debug for MdnsAddressLookupBuilder
Source§impl Default for MdnsAddressLookupBuilder
impl Default for MdnsAddressLookupBuilder
Trait Implementations§
Source§impl AddressLookupBuilder for MdnsAddressLookupBuilder
impl AddressLookupBuilder for MdnsAddressLookupBuilder
Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
fn into_address_lookup( self, endpoint: &Endpoint, -) -> Result<impl AddressLookup, IntoAddressLookupError>
Auto Trait Implementations§
impl Freeze for MdnsAddressLookupBuilder
impl RefUnwindSafe for MdnsAddressLookupBuilder
impl Send for MdnsAddressLookupBuilder
impl Sync for MdnsAddressLookupBuilder
impl Unpin for MdnsAddressLookupBuilder
impl UnwindSafe for MdnsAddressLookupBuilder
Blanket Implementations§
Source§impl<T> Any for Twhere
+) -> Result<impl AddressLookup, AddressLookupBuilderError>Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, filter: AddrFilter) -> Self
Sets a filter to control which addresses are published by this service Read more
impl<T> Any for Twhere
+) -> Result<impl AddressLookup, AddressLookupBuilderError>Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, filter: AddrFilter) -> Self
Sets a filter to control which addresses are published by this service Read more
Source§fn with_addr_filter(self, filter: AddrFilter) -> Self
fn with_addr_filter(self, filter: AddrFilter) -> Self
Source§impl Debug for MdnsAddressLookupBuilder
impl Debug for MdnsAddressLookupBuilder
Auto Trait Implementations§
impl Freeze for MdnsAddressLookupBuilder
impl !RefUnwindSafe for MdnsAddressLookupBuilder
impl Send for MdnsAddressLookupBuilder
impl Sync for MdnsAddressLookupBuilder
impl Unpin for MdnsAddressLookupBuilder
impl !UnwindSafe for MdnsAddressLookupBuilder
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/3958/docs/iroh/address_lookup/memory/struct.MemoryLookup.html b/pr/3958/docs/iroh/address_lookup/memory/struct.MemoryLookup.html
index d7bd2b5528..ed3825b3d2 100644
--- a/pr/3958/docs/iroh/address_lookup/memory/struct.MemoryLookup.html
+++ b/pr/3958/docs/iroh/address_lookup/memory/struct.MemoryLookup.html
@@ -1,4 +1,4 @@
-MemoryLookup in iroh::address_lookup::memory - Rust MemoryLookup
pub struct MemoryLookup { /* private fields */ }
Expand description
An in-memory address lookup system to manually add endpoint addressing information.
+MemoryLookup in iroh::address_lookup::memory - Rust MemoryLookup
pub struct MemoryLookup { /* private fields */ }
Expand description
An in-memory address lookup system to manually add endpoint addressing information.
Often an application might get endpoint addressing information out-of-band in an
application-specific way. EndpointTicket’s are one common way used to achieve this.
This addressing information is often only usable for a limited time so needs to
@@ -71,7 +71,11 @@ relay URL is overwritten.
Trait Implementations§
Source§impl AddressLookup for MemoryLookup
Source§fn publish(&self, _data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreSource§impl Clone for MemoryLookup
Source§fn clone(&self) -> MemoryLookup
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 MemoryLookup
Auto Trait Implementations§
§impl Freeze for MemoryLookup
§impl RefUnwindSafe for MemoryLookup
§impl Send for MemoryLookup
§impl Sync for MemoryLookup
§impl Unpin for MemoryLookup
§impl UnwindSafe for MemoryLookup
Blanket Implementations§
Source§impl Clone for MemoryLookup
Source§fn clone(&self) -> MemoryLookup
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 MemoryLookup
Auto Trait Implementations§
§impl Freeze for MemoryLookup
§impl RefUnwindSafe for MemoryLookup
§impl Send for MemoryLookup
§impl Sync for MemoryLookup
§impl Unpin for MemoryLookup
§impl UnwindSafe for MemoryLookup
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
+ T: AddressLookup,
Source§fn into_address_lookup(
+ self,
+ _endpoint: &Endpoint,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_PKARR_TTL.html b/pr/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_PKARR_TTL.html
index 0f33a26465..132d13db24 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_PKARR_TTL.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_PKARR_TTL.html
@@ -1,4 +1,4 @@
-DEFAULT_PKARR_TTL in iroh::address_lookup::pkarr - Rust 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 in iroh::address_lookup::pkarr - Rust 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/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_REPUBLISH_INTERVAL.html b/pr/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_REPUBLISH_INTERVAL.html
index e22092eb60..6d9fc2f7aa 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_REPUBLISH_INTERVAL.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_REPUBLISH_INTERVAL.html
@@ -1,2 +1,2 @@
-
DEFAULT_REPUBLISH_INTERVAL in iroh::address_lookup::pkarr - Rust 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 in iroh::address_lookup::pkarr - Rust DEFAULT_REPUBLISH_INTERVAL
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_PROD.html b/pr/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_PROD.html
index 0706a5896e..53b2d1dfc9 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_PROD.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_PROD.html
@@ -1,4 +1,4 @@
-N0_DNS_PKARR_RELAY_PROD in iroh::address_lookup::pkarr - Rust 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 in iroh::address_lookup::pkarr - Rust 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/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_STAGING.html b/pr/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_STAGING.html
index 7b0c6835c5..69f1bb5e54 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_STAGING.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_STAGING.html
@@ -1,4 +1,4 @@
-N0_DNS_PKARR_RELAY_STAGING in iroh::address_lookup::pkarr - Rust 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 in iroh::address_lookup::pkarr - Rust 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.
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/dht/index.html b/pr/3958/docs/iroh/address_lookup/pkarr/dht/index.html
index c0680fc4a6..4373a5b5d6 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/dht/index.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/dht/index.html
@@ -1,4 +1,4 @@
-iroh::address_lookup::pkarr::dht - Rust Module dht
Available on crate feature address-lookup-pkarr-dht only.Expand description
Pkarr based address lookup for iroh, supporting both relay servers and the DHT.
+iroh::address_lookup::pkarr::dht - Rust Module dht
Available on crate feature address-lookup-pkarr-dht only.Expand description
Pkarr based address lookup for iroh, supporting both relay servers and the DHT.
This module contains pkarr-based address lookup for iroh which can use both pkarr
relay servers as well as the Mainline DHT directly. See the pkarr module for an
overview of pkarr.
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.Builder.html b/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.Builder.html
index 34f9e9feba..53c1d72aa4 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.Builder.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.Builder.html
@@ -1,20 +1,20 @@
-Builder in iroh::address_lookup::pkarr::dht - Rust Builder
pub struct Builder { /* private fields */ }
Available on crate feature address-lookup-pkarr-dht only.Expand description
Builder for DhtAddressLookup.
+Builder in iroh::address_lookup::pkarr::dht - Rust Builder
pub struct Builder { /* private fields */ }
Available on crate feature address-lookup-pkarr-dht only.Expand description
Builder for DhtAddressLookup.
By default, publishing to the DHT is enabled, and relay publishing is disabled.
-Implementations§
Source§impl Builder
Sourcepub fn secret_key(self, secret_key: SecretKey) -> Self
Sets the secret key to use for signing the DNS packets.
+Implementations§
Source§impl Builder
Sourcepub fn secret_key(self, secret_key: SecretKey) -> Self
Sets the secret key to use for signing the DNS packets.
Without a secret key, the endpoint will not publish its address to the DHT.
-Sourcepub fn pkarr_relay(self, pkarr_relay: Url) -> Self
Sets the pkarr relay URL to use.
-Sourcepub fn n0_dns_pkarr_relay(self) -> Self
Uses the default number 0 pkarr relay URL.
-Sourcepub fn include_direct_addresses(self, include_direct_addresses: bool) -> Self
Sets whether to include the direct addresses in the DNS packet.
-Sourcepub fn republish_delay(self, republish_delay: Duration) -> Self
Sets the republish delay for the DHT.
-Sourcepub fn no_publish(self) -> Self
Disables publishing even if a secret key is set.
-Sourcepub fn build(self) -> Result<DhtAddressLookup, IntoAddressLookupError>
Builds the address lookup mechanism.
-Trait Implementations§
Source§impl IntoAddressLookup for Builder
Sourcepub fn pkarr_relay(self, pkarr_relay: Url) -> Self
Sets the pkarr relay URL to use.
+Sourcepub fn n0_dns_pkarr_relay(self) -> Self
Uses the default number 0 pkarr relay URL.
+Sourcepub fn republish_delay(self, republish_delay: Duration) -> Self
Sets the republish delay for the DHT.
+Sourcepub fn no_publish(self) -> Self
Disables publishing even if a secret key is set.
+Sourcepub fn set_addr_filter(self, filter: AddrFilter) -> Self
Sets a filter to control which addresses are published by this service.
+Sourcepub fn build(self) -> Result<DhtAddressLookup, AddressLookupBuilderError>
Builds the address lookup mechanism.
+Trait Implementations§
Source§impl AddressLookupBuilder for Builder
Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreAuto Trait Implementations§
§impl Freeze for Builder
§impl !RefUnwindSafe for Builder
§impl Send for Builder
§impl Sync for Builder
§impl Unpin for Builder
§impl !UnwindSafe for Builder
Blanket Implementations§
Source§impl<T> Any for Twhere
+) -> Result<impl AddressLookup, AddressLookupBuilderError>Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, filter: AddrFilter) -> Self
Sets a filter to control which addresses are published by this service Read more
Auto Trait Implementations§
§impl Freeze for Builder
§impl !RefUnwindSafe for Builder
§impl Send for Builder
§impl Sync for Builder
§impl Unpin for Builder
§impl !UnwindSafe for Builder
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.DhtAddressLookup.html b/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.DhtAddressLookup.html
index 71a5720045..05dac9ca82 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.DhtAddressLookup.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.DhtAddressLookup.html
@@ -1,14 +1,23 @@
-DhtAddressLookup in iroh::address_lookup::pkarr::dht - Rust DhtAddressLookup
pub struct DhtAddressLookup(/* private fields */);
Available on crate feature address-lookup-pkarr-dht only.Expand description
Pkarr Mainline DHT and relay server address lookup.
+DhtAddressLookup in iroh::address_lookup::pkarr::dht - Rust DhtAddressLookup
pub struct DhtAddressLookup(/* private fields */);
Available on crate feature address-lookup-pkarr-dht only.Expand description
Pkarr Mainline DHT and relay server address lookup.
It stores endpoint addresses in DNS records, signed by the endpoint’s private key, and publishes
them to the BitTorrent Mainline DHT. See the pkarr module for more details.
This implements the AddressLookup trait to be used as an address lookup service which can
be used as both a publisher and resolver. Calling DhtAddressLookup::publish will start
a background task that periodically publishes the endpoint address.
-Implementations§
Source§impl DhtAddressLookup
Sourcepub fn builder() -> Builder
Creates a new builder for DhtAddressLookup.
-Trait Implementations§
Source§impl AddressLookup for DhtAddressLookup
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreSource§fn resolve(
+
By default, DhtAddressLookup will publish all addresses it receives:
+direct IP addresses and relay URLs. No internal address limits or truncation
+are applied.
+You can supply an AddrFilter via Builder::set_addr_filter to
+control which addresses are published.
+
Implementations§
Source§impl DhtAddressLookup
Sourcepub fn builder() -> Builder
Creates a new builder for DhtAddressLookup.
+Trait Implementations§
Source§impl AddressLookup for DhtAddressLookup
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreSource§fn resolve(
&self,
endpoint_id: EndpointId,
-) -> Option<BoxStream<Result<AddressLookupItem, AddressLookupError>>>
Source§impl Clone for DhtAddressLookup
Source§fn clone(&self) -> DhtAddressLookup
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 DhtAddressLookup
Auto Trait Implementations§
§impl Freeze for DhtAddressLookup
§impl !RefUnwindSafe for DhtAddressLookup
§impl Send for DhtAddressLookup
§impl Sync for DhtAddressLookup
§impl Unpin for DhtAddressLookup
§impl !UnwindSafe for DhtAddressLookup
Blanket Implementations§
Source§impl<T> Any for T
Source§impl Clone for DhtAddressLookup
Source§fn clone(&self) -> DhtAddressLookup
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 DhtAddressLookup
Auto Trait Implementations§
§impl Freeze for DhtAddressLookup
§impl !RefUnwindSafe for DhtAddressLookup
§impl Send for DhtAddressLookup
§impl Sync for DhtAddressLookup
§impl Unpin for DhtAddressLookup
§impl !UnwindSafe for DhtAddressLookup
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
+ T: AddressLookup,
Source§fn into_address_lookup(
+ self,
+ _endpoint: &Endpoint,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/enum.PkarrError.html b/pr/3958/docs/iroh/address_lookup/pkarr/enum.PkarrError.html
index 674b8ca39d..89501751b1 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/enum.PkarrError.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/enum.PkarrError.html
@@ -1,4 +1,4 @@
-PkarrError in iroh::address_lookup::pkarr - Rust PkarrError
#[non_exhaustive]pub enum PkarrError {
+PkarrError in iroh::address_lookup::pkarr - Rust PkarrError
#[non_exhaustive]pub enum PkarrError {
PublicKey {
source: PublicKeyError,
meta: Meta,
@@ -34,7 +34,7 @@
§HttpRequest
§HttpPayload
§Encoding
Trait Implementations§
Source§impl Debug for PkarrError
Source§impl Display for PkarrError
Source§impl Error for PkarrError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Source§impl From<PkarrError> for AnyError
Source§fn from(value: PkarrError) -> AnyError
Converts to this type from the input type.Source§impl From<PkarrError> for Error
Source§fn from(err: PkarrError) -> Self
Converts to this type from the input type.Source§impl StackError for PkarrError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
Returns the next source in the chain, if any.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for 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
Source§impl Display for PkarrError
Source§impl Error for PkarrError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Source§impl From<PkarrError> for AnyError
Source§fn from(value: PkarrError) -> AnyError
Converts to this type from the input type.Source§impl From<PkarrError> for Error
Source§fn from(err: PkarrError) -> Self
Converts to this type from the input type.Source§impl StackError for PkarrError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
Returns the next source in the chain, if any.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for 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> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/index.html b/pr/3958/docs/iroh/address_lookup/pkarr/index.html
index 9812c19ba2..5ae7d5f488 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/index.html
+++ b/pr/3958/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
@@ -20,6 +20,10 @@ the Mainline DHT on behalf on the client as well as cache lookups performed on t
to improve performance.
+PkarrPublisher publishes all addresses it receives by default, with no internal limiting.
+You can supply an AddrFilter via PkarrPublisherBuilder::set_addr_filter to limit the kinds
+and number of addresses that get published.
+Note that PkarrResolver and address_lookup::DnsAddressLookup only resolve and do not publish, so filtering does not apply to them.
For address lookup in iroh the pkarr Resource Records contain the addressing information,
providing endpoints which retrieve the pkarr Resource Record with enough detail
to contact the iroh endpoint.
@@ -40,4 +44,4 @@ to the application’s needs:
as the Mainline DHT.
-Modules§
- dht
address-lookup-pkarr-dht - Pkarr based address lookup for iroh, supporting both relay servers and the DHT.
Structs§
- Pkarr
Publisher - Publisher of address lookup information to a pkarr relay.
- Pkarr
PublisherBuilder - Builder for
PkarrPublisher. - Pkarr
RelayClient - A pkarr client to publish [
pkarr::SignedPacket]s to a pkarr relay. - Pkarr
Resolver - Resolver of address lookup information from a pkarr relay.
- Pkarr
ResolverBuilder - Builder for
PkarrResolver.
Enums§
Constants§
- DEFAULT_
PKARR_TTL - Default TTL for the records in the pkarr signed packet.
- DEFAULT_
REPUBLISH_INTERVAL - Interval in which to republish the endpoint info even if unchanged: 5 minutes.
- N0_
DNS_PKARR_RELAY_PROD - The production pkarr relay run by number 0.
- N0_
DNS_PKARR_RELAY_STAGING - The testing pkarr relay run by number 0.
\ No newline at end of file
+Modules§
- dht
address-lookup-pkarr-dht - Pkarr based address lookup for iroh, supporting both relay servers and the DHT.
Structs§
- Pkarr
Publisher - Publisher of address lookup information to a pkarr relay.
- Pkarr
PublisherBuilder - Builder for
PkarrPublisher. - Pkarr
RelayClient - A pkarr client to publish [
pkarr::SignedPacket]s to a pkarr relay. - Pkarr
RelayClientBuilder - A builder for the
PkarrRelayClient - Pkarr
Resolver - Resolver of address lookup information from a pkarr relay.
- Pkarr
ResolverBuilder - Builder for
PkarrResolver.
Enums§
Constants§
- DEFAULT_
PKARR_TTL - Default TTL for the records in the pkarr signed packet.
- DEFAULT_
REPUBLISH_INTERVAL - Interval in which to republish the endpoint info even if unchanged: 5 minutes.
- N0_
DNS_PKARR_RELAY_PROD - The production pkarr relay run by number 0.
- N0_
DNS_PKARR_RELAY_STAGING - The testing pkarr relay run by number 0.
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/sidebar-items.js b/pr/3958/docs/iroh/address_lookup/pkarr/sidebar-items.js
index 400a6bc7cf..46dcce1f3d 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/sidebar-items.js
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/sidebar-items.js
@@ -1 +1 @@
-window.SIDEBAR_ITEMS = {"constant":["DEFAULT_PKARR_TTL","DEFAULT_REPUBLISH_INTERVAL","N0_DNS_PKARR_RELAY_PROD","N0_DNS_PKARR_RELAY_STAGING"],"enum":["PkarrError"],"mod":["dht"],"struct":["PkarrPublisher","PkarrPublisherBuilder","PkarrRelayClient","PkarrResolver","PkarrResolverBuilder"]};
\ No newline at end of file
+window.SIDEBAR_ITEMS = {"constant":["DEFAULT_PKARR_TTL","DEFAULT_REPUBLISH_INTERVAL","N0_DNS_PKARR_RELAY_PROD","N0_DNS_PKARR_RELAY_STAGING"],"enum":["PkarrError"],"mod":["dht"],"struct":["PkarrPublisher","PkarrPublisherBuilder","PkarrRelayClient","PkarrRelayClientBuilder","PkarrResolver","PkarrResolverBuilder"]};
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html
index 95a62b4d39..02dd3d5ef6 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html
@@ -1,28 +1,32 @@
-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 IntoAddressLookup, so it can be passed to address_lookup.
+
PkarrPublisherBuilder implements AddressLookupBuilder, so it can be passed to address_lookup.
It will then use the endpoint’s secret key to sign published packets.
-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 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,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html
index e6be21376b..7dfa451886 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html
@@ -1,16 +1,22 @@
-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 build(self, secret_key: SecretKey) -> PkarrPublisher
Builds the PkarrPublisher with the passed secret key for signing packets.
+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 set_addr_filter(self, filter: AddrFilter) -> Self
Sets a filter to control which addresses are published by this service
+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§
Source§impl Debug for PkarrPublisherBuilder
Trait Implementations§
Source§impl AddressLookupBuilder for PkarrPublisherBuilder
Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. 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 AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, filter: AddrFilter) -> Selfwhere
+ Self: Sized,
Sets a filter to control which addresses are published by this service 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/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
index 1aebc073cb..a211ef5a81 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
@@ -1,18 +1,20 @@
-PkarrRelayClient in iroh::address_lookup::pkarr - Rust PkarrRelayClient
pub struct PkarrRelayClient { /* private fields */ }
Expand description
A pkarr client to publish [pkarr::SignedPacket]s to a pkarr relay.
-Implementations§
Source§impl PkarrRelayClient
Sourcepub fn with_dns_resolver(
+PkarrRelayClient in iroh::address_lookup::pkarr - Rust PkarrRelayClient
pub struct PkarrRelayClient { /* private fields */ }
Expand description
A pkarr client to publish [pkarr::SignedPacket]s 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,
- dns_resolver: DnsResolver,
-) -> Self
Available on non-wasm_browser only.
Creates a new client while passing a DNS resolver to use.
-Sourcepub async fn resolve(
+ 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/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
new file mode 100644
index 0000000000..a36791fe33
--- /dev/null
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
@@ -0,0 +1,45 @@
+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,
Source§impl<T> BorrowMut<T> for Twhere
+ T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moreSource§impl<T> CloneToUninit for Twhere
+ T: Clone,
§impl<T> CompatExt for T
§impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left is true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left(&self) returns true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read more§impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
+ T: ?Sized,
§impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
+ S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
+[WithDispatch] wrapper. Read more
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
index 7503fe7c7d..4ee7e8ed15 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
@@ -1,21 +1,25 @@
-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.
-The builder implements IntoAddressLookup.
-Sourcepub fn n0_dns() -> PkarrResolverBuilder
Creates a pkarr resolver builder which uses the number 0 pkarr relay server.
+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.
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> Any 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,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
index 32061012fe..d6a0f879d3 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
@@ -1,11 +1,12 @@
-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) -> PkarrResolver
Creates a PkarrResolver from this builder.
-Trait Implementations§
Source§impl Debug for PkarrResolverBuilder
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 with_addr_filter(self, _filter: AddrFilter) -> Self
no-op: resolver does not publish
+Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. 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 AddressLookup builder into a ready-to-use Address Lookup. 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/3958/docs/iroh/address_lookup/sidebar-items.js b/pr/3958/docs/iroh/address_lookup/sidebar-items.js
index 256a9a6580..a80ededc1c 100644
--- a/pr/3958/docs/iroh/address_lookup/sidebar-items.js
+++ b/pr/3958/docs/iroh/address_lookup/sidebar-items.js
@@ -1 +1 @@
-window.SIDEBAR_ITEMS = {"enum":["Error","IntoAddressLookupError","ParseError"],"mod":["dns","mdns","memory","pkarr"],"struct":["ConcurrentAddressLookup","EndpointData","EndpointInfo","Item","UserData"],"trait":["AddressLookup","IntoAddressLookup"]};
\ No newline at end of file
+window.SIDEBAR_ITEMS = {"enum":["AddressLookupBuilderError","Error","ParseError"],"mod":["dns","mdns","memory","pkarr"],"struct":["AddrFilter","ConcurrentAddressLookup","EndpointData","EndpointInfo","Item","UserData"],"trait":["AddressLookup","AddressLookupBuilder"]};
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/struct.AddrFilter.html b/pr/3958/docs/iroh/address_lookup/struct.AddrFilter.html
new file mode 100644
index 0000000000..18e77ad3d0
--- /dev/null
+++ b/pr/3958/docs/iroh/address_lookup/struct.AddrFilter.html
@@ -0,0 +1,56 @@
+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
+the output order). A BTreeSet cannot preserve a custom order, so the return
+type is Vec to make reordering possible.
+See the documentation for each address lookup implementation for details on
+what additional filtering the implementation may perform on top.
+Implementations§
Source§impl AddrFilter
Sourcepub fn new(
+ f: impl Fn(&BTreeSet<TransportAddr>) -> Vec<TransportAddr> + Send + Sync + 'static,
+) -> AddrFilter
Create a new AddrFilter
+Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
+Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
+Sourcepub fn apply(&self, addrs: &BTreeSet<TransportAddr>) -> 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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
+ T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
+ T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
+ T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moreSource§impl<T> CloneToUninit for Twhere
+ T: Clone,
§impl<T> CompatExt for T
§impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left is true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left(&self) returns true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read more§impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
+ T: ?Sized,
§impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
+ S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
+[WithDispatch] wrapper. Read more
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html b/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html
index 2ac53f880b..1f3c54ad49 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html
@@ -1,19 +1,23 @@
-ConcurrentAddressLookup in iroh::address_lookup - Rust ConcurrentAddressLookup
pub struct ConcurrentAddressLookup { /* private fields */ }
Expand description
An Address Lookup service that combines multiple Address Lookup sources.
+ConcurrentAddressLookup in iroh::address_lookup - Rust ConcurrentAddressLookup
pub struct ConcurrentAddressLookup { /* private fields */ }
Expand description
An Address Lookup service that combines multiple Address Lookup sources.
The Address Lookup will resolve concurrently.
-Implementations§
Source§impl ConcurrentAddressLookup
Sourcepub fn empty() -> Self
Creates an empty ConcurrentAddressLookup.
-Sourcepub fn from_services(services: Vec<Box<dyn AddressLookup>>) -> Self
Creates a new ConcurrentAddressLookup.
-Sourcepub fn add(&self, service: impl AddressLookup + 'static)
Adds an AddressLookup service.
+Implementations§
Source§impl ConcurrentAddressLookup
Sourcepub fn empty() -> Self
Creates an empty ConcurrentAddressLookup.
+Sourcepub fn from_services(services: Vec<Box<dyn AddressLookup>>) -> Self
Creates a new ConcurrentAddressLookup.
+Sourcepub fn add(&self, service: impl AddressLookup + 'static)
Adds an AddressLookup service.
If there is historical Address Lookup data, it will be published immediately on this service.
-Sourcepub fn add_boxed(&self, service: Box<dyn AddressLookup>)
Adds an already Boxed AddressLookup service.
+Sourcepub fn add_boxed(&self, service: Box<dyn AddressLookup>)
Adds an already Boxed AddressLookup service.
If there is historical Address Lookup data, it will be published immediately on this service.
-Trait Implementations§
Source§impl AddressLookup for ConcurrentAddressLookup
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreTrait Implementations§
Source§impl AddressLookup for ConcurrentAddressLookup
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreSource§impl Clone for ConcurrentAddressLookup
Source§fn clone(&self) -> ConcurrentAddressLookup
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 ConcurrentAddressLookup
Source§impl Default for ConcurrentAddressLookup
Source§fn default() -> ConcurrentAddressLookup
Returns the “default value” for a type. Read moreSource§impl<T> From<T> for ConcurrentAddressLookup
Auto Trait Implementations§
§impl Freeze for ConcurrentAddressLookup
§impl RefUnwindSafe for ConcurrentAddressLookup
§impl Send for ConcurrentAddressLookup
§impl Sync for ConcurrentAddressLookup
§impl Unpin for ConcurrentAddressLookup
§impl UnwindSafe for ConcurrentAddressLookup
Blanket Implementations§
Source§impl Clone for ConcurrentAddressLookup
Source§fn clone(&self) -> ConcurrentAddressLookup
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 ConcurrentAddressLookup
Source§impl Default for ConcurrentAddressLookup
Source§fn default() -> ConcurrentAddressLookup
Returns the “default value” for a type. Read moreSource§impl<T> From<T> for ConcurrentAddressLookup
Auto Trait Implementations§
§impl Freeze for ConcurrentAddressLookup
§impl RefUnwindSafe for ConcurrentAddressLookup
§impl Send for ConcurrentAddressLookup
§impl Sync for ConcurrentAddressLookup
§impl Unpin for ConcurrentAddressLookup
§impl UnwindSafe for ConcurrentAddressLookup
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
+ T: AddressLookup,
Source§fn into_address_lookup(
+ self,
+ _endpoint: &Endpoint,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html b/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
index d1e92d14df..d3d2a057f4 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
@@ -1,24 +1,26 @@
-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: impl IntoIterator<Item = TransportAddr>) -> EndpointData
Creates a new EndpointData with a relay URL and a set of direct addresses.
-Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> EndpointData
Sets the relay URL and returns the updated endpoint data.
-Sourcepub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> EndpointData
Sets the direct addresses and returns the updated endpoint data.
-Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> EndpointData
Sets the user-defined data and returns the updated 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 clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
-Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-Trait Implementations§
Source§impl Clone for 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<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§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§
Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: impl IntoIterator<Item = TransportAddr>) -> EndpointData
Creates a new EndpointData with a relay URL and a set of direct addresses.
+Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> EndpointData
Sets the relay URL and returns the updated endpoint data.
+Sourcepub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> EndpointData
Sets the direct addresses and returns the updated endpoint data.
+Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> EndpointData
Sets the user-defined data and returns the updated 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 clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
+Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
+Sourcepub fn filtered_addrs(&self, filter: &AddrFilter) -> Vec<TransportAddr>
Apply the given filter to the current addresses.
+Returns a vec to allow re-ordering of addresses.
+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<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§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/3958/docs/iroh/address_lookup/struct.EndpointInfo.html b/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
index 333b720b45..623c3442bf 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
@@ -1,42 +1,44 @@
-EndpointInfo in iroh::address_lookup - Rust EndpointInfo
MemoryLookup
pub struct MemoryLookup { /* private fields */ }Expand description
An in-memory address lookup system to manually add endpoint addressing information.
+MemoryLookup
pub struct MemoryLookup { /* private fields */ }Expand description
An in-memory address lookup system to manually add endpoint addressing information.
Often an application might get endpoint addressing information out-of-band in an
application-specific way. EndpointTicket’s are one common way used to achieve this.
This addressing information is often only usable for a limited time so needs to
@@ -71,7 +71,11 @@ relay URL is overwritten.
Trait Implementations§
Source§impl AddressLookup for MemoryLookup
impl AddressLookup for MemoryLookup
Source§fn publish(&self, _data: &EndpointData)
fn publish(&self, _data: &EndpointData)
EndpointData to the Address Lookup mechanism. Read moreSource§impl Clone for MemoryLookup
impl Clone for MemoryLookup
Source§fn clone(&self) -> MemoryLookup
fn clone(&self) -> MemoryLookup
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MemoryLookup
impl Debug for MemoryLookup
Auto Trait Implementations§
impl Freeze for MemoryLookup
impl RefUnwindSafe for MemoryLookup
impl Send for MemoryLookup
impl Sync for MemoryLookup
impl Unpin for MemoryLookup
impl UnwindSafe for MemoryLookup
Blanket Implementations§
Source§impl Clone for MemoryLookup
impl Clone for MemoryLookup
Source§fn clone(&self) -> MemoryLookup
fn clone(&self) -> MemoryLookup
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MemoryLookup
impl Debug for MemoryLookup
Auto Trait Implementations§
impl Freeze for MemoryLookup
impl RefUnwindSafe for MemoryLookup
impl Send for MemoryLookup
impl Sync for MemoryLookup
impl Unpin for MemoryLookup
impl UnwindSafe for MemoryLookup
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
+ T: AddressLookup,
impl<T> AddressLookupBuilder for Twhere
+ T: AddressLookup,
Source§fn into_address_lookup(
+ self,
+ _endpoint: &Endpoint,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
fn into_address_lookup( + self, + _endpoint: &Endpoint, +) -> Result<impl AddressLookup, AddressLookupBuilderError>
Source§fn with_addr_filter(self, _filter: AddrFilter) -> T
fn with_addr_filter(self, _filter: AddrFilter) -> T
§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,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
fn into_address_lookup( - self, - _endpoint: &Endpoint, -) -> Result<impl AddressLookup, IntoAddressLookupError>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_PKARR_TTL.html b/pr/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_PKARR_TTL.html
index 0f33a26465..132d13db24 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_PKARR_TTL.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_PKARR_TTL.html
@@ -1,4 +1,4 @@
-DEFAULT_PKARR_TTL in iroh::address_lookup::pkarr - Rust 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 in iroh::address_lookup::pkarr - Rust 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/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_REPUBLISH_INTERVAL.html b/pr/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_REPUBLISH_INTERVAL.html
index e22092eb60..6d9fc2f7aa 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_REPUBLISH_INTERVAL.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_REPUBLISH_INTERVAL.html
@@ -1,2 +1,2 @@
-
DEFAULT_REPUBLISH_INTERVAL in iroh::address_lookup::pkarr - Rust 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 in iroh::address_lookup::pkarr - Rust DEFAULT_REPUBLISH_INTERVAL
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_PROD.html b/pr/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_PROD.html
index 0706a5896e..53b2d1dfc9 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_PROD.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_PROD.html
@@ -1,4 +1,4 @@
-N0_DNS_PKARR_RELAY_PROD in iroh::address_lookup::pkarr - Rust 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 in iroh::address_lookup::pkarr - Rust 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/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_STAGING.html b/pr/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_STAGING.html
index 7b0c6835c5..69f1bb5e54 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_STAGING.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_STAGING.html
@@ -1,4 +1,4 @@
-N0_DNS_PKARR_RELAY_STAGING in iroh::address_lookup::pkarr - Rust 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 in iroh::address_lookup::pkarr - Rust 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.
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/dht/index.html b/pr/3958/docs/iroh/address_lookup/pkarr/dht/index.html
index c0680fc4a6..4373a5b5d6 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/dht/index.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/dht/index.html
@@ -1,4 +1,4 @@
-iroh::address_lookup::pkarr::dht - Rust Module dht
Available on crate feature address-lookup-pkarr-dht only.Expand description
Pkarr based address lookup for iroh, supporting both relay servers and the DHT.
+iroh::address_lookup::pkarr::dht - Rust Module dht
Available on crate feature address-lookup-pkarr-dht only.Expand description
Pkarr based address lookup for iroh, supporting both relay servers and the DHT.
This module contains pkarr-based address lookup for iroh which can use both pkarr
relay servers as well as the Mainline DHT directly. See the pkarr module for an
overview of pkarr.
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.Builder.html b/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.Builder.html
index 34f9e9feba..53c1d72aa4 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.Builder.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.Builder.html
@@ -1,20 +1,20 @@
-Builder in iroh::address_lookup::pkarr::dht - Rust Builder
pub struct Builder { /* private fields */ }
Available on crate feature address-lookup-pkarr-dht only.Expand description
Builder for DhtAddressLookup.
+Builder in iroh::address_lookup::pkarr::dht - Rust Builder
pub struct Builder { /* private fields */ }
Available on crate feature address-lookup-pkarr-dht only.Expand description
Builder for DhtAddressLookup.
By default, publishing to the DHT is enabled, and relay publishing is disabled.
-Implementations§
Source§impl Builder
Sourcepub fn secret_key(self, secret_key: SecretKey) -> Self
Sets the secret key to use for signing the DNS packets.
+Implementations§
Source§impl Builder
Sourcepub fn secret_key(self, secret_key: SecretKey) -> Self
Sets the secret key to use for signing the DNS packets.
Without a secret key, the endpoint will not publish its address to the DHT.
-Sourcepub fn pkarr_relay(self, pkarr_relay: Url) -> Self
Sets the pkarr relay URL to use.
-Sourcepub fn n0_dns_pkarr_relay(self) -> Self
Uses the default number 0 pkarr relay URL.
-Sourcepub fn include_direct_addresses(self, include_direct_addresses: bool) -> Self
Sets whether to include the direct addresses in the DNS packet.
-Sourcepub fn republish_delay(self, republish_delay: Duration) -> Self
Sets the republish delay for the DHT.
-Sourcepub fn no_publish(self) -> Self
Disables publishing even if a secret key is set.
-Sourcepub fn build(self) -> Result<DhtAddressLookup, IntoAddressLookupError>
Builds the address lookup mechanism.
-Trait Implementations§
Source§impl IntoAddressLookup for Builder
Sourcepub fn pkarr_relay(self, pkarr_relay: Url) -> Self
Sets the pkarr relay URL to use.
+Sourcepub fn n0_dns_pkarr_relay(self) -> Self
Uses the default number 0 pkarr relay URL.
+Sourcepub fn republish_delay(self, republish_delay: Duration) -> Self
Sets the republish delay for the DHT.
+Sourcepub fn no_publish(self) -> Self
Disables publishing even if a secret key is set.
+Sourcepub fn set_addr_filter(self, filter: AddrFilter) -> Self
Sets a filter to control which addresses are published by this service.
+Sourcepub fn build(self) -> Result<DhtAddressLookup, AddressLookupBuilderError>
Builds the address lookup mechanism.
+Trait Implementations§
Source§impl AddressLookupBuilder for Builder
Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreAuto Trait Implementations§
§impl Freeze for Builder
§impl !RefUnwindSafe for Builder
§impl Send for Builder
§impl Sync for Builder
§impl Unpin for Builder
§impl !UnwindSafe for Builder
Blanket Implementations§
Source§impl<T> Any for Twhere
+) -> Result<impl AddressLookup, AddressLookupBuilderError>Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, filter: AddrFilter) -> Self
Sets a filter to control which addresses are published by this service Read more
Auto Trait Implementations§
§impl Freeze for Builder
§impl !RefUnwindSafe for Builder
§impl Send for Builder
§impl Sync for Builder
§impl Unpin for Builder
§impl !UnwindSafe for Builder
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.DhtAddressLookup.html b/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.DhtAddressLookup.html
index 71a5720045..05dac9ca82 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.DhtAddressLookup.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.DhtAddressLookup.html
@@ -1,14 +1,23 @@
-DhtAddressLookup in iroh::address_lookup::pkarr::dht - Rust DhtAddressLookup
pub struct DhtAddressLookup(/* private fields */);
Available on crate feature address-lookup-pkarr-dht only.Expand description
Pkarr Mainline DHT and relay server address lookup.
+DhtAddressLookup in iroh::address_lookup::pkarr::dht - Rust DhtAddressLookup
pub struct DhtAddressLookup(/* private fields */);
Available on crate feature address-lookup-pkarr-dht only.Expand description
Pkarr Mainline DHT and relay server address lookup.
It stores endpoint addresses in DNS records, signed by the endpoint’s private key, and publishes
them to the BitTorrent Mainline DHT. See the pkarr module for more details.
This implements the AddressLookup trait to be used as an address lookup service which can
be used as both a publisher and resolver. Calling DhtAddressLookup::publish will start
a background task that periodically publishes the endpoint address.
-Implementations§
Source§impl DhtAddressLookup
Sourcepub fn builder() -> Builder
Creates a new builder for DhtAddressLookup.
-Trait Implementations§
Source§impl AddressLookup for DhtAddressLookup
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreSource§fn resolve(
+
By default, DhtAddressLookup will publish all addresses it receives:
+direct IP addresses and relay URLs. No internal address limits or truncation
+are applied.
+You can supply an AddrFilter via Builder::set_addr_filter to
+control which addresses are published.
+
Implementations§
Source§impl DhtAddressLookup
Sourcepub fn builder() -> Builder
Creates a new builder for DhtAddressLookup.
+Trait Implementations§
Source§impl AddressLookup for DhtAddressLookup
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreSource§fn resolve(
&self,
endpoint_id: EndpointId,
-) -> Option<BoxStream<Result<AddressLookupItem, AddressLookupError>>>
Source§impl Clone for DhtAddressLookup
Source§fn clone(&self) -> DhtAddressLookup
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 DhtAddressLookup
Auto Trait Implementations§
§impl Freeze for DhtAddressLookup
§impl !RefUnwindSafe for DhtAddressLookup
§impl Send for DhtAddressLookup
§impl Sync for DhtAddressLookup
§impl Unpin for DhtAddressLookup
§impl !UnwindSafe for DhtAddressLookup
Blanket Implementations§
Source§impl<T> Any for T
Source§impl Clone for DhtAddressLookup
Source§fn clone(&self) -> DhtAddressLookup
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 DhtAddressLookup
Auto Trait Implementations§
§impl Freeze for DhtAddressLookup
§impl !RefUnwindSafe for DhtAddressLookup
§impl Send for DhtAddressLookup
§impl Sync for DhtAddressLookup
§impl Unpin for DhtAddressLookup
§impl !UnwindSafe for DhtAddressLookup
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
+ T: AddressLookup,
Source§fn into_address_lookup(
+ self,
+ _endpoint: &Endpoint,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/enum.PkarrError.html b/pr/3958/docs/iroh/address_lookup/pkarr/enum.PkarrError.html
index 674b8ca39d..89501751b1 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/enum.PkarrError.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/enum.PkarrError.html
@@ -1,4 +1,4 @@
-PkarrError in iroh::address_lookup::pkarr - Rust PkarrError
#[non_exhaustive]pub enum PkarrError {
+PkarrError in iroh::address_lookup::pkarr - Rust PkarrError
#[non_exhaustive]pub enum PkarrError {
PublicKey {
source: PublicKeyError,
meta: Meta,
@@ -34,7 +34,7 @@
§HttpRequest
§HttpPayload
§Encoding
Trait Implementations§
Source§impl Debug for PkarrError
Source§impl Display for PkarrError
Source§impl Error for PkarrError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Source§impl From<PkarrError> for AnyError
Source§fn from(value: PkarrError) -> AnyError
Converts to this type from the input type.Source§impl From<PkarrError> for Error
Source§fn from(err: PkarrError) -> Self
Converts to this type from the input type.Source§impl StackError for PkarrError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
Returns the next source in the chain, if any.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for 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
Source§impl Display for PkarrError
Source§impl Error for PkarrError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Source§impl From<PkarrError> for AnyError
Source§fn from(value: PkarrError) -> AnyError
Converts to this type from the input type.Source§impl From<PkarrError> for Error
Source§fn from(err: PkarrError) -> Self
Converts to this type from the input type.Source§impl StackError for PkarrError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
Returns the next source in the chain, if any.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for 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> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/index.html b/pr/3958/docs/iroh/address_lookup/pkarr/index.html
index 9812c19ba2..5ae7d5f488 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/index.html
+++ b/pr/3958/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
@@ -20,6 +20,10 @@ the Mainline DHT on behalf on the client as well as cache lookups performed on t
to improve performance.
+PkarrPublisher publishes all addresses it receives by default, with no internal limiting.
+You can supply an AddrFilter via PkarrPublisherBuilder::set_addr_filter to limit the kinds
+and number of addresses that get published.
+Note that PkarrResolver and address_lookup::DnsAddressLookup only resolve and do not publish, so filtering does not apply to them.
For address lookup in iroh the pkarr Resource Records contain the addressing information,
providing endpoints which retrieve the pkarr Resource Record with enough detail
to contact the iroh endpoint.
@@ -40,4 +44,4 @@ to the application’s needs:
as the Mainline DHT.
-Modules§
- dht
address-lookup-pkarr-dht - Pkarr based address lookup for iroh, supporting both relay servers and the DHT.
Structs§
- Pkarr
Publisher - Publisher of address lookup information to a pkarr relay.
- Pkarr
PublisherBuilder - Builder for
PkarrPublisher. - Pkarr
RelayClient - A pkarr client to publish [
pkarr::SignedPacket]s to a pkarr relay. - Pkarr
Resolver - Resolver of address lookup information from a pkarr relay.
- Pkarr
ResolverBuilder - Builder for
PkarrResolver.
Enums§
Constants§
- DEFAULT_
PKARR_TTL - Default TTL for the records in the pkarr signed packet.
- DEFAULT_
REPUBLISH_INTERVAL - Interval in which to republish the endpoint info even if unchanged: 5 minutes.
- N0_
DNS_PKARR_RELAY_PROD - The production pkarr relay run by number 0.
- N0_
DNS_PKARR_RELAY_STAGING - The testing pkarr relay run by number 0.
\ No newline at end of file
+Modules§
- dht
address-lookup-pkarr-dht - Pkarr based address lookup for iroh, supporting both relay servers and the DHT.
Structs§
- Pkarr
Publisher - Publisher of address lookup information to a pkarr relay.
- Pkarr
PublisherBuilder - Builder for
PkarrPublisher. - Pkarr
RelayClient - A pkarr client to publish [
pkarr::SignedPacket]s to a pkarr relay. - Pkarr
RelayClientBuilder - A builder for the
PkarrRelayClient - Pkarr
Resolver - Resolver of address lookup information from a pkarr relay.
- Pkarr
ResolverBuilder - Builder for
PkarrResolver.
Enums§
Constants§
- DEFAULT_
PKARR_TTL - Default TTL for the records in the pkarr signed packet.
- DEFAULT_
REPUBLISH_INTERVAL - Interval in which to republish the endpoint info even if unchanged: 5 minutes.
- N0_
DNS_PKARR_RELAY_PROD - The production pkarr relay run by number 0.
- N0_
DNS_PKARR_RELAY_STAGING - The testing pkarr relay run by number 0.
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/sidebar-items.js b/pr/3958/docs/iroh/address_lookup/pkarr/sidebar-items.js
index 400a6bc7cf..46dcce1f3d 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/sidebar-items.js
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/sidebar-items.js
@@ -1 +1 @@
-window.SIDEBAR_ITEMS = {"constant":["DEFAULT_PKARR_TTL","DEFAULT_REPUBLISH_INTERVAL","N0_DNS_PKARR_RELAY_PROD","N0_DNS_PKARR_RELAY_STAGING"],"enum":["PkarrError"],"mod":["dht"],"struct":["PkarrPublisher","PkarrPublisherBuilder","PkarrRelayClient","PkarrResolver","PkarrResolverBuilder"]};
\ No newline at end of file
+window.SIDEBAR_ITEMS = {"constant":["DEFAULT_PKARR_TTL","DEFAULT_REPUBLISH_INTERVAL","N0_DNS_PKARR_RELAY_PROD","N0_DNS_PKARR_RELAY_STAGING"],"enum":["PkarrError"],"mod":["dht"],"struct":["PkarrPublisher","PkarrPublisherBuilder","PkarrRelayClient","PkarrRelayClientBuilder","PkarrResolver","PkarrResolverBuilder"]};
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html
index 95a62b4d39..02dd3d5ef6 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html
@@ -1,28 +1,32 @@
-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 IntoAddressLookup, so it can be passed to address_lookup.
+
PkarrPublisherBuilder implements AddressLookupBuilder, so it can be passed to address_lookup.
It will then use the endpoint’s secret key to sign published packets.
-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 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,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html
index e6be21376b..7dfa451886 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html
@@ -1,16 +1,22 @@
-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 build(self, secret_key: SecretKey) -> PkarrPublisher
Builds the PkarrPublisher with the passed secret key for signing packets.
+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 set_addr_filter(self, filter: AddrFilter) -> Self
Sets a filter to control which addresses are published by this service
+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§
Source§impl Debug for PkarrPublisherBuilder
Trait Implementations§
Source§impl AddressLookupBuilder for PkarrPublisherBuilder
Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. 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 AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, filter: AddrFilter) -> Selfwhere
+ Self: Sized,
Sets a filter to control which addresses are published by this service 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/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
index 1aebc073cb..a211ef5a81 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
@@ -1,18 +1,20 @@
-PkarrRelayClient in iroh::address_lookup::pkarr - Rust PkarrRelayClient
pub struct PkarrRelayClient { /* private fields */ }
Expand description
A pkarr client to publish [pkarr::SignedPacket]s to a pkarr relay.
-Implementations§
Source§impl PkarrRelayClient
Sourcepub fn with_dns_resolver(
+PkarrRelayClient in iroh::address_lookup::pkarr - Rust PkarrRelayClient
pub struct PkarrRelayClient { /* private fields */ }
Expand description
A pkarr client to publish [pkarr::SignedPacket]s 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,
- dns_resolver: DnsResolver,
-) -> Self
Available on non-wasm_browser only.
Creates a new client while passing a DNS resolver to use.
-Sourcepub async fn resolve(
+ 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/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
new file mode 100644
index 0000000000..a36791fe33
--- /dev/null
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
@@ -0,0 +1,45 @@
+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,
Source§impl<T> BorrowMut<T> for Twhere
+ T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moreSource§impl<T> CloneToUninit for Twhere
+ T: Clone,
§impl<T> CompatExt for T
§impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left is true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left(&self) returns true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read more§impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
+ T: ?Sized,
§impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
+ S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
+[WithDispatch] wrapper. Read more
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
index 7503fe7c7d..4ee7e8ed15 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
@@ -1,21 +1,25 @@
-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.
-The builder implements IntoAddressLookup.
-Sourcepub fn n0_dns() -> PkarrResolverBuilder
Creates a pkarr resolver builder which uses the number 0 pkarr relay server.
+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.
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> Any 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,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
index 32061012fe..d6a0f879d3 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
@@ -1,11 +1,12 @@
-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) -> PkarrResolver
Creates a PkarrResolver from this builder.
-Trait Implementations§
Source§impl Debug for PkarrResolverBuilder
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 with_addr_filter(self, _filter: AddrFilter) -> Self
no-op: resolver does not publish
+Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. 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 AddressLookup builder into a ready-to-use Address Lookup. 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/3958/docs/iroh/address_lookup/sidebar-items.js b/pr/3958/docs/iroh/address_lookup/sidebar-items.js
index 256a9a6580..a80ededc1c 100644
--- a/pr/3958/docs/iroh/address_lookup/sidebar-items.js
+++ b/pr/3958/docs/iroh/address_lookup/sidebar-items.js
@@ -1 +1 @@
-window.SIDEBAR_ITEMS = {"enum":["Error","IntoAddressLookupError","ParseError"],"mod":["dns","mdns","memory","pkarr"],"struct":["ConcurrentAddressLookup","EndpointData","EndpointInfo","Item","UserData"],"trait":["AddressLookup","IntoAddressLookup"]};
\ No newline at end of file
+window.SIDEBAR_ITEMS = {"enum":["AddressLookupBuilderError","Error","ParseError"],"mod":["dns","mdns","memory","pkarr"],"struct":["AddrFilter","ConcurrentAddressLookup","EndpointData","EndpointInfo","Item","UserData"],"trait":["AddressLookup","AddressLookupBuilder"]};
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/struct.AddrFilter.html b/pr/3958/docs/iroh/address_lookup/struct.AddrFilter.html
new file mode 100644
index 0000000000..18e77ad3d0
--- /dev/null
+++ b/pr/3958/docs/iroh/address_lookup/struct.AddrFilter.html
@@ -0,0 +1,56 @@
+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
+the output order). A BTreeSet cannot preserve a custom order, so the return
+type is Vec to make reordering possible.
+See the documentation for each address lookup implementation for details on
+what additional filtering the implementation may perform on top.
+Implementations§
Source§impl AddrFilter
Sourcepub fn new(
+ f: impl Fn(&BTreeSet<TransportAddr>) -> Vec<TransportAddr> + Send + Sync + 'static,
+) -> AddrFilter
Create a new AddrFilter
+Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
+Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
+Sourcepub fn apply(&self, addrs: &BTreeSet<TransportAddr>) -> 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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
+ T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
+ T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
+ T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moreSource§impl<T> CloneToUninit for Twhere
+ T: Clone,
§impl<T> CompatExt for T
§impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left is true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left(&self) returns true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read more§impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
+ T: ?Sized,
§impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
+ S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
+[WithDispatch] wrapper. Read more
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html b/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html
index 2ac53f880b..1f3c54ad49 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html
@@ -1,19 +1,23 @@
-ConcurrentAddressLookup in iroh::address_lookup - Rust ConcurrentAddressLookup
pub struct ConcurrentAddressLookup { /* private fields */ }
Expand description
An Address Lookup service that combines multiple Address Lookup sources.
+ConcurrentAddressLookup in iroh::address_lookup - Rust ConcurrentAddressLookup
pub struct ConcurrentAddressLookup { /* private fields */ }
Expand description
An Address Lookup service that combines multiple Address Lookup sources.
The Address Lookup will resolve concurrently.
-Implementations§
Source§impl ConcurrentAddressLookup
Sourcepub fn empty() -> Self
Creates an empty ConcurrentAddressLookup.
-Sourcepub fn from_services(services: Vec<Box<dyn AddressLookup>>) -> Self
Creates a new ConcurrentAddressLookup.
-Sourcepub fn add(&self, service: impl AddressLookup + 'static)
Adds an AddressLookup service.
+Implementations§
Source§impl ConcurrentAddressLookup
Sourcepub fn empty() -> Self
Creates an empty ConcurrentAddressLookup.
+Sourcepub fn from_services(services: Vec<Box<dyn AddressLookup>>) -> Self
Creates a new ConcurrentAddressLookup.
+Sourcepub fn add(&self, service: impl AddressLookup + 'static)
Adds an AddressLookup service.
If there is historical Address Lookup data, it will be published immediately on this service.
-Sourcepub fn add_boxed(&self, service: Box<dyn AddressLookup>)
Adds an already Boxed AddressLookup service.
+Sourcepub fn add_boxed(&self, service: Box<dyn AddressLookup>)
Adds an already Boxed AddressLookup service.
If there is historical Address Lookup data, it will be published immediately on this service.
-Trait Implementations§
Source§impl AddressLookup for ConcurrentAddressLookup
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreTrait Implementations§
Source§impl AddressLookup for ConcurrentAddressLookup
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreSource§impl Clone for ConcurrentAddressLookup
Source§fn clone(&self) -> ConcurrentAddressLookup
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 ConcurrentAddressLookup
Source§impl Default for ConcurrentAddressLookup
Source§fn default() -> ConcurrentAddressLookup
Returns the “default value” for a type. Read moreSource§impl<T> From<T> for ConcurrentAddressLookup
Auto Trait Implementations§
§impl Freeze for ConcurrentAddressLookup
§impl RefUnwindSafe for ConcurrentAddressLookup
§impl Send for ConcurrentAddressLookup
§impl Sync for ConcurrentAddressLookup
§impl Unpin for ConcurrentAddressLookup
§impl UnwindSafe for ConcurrentAddressLookup
Blanket Implementations§
Source§impl Clone for ConcurrentAddressLookup
Source§fn clone(&self) -> ConcurrentAddressLookup
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 ConcurrentAddressLookup
Source§impl Default for ConcurrentAddressLookup
Source§fn default() -> ConcurrentAddressLookup
Returns the “default value” for a type. Read moreSource§impl<T> From<T> for ConcurrentAddressLookup
Auto Trait Implementations§
§impl Freeze for ConcurrentAddressLookup
§impl RefUnwindSafe for ConcurrentAddressLookup
§impl Send for ConcurrentAddressLookup
§impl Sync for ConcurrentAddressLookup
§impl Unpin for ConcurrentAddressLookup
§impl UnwindSafe for ConcurrentAddressLookup
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
+ T: AddressLookup,
Source§fn into_address_lookup(
+ self,
+ _endpoint: &Endpoint,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html b/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
index d1e92d14df..d3d2a057f4 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
@@ -1,24 +1,26 @@
-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: impl IntoIterator<Item = TransportAddr>) -> EndpointData
Creates a new EndpointData with a relay URL and a set of direct addresses.
-Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> EndpointData
Sets the relay URL and returns the updated endpoint data.
-Sourcepub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> EndpointData
Sets the direct addresses and returns the updated endpoint data.
-Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> EndpointData
Sets the user-defined data and returns the updated 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 clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
-Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-Trait Implementations§
Source§impl Clone for 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<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§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§
Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: impl IntoIterator<Item = TransportAddr>) -> EndpointData
Creates a new EndpointData with a relay URL and a set of direct addresses.
+Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> EndpointData
Sets the relay URL and returns the updated endpoint data.
+Sourcepub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> EndpointData
Sets the direct addresses and returns the updated endpoint data.
+Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> EndpointData
Sets the user-defined data and returns the updated 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 clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
+Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
+Sourcepub fn filtered_addrs(&self, filter: &AddrFilter) -> Vec<TransportAddr>
Apply the given filter to the current addresses.
+Returns a vec to allow re-ordering of addresses.
+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<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§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/3958/docs/iroh/address_lookup/struct.EndpointInfo.html b/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
index 333b720b45..623c3442bf 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
@@ -1,42 +1,44 @@
-EndpointInfo in iroh::address_lookup - Rust EndpointInfo
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_PKARR_TTL.html b/pr/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_PKARR_TTL.html
index 0f33a26465..132d13db24 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_PKARR_TTL.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_PKARR_TTL.html
@@ -1,4 +1,4 @@
-DEFAULT_PKARR_TTL in iroh::address_lookup::pkarr - Rust 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 in iroh::address_lookup::pkarr - Rust 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/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_REPUBLISH_INTERVAL.html b/pr/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_REPUBLISH_INTERVAL.html
index e22092eb60..6d9fc2f7aa 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_REPUBLISH_INTERVAL.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_REPUBLISH_INTERVAL.html
@@ -1,2 +1,2 @@
-
DEFAULT_REPUBLISH_INTERVAL in iroh::address_lookup::pkarr - Rust 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 in iroh::address_lookup::pkarr - Rust DEFAULT_REPUBLISH_INTERVAL
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_PROD.html b/pr/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_PROD.html
index 0706a5896e..53b2d1dfc9 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_PROD.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_PROD.html
@@ -1,4 +1,4 @@
-N0_DNS_PKARR_RELAY_PROD in iroh::address_lookup::pkarr - Rust 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 in iroh::address_lookup::pkarr - Rust 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/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_STAGING.html b/pr/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_STAGING.html
index 7b0c6835c5..69f1bb5e54 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_STAGING.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_STAGING.html
@@ -1,4 +1,4 @@
-N0_DNS_PKARR_RELAY_STAGING in iroh::address_lookup::pkarr - Rust 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 in iroh::address_lookup::pkarr - Rust 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.
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/dht/index.html b/pr/3958/docs/iroh/address_lookup/pkarr/dht/index.html
index c0680fc4a6..4373a5b5d6 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/dht/index.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/dht/index.html
@@ -1,4 +1,4 @@
-iroh::address_lookup::pkarr::dht - Rust Module dht
Available on crate feature address-lookup-pkarr-dht only.Expand description
Pkarr based address lookup for iroh, supporting both relay servers and the DHT.
+iroh::address_lookup::pkarr::dht - Rust Module dht
Available on crate feature address-lookup-pkarr-dht only.Expand description
Pkarr based address lookup for iroh, supporting both relay servers and the DHT.
This module contains pkarr-based address lookup for iroh which can use both pkarr
relay servers as well as the Mainline DHT directly. See the pkarr module for an
overview of pkarr.
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.Builder.html b/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.Builder.html
index 34f9e9feba..53c1d72aa4 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.Builder.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.Builder.html
@@ -1,20 +1,20 @@
-Builder in iroh::address_lookup::pkarr::dht - Rust Builder
pub struct Builder { /* private fields */ }
Available on crate feature address-lookup-pkarr-dht only.Expand description
Builder for DhtAddressLookup.
+Builder in iroh::address_lookup::pkarr::dht - Rust Builder
pub struct Builder { /* private fields */ }
Available on crate feature address-lookup-pkarr-dht only.Expand description
Builder for DhtAddressLookup.
By default, publishing to the DHT is enabled, and relay publishing is disabled.
-Implementations§
Source§impl Builder
Sourcepub fn secret_key(self, secret_key: SecretKey) -> Self
Sets the secret key to use for signing the DNS packets.
+Implementations§
Source§impl Builder
Sourcepub fn secret_key(self, secret_key: SecretKey) -> Self
Sets the secret key to use for signing the DNS packets.
Without a secret key, the endpoint will not publish its address to the DHT.
-Sourcepub fn pkarr_relay(self, pkarr_relay: Url) -> Self
Sets the pkarr relay URL to use.
-Sourcepub fn n0_dns_pkarr_relay(self) -> Self
Uses the default number 0 pkarr relay URL.
-Sourcepub fn include_direct_addresses(self, include_direct_addresses: bool) -> Self
Sets whether to include the direct addresses in the DNS packet.
-Sourcepub fn republish_delay(self, republish_delay: Duration) -> Self
Sets the republish delay for the DHT.
-Sourcepub fn no_publish(self) -> Self
Disables publishing even if a secret key is set.
-Sourcepub fn build(self) -> Result<DhtAddressLookup, IntoAddressLookupError>
Builds the address lookup mechanism.
-Trait Implementations§
Source§impl IntoAddressLookup for Builder
Sourcepub fn pkarr_relay(self, pkarr_relay: Url) -> Self
Sets the pkarr relay URL to use.
+Sourcepub fn n0_dns_pkarr_relay(self) -> Self
Uses the default number 0 pkarr relay URL.
+Sourcepub fn republish_delay(self, republish_delay: Duration) -> Self
Sets the republish delay for the DHT.
+Sourcepub fn no_publish(self) -> Self
Disables publishing even if a secret key is set.
+Sourcepub fn set_addr_filter(self, filter: AddrFilter) -> Self
Sets a filter to control which addresses are published by this service.
+Sourcepub fn build(self) -> Result<DhtAddressLookup, AddressLookupBuilderError>
Builds the address lookup mechanism.
+Trait Implementations§
Source§impl AddressLookupBuilder for Builder
Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreAuto Trait Implementations§
§impl Freeze for Builder
§impl !RefUnwindSafe for Builder
§impl Send for Builder
§impl Sync for Builder
§impl Unpin for Builder
§impl !UnwindSafe for Builder
Blanket Implementations§
Source§impl<T> Any for Twhere
+) -> Result<impl AddressLookup, AddressLookupBuilderError>Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, filter: AddrFilter) -> Self
Sets a filter to control which addresses are published by this service Read more
Auto Trait Implementations§
§impl Freeze for Builder
§impl !RefUnwindSafe for Builder
§impl Send for Builder
§impl Sync for Builder
§impl Unpin for Builder
§impl !UnwindSafe for Builder
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.DhtAddressLookup.html b/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.DhtAddressLookup.html
index 71a5720045..05dac9ca82 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.DhtAddressLookup.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.DhtAddressLookup.html
@@ -1,14 +1,23 @@
-DhtAddressLookup in iroh::address_lookup::pkarr::dht - Rust DhtAddressLookup
pub struct DhtAddressLookup(/* private fields */);
Available on crate feature address-lookup-pkarr-dht only.Expand description
Pkarr Mainline DHT and relay server address lookup.
+DhtAddressLookup in iroh::address_lookup::pkarr::dht - Rust DhtAddressLookup
pub struct DhtAddressLookup(/* private fields */);
Available on crate feature address-lookup-pkarr-dht only.Expand description
Pkarr Mainline DHT and relay server address lookup.
It stores endpoint addresses in DNS records, signed by the endpoint’s private key, and publishes
them to the BitTorrent Mainline DHT. See the pkarr module for more details.
This implements the AddressLookup trait to be used as an address lookup service which can
be used as both a publisher and resolver. Calling DhtAddressLookup::publish will start
a background task that periodically publishes the endpoint address.
-Implementations§
Source§impl DhtAddressLookup
Sourcepub fn builder() -> Builder
Creates a new builder for DhtAddressLookup.
-Trait Implementations§
Source§impl AddressLookup for DhtAddressLookup
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreSource§fn resolve(
+
By default, DhtAddressLookup will publish all addresses it receives:
+direct IP addresses and relay URLs. No internal address limits or truncation
+are applied.
+You can supply an AddrFilter via Builder::set_addr_filter to
+control which addresses are published.
+
Implementations§
Source§impl DhtAddressLookup
Sourcepub fn builder() -> Builder
Creates a new builder for DhtAddressLookup.
+Trait Implementations§
Source§impl AddressLookup for DhtAddressLookup
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreSource§fn resolve(
&self,
endpoint_id: EndpointId,
-) -> Option<BoxStream<Result<AddressLookupItem, AddressLookupError>>>
Source§impl Clone for DhtAddressLookup
Source§fn clone(&self) -> DhtAddressLookup
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 DhtAddressLookup
Auto Trait Implementations§
§impl Freeze for DhtAddressLookup
§impl !RefUnwindSafe for DhtAddressLookup
§impl Send for DhtAddressLookup
§impl Sync for DhtAddressLookup
§impl Unpin for DhtAddressLookup
§impl !UnwindSafe for DhtAddressLookup
Blanket Implementations§
Source§impl<T> Any for T
Source§impl Clone for DhtAddressLookup
Source§fn clone(&self) -> DhtAddressLookup
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 DhtAddressLookup
Auto Trait Implementations§
§impl Freeze for DhtAddressLookup
§impl !RefUnwindSafe for DhtAddressLookup
§impl Send for DhtAddressLookup
§impl Sync for DhtAddressLookup
§impl Unpin for DhtAddressLookup
§impl !UnwindSafe for DhtAddressLookup
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
+ T: AddressLookup,
Source§fn into_address_lookup(
+ self,
+ _endpoint: &Endpoint,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/enum.PkarrError.html b/pr/3958/docs/iroh/address_lookup/pkarr/enum.PkarrError.html
index 674b8ca39d..89501751b1 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/enum.PkarrError.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/enum.PkarrError.html
@@ -1,4 +1,4 @@
-PkarrError in iroh::address_lookup::pkarr - Rust PkarrError
#[non_exhaustive]pub enum PkarrError {
+PkarrError in iroh::address_lookup::pkarr - Rust PkarrError
#[non_exhaustive]pub enum PkarrError {
PublicKey {
source: PublicKeyError,
meta: Meta,
@@ -34,7 +34,7 @@
§HttpRequest
§HttpPayload
§Encoding
Trait Implementations§
Source§impl Debug for PkarrError
Source§impl Display for PkarrError
Source§impl Error for PkarrError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Source§impl From<PkarrError> for AnyError
Source§fn from(value: PkarrError) -> AnyError
Converts to this type from the input type.Source§impl From<PkarrError> for Error
Source§fn from(err: PkarrError) -> Self
Converts to this type from the input type.Source§impl StackError for PkarrError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
Returns the next source in the chain, if any.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for 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
Source§impl Display for PkarrError
Source§impl Error for PkarrError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Source§impl From<PkarrError> for AnyError
Source§fn from(value: PkarrError) -> AnyError
Converts to this type from the input type.Source§impl From<PkarrError> for Error
Source§fn from(err: PkarrError) -> Self
Converts to this type from the input type.Source§impl StackError for PkarrError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
Returns the next source in the chain, if any.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for 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> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/index.html b/pr/3958/docs/iroh/address_lookup/pkarr/index.html
index 9812c19ba2..5ae7d5f488 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/index.html
+++ b/pr/3958/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
@@ -20,6 +20,10 @@ the Mainline DHT on behalf on the client as well as cache lookups performed on t
to improve performance.
+PkarrPublisher publishes all addresses it receives by default, with no internal limiting.
+You can supply an AddrFilter via PkarrPublisherBuilder::set_addr_filter to limit the kinds
+and number of addresses that get published.
+Note that PkarrResolver and address_lookup::DnsAddressLookup only resolve and do not publish, so filtering does not apply to them.
For address lookup in iroh the pkarr Resource Records contain the addressing information,
providing endpoints which retrieve the pkarr Resource Record with enough detail
to contact the iroh endpoint.
@@ -40,4 +44,4 @@ to the application’s needs:
as the Mainline DHT.
-Modules§
- dht
address-lookup-pkarr-dht - Pkarr based address lookup for iroh, supporting both relay servers and the DHT.
Structs§
- Pkarr
Publisher - Publisher of address lookup information to a pkarr relay.
- Pkarr
PublisherBuilder - Builder for
PkarrPublisher. - Pkarr
RelayClient - A pkarr client to publish [
pkarr::SignedPacket]s to a pkarr relay. - Pkarr
Resolver - Resolver of address lookup information from a pkarr relay.
- Pkarr
ResolverBuilder - Builder for
PkarrResolver.
Enums§
Constants§
- DEFAULT_
PKARR_TTL - Default TTL for the records in the pkarr signed packet.
- DEFAULT_
REPUBLISH_INTERVAL - Interval in which to republish the endpoint info even if unchanged: 5 minutes.
- N0_
DNS_PKARR_RELAY_PROD - The production pkarr relay run by number 0.
- N0_
DNS_PKARR_RELAY_STAGING - The testing pkarr relay run by number 0.
\ No newline at end of file
+Modules§
- dht
address-lookup-pkarr-dht - Pkarr based address lookup for iroh, supporting both relay servers and the DHT.
Structs§
- Pkarr
Publisher - Publisher of address lookup information to a pkarr relay.
- Pkarr
PublisherBuilder - Builder for
PkarrPublisher. - Pkarr
RelayClient - A pkarr client to publish [
pkarr::SignedPacket]s to a pkarr relay. - Pkarr
RelayClientBuilder - A builder for the
PkarrRelayClient - Pkarr
Resolver - Resolver of address lookup information from a pkarr relay.
- Pkarr
ResolverBuilder - Builder for
PkarrResolver.
Enums§
Constants§
- DEFAULT_
PKARR_TTL - Default TTL for the records in the pkarr signed packet.
- DEFAULT_
REPUBLISH_INTERVAL - Interval in which to republish the endpoint info even if unchanged: 5 minutes.
- N0_
DNS_PKARR_RELAY_PROD - The production pkarr relay run by number 0.
- N0_
DNS_PKARR_RELAY_STAGING - The testing pkarr relay run by number 0.
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/sidebar-items.js b/pr/3958/docs/iroh/address_lookup/pkarr/sidebar-items.js
index 400a6bc7cf..46dcce1f3d 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/sidebar-items.js
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/sidebar-items.js
@@ -1 +1 @@
-window.SIDEBAR_ITEMS = {"constant":["DEFAULT_PKARR_TTL","DEFAULT_REPUBLISH_INTERVAL","N0_DNS_PKARR_RELAY_PROD","N0_DNS_PKARR_RELAY_STAGING"],"enum":["PkarrError"],"mod":["dht"],"struct":["PkarrPublisher","PkarrPublisherBuilder","PkarrRelayClient","PkarrResolver","PkarrResolverBuilder"]};
\ No newline at end of file
+window.SIDEBAR_ITEMS = {"constant":["DEFAULT_PKARR_TTL","DEFAULT_REPUBLISH_INTERVAL","N0_DNS_PKARR_RELAY_PROD","N0_DNS_PKARR_RELAY_STAGING"],"enum":["PkarrError"],"mod":["dht"],"struct":["PkarrPublisher","PkarrPublisherBuilder","PkarrRelayClient","PkarrRelayClientBuilder","PkarrResolver","PkarrResolverBuilder"]};
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html
index 95a62b4d39..02dd3d5ef6 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html
@@ -1,28 +1,32 @@
-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 IntoAddressLookup, so it can be passed to address_lookup.
+
PkarrPublisherBuilder implements AddressLookupBuilder, so it can be passed to address_lookup.
It will then use the endpoint’s secret key to sign published packets.
-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 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,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html
index e6be21376b..7dfa451886 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html
@@ -1,16 +1,22 @@
-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 build(self, secret_key: SecretKey) -> PkarrPublisher
Builds the PkarrPublisher with the passed secret key for signing packets.
+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 set_addr_filter(self, filter: AddrFilter) -> Self
Sets a filter to control which addresses are published by this service
+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§
Source§impl Debug for PkarrPublisherBuilder
Trait Implementations§
Source§impl AddressLookupBuilder for PkarrPublisherBuilder
Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. 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 AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, filter: AddrFilter) -> Selfwhere
+ Self: Sized,
Sets a filter to control which addresses are published by this service 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/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
index 1aebc073cb..a211ef5a81 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
@@ -1,18 +1,20 @@
-PkarrRelayClient in iroh::address_lookup::pkarr - Rust PkarrRelayClient
pub struct PkarrRelayClient { /* private fields */ }
Expand description
A pkarr client to publish [pkarr::SignedPacket]s to a pkarr relay.
-Implementations§
Source§impl PkarrRelayClient
Sourcepub fn with_dns_resolver(
+PkarrRelayClient in iroh::address_lookup::pkarr - Rust PkarrRelayClient
pub struct PkarrRelayClient { /* private fields */ }
Expand description
A pkarr client to publish [pkarr::SignedPacket]s 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,
- dns_resolver: DnsResolver,
-) -> Self
Available on non-wasm_browser only.
Creates a new client while passing a DNS resolver to use.
-Sourcepub async fn resolve(
+ 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/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
new file mode 100644
index 0000000000..a36791fe33
--- /dev/null
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
@@ -0,0 +1,45 @@
+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,
Source§impl<T> BorrowMut<T> for Twhere
+ T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moreSource§impl<T> CloneToUninit for Twhere
+ T: Clone,
§impl<T> CompatExt for T
§impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left is true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left(&self) returns true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read more§impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
+ T: ?Sized,
§impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
+ S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
+[WithDispatch] wrapper. Read more
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
index 7503fe7c7d..4ee7e8ed15 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
@@ -1,21 +1,25 @@
-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.
-The builder implements IntoAddressLookup.
-Sourcepub fn n0_dns() -> PkarrResolverBuilder
Creates a pkarr resolver builder which uses the number 0 pkarr relay server.
+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.
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> Any 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,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
index 32061012fe..d6a0f879d3 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
@@ -1,11 +1,12 @@
-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) -> PkarrResolver
Creates a PkarrResolver from this builder.
-Trait Implementations§
Source§impl Debug for PkarrResolverBuilder
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 with_addr_filter(self, _filter: AddrFilter) -> Self
no-op: resolver does not publish
+Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. 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 AddressLookup builder into a ready-to-use Address Lookup. 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/3958/docs/iroh/address_lookup/sidebar-items.js b/pr/3958/docs/iroh/address_lookup/sidebar-items.js
index 256a9a6580..a80ededc1c 100644
--- a/pr/3958/docs/iroh/address_lookup/sidebar-items.js
+++ b/pr/3958/docs/iroh/address_lookup/sidebar-items.js
@@ -1 +1 @@
-window.SIDEBAR_ITEMS = {"enum":["Error","IntoAddressLookupError","ParseError"],"mod":["dns","mdns","memory","pkarr"],"struct":["ConcurrentAddressLookup","EndpointData","EndpointInfo","Item","UserData"],"trait":["AddressLookup","IntoAddressLookup"]};
\ No newline at end of file
+window.SIDEBAR_ITEMS = {"enum":["AddressLookupBuilderError","Error","ParseError"],"mod":["dns","mdns","memory","pkarr"],"struct":["AddrFilter","ConcurrentAddressLookup","EndpointData","EndpointInfo","Item","UserData"],"trait":["AddressLookup","AddressLookupBuilder"]};
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/struct.AddrFilter.html b/pr/3958/docs/iroh/address_lookup/struct.AddrFilter.html
new file mode 100644
index 0000000000..18e77ad3d0
--- /dev/null
+++ b/pr/3958/docs/iroh/address_lookup/struct.AddrFilter.html
@@ -0,0 +1,56 @@
+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
+the output order). A BTreeSet cannot preserve a custom order, so the return
+type is Vec to make reordering possible.
+See the documentation for each address lookup implementation for details on
+what additional filtering the implementation may perform on top.
+Implementations§
Source§impl AddrFilter
Sourcepub fn new(
+ f: impl Fn(&BTreeSet<TransportAddr>) -> Vec<TransportAddr> + Send + Sync + 'static,
+) -> AddrFilter
Create a new AddrFilter
+Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
+Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
+Sourcepub fn apply(&self, addrs: &BTreeSet<TransportAddr>) -> 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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
+ T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
+ T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
+ T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moreSource§impl<T> CloneToUninit for Twhere
+ T: Clone,
§impl<T> CompatExt for T
§impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left is true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left(&self) returns true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read more§impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
+ T: ?Sized,
§impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
+ S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
+[WithDispatch] wrapper. Read more
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html b/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html
index 2ac53f880b..1f3c54ad49 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html
@@ -1,19 +1,23 @@
-ConcurrentAddressLookup in iroh::address_lookup - Rust ConcurrentAddressLookup
pub struct ConcurrentAddressLookup { /* private fields */ }
Expand description
An Address Lookup service that combines multiple Address Lookup sources.
+ConcurrentAddressLookup in iroh::address_lookup - Rust ConcurrentAddressLookup
pub struct ConcurrentAddressLookup { /* private fields */ }
Expand description
An Address Lookup service that combines multiple Address Lookup sources.
The Address Lookup will resolve concurrently.
-Implementations§
Source§impl ConcurrentAddressLookup
Sourcepub fn empty() -> Self
Creates an empty ConcurrentAddressLookup.
-Sourcepub fn from_services(services: Vec<Box<dyn AddressLookup>>) -> Self
Creates a new ConcurrentAddressLookup.
-Sourcepub fn add(&self, service: impl AddressLookup + 'static)
Adds an AddressLookup service.
+Implementations§
Source§impl ConcurrentAddressLookup
Sourcepub fn empty() -> Self
Creates an empty ConcurrentAddressLookup.
+Sourcepub fn from_services(services: Vec<Box<dyn AddressLookup>>) -> Self
Creates a new ConcurrentAddressLookup.
+Sourcepub fn add(&self, service: impl AddressLookup + 'static)
Adds an AddressLookup service.
If there is historical Address Lookup data, it will be published immediately on this service.
-Sourcepub fn add_boxed(&self, service: Box<dyn AddressLookup>)
Adds an already Boxed AddressLookup service.
+Sourcepub fn add_boxed(&self, service: Box<dyn AddressLookup>)
Adds an already Boxed AddressLookup service.
If there is historical Address Lookup data, it will be published immediately on this service.
-Trait Implementations§
Source§impl AddressLookup for ConcurrentAddressLookup
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreTrait Implementations§
Source§impl AddressLookup for ConcurrentAddressLookup
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreSource§impl Clone for ConcurrentAddressLookup
Source§fn clone(&self) -> ConcurrentAddressLookup
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 ConcurrentAddressLookup
Source§impl Default for ConcurrentAddressLookup
Source§fn default() -> ConcurrentAddressLookup
Returns the “default value” for a type. Read moreSource§impl<T> From<T> for ConcurrentAddressLookup
Auto Trait Implementations§
§impl Freeze for ConcurrentAddressLookup
§impl RefUnwindSafe for ConcurrentAddressLookup
§impl Send for ConcurrentAddressLookup
§impl Sync for ConcurrentAddressLookup
§impl Unpin for ConcurrentAddressLookup
§impl UnwindSafe for ConcurrentAddressLookup
Blanket Implementations§
Source§impl Clone for ConcurrentAddressLookup
Source§fn clone(&self) -> ConcurrentAddressLookup
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 ConcurrentAddressLookup
Source§impl Default for ConcurrentAddressLookup
Source§fn default() -> ConcurrentAddressLookup
Returns the “default value” for a type. Read moreSource§impl<T> From<T> for ConcurrentAddressLookup
Auto Trait Implementations§
§impl Freeze for ConcurrentAddressLookup
§impl RefUnwindSafe for ConcurrentAddressLookup
§impl Send for ConcurrentAddressLookup
§impl Sync for ConcurrentAddressLookup
§impl Unpin for ConcurrentAddressLookup
§impl UnwindSafe for ConcurrentAddressLookup
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
+ T: AddressLookup,
Source§fn into_address_lookup(
+ self,
+ _endpoint: &Endpoint,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html b/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
index d1e92d14df..d3d2a057f4 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
@@ -1,24 +1,26 @@
-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: impl IntoIterator<Item = TransportAddr>) -> EndpointData
Creates a new EndpointData with a relay URL and a set of direct addresses.
-Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> EndpointData
Sets the relay URL and returns the updated endpoint data.
-Sourcepub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> EndpointData
Sets the direct addresses and returns the updated endpoint data.
-Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> EndpointData
Sets the user-defined data and returns the updated 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 clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
-Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-Trait Implementations§
Source§impl Clone for 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<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§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§
Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: impl IntoIterator<Item = TransportAddr>) -> EndpointData
Creates a new EndpointData with a relay URL and a set of direct addresses.
+Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> EndpointData
Sets the relay URL and returns the updated endpoint data.
+Sourcepub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> EndpointData
Sets the direct addresses and returns the updated endpoint data.
+Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> EndpointData
Sets the user-defined data and returns the updated 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 clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
+Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
+Sourcepub fn filtered_addrs(&self, filter: &AddrFilter) -> Vec<TransportAddr>
Apply the given filter to the current addresses.
+Returns a vec to allow re-ordering of addresses.
+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<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§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/3958/docs/iroh/address_lookup/struct.EndpointInfo.html b/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
index 333b720b45..623c3442bf 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
@@ -1,42 +1,44 @@
-EndpointInfo in iroh::address_lookup - Rust EndpointInfo
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/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_REPUBLISH_INTERVAL.html b/pr/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_REPUBLISH_INTERVAL.html
index e22092eb60..6d9fc2f7aa 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/constant.DEFAULT_REPUBLISH_INTERVAL.html
+++ b/pr/3958/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/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_STAGING.html b/pr/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_STAGING.html index 7b0c6835c5..69f1bb5e54 100644 --- a/pr/3958/docs/iroh/address_lookup/pkarr/constant.N0_DNS_PKARR_RELAY_STAGING.html +++ b/pr/3958/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.
Module dht
address-lookup-pkarr-dht only.Expand description
Pkarr based address lookup for iroh, supporting both relay servers and the DHT.
+Module dht
address-lookup-pkarr-dht only.Expand description
Pkarr based address lookup for iroh, supporting both relay servers and the DHT.
This module contains pkarr-based address lookup for iroh which can use both pkarr relay servers as well as the Mainline DHT directly. See the pkarr module for an overview of pkarr.
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.Builder.html b/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.Builder.html index 34f9e9feba..53c1d72aa4 100644 --- a/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.Builder.html +++ b/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.Builder.html @@ -1,20 +1,20 @@ -Builder
pub struct Builder { /* private fields */ }address-lookup-pkarr-dht only.Expand description
Builder for DhtAddressLookup.
Builder
pub struct Builder { /* private fields */ }address-lookup-pkarr-dht only.Expand description
Builder for DhtAddressLookup.
By default, publishing to the DHT is enabled, and relay publishing is disabled.
-Implementations§
Source§impl Builder
impl Builder
Sourcepub fn secret_key(self, secret_key: SecretKey) -> Self
pub fn secret_key(self, secret_key: SecretKey) -> Self
Sets the secret key to use for signing the DNS packets.
+Implementations§
Source§impl Builder
impl Builder
Sourcepub fn secret_key(self, secret_key: SecretKey) -> Self
pub fn secret_key(self, secret_key: SecretKey) -> Self
Sets the secret key to use for signing the DNS packets.
Without a secret key, the endpoint will not publish its address to the DHT.
-Sourcepub fn pkarr_relay(self, pkarr_relay: Url) -> Self
pub fn pkarr_relay(self, pkarr_relay: Url) -> Self
Sets the pkarr relay URL to use.
-Sourcepub fn n0_dns_pkarr_relay(self) -> Self
pub fn n0_dns_pkarr_relay(self) -> Self
Uses the default number 0 pkarr relay URL.
-Sourcepub fn include_direct_addresses(self, include_direct_addresses: bool) -> Self
pub fn include_direct_addresses(self, include_direct_addresses: bool) -> Self
Sets whether to include the direct addresses in the DNS packet.
-Sourcepub fn republish_delay(self, republish_delay: Duration) -> Self
pub fn republish_delay(self, republish_delay: Duration) -> Self
Sets the republish delay for the DHT.
-Sourcepub fn no_publish(self) -> Self
pub fn no_publish(self) -> Self
Disables publishing even if a secret key is set.
-Sourcepub fn build(self) -> Result<DhtAddressLookup, IntoAddressLookupError>
pub fn build(self) -> Result<DhtAddressLookup, IntoAddressLookupError>
Builds the address lookup mechanism.
-Trait Implementations§
Source§impl IntoAddressLookup for Builder
impl IntoAddressLookup for Builder
Sourcepub fn pkarr_relay(self, pkarr_relay: Url) -> Self
pub fn pkarr_relay(self, pkarr_relay: Url) -> Self
Sets the pkarr relay URL to use.
+Sourcepub fn n0_dns_pkarr_relay(self) -> Self
pub fn n0_dns_pkarr_relay(self) -> Self
Uses the default number 0 pkarr relay URL.
+Sourcepub fn republish_delay(self, republish_delay: Duration) -> Self
pub fn republish_delay(self, republish_delay: Duration) -> Self
Sets the republish delay for the DHT.
+Sourcepub fn no_publish(self) -> Self
pub fn no_publish(self) -> Self
Disables publishing even if a secret key is set.
+Sourcepub fn set_addr_filter(self, filter: AddrFilter) -> Self
pub fn set_addr_filter(self, filter: AddrFilter) -> Self
Sets a filter to control which addresses are published by this service.
+Sourcepub fn build(self) -> Result<DhtAddressLookup, AddressLookupBuilderError>
pub fn build(self) -> Result<DhtAddressLookup, AddressLookupBuilderError>
Builds the address lookup mechanism.
+Trait Implementations§
Source§impl AddressLookupBuilder for Builder
impl AddressLookupBuilder for Builder
Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
fn into_address_lookup( self, endpoint: &Endpoint, -) -> Result<impl AddressLookup, IntoAddressLookupError>
Auto Trait Implementations§
impl Freeze for Builder
impl !RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl !UnwindSafe for Builder
Blanket Implementations§
Source§impl<T> Any for Twhere
+) -> Result<impl AddressLookup, AddressLookupBuilderError>Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, filter: AddrFilter) -> Self
Sets a filter to control which addresses are published by this service Read more
impl<T> Any for Twhere
+) -> Result<impl AddressLookup, AddressLookupBuilderError>Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, filter: AddrFilter) -> Self
Sets a filter to control which addresses are published by this service Read more
Source§fn with_addr_filter(self, filter: AddrFilter) -> Self
fn with_addr_filter(self, filter: AddrFilter) -> Self
Auto Trait Implementations§
impl Freeze for Builder
impl !RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl !UnwindSafe for Builder
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
fn implicit(
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.DhtAddressLookup.html b/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.DhtAddressLookup.html
index 71a5720045..05dac9ca82 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.DhtAddressLookup.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/dht/struct.DhtAddressLookup.html
@@ -1,14 +1,23 @@
-DhtAddressLookup in iroh::address_lookup::pkarr::dht - Rust DhtAddressLookup
pub struct DhtAddressLookup(/* private fields */);
Available on crate feature address-lookup-pkarr-dht only.Expand description
Pkarr Mainline DHT and relay server address lookup.
+DhtAddressLookup in iroh::address_lookup::pkarr::dht - Rust DhtAddressLookup
pub struct DhtAddressLookup(/* private fields */);
Available on crate feature address-lookup-pkarr-dht only.Expand description
Pkarr Mainline DHT and relay server address lookup.
It stores endpoint addresses in DNS records, signed by the endpoint’s private key, and publishes
them to the BitTorrent Mainline DHT. See the pkarr module for more details.
This implements the AddressLookup trait to be used as an address lookup service which can
be used as both a publisher and resolver. Calling DhtAddressLookup::publish will start
a background task that periodically publishes the endpoint address.
-Implementations§
Source§impl DhtAddressLookup
Sourcepub fn builder() -> Builder
Creates a new builder for DhtAddressLookup.
-Trait Implementations§
Source§impl AddressLookup for DhtAddressLookup
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreSource§fn resolve(
+
By default, DhtAddressLookup will publish all addresses it receives:
+direct IP addresses and relay URLs. No internal address limits or truncation
+are applied.
+You can supply an AddrFilter via Builder::set_addr_filter to
+control which addresses are published.
+
Implementations§
Source§impl DhtAddressLookup
Sourcepub fn builder() -> Builder
Creates a new builder for DhtAddressLookup.
+Trait Implementations§
Source§impl AddressLookup for DhtAddressLookup
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreSource§fn resolve(
&self,
endpoint_id: EndpointId,
-) -> Option<BoxStream<Result<AddressLookupItem, AddressLookupError>>>
Source§impl Clone for DhtAddressLookup
Source§fn clone(&self) -> DhtAddressLookup
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 DhtAddressLookup
Auto Trait Implementations§
§impl Freeze for DhtAddressLookup
§impl !RefUnwindSafe for DhtAddressLookup
§impl Send for DhtAddressLookup
§impl Sync for DhtAddressLookup
§impl Unpin for DhtAddressLookup
§impl !UnwindSafe for DhtAddressLookup
Blanket Implementations§
Source§impl<T> Any for T
Source§impl Clone for DhtAddressLookup
Source§fn clone(&self) -> DhtAddressLookup
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 DhtAddressLookup
Auto Trait Implementations§
§impl Freeze for DhtAddressLookup
§impl !RefUnwindSafe for DhtAddressLookup
§impl Send for DhtAddressLookup
§impl Sync for DhtAddressLookup
§impl Unpin for DhtAddressLookup
§impl !UnwindSafe for DhtAddressLookup
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
+ T: AddressLookup,
Source§fn into_address_lookup(
+ self,
+ _endpoint: &Endpoint,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/enum.PkarrError.html b/pr/3958/docs/iroh/address_lookup/pkarr/enum.PkarrError.html
index 674b8ca39d..89501751b1 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/enum.PkarrError.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/enum.PkarrError.html
@@ -1,4 +1,4 @@
-PkarrError in iroh::address_lookup::pkarr - Rust PkarrError
#[non_exhaustive]pub enum PkarrError {
+PkarrError in iroh::address_lookup::pkarr - Rust PkarrError
#[non_exhaustive]pub enum PkarrError {
PublicKey {
source: PublicKeyError,
meta: Meta,
@@ -34,7 +34,7 @@
§HttpRequest
§HttpPayload
§Encoding
Trait Implementations§
Source§impl Debug for PkarrError
Source§impl Display for PkarrError
Source§impl Error for PkarrError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Source§impl From<PkarrError> for AnyError
Source§fn from(value: PkarrError) -> AnyError
Converts to this type from the input type.Source§impl From<PkarrError> for Error
Source§fn from(err: PkarrError) -> Self
Converts to this type from the input type.Source§impl StackError for PkarrError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
Returns the next source in the chain, if any.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for 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
Source§impl Display for PkarrError
Source§impl Error for PkarrError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Source§impl From<PkarrError> for AnyError
Source§fn from(value: PkarrError) -> AnyError
Converts to this type from the input type.Source§impl From<PkarrError> for Error
Source§fn from(err: PkarrError) -> Self
Converts to this type from the input type.Source§impl StackError for PkarrError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
Returns the next source in the chain, if any.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for 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> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/index.html b/pr/3958/docs/iroh/address_lookup/pkarr/index.html
index 9812c19ba2..5ae7d5f488 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/index.html
+++ b/pr/3958/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
@@ -20,6 +20,10 @@ the Mainline DHT on behalf on the client as well as cache lookups performed on t
to improve performance.
+PkarrPublisher publishes all addresses it receives by default, with no internal limiting.
+You can supply an AddrFilter via PkarrPublisherBuilder::set_addr_filter to limit the kinds
+and number of addresses that get published.
+Note that PkarrResolver and address_lookup::DnsAddressLookup only resolve and do not publish, so filtering does not apply to them.
For address lookup in iroh the pkarr Resource Records contain the addressing information,
providing endpoints which retrieve the pkarr Resource Record with enough detail
to contact the iroh endpoint.
@@ -40,4 +44,4 @@ to the application’s needs:
as the Mainline DHT.
-Modules§
- dht
address-lookup-pkarr-dht - Pkarr based address lookup for iroh, supporting both relay servers and the DHT.
Structs§
- Pkarr
Publisher - Publisher of address lookup information to a pkarr relay.
- Pkarr
PublisherBuilder - Builder for
PkarrPublisher. - Pkarr
RelayClient - A pkarr client to publish [
pkarr::SignedPacket]s to a pkarr relay. - Pkarr
Resolver - Resolver of address lookup information from a pkarr relay.
- Pkarr
ResolverBuilder - Builder for
PkarrResolver.
Enums§
Constants§
- DEFAULT_
PKARR_TTL - Default TTL for the records in the pkarr signed packet.
- DEFAULT_
REPUBLISH_INTERVAL - Interval in which to republish the endpoint info even if unchanged: 5 minutes.
- N0_
DNS_PKARR_RELAY_PROD - The production pkarr relay run by number 0.
- N0_
DNS_PKARR_RELAY_STAGING - The testing pkarr relay run by number 0.
\ No newline at end of file
+Modules§
- dht
address-lookup-pkarr-dht - Pkarr based address lookup for iroh, supporting both relay servers and the DHT.
Structs§
- Pkarr
Publisher - Publisher of address lookup information to a pkarr relay.
- Pkarr
PublisherBuilder - Builder for
PkarrPublisher. - Pkarr
RelayClient - A pkarr client to publish [
pkarr::SignedPacket]s to a pkarr relay. - Pkarr
RelayClientBuilder - A builder for the
PkarrRelayClient - Pkarr
Resolver - Resolver of address lookup information from a pkarr relay.
- Pkarr
ResolverBuilder - Builder for
PkarrResolver.
Enums§
Constants§
- DEFAULT_
PKARR_TTL - Default TTL for the records in the pkarr signed packet.
- DEFAULT_
REPUBLISH_INTERVAL - Interval in which to republish the endpoint info even if unchanged: 5 minutes.
- N0_
DNS_PKARR_RELAY_PROD - The production pkarr relay run by number 0.
- N0_
DNS_PKARR_RELAY_STAGING - The testing pkarr relay run by number 0.
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/sidebar-items.js b/pr/3958/docs/iroh/address_lookup/pkarr/sidebar-items.js
index 400a6bc7cf..46dcce1f3d 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/sidebar-items.js
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/sidebar-items.js
@@ -1 +1 @@
-window.SIDEBAR_ITEMS = {"constant":["DEFAULT_PKARR_TTL","DEFAULT_REPUBLISH_INTERVAL","N0_DNS_PKARR_RELAY_PROD","N0_DNS_PKARR_RELAY_STAGING"],"enum":["PkarrError"],"mod":["dht"],"struct":["PkarrPublisher","PkarrPublisherBuilder","PkarrRelayClient","PkarrResolver","PkarrResolverBuilder"]};
\ No newline at end of file
+window.SIDEBAR_ITEMS = {"constant":["DEFAULT_PKARR_TTL","DEFAULT_REPUBLISH_INTERVAL","N0_DNS_PKARR_RELAY_PROD","N0_DNS_PKARR_RELAY_STAGING"],"enum":["PkarrError"],"mod":["dht"],"struct":["PkarrPublisher","PkarrPublisherBuilder","PkarrRelayClient","PkarrRelayClientBuilder","PkarrResolver","PkarrResolverBuilder"]};
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html
index 95a62b4d39..02dd3d5ef6 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html
@@ -1,28 +1,32 @@
-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 IntoAddressLookup, so it can be passed to address_lookup.
+
PkarrPublisherBuilder implements AddressLookupBuilder, so it can be passed to address_lookup.
It will then use the endpoint’s secret key to sign published packets.
-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 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,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html
index e6be21376b..7dfa451886 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html
@@ -1,16 +1,22 @@
-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 build(self, secret_key: SecretKey) -> PkarrPublisher
Builds the PkarrPublisher with the passed secret key for signing packets.
+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 set_addr_filter(self, filter: AddrFilter) -> Self
Sets a filter to control which addresses are published by this service
+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§
Source§impl Debug for PkarrPublisherBuilder
Trait Implementations§
Source§impl AddressLookupBuilder for PkarrPublisherBuilder
Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. 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 AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, filter: AddrFilter) -> Selfwhere
+ Self: Sized,
Sets a filter to control which addresses are published by this service 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/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
index 1aebc073cb..a211ef5a81 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
@@ -1,18 +1,20 @@
-PkarrRelayClient in iroh::address_lookup::pkarr - Rust PkarrRelayClient
pub struct PkarrRelayClient { /* private fields */ }
Expand description
A pkarr client to publish [pkarr::SignedPacket]s to a pkarr relay.
-Implementations§
Source§impl PkarrRelayClient
Sourcepub fn with_dns_resolver(
+PkarrRelayClient in iroh::address_lookup::pkarr - Rust PkarrRelayClient
pub struct PkarrRelayClient { /* private fields */ }
Expand description
A pkarr client to publish [pkarr::SignedPacket]s 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,
- dns_resolver: DnsResolver,
-) -> Self
Available on non-wasm_browser only.
Creates a new client while passing a DNS resolver to use.
-Sourcepub async fn resolve(
+ 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/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
new file mode 100644
index 0000000000..a36791fe33
--- /dev/null
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
@@ -0,0 +1,45 @@
+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,
Source§impl<T> BorrowMut<T> for Twhere
+ T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moreSource§impl<T> CloneToUninit for Twhere
+ T: Clone,
§impl<T> CompatExt for T
§impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left is true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left(&self) returns true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read more§impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
+ T: ?Sized,
§impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
+ S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
+[WithDispatch] wrapper. Read more
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
index 7503fe7c7d..4ee7e8ed15 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
@@ -1,21 +1,25 @@
-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.
-The builder implements IntoAddressLookup.
-Sourcepub fn n0_dns() -> PkarrResolverBuilder
Creates a pkarr resolver builder which uses the number 0 pkarr relay server.
+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.
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> Any 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,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
index 32061012fe..d6a0f879d3 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
@@ -1,11 +1,12 @@
-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) -> PkarrResolver
Creates a PkarrResolver from this builder.
-Trait Implementations§
Source§impl Debug for PkarrResolverBuilder
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 with_addr_filter(self, _filter: AddrFilter) -> Self
no-op: resolver does not publish
+Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. 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 AddressLookup builder into a ready-to-use Address Lookup. 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/3958/docs/iroh/address_lookup/sidebar-items.js b/pr/3958/docs/iroh/address_lookup/sidebar-items.js
index 256a9a6580..a80ededc1c 100644
--- a/pr/3958/docs/iroh/address_lookup/sidebar-items.js
+++ b/pr/3958/docs/iroh/address_lookup/sidebar-items.js
@@ -1 +1 @@
-window.SIDEBAR_ITEMS = {"enum":["Error","IntoAddressLookupError","ParseError"],"mod":["dns","mdns","memory","pkarr"],"struct":["ConcurrentAddressLookup","EndpointData","EndpointInfo","Item","UserData"],"trait":["AddressLookup","IntoAddressLookup"]};
\ No newline at end of file
+window.SIDEBAR_ITEMS = {"enum":["AddressLookupBuilderError","Error","ParseError"],"mod":["dns","mdns","memory","pkarr"],"struct":["AddrFilter","ConcurrentAddressLookup","EndpointData","EndpointInfo","Item","UserData"],"trait":["AddressLookup","AddressLookupBuilder"]};
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/struct.AddrFilter.html b/pr/3958/docs/iroh/address_lookup/struct.AddrFilter.html
new file mode 100644
index 0000000000..18e77ad3d0
--- /dev/null
+++ b/pr/3958/docs/iroh/address_lookup/struct.AddrFilter.html
@@ -0,0 +1,56 @@
+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
+the output order). A BTreeSet cannot preserve a custom order, so the return
+type is Vec to make reordering possible.
+See the documentation for each address lookup implementation for details on
+what additional filtering the implementation may perform on top.
+Implementations§
Source§impl AddrFilter
Sourcepub fn new(
+ f: impl Fn(&BTreeSet<TransportAddr>) -> Vec<TransportAddr> + Send + Sync + 'static,
+) -> AddrFilter
Create a new AddrFilter
+Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
+Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
+Sourcepub fn apply(&self, addrs: &BTreeSet<TransportAddr>) -> 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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
+ T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
+ T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
+ T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moreSource§impl<T> CloneToUninit for Twhere
+ T: Clone,
§impl<T> CompatExt for T
§impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left is true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left(&self) returns true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read more§impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
+ T: ?Sized,
§impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
+ S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
+[WithDispatch] wrapper. Read more
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html b/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html
index 2ac53f880b..1f3c54ad49 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html
@@ -1,19 +1,23 @@
-ConcurrentAddressLookup in iroh::address_lookup - Rust ConcurrentAddressLookup
pub struct ConcurrentAddressLookup { /* private fields */ }
Expand description
An Address Lookup service that combines multiple Address Lookup sources.
+ConcurrentAddressLookup in iroh::address_lookup - Rust ConcurrentAddressLookup
pub struct ConcurrentAddressLookup { /* private fields */ }
Expand description
An Address Lookup service that combines multiple Address Lookup sources.
The Address Lookup will resolve concurrently.
-Implementations§
Source§impl ConcurrentAddressLookup
Sourcepub fn empty() -> Self
Creates an empty ConcurrentAddressLookup.
-Sourcepub fn from_services(services: Vec<Box<dyn AddressLookup>>) -> Self
Creates a new ConcurrentAddressLookup.
-Sourcepub fn add(&self, service: impl AddressLookup + 'static)
Adds an AddressLookup service.
+Implementations§
Source§impl ConcurrentAddressLookup
Sourcepub fn empty() -> Self
Creates an empty ConcurrentAddressLookup.
+Sourcepub fn from_services(services: Vec<Box<dyn AddressLookup>>) -> Self
Creates a new ConcurrentAddressLookup.
+Sourcepub fn add(&self, service: impl AddressLookup + 'static)
Adds an AddressLookup service.
If there is historical Address Lookup data, it will be published immediately on this service.
-Sourcepub fn add_boxed(&self, service: Box<dyn AddressLookup>)
Adds an already Boxed AddressLookup service.
+Sourcepub fn add_boxed(&self, service: Box<dyn AddressLookup>)
Adds an already Boxed AddressLookup service.
If there is historical Address Lookup data, it will be published immediately on this service.
-Trait Implementations§
Source§impl AddressLookup for ConcurrentAddressLookup
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreTrait Implementations§
Source§impl AddressLookup for ConcurrentAddressLookup
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreSource§impl Clone for ConcurrentAddressLookup
Source§fn clone(&self) -> ConcurrentAddressLookup
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 ConcurrentAddressLookup
Source§impl Default for ConcurrentAddressLookup
Source§fn default() -> ConcurrentAddressLookup
Returns the “default value” for a type. Read moreSource§impl<T> From<T> for ConcurrentAddressLookup
Auto Trait Implementations§
§impl Freeze for ConcurrentAddressLookup
§impl RefUnwindSafe for ConcurrentAddressLookup
§impl Send for ConcurrentAddressLookup
§impl Sync for ConcurrentAddressLookup
§impl Unpin for ConcurrentAddressLookup
§impl UnwindSafe for ConcurrentAddressLookup
Blanket Implementations§
Source§impl Clone for ConcurrentAddressLookup
Source§fn clone(&self) -> ConcurrentAddressLookup
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 ConcurrentAddressLookup
Source§impl Default for ConcurrentAddressLookup
Source§fn default() -> ConcurrentAddressLookup
Returns the “default value” for a type. Read moreSource§impl<T> From<T> for ConcurrentAddressLookup
Auto Trait Implementations§
§impl Freeze for ConcurrentAddressLookup
§impl RefUnwindSafe for ConcurrentAddressLookup
§impl Send for ConcurrentAddressLookup
§impl Sync for ConcurrentAddressLookup
§impl Unpin for ConcurrentAddressLookup
§impl UnwindSafe for ConcurrentAddressLookup
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
+ T: AddressLookup,
Source§fn into_address_lookup(
+ self,
+ _endpoint: &Endpoint,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html b/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
index d1e92d14df..d3d2a057f4 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
@@ -1,24 +1,26 @@
-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: impl IntoIterator<Item = TransportAddr>) -> EndpointData
Creates a new EndpointData with a relay URL and a set of direct addresses.
-Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> EndpointData
Sets the relay URL and returns the updated endpoint data.
-Sourcepub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> EndpointData
Sets the direct addresses and returns the updated endpoint data.
-Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> EndpointData
Sets the user-defined data and returns the updated 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 clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
-Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-Trait Implementations§
Source§impl Clone for 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<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§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§
Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: impl IntoIterator<Item = TransportAddr>) -> EndpointData
Creates a new EndpointData with a relay URL and a set of direct addresses.
+Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> EndpointData
Sets the relay URL and returns the updated endpoint data.
+Sourcepub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> EndpointData
Sets the direct addresses and returns the updated endpoint data.
+Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> EndpointData
Sets the user-defined data and returns the updated 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 clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
+Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
+Sourcepub fn filtered_addrs(&self, filter: &AddrFilter) -> Vec<TransportAddr>
Apply the given filter to the current addresses.
+Returns a vec to allow re-ordering of addresses.
+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<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§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/3958/docs/iroh/address_lookup/struct.EndpointInfo.html b/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
index 333b720b45..623c3442bf 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
@@ -1,42 +1,44 @@
-EndpointInfo in iroh::address_lookup - Rust EndpointInfo
DhtAddressLookup
pub struct DhtAddressLookup(/* private fields */);address-lookup-pkarr-dht only.Expand description
Pkarr Mainline DHT and relay server address lookup.
+DhtAddressLookup
pub struct DhtAddressLookup(/* private fields */);address-lookup-pkarr-dht only.Expand description
Pkarr Mainline DHT and relay server address lookup.
It stores endpoint addresses in DNS records, signed by the endpoint’s private key, and publishes them to the BitTorrent Mainline DHT. See the pkarr module for more details.
This implements the AddressLookup trait to be used as an address lookup service which can
be used as both a publisher and resolver. Calling DhtAddressLookup::publish will start
a background task that periodically publishes the endpoint address.
Implementations§
Source§impl DhtAddressLookup
impl DhtAddressLookup
Sourcepub fn builder() -> Builder
pub fn builder() -> Builder
Creates a new builder for DhtAddressLookup.
Trait Implementations§
Source§impl AddressLookup for DhtAddressLookup
impl AddressLookup for DhtAddressLookup
Source§fn publish(&self, data: &EndpointData)
fn publish(&self, data: &EndpointData)
EndpointData to the Address Lookup mechanism. Read moreSource§fn resolve(
+
By default, DhtAddressLookup will publish all addresses it receives:
+direct IP addresses and relay URLs. No internal address limits or truncation
+are applied.
+You can supply an AddrFilter via Builder::set_addr_filter to
+control which addresses are published.
+
fn resolve( +
By default, DhtAddressLookup will publish all addresses it receives:
+direct IP addresses and relay URLs. No internal address limits or truncation
+are applied.
You can supply an AddrFilter via Builder::set_addr_filter to
+control which addresses are published.
Implementations§
Source§impl DhtAddressLookup
impl DhtAddressLookup
Sourcepub fn builder() -> Builder
pub fn builder() -> Builder
Creates a new builder for DhtAddressLookup.
Trait Implementations§
Source§impl AddressLookup for DhtAddressLookup
impl AddressLookup for DhtAddressLookup
Source§fn publish(&self, data: &EndpointData)
fn publish(&self, data: &EndpointData)
EndpointData to the Address Lookup mechanism. Read moreSource§fn resolve(
&self,
endpoint_id: EndpointId,
-) -> Option<BoxStream<Result<AddressLookupItem, AddressLookupError>>>
fn resolve( &self, endpoint_id: EndpointId, -) -> Option<BoxStream<Result<AddressLookupItem, AddressLookupError>>>
Source§impl Clone for DhtAddressLookup
impl Clone for DhtAddressLookup
Source§fn clone(&self) -> DhtAddressLookup
fn clone(&self) -> DhtAddressLookup
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DhtAddressLookup
impl Debug for DhtAddressLookup
Auto Trait Implementations§
impl Freeze for DhtAddressLookup
impl !RefUnwindSafe for DhtAddressLookup
impl Send for DhtAddressLookup
impl Sync for DhtAddressLookup
impl Unpin for DhtAddressLookup
impl !UnwindSafe for DhtAddressLookup
Blanket Implementations§
Source§impl<T> Any for T
impl<T> Any for T
Source§impl Clone for DhtAddressLookup
impl Clone for DhtAddressLookup
Source§fn clone(&self) -> DhtAddressLookup
fn clone(&self) -> DhtAddressLookup
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DhtAddressLookup
impl Debug for DhtAddressLookup
Auto Trait Implementations§
impl Freeze for DhtAddressLookup
impl !RefUnwindSafe for DhtAddressLookup
impl Send for DhtAddressLookup
impl Sync for DhtAddressLookup
impl Unpin for DhtAddressLookup
impl !UnwindSafe for DhtAddressLookup
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,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
fn into_address_lookup( + self, + _endpoint: &Endpoint, +) -> Result<impl AddressLookup, AddressLookupBuilderError>
Source§fn with_addr_filter(self, _filter: AddrFilter) -> T
fn with_addr_filter(self, _filter: AddrFilter) -> T
§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,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
fn into_address_lookup( - self, - _endpoint: &Endpoint, -) -> Result<impl AddressLookup, IntoAddressLookupError>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/enum.PkarrError.html b/pr/3958/docs/iroh/address_lookup/pkarr/enum.PkarrError.html
index 674b8ca39d..89501751b1 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/enum.PkarrError.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/enum.PkarrError.html
@@ -1,4 +1,4 @@
-PkarrError in iroh::address_lookup::pkarr - Rust PkarrError
#[non_exhaustive]pub enum PkarrError {
+PkarrError in iroh::address_lookup::pkarr - Rust PkarrError
#[non_exhaustive]pub enum PkarrError {
PublicKey {
source: PublicKeyError,
meta: Meta,
@@ -34,7 +34,7 @@
§HttpRequest
§HttpPayload
§Encoding
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/enum.PkarrError.html b/pr/3958/docs/iroh/address_lookup/pkarr/enum.PkarrError.html
index 674b8ca39d..89501751b1 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/enum.PkarrError.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/enum.PkarrError.html
@@ -1,4 +1,4 @@
-PkarrError in iroh::address_lookup::pkarr - Rust PkarrError
#[non_exhaustive]pub enum PkarrError {
+PkarrError in iroh::address_lookup::pkarr - Rust PkarrError
#[non_exhaustive]pub enum PkarrError {
PublicKey {
source: PublicKeyError,
meta: Meta,
@@ -34,7 +34,7 @@
§HttpRequest
§HttpPayload
§Encoding
PkarrError
#[non_exhaustive]pub enum PkarrError {
+PkarrError in iroh::address_lookup::pkarr - Rust PkarrError
#[non_exhaustive]pub enum PkarrError {
PublicKey {
source: PublicKeyError,
meta: Meta,
@@ -34,7 +34,7 @@
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/3958/docs/iroh/address_lookup/pkarr/index.html b/pr/3958/docs/iroh/address_lookup/pkarr/index.html
index 9812c19ba2..5ae7d5f488 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/index.html
+++ b/pr/3958/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
@@ -20,6 +20,10 @@ the Mainline DHT on behalf on the client as well as cache lookups performed on t
to improve performance.
+PkarrPublisher publishes all addresses it receives by default, with no internal limiting.
+You can supply an AddrFilter via PkarrPublisherBuilder::set_addr_filter to limit the kinds
+and number of addresses that get published.
+Note that PkarrResolver and address_lookup::DnsAddressLookup only resolve and do not publish, so filtering does not apply to them.
For address lookup in iroh the pkarr Resource Records contain the addressing information,
providing endpoints which retrieve the pkarr Resource Record with enough detail
to contact the iroh endpoint.
@@ -40,4 +44,4 @@ to the application’s needs:
as the Mainline DHT.
-Modules§
- dht
address-lookup-pkarr-dht - Pkarr based address lookup for iroh, supporting both relay servers and the DHT.
Structs§
- Pkarr
Publisher - Publisher of address lookup information to a pkarr relay.
- Pkarr
PublisherBuilder - Builder for
PkarrPublisher. - Pkarr
RelayClient - A pkarr client to publish [
pkarr::SignedPacket]s to a pkarr relay. - Pkarr
Resolver - Resolver of address lookup information from a pkarr relay.
- Pkarr
ResolverBuilder - Builder for
PkarrResolver.
Enums§
Constants§
- DEFAULT_
PKARR_TTL - Default TTL for the records in the pkarr signed packet.
- DEFAULT_
REPUBLISH_INTERVAL - Interval in which to republish the endpoint info even if unchanged: 5 minutes.
- N0_
DNS_PKARR_RELAY_PROD - The production pkarr relay run by number 0.
- N0_
DNS_PKARR_RELAY_STAGING - The testing pkarr relay run by number 0.
\ No newline at end of file
+Modules§
- dht
address-lookup-pkarr-dht - Pkarr based address lookup for iroh, supporting both relay servers and the DHT.
Structs§
- Pkarr
Publisher - Publisher of address lookup information to a pkarr relay.
- Pkarr
PublisherBuilder - Builder for
PkarrPublisher. - Pkarr
RelayClient - A pkarr client to publish [
pkarr::SignedPacket]s to a pkarr relay. - Pkarr
RelayClientBuilder - A builder for the
PkarrRelayClient - Pkarr
Resolver - Resolver of address lookup information from a pkarr relay.
- Pkarr
ResolverBuilder - Builder for
PkarrResolver.
Enums§
Constants§
- DEFAULT_
PKARR_TTL - Default TTL for the records in the pkarr signed packet.
- DEFAULT_
REPUBLISH_INTERVAL - Interval in which to republish the endpoint info even if unchanged: 5 minutes.
- N0_
DNS_PKARR_RELAY_PROD - The production pkarr relay run by number 0.
- N0_
DNS_PKARR_RELAY_STAGING - The testing pkarr relay run by number 0.
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/sidebar-items.js b/pr/3958/docs/iroh/address_lookup/pkarr/sidebar-items.js
index 400a6bc7cf..46dcce1f3d 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/sidebar-items.js
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/sidebar-items.js
@@ -1 +1 @@
-window.SIDEBAR_ITEMS = {"constant":["DEFAULT_PKARR_TTL","DEFAULT_REPUBLISH_INTERVAL","N0_DNS_PKARR_RELAY_PROD","N0_DNS_PKARR_RELAY_STAGING"],"enum":["PkarrError"],"mod":["dht"],"struct":["PkarrPublisher","PkarrPublisherBuilder","PkarrRelayClient","PkarrResolver","PkarrResolverBuilder"]};
\ No newline at end of file
+window.SIDEBAR_ITEMS = {"constant":["DEFAULT_PKARR_TTL","DEFAULT_REPUBLISH_INTERVAL","N0_DNS_PKARR_RELAY_PROD","N0_DNS_PKARR_RELAY_STAGING"],"enum":["PkarrError"],"mod":["dht"],"struct":["PkarrPublisher","PkarrPublisherBuilder","PkarrRelayClient","PkarrRelayClientBuilder","PkarrResolver","PkarrResolverBuilder"]};
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html
index 95a62b4d39..02dd3d5ef6 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html
@@ -1,28 +1,32 @@
-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 IntoAddressLookup, so it can be passed to address_lookup.
+
PkarrPublisherBuilder implements AddressLookupBuilder, so it can be passed to address_lookup.
It will then use the endpoint’s secret key to sign published packets.
-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 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,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html
index e6be21376b..7dfa451886 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html
@@ -1,16 +1,22 @@
-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 build(self, secret_key: SecretKey) -> PkarrPublisher
Builds the PkarrPublisher with the passed secret key for signing packets.
+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 set_addr_filter(self, filter: AddrFilter) -> Self
Sets a filter to control which addresses are published by this service
+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§
Source§impl Debug for PkarrPublisherBuilder
Trait Implementations§
Source§impl AddressLookupBuilder for PkarrPublisherBuilder
Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. 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 AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, filter: AddrFilter) -> Selfwhere
+ Self: Sized,
Sets a filter to control which addresses are published by this service 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/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
index 1aebc073cb..a211ef5a81 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
@@ -1,18 +1,20 @@
-PkarrRelayClient in iroh::address_lookup::pkarr - Rust PkarrRelayClient
pub struct PkarrRelayClient { /* private fields */ }
Expand description
A pkarr client to publish [pkarr::SignedPacket]s to a pkarr relay.
-Implementations§
Source§impl PkarrRelayClient
Sourcepub fn with_dns_resolver(
+PkarrRelayClient in iroh::address_lookup::pkarr - Rust PkarrRelayClient
pub struct PkarrRelayClient { /* private fields */ }
Expand description
A pkarr client to publish [pkarr::SignedPacket]s 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,
- dns_resolver: DnsResolver,
-) -> Self
Available on non-wasm_browser only.
Creates a new client while passing a DNS resolver to use.
-Sourcepub async fn resolve(
+ 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/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
new file mode 100644
index 0000000000..a36791fe33
--- /dev/null
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
@@ -0,0 +1,45 @@
+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,
Source§impl<T> BorrowMut<T> for Twhere
+ T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moreSource§impl<T> CloneToUninit for Twhere
+ T: Clone,
§impl<T> CompatExt for T
§impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left is true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left(&self) returns true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read more§impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
+ T: ?Sized,
§impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
+ S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
+[WithDispatch] wrapper. Read more
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
index 7503fe7c7d..4ee7e8ed15 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
@@ -1,21 +1,25 @@
-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.
-The builder implements IntoAddressLookup.
-Sourcepub fn n0_dns() -> PkarrResolverBuilder
Creates a pkarr resolver builder which uses the number 0 pkarr relay server.
+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.
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> Any 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,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
index 32061012fe..d6a0f879d3 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
@@ -1,11 +1,12 @@
-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) -> PkarrResolver
Creates a PkarrResolver from this builder.
-Trait Implementations§
Source§impl Debug for PkarrResolverBuilder
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 with_addr_filter(self, _filter: AddrFilter) -> Self
no-op: resolver does not publish
+Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. 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 AddressLookup builder into a ready-to-use Address Lookup. 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/3958/docs/iroh/address_lookup/sidebar-items.js b/pr/3958/docs/iroh/address_lookup/sidebar-items.js
index 256a9a6580..a80ededc1c 100644
--- a/pr/3958/docs/iroh/address_lookup/sidebar-items.js
+++ b/pr/3958/docs/iroh/address_lookup/sidebar-items.js
@@ -1 +1 @@
-window.SIDEBAR_ITEMS = {"enum":["Error","IntoAddressLookupError","ParseError"],"mod":["dns","mdns","memory","pkarr"],"struct":["ConcurrentAddressLookup","EndpointData","EndpointInfo","Item","UserData"],"trait":["AddressLookup","IntoAddressLookup"]};
\ No newline at end of file
+window.SIDEBAR_ITEMS = {"enum":["AddressLookupBuilderError","Error","ParseError"],"mod":["dns","mdns","memory","pkarr"],"struct":["AddrFilter","ConcurrentAddressLookup","EndpointData","EndpointInfo","Item","UserData"],"trait":["AddressLookup","AddressLookupBuilder"]};
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/struct.AddrFilter.html b/pr/3958/docs/iroh/address_lookup/struct.AddrFilter.html
new file mode 100644
index 0000000000..18e77ad3d0
--- /dev/null
+++ b/pr/3958/docs/iroh/address_lookup/struct.AddrFilter.html
@@ -0,0 +1,56 @@
+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
+the output order). A BTreeSet cannot preserve a custom order, so the return
+type is Vec to make reordering possible.
+See the documentation for each address lookup implementation for details on
+what additional filtering the implementation may perform on top.
+Implementations§
Source§impl AddrFilter
Sourcepub fn new(
+ f: impl Fn(&BTreeSet<TransportAddr>) -> Vec<TransportAddr> + Send + Sync + 'static,
+) -> AddrFilter
Create a new AddrFilter
+Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
+Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
+Sourcepub fn apply(&self, addrs: &BTreeSet<TransportAddr>) -> 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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
+ T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
+ T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
+ T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moreSource§impl<T> CloneToUninit for Twhere
+ T: Clone,
§impl<T> CompatExt for T
§impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left is true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left(&self) returns true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read more§impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
+ T: ?Sized,
§impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
+ S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
+[WithDispatch] wrapper. Read more
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html b/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html
index 2ac53f880b..1f3c54ad49 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html
@@ -1,19 +1,23 @@
-ConcurrentAddressLookup in iroh::address_lookup - Rust ConcurrentAddressLookup
pub struct ConcurrentAddressLookup { /* private fields */ }
Expand description
An Address Lookup service that combines multiple Address Lookup sources.
+ConcurrentAddressLookup in iroh::address_lookup - Rust ConcurrentAddressLookup
pub struct ConcurrentAddressLookup { /* private fields */ }
Expand description
An Address Lookup service that combines multiple Address Lookup sources.
The Address Lookup will resolve concurrently.
-Implementations§
Source§impl ConcurrentAddressLookup
Sourcepub fn empty() -> Self
Creates an empty ConcurrentAddressLookup.
-Sourcepub fn from_services(services: Vec<Box<dyn AddressLookup>>) -> Self
Creates a new ConcurrentAddressLookup.
-Sourcepub fn add(&self, service: impl AddressLookup + 'static)
Adds an AddressLookup service.
+Implementations§
Source§impl ConcurrentAddressLookup
Sourcepub fn empty() -> Self
Creates an empty ConcurrentAddressLookup.
+Sourcepub fn from_services(services: Vec<Box<dyn AddressLookup>>) -> Self
Creates a new ConcurrentAddressLookup.
+Sourcepub fn add(&self, service: impl AddressLookup + 'static)
Adds an AddressLookup service.
If there is historical Address Lookup data, it will be published immediately on this service.
-Sourcepub fn add_boxed(&self, service: Box<dyn AddressLookup>)
Adds an already Boxed AddressLookup service.
+Sourcepub fn add_boxed(&self, service: Box<dyn AddressLookup>)
Adds an already Boxed AddressLookup service.
If there is historical Address Lookup data, it will be published immediately on this service.
-Trait Implementations§
Source§impl AddressLookup for ConcurrentAddressLookup
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreTrait Implementations§
Source§impl AddressLookup for ConcurrentAddressLookup
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreSource§impl Clone for ConcurrentAddressLookup
Source§fn clone(&self) -> ConcurrentAddressLookup
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 ConcurrentAddressLookup
Source§impl Default for ConcurrentAddressLookup
Source§fn default() -> ConcurrentAddressLookup
Returns the “default value” for a type. Read moreSource§impl<T> From<T> for ConcurrentAddressLookup
Auto Trait Implementations§
§impl Freeze for ConcurrentAddressLookup
§impl RefUnwindSafe for ConcurrentAddressLookup
§impl Send for ConcurrentAddressLookup
§impl Sync for ConcurrentAddressLookup
§impl Unpin for ConcurrentAddressLookup
§impl UnwindSafe for ConcurrentAddressLookup
Blanket Implementations§
Source§impl Clone for ConcurrentAddressLookup
Source§fn clone(&self) -> ConcurrentAddressLookup
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 ConcurrentAddressLookup
Source§impl Default for ConcurrentAddressLookup
Source§fn default() -> ConcurrentAddressLookup
Returns the “default value” for a type. Read moreSource§impl<T> From<T> for ConcurrentAddressLookup
Auto Trait Implementations§
§impl Freeze for ConcurrentAddressLookup
§impl RefUnwindSafe for ConcurrentAddressLookup
§impl Send for ConcurrentAddressLookup
§impl Sync for ConcurrentAddressLookup
§impl Unpin for ConcurrentAddressLookup
§impl UnwindSafe for ConcurrentAddressLookup
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
+ T: AddressLookup,
Source§fn into_address_lookup(
+ self,
+ _endpoint: &Endpoint,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html b/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
index d1e92d14df..d3d2a057f4 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
@@ -1,24 +1,26 @@
-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: impl IntoIterator<Item = TransportAddr>) -> EndpointData
Creates a new EndpointData with a relay URL and a set of direct addresses.
-Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> EndpointData
Sets the relay URL and returns the updated endpoint data.
-Sourcepub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> EndpointData
Sets the direct addresses and returns the updated endpoint data.
-Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> EndpointData
Sets the user-defined data and returns the updated 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 clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
-Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-Trait Implementations§
Source§impl Clone for 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<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§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§
Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: impl IntoIterator<Item = TransportAddr>) -> EndpointData
Creates a new EndpointData with a relay URL and a set of direct addresses.
+Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> EndpointData
Sets the relay URL and returns the updated endpoint data.
+Sourcepub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> EndpointData
Sets the direct addresses and returns the updated endpoint data.
+Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> EndpointData
Sets the user-defined data and returns the updated 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 clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
+Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
+Sourcepub fn filtered_addrs(&self, filter: &AddrFilter) -> Vec<TransportAddr>
Apply the given filter to the current addresses.
+Returns a vec to allow re-ordering of addresses.
+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<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§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/3958/docs/iroh/address_lookup/struct.EndpointInfo.html b/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
index 333b720b45..623c3442bf 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
@@ -1,42 +1,44 @@
-EndpointInfo in iroh::address_lookup - Rust EndpointInfo
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
@@ -20,6 +20,10 @@ the Mainline DHT on behalf on the client as well as cache lookups performed on t
to improve performance.
PkarrPublisher publishes all addresses it receives by default, with no internal limiting.
+You can supply an AddrFilter via PkarrPublisherBuilder::set_addr_filter to limit the kinds
+and number of addresses that get published.
Note that PkarrResolver and address_lookup::DnsAddressLookup only resolve and do not publish, so filtering does not apply to them.
For address lookup in iroh the pkarr Resource Records contain the addressing information, providing endpoints which retrieve the pkarr Resource Record with enough detail to contact the iroh endpoint.
@@ -40,4 +44,4 @@ to the application’s needs: as the Mainline DHT. -Modules§
- dht
address-lookup-pkarr-dht - Pkarr based address lookup for iroh, supporting both relay servers and the DHT.
Structs§
- Pkarr
Publisher - Publisher of address lookup information to a pkarr relay.
- Pkarr
Publisher Builder - Builder for
PkarrPublisher. - Pkarr
Relay Client - A pkarr client to publish [
pkarr::SignedPacket]s to a pkarr relay. - Pkarr
Resolver - Resolver of address lookup information from a pkarr relay.
- Pkarr
Resolver Builder - Builder for
PkarrResolver.
Enums§
Constants§
- DEFAULT_
PKARR_ TTL - Default TTL for the records in the pkarr signed packet.
- DEFAULT_
REPUBLISH_ INTERVAL - Interval in which to republish the endpoint info even if unchanged: 5 minutes.
- N0_
DNS_ PKARR_ RELAY_ PROD - The production pkarr relay run by number 0.
- N0_
DNS_ PKARR_ RELAY_ STAGING - The testing pkarr relay run by number 0.
Modules§
- dht
address-lookup-pkarr-dht - Pkarr based address lookup for iroh, supporting both relay servers and the DHT.
Structs§
- Pkarr
Publisher - Publisher of address lookup information to a pkarr relay.
- Pkarr
Publisher Builder - Builder for
PkarrPublisher. - Pkarr
Relay Client - A pkarr client to publish [
pkarr::SignedPacket]s to a pkarr relay. - Pkarr
Relay Client Builder - A builder for the
PkarrRelayClient - Pkarr
Resolver - Resolver of address lookup information from a pkarr relay.
- Pkarr
Resolver Builder - Builder for
PkarrResolver.
Enums§
Constants§
- DEFAULT_
PKARR_ TTL - Default TTL for the records in the pkarr signed packet.
- DEFAULT_
REPUBLISH_ INTERVAL - Interval in which to republish the endpoint info even if unchanged: 5 minutes.
- N0_
DNS_ PKARR_ RELAY_ PROD - The production pkarr relay run by number 0.
- N0_
DNS_ PKARR_ RELAY_ STAGING - The testing pkarr relay run by number 0.
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 IntoAddressLookup, so it can be passed to address_lookup.
+
PkarrPublisherBuilder implements AddressLookupBuilder, so it can be passed to address_lookup.
It will then use the endpoint’s secret key to sign published packets.
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 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,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
fn into_address_lookup( + self, + _endpoint: &Endpoint, +) -> Result<impl AddressLookup, AddressLookupBuilderError>
Source§fn with_addr_filter(self, _filter: AddrFilter) -> T
fn with_addr_filter(self, _filter: AddrFilter) -> T
§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,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
fn into_address_lookup( - self, - _endpoint: &Endpoint, -) -> Result<impl AddressLookup, IntoAddressLookupError>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html
index e6be21376b..7dfa451886 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html
@@ -1,16 +1,22 @@
-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 build(self, secret_key: SecretKey) -> PkarrPublisher
Builds the PkarrPublisher with the passed secret key for signing packets.
+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 set_addr_filter(self, filter: AddrFilter) -> Self
Sets a filter to control which addresses are published by this service
+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§
Source§impl Debug for PkarrPublisherBuilder
Trait Implementations§
Source§impl AddressLookupBuilder for PkarrPublisherBuilder
Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. 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 AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, filter: AddrFilter) -> Selfwhere
+ Self: Sized,
Sets a filter to control which addresses are published by this service 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/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
index 1aebc073cb..a211ef5a81 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
@@ -1,18 +1,20 @@
-PkarrRelayClient in iroh::address_lookup::pkarr - Rust PkarrRelayClient
pub struct PkarrRelayClient { /* private fields */ }
Expand description
A pkarr client to publish [pkarr::SignedPacket]s to a pkarr relay.
-Implementations§
Source§impl PkarrRelayClient
Sourcepub fn with_dns_resolver(
+PkarrRelayClient in iroh::address_lookup::pkarr - Rust PkarrRelayClient
pub struct PkarrRelayClient { /* private fields */ }
Expand description
A pkarr client to publish [pkarr::SignedPacket]s 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,
- dns_resolver: DnsResolver,
-) -> Self
Available on non-wasm_browser only.
Creates a new client while passing a DNS resolver to use.
-Sourcepub async fn resolve(
+ 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/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
new file mode 100644
index 0000000000..a36791fe33
--- /dev/null
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
@@ -0,0 +1,45 @@
+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,
Source§impl<T> BorrowMut<T> for Twhere
+ T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moreSource§impl<T> CloneToUninit for Twhere
+ T: Clone,
§impl<T> CompatExt for T
§impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left is true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left(&self) returns true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read more§impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
+ T: ?Sized,
§impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
+ S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
+[WithDispatch] wrapper. Read more
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
index 7503fe7c7d..4ee7e8ed15 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
@@ -1,21 +1,25 @@
-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.
-The builder implements IntoAddressLookup.
-Sourcepub fn n0_dns() -> PkarrResolverBuilder
Creates a pkarr resolver builder which uses the number 0 pkarr relay server.
+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.
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> Any 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,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
index 32061012fe..d6a0f879d3 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
@@ -1,11 +1,12 @@
-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) -> PkarrResolver
Creates a PkarrResolver from this builder.
-Trait Implementations§
Source§impl Debug for PkarrResolverBuilder
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 with_addr_filter(self, _filter: AddrFilter) -> Self
no-op: resolver does not publish
+Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. 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 AddressLookup builder into a ready-to-use Address Lookup. 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/3958/docs/iroh/address_lookup/sidebar-items.js b/pr/3958/docs/iroh/address_lookup/sidebar-items.js
index 256a9a6580..a80ededc1c 100644
--- a/pr/3958/docs/iroh/address_lookup/sidebar-items.js
+++ b/pr/3958/docs/iroh/address_lookup/sidebar-items.js
@@ -1 +1 @@
-window.SIDEBAR_ITEMS = {"enum":["Error","IntoAddressLookupError","ParseError"],"mod":["dns","mdns","memory","pkarr"],"struct":["ConcurrentAddressLookup","EndpointData","EndpointInfo","Item","UserData"],"trait":["AddressLookup","IntoAddressLookup"]};
\ No newline at end of file
+window.SIDEBAR_ITEMS = {"enum":["AddressLookupBuilderError","Error","ParseError"],"mod":["dns","mdns","memory","pkarr"],"struct":["AddrFilter","ConcurrentAddressLookup","EndpointData","EndpointInfo","Item","UserData"],"trait":["AddressLookup","AddressLookupBuilder"]};
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/struct.AddrFilter.html b/pr/3958/docs/iroh/address_lookup/struct.AddrFilter.html
new file mode 100644
index 0000000000..18e77ad3d0
--- /dev/null
+++ b/pr/3958/docs/iroh/address_lookup/struct.AddrFilter.html
@@ -0,0 +1,56 @@
+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
+the output order). A BTreeSet cannot preserve a custom order, so the return
+type is Vec to make reordering possible.
+See the documentation for each address lookup implementation for details on
+what additional filtering the implementation may perform on top.
+Implementations§
Source§impl AddrFilter
Sourcepub fn new(
+ f: impl Fn(&BTreeSet<TransportAddr>) -> Vec<TransportAddr> + Send + Sync + 'static,
+) -> AddrFilter
Create a new AddrFilter
+Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
+Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
+Sourcepub fn apply(&self, addrs: &BTreeSet<TransportAddr>) -> 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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
+ T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
+ T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
+ T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moreSource§impl<T> CloneToUninit for Twhere
+ T: Clone,
§impl<T> CompatExt for T
§impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left is true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left(&self) returns true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read more§impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
+ T: ?Sized,
§impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
+ S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
+[WithDispatch] wrapper. Read more
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html b/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html
index 2ac53f880b..1f3c54ad49 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html
@@ -1,19 +1,23 @@
-ConcurrentAddressLookup in iroh::address_lookup - Rust ConcurrentAddressLookup
pub struct ConcurrentAddressLookup { /* private fields */ }
Expand description
An Address Lookup service that combines multiple Address Lookup sources.
+ConcurrentAddressLookup in iroh::address_lookup - Rust ConcurrentAddressLookup
pub struct ConcurrentAddressLookup { /* private fields */ }
Expand description
An Address Lookup service that combines multiple Address Lookup sources.
The Address Lookup will resolve concurrently.
-Implementations§
Source§impl ConcurrentAddressLookup
Sourcepub fn empty() -> Self
Creates an empty ConcurrentAddressLookup.
-Sourcepub fn from_services(services: Vec<Box<dyn AddressLookup>>) -> Self
Creates a new ConcurrentAddressLookup.
-Sourcepub fn add(&self, service: impl AddressLookup + 'static)
Adds an AddressLookup service.
+Implementations§
Source§impl ConcurrentAddressLookup
Sourcepub fn empty() -> Self
Creates an empty ConcurrentAddressLookup.
+Sourcepub fn from_services(services: Vec<Box<dyn AddressLookup>>) -> Self
Creates a new ConcurrentAddressLookup.
+Sourcepub fn add(&self, service: impl AddressLookup + 'static)
Adds an AddressLookup service.
If there is historical Address Lookup data, it will be published immediately on this service.
-Sourcepub fn add_boxed(&self, service: Box<dyn AddressLookup>)
Adds an already Boxed AddressLookup service.
+Sourcepub fn add_boxed(&self, service: Box<dyn AddressLookup>)
Adds an already Boxed AddressLookup service.
If there is historical Address Lookup data, it will be published immediately on this service.
-Trait Implementations§
Source§impl AddressLookup for ConcurrentAddressLookup
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreTrait Implementations§
Source§impl AddressLookup for ConcurrentAddressLookup
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreSource§impl Clone for ConcurrentAddressLookup
Source§fn clone(&self) -> ConcurrentAddressLookup
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 ConcurrentAddressLookup
Source§impl Default for ConcurrentAddressLookup
Source§fn default() -> ConcurrentAddressLookup
Returns the “default value” for a type. Read moreSource§impl<T> From<T> for ConcurrentAddressLookup
Auto Trait Implementations§
§impl Freeze for ConcurrentAddressLookup
§impl RefUnwindSafe for ConcurrentAddressLookup
§impl Send for ConcurrentAddressLookup
§impl Sync for ConcurrentAddressLookup
§impl Unpin for ConcurrentAddressLookup
§impl UnwindSafe for ConcurrentAddressLookup
Blanket Implementations§
Source§impl Clone for ConcurrentAddressLookup
Source§fn clone(&self) -> ConcurrentAddressLookup
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 ConcurrentAddressLookup
Source§impl Default for ConcurrentAddressLookup
Source§fn default() -> ConcurrentAddressLookup
Returns the “default value” for a type. Read moreSource§impl<T> From<T> for ConcurrentAddressLookup
Auto Trait Implementations§
§impl Freeze for ConcurrentAddressLookup
§impl RefUnwindSafe for ConcurrentAddressLookup
§impl Send for ConcurrentAddressLookup
§impl Sync for ConcurrentAddressLookup
§impl Unpin for ConcurrentAddressLookup
§impl UnwindSafe for ConcurrentAddressLookup
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
+ T: AddressLookup,
Source§fn into_address_lookup(
+ self,
+ _endpoint: &Endpoint,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html b/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
index d1e92d14df..d3d2a057f4 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
@@ -1,24 +1,26 @@
-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: impl IntoIterator<Item = TransportAddr>) -> EndpointData
Creates a new EndpointData with a relay URL and a set of direct addresses.
-Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> EndpointData
Sets the relay URL and returns the updated endpoint data.
-Sourcepub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> EndpointData
Sets the direct addresses and returns the updated endpoint data.
-Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> EndpointData
Sets the user-defined data and returns the updated 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 clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
-Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-Trait Implementations§
Source§impl Clone for 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<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§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§
Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: impl IntoIterator<Item = TransportAddr>) -> EndpointData
Creates a new EndpointData with a relay URL and a set of direct addresses.
+Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> EndpointData
Sets the relay URL and returns the updated endpoint data.
+Sourcepub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> EndpointData
Sets the direct addresses and returns the updated endpoint data.
+Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> EndpointData
Sets the user-defined data and returns the updated 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 clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
+Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
+Sourcepub fn filtered_addrs(&self, filter: &AddrFilter) -> Vec<TransportAddr>
Apply the given filter to the current addresses.
+Returns a vec to allow re-ordering of addresses.
+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<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§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/3958/docs/iroh/address_lookup/struct.EndpointInfo.html b/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
index 333b720b45..623c3442bf 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
@@ -1,42 +1,44 @@
-EndpointInfo in iroh::address_lookup - Rust EndpointInfo
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html
index e6be21376b..7dfa451886 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrPublisherBuilder.html
@@ -1,16 +1,22 @@
-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 build(self, secret_key: SecretKey) -> PkarrPublisher
Builds the PkarrPublisher with the passed secret key for signing packets.
+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 set_addr_filter(self, filter: AddrFilter) -> Self
Sets a filter to control which addresses are published by this service
+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§
Source§impl Debug for PkarrPublisherBuilder
Trait Implementations§
Source§impl AddressLookupBuilder for PkarrPublisherBuilder
Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. 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 AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, filter: AddrFilter) -> Selfwhere
+ Self: Sized,
Sets a filter to control which addresses are published by this service 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/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
index 1aebc073cb..a211ef5a81 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
@@ -1,18 +1,20 @@
-PkarrRelayClient in iroh::address_lookup::pkarr - Rust PkarrRelayClient
pub struct PkarrRelayClient { /* private fields */ }
Expand description
A pkarr client to publish [pkarr::SignedPacket]s to a pkarr relay.
-Implementations§
Source§impl PkarrRelayClient
Sourcepub fn with_dns_resolver(
+PkarrRelayClient in iroh::address_lookup::pkarr - Rust PkarrRelayClient
pub struct PkarrRelayClient { /* private fields */ }
Expand description
A pkarr client to publish [pkarr::SignedPacket]s 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,
- dns_resolver: DnsResolver,
-) -> Self
Available on non-wasm_browser only.
Creates a new client while passing a DNS resolver to use.
-Sourcepub async fn resolve(
+ 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/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
new file mode 100644
index 0000000000..a36791fe33
--- /dev/null
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
@@ -0,0 +1,45 @@
+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,
Source§impl<T> BorrowMut<T> for Twhere
+ T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moreSource§impl<T> CloneToUninit for Twhere
+ T: Clone,
§impl<T> CompatExt for T
§impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left is true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left(&self) returns true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read more§impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
+ T: ?Sized,
§impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
+ S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
+[WithDispatch] wrapper. Read more
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
index 7503fe7c7d..4ee7e8ed15 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
@@ -1,21 +1,25 @@
-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.
-The builder implements IntoAddressLookup.
-Sourcepub fn n0_dns() -> PkarrResolverBuilder
Creates a pkarr resolver builder which uses the number 0 pkarr relay server.
+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.
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> Any 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,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
index 32061012fe..d6a0f879d3 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
@@ -1,11 +1,12 @@
-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) -> PkarrResolver
Creates a PkarrResolver from this builder.
-Trait Implementations§
Source§impl Debug for PkarrResolverBuilder
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 with_addr_filter(self, _filter: AddrFilter) -> Self
no-op: resolver does not publish
+Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. 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 AddressLookup builder into a ready-to-use Address Lookup. 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/3958/docs/iroh/address_lookup/sidebar-items.js b/pr/3958/docs/iroh/address_lookup/sidebar-items.js
index 256a9a6580..a80ededc1c 100644
--- a/pr/3958/docs/iroh/address_lookup/sidebar-items.js
+++ b/pr/3958/docs/iroh/address_lookup/sidebar-items.js
@@ -1 +1 @@
-window.SIDEBAR_ITEMS = {"enum":["Error","IntoAddressLookupError","ParseError"],"mod":["dns","mdns","memory","pkarr"],"struct":["ConcurrentAddressLookup","EndpointData","EndpointInfo","Item","UserData"],"trait":["AddressLookup","IntoAddressLookup"]};
\ No newline at end of file
+window.SIDEBAR_ITEMS = {"enum":["AddressLookupBuilderError","Error","ParseError"],"mod":["dns","mdns","memory","pkarr"],"struct":["AddrFilter","ConcurrentAddressLookup","EndpointData","EndpointInfo","Item","UserData"],"trait":["AddressLookup","AddressLookupBuilder"]};
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/struct.AddrFilter.html b/pr/3958/docs/iroh/address_lookup/struct.AddrFilter.html
new file mode 100644
index 0000000000..18e77ad3d0
--- /dev/null
+++ b/pr/3958/docs/iroh/address_lookup/struct.AddrFilter.html
@@ -0,0 +1,56 @@
+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
+the output order). A BTreeSet cannot preserve a custom order, so the return
+type is Vec to make reordering possible.
+See the documentation for each address lookup implementation for details on
+what additional filtering the implementation may perform on top.
+Implementations§
Source§impl AddrFilter
Sourcepub fn new(
+ f: impl Fn(&BTreeSet<TransportAddr>) -> Vec<TransportAddr> + Send + Sync + 'static,
+) -> AddrFilter
Create a new AddrFilter
+Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
+Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
+Sourcepub fn apply(&self, addrs: &BTreeSet<TransportAddr>) -> 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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
+ T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
+ T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
+ T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moreSource§impl<T> CloneToUninit for Twhere
+ T: Clone,
§impl<T> CompatExt for T
§impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left is true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left(&self) returns true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read more§impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
+ T: ?Sized,
§impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
+ S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
+[WithDispatch] wrapper. Read more
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html b/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html
index 2ac53f880b..1f3c54ad49 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html
@@ -1,19 +1,23 @@
-ConcurrentAddressLookup in iroh::address_lookup - Rust ConcurrentAddressLookup
pub struct ConcurrentAddressLookup { /* private fields */ }
Expand description
An Address Lookup service that combines multiple Address Lookup sources.
+ConcurrentAddressLookup in iroh::address_lookup - Rust ConcurrentAddressLookup
pub struct ConcurrentAddressLookup { /* private fields */ }
Expand description
An Address Lookup service that combines multiple Address Lookup sources.
The Address Lookup will resolve concurrently.
-Implementations§
Source§impl ConcurrentAddressLookup
Sourcepub fn empty() -> Self
Creates an empty ConcurrentAddressLookup.
-Sourcepub fn from_services(services: Vec<Box<dyn AddressLookup>>) -> Self
Creates a new ConcurrentAddressLookup.
-Sourcepub fn add(&self, service: impl AddressLookup + 'static)
Adds an AddressLookup service.
+Implementations§
Source§impl ConcurrentAddressLookup
Sourcepub fn empty() -> Self
Creates an empty ConcurrentAddressLookup.
+Sourcepub fn from_services(services: Vec<Box<dyn AddressLookup>>) -> Self
Creates a new ConcurrentAddressLookup.
+Sourcepub fn add(&self, service: impl AddressLookup + 'static)
Adds an AddressLookup service.
If there is historical Address Lookup data, it will be published immediately on this service.
-Sourcepub fn add_boxed(&self, service: Box<dyn AddressLookup>)
Adds an already Boxed AddressLookup service.
+Sourcepub fn add_boxed(&self, service: Box<dyn AddressLookup>)
Adds an already Boxed AddressLookup service.
If there is historical Address Lookup data, it will be published immediately on this service.
-Trait Implementations§
Source§impl AddressLookup for ConcurrentAddressLookup
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreTrait Implementations§
Source§impl AddressLookup for ConcurrentAddressLookup
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreSource§impl Clone for ConcurrentAddressLookup
Source§fn clone(&self) -> ConcurrentAddressLookup
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 ConcurrentAddressLookup
Source§impl Default for ConcurrentAddressLookup
Source§fn default() -> ConcurrentAddressLookup
Returns the “default value” for a type. Read moreSource§impl<T> From<T> for ConcurrentAddressLookup
Auto Trait Implementations§
§impl Freeze for ConcurrentAddressLookup
§impl RefUnwindSafe for ConcurrentAddressLookup
§impl Send for ConcurrentAddressLookup
§impl Sync for ConcurrentAddressLookup
§impl Unpin for ConcurrentAddressLookup
§impl UnwindSafe for ConcurrentAddressLookup
Blanket Implementations§
Source§impl Clone for ConcurrentAddressLookup
Source§fn clone(&self) -> ConcurrentAddressLookup
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 ConcurrentAddressLookup
Source§impl Default for ConcurrentAddressLookup
Source§fn default() -> ConcurrentAddressLookup
Returns the “default value” for a type. Read moreSource§impl<T> From<T> for ConcurrentAddressLookup
Auto Trait Implementations§
§impl Freeze for ConcurrentAddressLookup
§impl RefUnwindSafe for ConcurrentAddressLookup
§impl Send for ConcurrentAddressLookup
§impl Sync for ConcurrentAddressLookup
§impl Unpin for ConcurrentAddressLookup
§impl UnwindSafe for ConcurrentAddressLookup
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
+ T: AddressLookup,
Source§fn into_address_lookup(
+ self,
+ _endpoint: &Endpoint,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html b/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
index d1e92d14df..d3d2a057f4 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
@@ -1,24 +1,26 @@
-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: impl IntoIterator<Item = TransportAddr>) -> EndpointData
Creates a new EndpointData with a relay URL and a set of direct addresses.
-Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> EndpointData
Sets the relay URL and returns the updated endpoint data.
-Sourcepub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> EndpointData
Sets the direct addresses and returns the updated endpoint data.
-Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> EndpointData
Sets the user-defined data and returns the updated 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 clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
-Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-Trait Implementations§
Source§impl Clone for 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<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§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§
Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: impl IntoIterator<Item = TransportAddr>) -> EndpointData
Creates a new EndpointData with a relay URL and a set of direct addresses.
+Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> EndpointData
Sets the relay URL and returns the updated endpoint data.
+Sourcepub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> EndpointData
Sets the direct addresses and returns the updated endpoint data.
+Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> EndpointData
Sets the user-defined data and returns the updated 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 clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
+Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
+Sourcepub fn filtered_addrs(&self, filter: &AddrFilter) -> Vec<TransportAddr>
Apply the given filter to the current addresses.
+Returns a vec to allow re-ordering of addresses.
+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<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§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/3958/docs/iroh/address_lookup/struct.EndpointInfo.html b/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
index 333b720b45..623c3442bf 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
@@ -1,42 +1,44 @@
-EndpointInfo in iroh::address_lookup - Rust EndpointInfo
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 build(self, secret_key: SecretKey) -> PkarrPublisher
pub fn build(self, secret_key: SecretKey) -> PkarrPublisher
Builds the PkarrPublisher with the passed secret key for signing packets.
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 set_addr_filter(self, filter: AddrFilter) -> Self
pub fn set_addr_filter(self, filter: AddrFilter) -> Self
Sets a filter to control which addresses are published by this service
+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§
Source§impl Debug for PkarrPublisherBuilder
impl Debug for PkarrPublisherBuilder
Trait Implementations§
Source§impl AddressLookupBuilder for PkarrPublisherBuilder
impl AddressLookupBuilder for PkarrPublisherBuilder
Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
fn into_address_lookup( self, endpoint: &Endpoint, -) -> Result<impl AddressLookup, IntoAddressLookupError>
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§
Source§impl<T> Any for Twhere
+) -> Result<impl AddressLookup, AddressLookupBuilderError>Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, filter: AddrFilter) -> Selfwhere
+ Self: Sized,
Sets a filter to control which addresses are published by this service Read more
impl<T> Any for Twhere
+) -> Result<impl AddressLookup, AddressLookupBuilderError>Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, filter: AddrFilter) -> Selfwhere
+ Self: Sized,
Sets a filter to control which addresses are published by this service Read more
Source§fn with_addr_filter(self, filter: AddrFilter) -> Selfwhere
+ Self: Sized,
fn with_addr_filter(self, filter: AddrFilter) -> Selfwhere
+ Self: Sized,
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> 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/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
index 1aebc073cb..a211ef5a81 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html
@@ -1,18 +1,20 @@
-PkarrRelayClient in iroh::address_lookup::pkarr - Rust PkarrRelayClient
pub struct PkarrRelayClient { /* private fields */ }
Expand description
A pkarr client to publish [pkarr::SignedPacket]s to a pkarr relay.
-Implementations§
Source§impl PkarrRelayClient
Sourcepub fn with_dns_resolver(
+PkarrRelayClient in iroh::address_lookup::pkarr - Rust PkarrRelayClient
pub struct PkarrRelayClient { /* private fields */ }
Expand description
A pkarr client to publish [pkarr::SignedPacket]s 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,
- dns_resolver: DnsResolver,
-) -> Self
Available on non-wasm_browser only.
Creates a new client while passing a DNS resolver to use.
-Sourcepub async fn resolve(
+ 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/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
new file mode 100644
index 0000000000..a36791fe33
--- /dev/null
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
@@ -0,0 +1,45 @@
+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,
Source§impl<T> BorrowMut<T> for Twhere
+ T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moreSource§impl<T> CloneToUninit for Twhere
+ T: Clone,
§impl<T> CompatExt for T
§impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left is true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left(&self) returns true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read more§impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
+ T: ?Sized,
§impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
+ S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
+[WithDispatch] wrapper. Read more
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
index 7503fe7c7d..4ee7e8ed15 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
@@ -1,21 +1,25 @@
-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.
-The builder implements IntoAddressLookup.
-Sourcepub fn n0_dns() -> PkarrResolverBuilder
Creates a pkarr resolver builder which uses the number 0 pkarr relay server.
+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.
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> Any 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,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
index 32061012fe..d6a0f879d3 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
@@ -1,11 +1,12 @@
-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) -> PkarrResolver
Creates a PkarrResolver from this builder.
-Trait Implementations§
Source§impl Debug for PkarrResolverBuilder
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 with_addr_filter(self, _filter: AddrFilter) -> Self
no-op: resolver does not publish
+Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. 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 AddressLookup builder into a ready-to-use Address Lookup. 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/3958/docs/iroh/address_lookup/sidebar-items.js b/pr/3958/docs/iroh/address_lookup/sidebar-items.js
index 256a9a6580..a80ededc1c 100644
--- a/pr/3958/docs/iroh/address_lookup/sidebar-items.js
+++ b/pr/3958/docs/iroh/address_lookup/sidebar-items.js
@@ -1 +1 @@
-window.SIDEBAR_ITEMS = {"enum":["Error","IntoAddressLookupError","ParseError"],"mod":["dns","mdns","memory","pkarr"],"struct":["ConcurrentAddressLookup","EndpointData","EndpointInfo","Item","UserData"],"trait":["AddressLookup","IntoAddressLookup"]};
\ No newline at end of file
+window.SIDEBAR_ITEMS = {"enum":["AddressLookupBuilderError","Error","ParseError"],"mod":["dns","mdns","memory","pkarr"],"struct":["AddrFilter","ConcurrentAddressLookup","EndpointData","EndpointInfo","Item","UserData"],"trait":["AddressLookup","AddressLookupBuilder"]};
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/struct.AddrFilter.html b/pr/3958/docs/iroh/address_lookup/struct.AddrFilter.html
new file mode 100644
index 0000000000..18e77ad3d0
--- /dev/null
+++ b/pr/3958/docs/iroh/address_lookup/struct.AddrFilter.html
@@ -0,0 +1,56 @@
+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
+the output order). A BTreeSet cannot preserve a custom order, so the return
+type is Vec to make reordering possible.
+See the documentation for each address lookup implementation for details on
+what additional filtering the implementation may perform on top.
+Implementations§
Source§impl AddrFilter
Sourcepub fn new(
+ f: impl Fn(&BTreeSet<TransportAddr>) -> Vec<TransportAddr> + Send + Sync + 'static,
+) -> AddrFilter
Create a new AddrFilter
+Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
+Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
+Sourcepub fn apply(&self, addrs: &BTreeSet<TransportAddr>) -> 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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
+ T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
+ T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
+ T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moreSource§impl<T> CloneToUninit for Twhere
+ T: Clone,
§impl<T> CompatExt for T
§impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left is true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left(&self) returns true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read more§impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
+ T: ?Sized,
§impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
+ S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
+[WithDispatch] wrapper. Read more
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html b/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html
index 2ac53f880b..1f3c54ad49 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html
@@ -1,19 +1,23 @@
-ConcurrentAddressLookup in iroh::address_lookup - Rust ConcurrentAddressLookup
pub struct ConcurrentAddressLookup { /* private fields */ }
Expand description
An Address Lookup service that combines multiple Address Lookup sources.
+ConcurrentAddressLookup in iroh::address_lookup - Rust ConcurrentAddressLookup
pub struct ConcurrentAddressLookup { /* private fields */ }
Expand description
An Address Lookup service that combines multiple Address Lookup sources.
The Address Lookup will resolve concurrently.
-Implementations§
Source§impl ConcurrentAddressLookup
Sourcepub fn empty() -> Self
Creates an empty ConcurrentAddressLookup.
-Sourcepub fn from_services(services: Vec<Box<dyn AddressLookup>>) -> Self
Creates a new ConcurrentAddressLookup.
-Sourcepub fn add(&self, service: impl AddressLookup + 'static)
Adds an AddressLookup service.
+Implementations§
Source§impl ConcurrentAddressLookup
Sourcepub fn empty() -> Self
Creates an empty ConcurrentAddressLookup.
+Sourcepub fn from_services(services: Vec<Box<dyn AddressLookup>>) -> Self
Creates a new ConcurrentAddressLookup.
+Sourcepub fn add(&self, service: impl AddressLookup + 'static)
Adds an AddressLookup service.
If there is historical Address Lookup data, it will be published immediately on this service.
-Sourcepub fn add_boxed(&self, service: Box<dyn AddressLookup>)
Adds an already Boxed AddressLookup service.
+Sourcepub fn add_boxed(&self, service: Box<dyn AddressLookup>)
Adds an already Boxed AddressLookup service.
If there is historical Address Lookup data, it will be published immediately on this service.
-Trait Implementations§
Source§impl AddressLookup for ConcurrentAddressLookup
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreTrait Implementations§
Source§impl AddressLookup for ConcurrentAddressLookup
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreSource§impl Clone for ConcurrentAddressLookup
Source§fn clone(&self) -> ConcurrentAddressLookup
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 ConcurrentAddressLookup
Source§impl Default for ConcurrentAddressLookup
Source§fn default() -> ConcurrentAddressLookup
Returns the “default value” for a type. Read moreSource§impl<T> From<T> for ConcurrentAddressLookup
Auto Trait Implementations§
§impl Freeze for ConcurrentAddressLookup
§impl RefUnwindSafe for ConcurrentAddressLookup
§impl Send for ConcurrentAddressLookup
§impl Sync for ConcurrentAddressLookup
§impl Unpin for ConcurrentAddressLookup
§impl UnwindSafe for ConcurrentAddressLookup
Blanket Implementations§
Source§impl Clone for ConcurrentAddressLookup
Source§fn clone(&self) -> ConcurrentAddressLookup
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 ConcurrentAddressLookup
Source§impl Default for ConcurrentAddressLookup
Source§fn default() -> ConcurrentAddressLookup
Returns the “default value” for a type. Read moreSource§impl<T> From<T> for ConcurrentAddressLookup
Auto Trait Implementations§
§impl Freeze for ConcurrentAddressLookup
§impl RefUnwindSafe for ConcurrentAddressLookup
§impl Send for ConcurrentAddressLookup
§impl Sync for ConcurrentAddressLookup
§impl Unpin for ConcurrentAddressLookup
§impl UnwindSafe for ConcurrentAddressLookup
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
+ T: AddressLookup,
Source§fn into_address_lookup(
+ self,
+ _endpoint: &Endpoint,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html b/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
index d1e92d14df..d3d2a057f4 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
@@ -1,24 +1,26 @@
-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: impl IntoIterator<Item = TransportAddr>) -> EndpointData
Creates a new EndpointData with a relay URL and a set of direct addresses.
-Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> EndpointData
Sets the relay URL and returns the updated endpoint data.
-Sourcepub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> EndpointData
Sets the direct addresses and returns the updated endpoint data.
-Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> EndpointData
Sets the user-defined data and returns the updated 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 clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
-Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-Trait Implementations§
Source§impl Clone for 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<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§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§
Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: impl IntoIterator<Item = TransportAddr>) -> EndpointData
Creates a new EndpointData with a relay URL and a set of direct addresses.
+Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> EndpointData
Sets the relay URL and returns the updated endpoint data.
+Sourcepub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> EndpointData
Sets the direct addresses and returns the updated endpoint data.
+Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> EndpointData
Sets the user-defined data and returns the updated 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 clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
+Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
+Sourcepub fn filtered_addrs(&self, filter: &AddrFilter) -> Vec<TransportAddr>
Apply the given filter to the current addresses.
+Returns a vec to allow re-ordering of addresses.
+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<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§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/3958/docs/iroh/address_lookup/struct.EndpointInfo.html b/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
index 333b720b45..623c3442bf 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
@@ -1,42 +1,44 @@
-EndpointInfo in iroh::address_lookup - Rust EndpointInfo
PkarrRelayClient
pub struct PkarrRelayClient { /* private fields */ }Expand description
A pkarr client to publish [pkarr::SignedPacket]s to a pkarr relay.
Implementations§
Source§impl PkarrRelayClient
impl PkarrRelayClient
Sourcepub fn with_dns_resolver(
+PkarrRelayClient in iroh::address_lookup::pkarr - Rust PkarrRelayClient
pub struct PkarrRelayClient { /* private fields */ }
Expand description
A pkarr client to publish [pkarr::SignedPacket]s 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,
- dns_resolver: DnsResolver,
-) -> Self
Available on non-wasm_browser only.
Creates a new client while passing a DNS resolver to use.
-Sourcepub async fn resolve(
+ 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§
pub fn with_dns_resolver(
+PkarrRelayClient in iroh::address_lookup::pkarr - Rust PkarrRelayClient
pub struct PkarrRelayClient { /* private fields */ }
Expand description
A pkarr client to publish [pkarr::SignedPacket]s 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,
- dns_resolver: DnsResolver,
-) -> Self
Available on non-wasm_browser only.
Creates a new client while passing a DNS resolver to use.
-Sourcepub async fn resolve(
+ 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§
PkarrRelayClient
pub struct PkarrRelayClient { /* private fields */ }Expand description
A pkarr client to publish [pkarr::SignedPacket]s 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,
- dns_resolver: DnsResolver,
-) -> Self
Available on non-wasm_browser only.
pub fn builder( pkarr_relay_url: Url, - dns_resolver: DnsResolver, -) -> Self
wasm_browser only.Creates a new client while passing a DNS resolver to use.
-Sourcepub async fn resolve(
+ tls_config: ClientConfig,
+) -> PkarrRelayClientBuilder
pub async fn resolve( + 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/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
new file mode 100644
index 0000000000..a36791fe33
--- /dev/null
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html
@@ -0,0 +1,45 @@
+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,
Source§impl<T> BorrowMut<T> for Twhere
+ T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moreSource§impl<T> CloneToUninit for Twhere
+ T: Clone,
§impl<T> CompatExt for T
§impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left is true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left(&self) returns true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read more§impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
+ T: ?Sized,
§impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
+ S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
+[WithDispatch] wrapper. Read more
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
index 7503fe7c7d..4ee7e8ed15 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html
@@ -1,21 +1,25 @@
-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.
-The builder implements IntoAddressLookup.
-Sourcepub fn n0_dns() -> PkarrResolverBuilder
Creates a pkarr resolver builder which uses the number 0 pkarr relay server.
+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.
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> Any 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,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
index 32061012fe..d6a0f879d3 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
@@ -1,11 +1,12 @@
-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) -> PkarrResolver
Creates a PkarrResolver from this builder.
-Trait Implementations§
Source§impl Debug for PkarrResolverBuilder
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 with_addr_filter(self, _filter: AddrFilter) -> Self
no-op: resolver does not publish
+Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. 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 AddressLookup builder into a ready-to-use Address Lookup. 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/3958/docs/iroh/address_lookup/sidebar-items.js b/pr/3958/docs/iroh/address_lookup/sidebar-items.js
index 256a9a6580..a80ededc1c 100644
--- a/pr/3958/docs/iroh/address_lookup/sidebar-items.js
+++ b/pr/3958/docs/iroh/address_lookup/sidebar-items.js
@@ -1 +1 @@
-window.SIDEBAR_ITEMS = {"enum":["Error","IntoAddressLookupError","ParseError"],"mod":["dns","mdns","memory","pkarr"],"struct":["ConcurrentAddressLookup","EndpointData","EndpointInfo","Item","UserData"],"trait":["AddressLookup","IntoAddressLookup"]};
\ No newline at end of file
+window.SIDEBAR_ITEMS = {"enum":["AddressLookupBuilderError","Error","ParseError"],"mod":["dns","mdns","memory","pkarr"],"struct":["AddrFilter","ConcurrentAddressLookup","EndpointData","EndpointInfo","Item","UserData"],"trait":["AddressLookup","AddressLookupBuilder"]};
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/struct.AddrFilter.html b/pr/3958/docs/iroh/address_lookup/struct.AddrFilter.html
new file mode 100644
index 0000000000..18e77ad3d0
--- /dev/null
+++ b/pr/3958/docs/iroh/address_lookup/struct.AddrFilter.html
@@ -0,0 +1,56 @@
+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
+the output order). A BTreeSet cannot preserve a custom order, so the return
+type is Vec to make reordering possible.
+See the documentation for each address lookup implementation for details on
+what additional filtering the implementation may perform on top.
+Implementations§
Source§impl AddrFilter
Sourcepub fn new(
+ f: impl Fn(&BTreeSet<TransportAddr>) -> Vec<TransportAddr> + Send + Sync + 'static,
+) -> AddrFilter
Create a new AddrFilter
+Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
+Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
+Sourcepub fn apply(&self, addrs: &BTreeSet<TransportAddr>) -> 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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
+ T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
+ T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
+ T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moreSource§impl<T> CloneToUninit for Twhere
+ T: Clone,
§impl<T> CompatExt for T
§impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left is true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left(&self) returns true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read more§impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
+ T: ?Sized,
§impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
+ S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
+[WithDispatch] wrapper. Read more
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html b/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html
index 2ac53f880b..1f3c54ad49 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html
@@ -1,19 +1,23 @@
-ConcurrentAddressLookup in iroh::address_lookup - Rust ConcurrentAddressLookup
pub struct ConcurrentAddressLookup { /* private fields */ }
Expand description
An Address Lookup service that combines multiple Address Lookup sources.
+ConcurrentAddressLookup in iroh::address_lookup - Rust ConcurrentAddressLookup
pub struct ConcurrentAddressLookup { /* private fields */ }
Expand description
An Address Lookup service that combines multiple Address Lookup sources.
The Address Lookup will resolve concurrently.
-Implementations§
Source§impl ConcurrentAddressLookup
Sourcepub fn empty() -> Self
Creates an empty ConcurrentAddressLookup.
-Sourcepub fn from_services(services: Vec<Box<dyn AddressLookup>>) -> Self
Creates a new ConcurrentAddressLookup.
-Sourcepub fn add(&self, service: impl AddressLookup + 'static)
Adds an AddressLookup service.
+Implementations§
Source§impl ConcurrentAddressLookup
Sourcepub fn empty() -> Self
Creates an empty ConcurrentAddressLookup.
+Sourcepub fn from_services(services: Vec<Box<dyn AddressLookup>>) -> Self
Creates a new ConcurrentAddressLookup.
+Sourcepub fn add(&self, service: impl AddressLookup + 'static)
Adds an AddressLookup service.
If there is historical Address Lookup data, it will be published immediately on this service.
-Sourcepub fn add_boxed(&self, service: Box<dyn AddressLookup>)
Adds an already Boxed AddressLookup service.
+Sourcepub fn add_boxed(&self, service: Box<dyn AddressLookup>)
Adds an already Boxed AddressLookup service.
If there is historical Address Lookup data, it will be published immediately on this service.
-Trait Implementations§
Source§impl AddressLookup for ConcurrentAddressLookup
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreTrait Implementations§
Source§impl AddressLookup for ConcurrentAddressLookup
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreSource§impl Clone for ConcurrentAddressLookup
Source§fn clone(&self) -> ConcurrentAddressLookup
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 ConcurrentAddressLookup
Source§impl Default for ConcurrentAddressLookup
Source§fn default() -> ConcurrentAddressLookup
Returns the “default value” for a type. Read moreSource§impl<T> From<T> for ConcurrentAddressLookup
Auto Trait Implementations§
§impl Freeze for ConcurrentAddressLookup
§impl RefUnwindSafe for ConcurrentAddressLookup
§impl Send for ConcurrentAddressLookup
§impl Sync for ConcurrentAddressLookup
§impl Unpin for ConcurrentAddressLookup
§impl UnwindSafe for ConcurrentAddressLookup
Blanket Implementations§
Source§impl Clone for ConcurrentAddressLookup
Source§fn clone(&self) -> ConcurrentAddressLookup
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 ConcurrentAddressLookup
Source§impl Default for ConcurrentAddressLookup
Source§fn default() -> ConcurrentAddressLookup
Returns the “default value” for a type. Read moreSource§impl<T> From<T> for ConcurrentAddressLookup
Auto Trait Implementations§
§impl Freeze for ConcurrentAddressLookup
§impl RefUnwindSafe for ConcurrentAddressLookup
§impl Send for ConcurrentAddressLookup
§impl Sync for ConcurrentAddressLookup
§impl Unpin for ConcurrentAddressLookup
§impl UnwindSafe for ConcurrentAddressLookup
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
+ T: AddressLookup,
Source§fn into_address_lookup(
+ self,
+ _endpoint: &Endpoint,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html b/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
index d1e92d14df..d3d2a057f4 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
@@ -1,24 +1,26 @@
-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: impl IntoIterator<Item = TransportAddr>) -> EndpointData
Creates a new EndpointData with a relay URL and a set of direct addresses.
-Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> EndpointData
Sets the relay URL and returns the updated endpoint data.
-Sourcepub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> EndpointData
Sets the direct addresses and returns the updated endpoint data.
-Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> EndpointData
Sets the user-defined data and returns the updated 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 clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
-Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-Trait Implementations§
Source§impl Clone for 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<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§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§
Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: impl IntoIterator<Item = TransportAddr>) -> EndpointData
Creates a new EndpointData with a relay URL and a set of direct addresses.
+Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> EndpointData
Sets the relay URL and returns the updated endpoint data.
+Sourcepub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> EndpointData
Sets the direct addresses and returns the updated endpoint data.
+Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> EndpointData
Sets the user-defined data and returns the updated 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 clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
+Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
+Sourcepub fn filtered_addrs(&self, filter: &AddrFilter) -> Vec<TransportAddr>
Apply the given filter to the current addresses.
+Returns a vec to allow re-ordering of addresses.
+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<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§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/3958/docs/iroh/address_lookup/struct.EndpointInfo.html b/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
index 333b720b45..623c3442bf 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
@@ -1,42 +1,44 @@
-EndpointInfo in iroh::address_lookup - Rust EndpointInfo
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,
Source§impl<T> BorrowMut<T> for Twhere
+ T: ?Sized,
impl<T> BorrowMut<T> for Twhere
+ T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
+ T: Clone,
impl<T> CloneToUninit for Twhere
+ T: Clone,
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
+if into_left is true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
+if into_left(&self) returns true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
+ T: ?Sized,
impl<T> PolicyExt for Twhere
+ T: ?Sized,
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
+ S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
+ S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Subscriber to this type, returning a
+[WithDispatch] wrapper. Read morePkarrResolver
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.
-The builder implements IntoAddressLookup.
Sourcepub fn n0_dns() -> PkarrResolverBuilder
pub fn n0_dns() -> PkarrResolverBuilder
Creates a pkarr resolver builder which uses the number 0 pkarr relay server.
+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.
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> Any 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> Any 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,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
fn into_address_lookup( + self, + _endpoint: &Endpoint, +) -> Result<impl AddressLookup, AddressLookupBuilderError>
Source§fn with_addr_filter(self, _filter: AddrFilter) -> T
fn with_addr_filter(self, _filter: AddrFilter) -> T
§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,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
fn into_address_lookup( - self, - _endpoint: &Endpoint, -) -> Result<impl AddressLookup, IntoAddressLookupError>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
index 32061012fe..d6a0f879d3 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
@@ -1,11 +1,12 @@
-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) -> PkarrResolver
Creates a PkarrResolver from this builder.
-Trait Implementations§
Source§impl Debug for PkarrResolverBuilder
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 with_addr_filter(self, _filter: AddrFilter) -> Self
no-op: resolver does not publish
+Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. 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 AddressLookup builder into a ready-to-use Address Lookup. 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/3958/docs/iroh/address_lookup/sidebar-items.js b/pr/3958/docs/iroh/address_lookup/sidebar-items.js
index 256a9a6580..a80ededc1c 100644
--- a/pr/3958/docs/iroh/address_lookup/sidebar-items.js
+++ b/pr/3958/docs/iroh/address_lookup/sidebar-items.js
@@ -1 +1 @@
-window.SIDEBAR_ITEMS = {"enum":["Error","IntoAddressLookupError","ParseError"],"mod":["dns","mdns","memory","pkarr"],"struct":["ConcurrentAddressLookup","EndpointData","EndpointInfo","Item","UserData"],"trait":["AddressLookup","IntoAddressLookup"]};
\ No newline at end of file
+window.SIDEBAR_ITEMS = {"enum":["AddressLookupBuilderError","Error","ParseError"],"mod":["dns","mdns","memory","pkarr"],"struct":["AddrFilter","ConcurrentAddressLookup","EndpointData","EndpointInfo","Item","UserData"],"trait":["AddressLookup","AddressLookupBuilder"]};
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/struct.AddrFilter.html b/pr/3958/docs/iroh/address_lookup/struct.AddrFilter.html
new file mode 100644
index 0000000000..18e77ad3d0
--- /dev/null
+++ b/pr/3958/docs/iroh/address_lookup/struct.AddrFilter.html
@@ -0,0 +1,56 @@
+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
+the output order). A BTreeSet cannot preserve a custom order, so the return
+type is Vec to make reordering possible.
+See the documentation for each address lookup implementation for details on
+what additional filtering the implementation may perform on top.
+Implementations§
Source§impl AddrFilter
Sourcepub fn new(
+ f: impl Fn(&BTreeSet<TransportAddr>) -> Vec<TransportAddr> + Send + Sync + 'static,
+) -> AddrFilter
Create a new AddrFilter
+Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
+Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
+Sourcepub fn apply(&self, addrs: &BTreeSet<TransportAddr>) -> 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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
+ T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
+ T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
+ T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moreSource§impl<T> CloneToUninit for Twhere
+ T: Clone,
§impl<T> CompatExt for T
§impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left is true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left(&self) returns true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read more§impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
+ T: ?Sized,
§impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
+ S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
+[WithDispatch] wrapper. Read more
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html b/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html
index 2ac53f880b..1f3c54ad49 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html
@@ -1,19 +1,23 @@
-ConcurrentAddressLookup in iroh::address_lookup - Rust ConcurrentAddressLookup
pub struct ConcurrentAddressLookup { /* private fields */ }
Expand description
An Address Lookup service that combines multiple Address Lookup sources.
+ConcurrentAddressLookup in iroh::address_lookup - Rust ConcurrentAddressLookup
pub struct ConcurrentAddressLookup { /* private fields */ }
Expand description
An Address Lookup service that combines multiple Address Lookup sources.
The Address Lookup will resolve concurrently.
-Implementations§
Source§impl ConcurrentAddressLookup
Sourcepub fn empty() -> Self
Creates an empty ConcurrentAddressLookup.
-Sourcepub fn from_services(services: Vec<Box<dyn AddressLookup>>) -> Self
Creates a new ConcurrentAddressLookup.
-Sourcepub fn add(&self, service: impl AddressLookup + 'static)
Adds an AddressLookup service.
+Implementations§
Source§impl ConcurrentAddressLookup
Sourcepub fn empty() -> Self
Creates an empty ConcurrentAddressLookup.
+Sourcepub fn from_services(services: Vec<Box<dyn AddressLookup>>) -> Self
Creates a new ConcurrentAddressLookup.
+Sourcepub fn add(&self, service: impl AddressLookup + 'static)
Adds an AddressLookup service.
If there is historical Address Lookup data, it will be published immediately on this service.
-Sourcepub fn add_boxed(&self, service: Box<dyn AddressLookup>)
Adds an already Boxed AddressLookup service.
+Sourcepub fn add_boxed(&self, service: Box<dyn AddressLookup>)
Adds an already Boxed AddressLookup service.
If there is historical Address Lookup data, it will be published immediately on this service.
-Trait Implementations§
Source§impl AddressLookup for ConcurrentAddressLookup
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreTrait Implementations§
Source§impl AddressLookup for ConcurrentAddressLookup
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreSource§impl Clone for ConcurrentAddressLookup
Source§fn clone(&self) -> ConcurrentAddressLookup
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 ConcurrentAddressLookup
Source§impl Default for ConcurrentAddressLookup
Source§fn default() -> ConcurrentAddressLookup
Returns the “default value” for a type. Read moreSource§impl<T> From<T> for ConcurrentAddressLookup
Auto Trait Implementations§
§impl Freeze for ConcurrentAddressLookup
§impl RefUnwindSafe for ConcurrentAddressLookup
§impl Send for ConcurrentAddressLookup
§impl Sync for ConcurrentAddressLookup
§impl Unpin for ConcurrentAddressLookup
§impl UnwindSafe for ConcurrentAddressLookup
Blanket Implementations§
Source§impl Clone for ConcurrentAddressLookup
Source§fn clone(&self) -> ConcurrentAddressLookup
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 ConcurrentAddressLookup
Source§impl Default for ConcurrentAddressLookup
Source§fn default() -> ConcurrentAddressLookup
Returns the “default value” for a type. Read moreSource§impl<T> From<T> for ConcurrentAddressLookup
Auto Trait Implementations§
§impl Freeze for ConcurrentAddressLookup
§impl RefUnwindSafe for ConcurrentAddressLookup
§impl Send for ConcurrentAddressLookup
§impl Sync for ConcurrentAddressLookup
§impl Unpin for ConcurrentAddressLookup
§impl UnwindSafe for ConcurrentAddressLookup
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
+ T: AddressLookup,
Source§fn into_address_lookup(
+ self,
+ _endpoint: &Endpoint,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html b/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
index d1e92d14df..d3d2a057f4 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
@@ -1,24 +1,26 @@
-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: impl IntoIterator<Item = TransportAddr>) -> EndpointData
Creates a new EndpointData with a relay URL and a set of direct addresses.
-Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> EndpointData
Sets the relay URL and returns the updated endpoint data.
-Sourcepub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> EndpointData
Sets the direct addresses and returns the updated endpoint data.
-Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> EndpointData
Sets the user-defined data and returns the updated 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 clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
-Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-Trait Implementations§
Source§impl Clone for 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<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§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§
Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: impl IntoIterator<Item = TransportAddr>) -> EndpointData
Creates a new EndpointData with a relay URL and a set of direct addresses.
+Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> EndpointData
Sets the relay URL and returns the updated endpoint data.
+Sourcepub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> EndpointData
Sets the direct addresses and returns the updated endpoint data.
+Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> EndpointData
Sets the user-defined data and returns the updated 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 clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
+Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
+Sourcepub fn filtered_addrs(&self, filter: &AddrFilter) -> Vec<TransportAddr>
Apply the given filter to the current addresses.
+Returns a vec to allow re-ordering of addresses.
+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<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§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/3958/docs/iroh/address_lookup/struct.EndpointInfo.html b/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
index 333b720b45..623c3442bf 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
@@ -1,42 +1,44 @@
-EndpointInfo in iroh::address_lookup - Rust EndpointInfo
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
index 32061012fe..d6a0f879d3 100644
--- a/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
+++ b/pr/3958/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html
@@ -1,11 +1,12 @@
-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) -> PkarrResolver
Creates a PkarrResolver from this builder.
-Trait Implementations§
Source§impl Debug for PkarrResolverBuilder
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 with_addr_filter(self, _filter: AddrFilter) -> Self
no-op: resolver does not publish
+Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. 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 AddressLookup builder into a ready-to-use Address Lookup. 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/3958/docs/iroh/address_lookup/sidebar-items.js b/pr/3958/docs/iroh/address_lookup/sidebar-items.js
index 256a9a6580..a80ededc1c 100644
--- a/pr/3958/docs/iroh/address_lookup/sidebar-items.js
+++ b/pr/3958/docs/iroh/address_lookup/sidebar-items.js
@@ -1 +1 @@
-window.SIDEBAR_ITEMS = {"enum":["Error","IntoAddressLookupError","ParseError"],"mod":["dns","mdns","memory","pkarr"],"struct":["ConcurrentAddressLookup","EndpointData","EndpointInfo","Item","UserData"],"trait":["AddressLookup","IntoAddressLookup"]};
\ No newline at end of file
+window.SIDEBAR_ITEMS = {"enum":["AddressLookupBuilderError","Error","ParseError"],"mod":["dns","mdns","memory","pkarr"],"struct":["AddrFilter","ConcurrentAddressLookup","EndpointData","EndpointInfo","Item","UserData"],"trait":["AddressLookup","AddressLookupBuilder"]};
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/struct.AddrFilter.html b/pr/3958/docs/iroh/address_lookup/struct.AddrFilter.html
new file mode 100644
index 0000000000..18e77ad3d0
--- /dev/null
+++ b/pr/3958/docs/iroh/address_lookup/struct.AddrFilter.html
@@ -0,0 +1,56 @@
+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
+the output order). A BTreeSet cannot preserve a custom order, so the return
+type is Vec to make reordering possible.
+See the documentation for each address lookup implementation for details on
+what additional filtering the implementation may perform on top.
+Implementations§
Source§impl AddrFilter
Sourcepub fn new(
+ f: impl Fn(&BTreeSet<TransportAddr>) -> Vec<TransportAddr> + Send + Sync + 'static,
+) -> AddrFilter
Create a new AddrFilter
+Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
+Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
+Sourcepub fn apply(&self, addrs: &BTreeSet<TransportAddr>) -> 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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
+ T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
+ T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
+ T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moreSource§impl<T> CloneToUninit for Twhere
+ T: Clone,
§impl<T> CompatExt for T
§impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left is true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left(&self) returns true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read more§impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
+ T: ?Sized,
§impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
+ S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
+[WithDispatch] wrapper. Read more
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html b/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html
index 2ac53f880b..1f3c54ad49 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html
@@ -1,19 +1,23 @@
-ConcurrentAddressLookup in iroh::address_lookup - Rust ConcurrentAddressLookup
pub struct ConcurrentAddressLookup { /* private fields */ }
Expand description
An Address Lookup service that combines multiple Address Lookup sources.
+ConcurrentAddressLookup in iroh::address_lookup - Rust ConcurrentAddressLookup
pub struct ConcurrentAddressLookup { /* private fields */ }
Expand description
An Address Lookup service that combines multiple Address Lookup sources.
The Address Lookup will resolve concurrently.
-Implementations§
Source§impl ConcurrentAddressLookup
Sourcepub fn empty() -> Self
Creates an empty ConcurrentAddressLookup.
-Sourcepub fn from_services(services: Vec<Box<dyn AddressLookup>>) -> Self
Creates a new ConcurrentAddressLookup.
-Sourcepub fn add(&self, service: impl AddressLookup + 'static)
Adds an AddressLookup service.
+Implementations§
Source§impl ConcurrentAddressLookup
Sourcepub fn empty() -> Self
Creates an empty ConcurrentAddressLookup.
+Sourcepub fn from_services(services: Vec<Box<dyn AddressLookup>>) -> Self
Creates a new ConcurrentAddressLookup.
+Sourcepub fn add(&self, service: impl AddressLookup + 'static)
Adds an AddressLookup service.
If there is historical Address Lookup data, it will be published immediately on this service.
-Sourcepub fn add_boxed(&self, service: Box<dyn AddressLookup>)
Adds an already Boxed AddressLookup service.
+Sourcepub fn add_boxed(&self, service: Box<dyn AddressLookup>)
Adds an already Boxed AddressLookup service.
If there is historical Address Lookup data, it will be published immediately on this service.
-Trait Implementations§
Source§impl AddressLookup for ConcurrentAddressLookup
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreTrait Implementations§
Source§impl AddressLookup for ConcurrentAddressLookup
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreSource§impl Clone for ConcurrentAddressLookup
Source§fn clone(&self) -> ConcurrentAddressLookup
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 ConcurrentAddressLookup
Source§impl Default for ConcurrentAddressLookup
Source§fn default() -> ConcurrentAddressLookup
Returns the “default value” for a type. Read moreSource§impl<T> From<T> for ConcurrentAddressLookup
Auto Trait Implementations§
§impl Freeze for ConcurrentAddressLookup
§impl RefUnwindSafe for ConcurrentAddressLookup
§impl Send for ConcurrentAddressLookup
§impl Sync for ConcurrentAddressLookup
§impl Unpin for ConcurrentAddressLookup
§impl UnwindSafe for ConcurrentAddressLookup
Blanket Implementations§
Source§impl Clone for ConcurrentAddressLookup
Source§fn clone(&self) -> ConcurrentAddressLookup
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 ConcurrentAddressLookup
Source§impl Default for ConcurrentAddressLookup
Source§fn default() -> ConcurrentAddressLookup
Returns the “default value” for a type. Read moreSource§impl<T> From<T> for ConcurrentAddressLookup
Auto Trait Implementations§
§impl Freeze for ConcurrentAddressLookup
§impl RefUnwindSafe for ConcurrentAddressLookup
§impl Send for ConcurrentAddressLookup
§impl Sync for ConcurrentAddressLookup
§impl Unpin for ConcurrentAddressLookup
§impl UnwindSafe for ConcurrentAddressLookup
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
+ T: AddressLookup,
Source§fn into_address_lookup(
+ self,
+ _endpoint: &Endpoint,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html b/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
index d1e92d14df..d3d2a057f4 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
@@ -1,24 +1,26 @@
-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: impl IntoIterator<Item = TransportAddr>) -> EndpointData
Creates a new EndpointData with a relay URL and a set of direct addresses.
-Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> EndpointData
Sets the relay URL and returns the updated endpoint data.
-Sourcepub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> EndpointData
Sets the direct addresses and returns the updated endpoint data.
-Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> EndpointData
Sets the user-defined data and returns the updated 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 clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
-Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-Trait Implementations§
Source§impl Clone for 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<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§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§
Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: impl IntoIterator<Item = TransportAddr>) -> EndpointData
Creates a new EndpointData with a relay URL and a set of direct addresses.
+Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> EndpointData
Sets the relay URL and returns the updated endpoint data.
+Sourcepub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> EndpointData
Sets the direct addresses and returns the updated endpoint data.
+Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> EndpointData
Sets the user-defined data and returns the updated 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 clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
+Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
+Sourcepub fn filtered_addrs(&self, filter: &AddrFilter) -> Vec<TransportAddr>
Apply the given filter to the current addresses.
+Returns a vec to allow re-ordering of addresses.
+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<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§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/3958/docs/iroh/address_lookup/struct.EndpointInfo.html b/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
index 333b720b45..623c3442bf 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
@@ -1,42 +1,44 @@
-EndpointInfo in iroh::address_lookup - Rust EndpointInfo
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) -> PkarrResolver
pub fn build(self) -> PkarrResolver
Creates a PkarrResolver from this builder.
Trait Implementations§
Source§impl Debug for PkarrResolverBuilder
impl Debug for PkarrResolverBuilder
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 with_addr_filter(self, _filter: AddrFilter) -> Self
fn with_addr_filter(self, _filter: AddrFilter) -> Self
no-op: resolver does not publish
+Source§fn into_address_lookup(
self,
endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
fn into_address_lookup( self, endpoint: &Endpoint, -) -> Result<impl AddressLookup, IntoAddressLookupError>
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§
Source§impl<T> Any for Twhere
+) -> Result<impl AddressLookup, AddressLookupBuilderError>Turns this AddressLookup builder into a ready-to-use Address Lookup. Read more
impl<T> Any for Twhere
+) -> Result<impl AddressLookup, AddressLookupBuilderError>Turns this AddressLookup builder into a ready-to-use Address Lookup. 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> 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/3958/docs/iroh/address_lookup/sidebar-items.js b/pr/3958/docs/iroh/address_lookup/sidebar-items.js
index 256a9a6580..a80ededc1c 100644
--- a/pr/3958/docs/iroh/address_lookup/sidebar-items.js
+++ b/pr/3958/docs/iroh/address_lookup/sidebar-items.js
@@ -1 +1 @@
-window.SIDEBAR_ITEMS = {"enum":["Error","IntoAddressLookupError","ParseError"],"mod":["dns","mdns","memory","pkarr"],"struct":["ConcurrentAddressLookup","EndpointData","EndpointInfo","Item","UserData"],"trait":["AddressLookup","IntoAddressLookup"]};
\ No newline at end of file
+window.SIDEBAR_ITEMS = {"enum":["AddressLookupBuilderError","Error","ParseError"],"mod":["dns","mdns","memory","pkarr"],"struct":["AddrFilter","ConcurrentAddressLookup","EndpointData","EndpointInfo","Item","UserData"],"trait":["AddressLookup","AddressLookupBuilder"]};
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/struct.AddrFilter.html b/pr/3958/docs/iroh/address_lookup/struct.AddrFilter.html
new file mode 100644
index 0000000000..18e77ad3d0
--- /dev/null
+++ b/pr/3958/docs/iroh/address_lookup/struct.AddrFilter.html
@@ -0,0 +1,56 @@
+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
+the output order). A BTreeSet cannot preserve a custom order, so the return
+type is Vec to make reordering possible.
+See the documentation for each address lookup implementation for details on
+what additional filtering the implementation may perform on top.
+Implementations§
Source§impl AddrFilter
Sourcepub fn new(
+ f: impl Fn(&BTreeSet<TransportAddr>) -> Vec<TransportAddr> + Send + Sync + 'static,
+) -> AddrFilter
Create a new AddrFilter
+Sourcepub fn relay_only() -> AddrFilter
Only keep relay addresses.
+Sourcepub fn ip_only() -> AddrFilter
Only keep direct IP addresses.
+Sourcepub fn apply(&self, addrs: &BTreeSet<TransportAddr>) -> 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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
+ T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
+ T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
+ T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moreSource§impl<T> CloneToUninit for Twhere
+ T: Clone,
§impl<T> CompatExt for T
§impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left is true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
+if into_left(&self) returns true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read more§impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
+ T: ?Sized,
§impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
+ S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
+[WithDispatch] wrapper. Read more
\ No newline at end of file
diff --git a/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html b/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html
index 2ac53f880b..1f3c54ad49 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.ConcurrentAddressLookup.html
@@ -1,19 +1,23 @@
-ConcurrentAddressLookup in iroh::address_lookup - Rust ConcurrentAddressLookup
pub struct ConcurrentAddressLookup { /* private fields */ }
Expand description
An Address Lookup service that combines multiple Address Lookup sources.
+ConcurrentAddressLookup in iroh::address_lookup - Rust ConcurrentAddressLookup
pub struct ConcurrentAddressLookup { /* private fields */ }
Expand description
An Address Lookup service that combines multiple Address Lookup sources.
The Address Lookup will resolve concurrently.
-Implementations§
Source§impl ConcurrentAddressLookup
Sourcepub fn empty() -> Self
Creates an empty ConcurrentAddressLookup.
-Sourcepub fn from_services(services: Vec<Box<dyn AddressLookup>>) -> Self
Creates a new ConcurrentAddressLookup.
-Sourcepub fn add(&self, service: impl AddressLookup + 'static)
Adds an AddressLookup service.
+Implementations§
Source§impl ConcurrentAddressLookup
Sourcepub fn empty() -> Self
Creates an empty ConcurrentAddressLookup.
+Sourcepub fn from_services(services: Vec<Box<dyn AddressLookup>>) -> Self
Creates a new ConcurrentAddressLookup.
+Sourcepub fn add(&self, service: impl AddressLookup + 'static)
Adds an AddressLookup service.
If there is historical Address Lookup data, it will be published immediately on this service.
-Sourcepub fn add_boxed(&self, service: Box<dyn AddressLookup>)
Adds an already Boxed AddressLookup service.
+Sourcepub fn add_boxed(&self, service: Box<dyn AddressLookup>)
Adds an already Boxed AddressLookup service.
If there is historical Address Lookup data, it will be published immediately on this service.
-Trait Implementations§
Source§impl AddressLookup for ConcurrentAddressLookup
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreTrait Implementations§
Source§impl AddressLookup for ConcurrentAddressLookup
Source§fn publish(&self, data: &EndpointData)
Publishes the given EndpointData to the Address Lookup mechanism. Read moreSource§impl Clone for ConcurrentAddressLookup
Source§fn clone(&self) -> ConcurrentAddressLookup
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 ConcurrentAddressLookup
Source§impl Default for ConcurrentAddressLookup
Source§fn default() -> ConcurrentAddressLookup
Returns the “default value” for a type. Read moreSource§impl<T> From<T> for ConcurrentAddressLookup
Auto Trait Implementations§
§impl Freeze for ConcurrentAddressLookup
§impl RefUnwindSafe for ConcurrentAddressLookup
§impl Send for ConcurrentAddressLookup
§impl Sync for ConcurrentAddressLookup
§impl Unpin for ConcurrentAddressLookup
§impl UnwindSafe for ConcurrentAddressLookup
Blanket Implementations§
Source§impl Clone for ConcurrentAddressLookup
Source§fn clone(&self) -> ConcurrentAddressLookup
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 ConcurrentAddressLookup
Source§impl Default for ConcurrentAddressLookup
Source§fn default() -> ConcurrentAddressLookup
Returns the “default value” for a type. Read moreSource§impl<T> From<T> for ConcurrentAddressLookup
Auto Trait Implementations§
§impl Freeze for ConcurrentAddressLookup
§impl RefUnwindSafe for ConcurrentAddressLookup
§impl Send for ConcurrentAddressLookup
§impl Sync for ConcurrentAddressLookup
§impl Unpin for ConcurrentAddressLookup
§impl UnwindSafe for ConcurrentAddressLookup
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
+ T: AddressLookup,
Source§fn into_address_lookup(
+ self,
+ _endpoint: &Endpoint,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§fn with_addr_filter(self, _filter: AddrFilter) -> T
Sets a filter to control which addresses are published by this service Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
Turns this AddressLookup builder into a ready-to-use Address Lookup. Read moreSource§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html b/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
index d1e92d14df..d3d2a057f4 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
@@ -1,24 +1,26 @@
-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: impl IntoIterator<Item = TransportAddr>) -> EndpointData
Creates a new EndpointData with a relay URL and a set of direct addresses.
-Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> EndpointData
Sets the relay URL and returns the updated endpoint data.
-Sourcepub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> EndpointData
Sets the direct addresses and returns the updated endpoint data.
-Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> EndpointData
Sets the user-defined data and returns the updated 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 clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
-Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-Trait Implementations§
Source§impl Clone for 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<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§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§
Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: impl IntoIterator<Item = TransportAddr>) -> EndpointData
Creates a new EndpointData with a relay URL and a set of direct addresses.
+Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> EndpointData
Sets the relay URL and returns the updated endpoint data.
+Sourcepub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> EndpointData
Sets the direct addresses and returns the updated endpoint data.
+Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> EndpointData
Sets the user-defined data and returns the updated 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 clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
+Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
+Sourcepub fn filtered_addrs(&self, filter: &AddrFilter) -> Vec<TransportAddr>
Apply the given filter to the current addresses.
+Returns a vec to allow re-ordering of addresses.
+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<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§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/3958/docs/iroh/address_lookup/struct.EndpointInfo.html b/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
index 333b720b45..623c3442bf 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
@@ -1,42 +1,44 @@
-EndpointInfo in iroh::address_lookup - Rust EndpointInfo
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
+the output order). A BTreeSet cannot preserve a custom order, so the return
+type is Vec to make reordering possible.
See the documentation for each address lookup implementation for details on +what additional filtering the implementation may perform on top.
+Implementations§
Source§impl AddrFilter
impl AddrFilter
Sourcepub fn new(
+ f: impl Fn(&BTreeSet<TransportAddr>) -> Vec<TransportAddr> + Send + Sync + 'static,
+) -> AddrFilter
pub fn new( + f: impl Fn(&BTreeSet<TransportAddr>) -> Vec<TransportAddr> + Send + Sync + 'static, +) -> AddrFilter
Create a new AddrFilter
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(&self, addrs: &BTreeSet<TransportAddr>) -> Vec<TransportAddr>
pub fn apply(&self, addrs: &BTreeSet<TransportAddr>) -> 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§
§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,
Source§impl<T> BorrowMut<T> for Twhere
+ T: ?Sized,
impl<T> BorrowMut<T> for Twhere
+ T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
+ T: Clone,
impl<T> CloneToUninit for Twhere
+ T: Clone,
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
+if into_left is true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
+if into_left(&self) returns true.
+Converts self into a Right variant of Either<Self, Self>
+otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
+ T: ?Sized,
impl<T> PolicyExt for Twhere
+ T: ?Sized,
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
+ S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
+ S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Subscriber to this type, returning a
+[WithDispatch] wrapper. Read moreConcurrentAddressLookup
pub struct ConcurrentAddressLookup { /* private fields */ }Expand description
An Address Lookup service that combines multiple Address Lookup sources.
+ConcurrentAddressLookup
pub struct ConcurrentAddressLookup { /* private fields */ }Expand description
An Address Lookup service that combines multiple Address Lookup sources.
The Address Lookup will resolve concurrently.
-Implementations§
Source§impl ConcurrentAddressLookup
impl ConcurrentAddressLookup
Sourcepub fn empty() -> Self
pub fn empty() -> Self
Creates an empty ConcurrentAddressLookup.
Sourcepub fn from_services(services: Vec<Box<dyn AddressLookup>>) -> Self
pub fn from_services(services: Vec<Box<dyn AddressLookup>>) -> Self
Creates a new ConcurrentAddressLookup.
Sourcepub fn add(&self, service: impl AddressLookup + 'static)
pub fn add(&self, service: impl AddressLookup + 'static)
Adds an AddressLookup service.
Implementations§
Source§impl ConcurrentAddressLookup
impl ConcurrentAddressLookup
Sourcepub fn empty() -> Self
pub fn empty() -> Self
Creates an empty ConcurrentAddressLookup.
Sourcepub fn from_services(services: Vec<Box<dyn AddressLookup>>) -> Self
pub fn from_services(services: Vec<Box<dyn AddressLookup>>) -> Self
Creates a new ConcurrentAddressLookup.
Sourcepub fn add(&self, service: impl AddressLookup + 'static)
pub fn add(&self, service: impl AddressLookup + 'static)
Adds an AddressLookup service.
If there is historical Address Lookup data, it will be published immediately on this service.
-Sourcepub fn add_boxed(&self, service: Box<dyn AddressLookup>)
pub fn add_boxed(&self, service: Box<dyn AddressLookup>)
Adds an already Boxed AddressLookup service.
Sourcepub fn add_boxed(&self, service: Box<dyn AddressLookup>)
pub fn add_boxed(&self, service: Box<dyn AddressLookup>)
Adds an already Boxed AddressLookup service.
If there is historical Address Lookup data, it will be published immediately on this service.
-Trait Implementations§
Source§impl AddressLookup for ConcurrentAddressLookup
impl AddressLookup for ConcurrentAddressLookup
Source§fn publish(&self, data: &EndpointData)
fn publish(&self, data: &EndpointData)
EndpointData to the Address Lookup mechanism. Read moreTrait Implementations§
Source§impl AddressLookup for ConcurrentAddressLookup
impl AddressLookup for ConcurrentAddressLookup
Source§fn publish(&self, data: &EndpointData)
fn publish(&self, data: &EndpointData)
EndpointData to the Address Lookup mechanism. Read moreSource§impl Clone for ConcurrentAddressLookup
impl Clone for ConcurrentAddressLookup
Source§fn clone(&self) -> ConcurrentAddressLookup
fn clone(&self) -> ConcurrentAddressLookup
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ConcurrentAddressLookup
impl Debug for ConcurrentAddressLookup
Source§impl Default for ConcurrentAddressLookup
impl Default for ConcurrentAddressLookup
Source§fn default() -> ConcurrentAddressLookup
fn default() -> ConcurrentAddressLookup
Source§impl<T> From<T> for ConcurrentAddressLookup
impl<T> From<T> for ConcurrentAddressLookup
Auto Trait Implementations§
impl Freeze for ConcurrentAddressLookup
impl RefUnwindSafe for ConcurrentAddressLookup
impl Send for ConcurrentAddressLookup
impl Sync for ConcurrentAddressLookup
impl Unpin for ConcurrentAddressLookup
impl UnwindSafe for ConcurrentAddressLookup
Blanket Implementations§
Source§impl Clone for ConcurrentAddressLookup
impl Clone for ConcurrentAddressLookup
Source§fn clone(&self) -> ConcurrentAddressLookup
fn clone(&self) -> ConcurrentAddressLookup
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ConcurrentAddressLookup
impl Debug for ConcurrentAddressLookup
Source§impl Default for ConcurrentAddressLookup
impl Default for ConcurrentAddressLookup
Source§fn default() -> ConcurrentAddressLookup
fn default() -> ConcurrentAddressLookup
Source§impl<T> From<T> for ConcurrentAddressLookup
impl<T> From<T> for ConcurrentAddressLookup
Auto Trait Implementations§
impl Freeze for ConcurrentAddressLookup
impl RefUnwindSafe for ConcurrentAddressLookup
impl Send for ConcurrentAddressLookup
impl Sync for ConcurrentAddressLookup
impl Unpin for ConcurrentAddressLookup
impl UnwindSafe for ConcurrentAddressLookup
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,
+) -> Result<impl AddressLookup, AddressLookupBuilderError>
fn into_address_lookup( + self, + _endpoint: &Endpoint, +) -> Result<impl AddressLookup, AddressLookupBuilderError>
Source§fn with_addr_filter(self, _filter: AddrFilter) -> T
fn with_addr_filter(self, _filter: AddrFilter) -> T
§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,
Source§impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
impl<T> IntoAddressLookup for Twhere
- T: AddressLookup,
Source§fn into_address_lookup(
- self,
- _endpoint: &Endpoint,
-) -> Result<impl AddressLookup, IntoAddressLookupError>
fn into_address_lookup( - self, - _endpoint: &Endpoint, -) -> Result<impl AddressLookup, IntoAddressLookupError>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html b/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
index d1e92d14df..d3d2a057f4 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
@@ -1,24 +1,26 @@
-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: impl IntoIterator<Item = TransportAddr>) -> EndpointData
Creates a new EndpointData with a relay URL and a set of direct addresses.
-Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> EndpointData
Sets the relay URL and returns the updated endpoint data.
-Sourcepub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> EndpointData
Sets the direct addresses and returns the updated endpoint data.
-Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> EndpointData
Sets the user-defined data and returns the updated 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 clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
-Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-Trait Implementations§
Source§impl Clone for 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<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§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§
Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: impl IntoIterator<Item = TransportAddr>) -> EndpointData
Creates a new EndpointData with a relay URL and a set of direct addresses.
+Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> EndpointData
Sets the relay URL and returns the updated endpoint data.
+Sourcepub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> EndpointData
Sets the direct addresses and returns the updated endpoint data.
+Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> EndpointData
Sets the user-defined data and returns the updated 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 clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
+Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
+Sourcepub fn filtered_addrs(&self, filter: &AddrFilter) -> Vec<TransportAddr>
Apply the given filter to the current addresses.
+Returns a vec to allow re-ordering of addresses.
+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<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§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/3958/docs/iroh/address_lookup/struct.EndpointInfo.html b/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
index 333b720b45..623c3442bf 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
@@ -1,42 +1,44 @@
-EndpointInfo in iroh::address_lookup - Rust EndpointInfo
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
diff --git a/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html b/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
index d1e92d14df..d3d2a057f4 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.EndpointData.html
@@ -1,24 +1,26 @@
-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: impl IntoIterator<Item = TransportAddr>) -> EndpointData
Creates a new EndpointData with a relay URL and a set of direct addresses.
-Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> EndpointData
Sets the relay URL and returns the updated endpoint data.
-Sourcepub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> EndpointData
Sets the direct addresses and returns the updated endpoint data.
-Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> EndpointData
Sets the user-defined data and returns the updated 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 clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
-Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-Trait Implementations§
Source§impl Clone for 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<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§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§
Implementations§
Source§impl EndpointData
Sourcepub fn new(addrs: impl IntoIterator<Item = TransportAddr>) -> EndpointData
Creates a new EndpointData with a relay URL and a set of direct addresses.
+Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> EndpointData
Sets the relay URL and returns the updated endpoint data.
+Sourcepub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> EndpointData
Sets the direct addresses and returns the updated endpoint data.
+Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> EndpointData
Sets the user-defined data and returns the updated 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 clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
+Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
+Sourcepub fn filtered_addrs(&self, filter: &AddrFilter) -> Vec<TransportAddr>
Apply the given filter to the current addresses.
+Returns a vec to allow re-ordering of addresses.
+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<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
Converts to this type from the input type.Source§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/3958/docs/iroh/address_lookup/struct.EndpointInfo.html b/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
index 333b720b45..623c3442bf 100644
--- a/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
+++ b/pr/3958/docs/iroh/address_lookup/struct.EndpointInfo.html
@@ -1,42 +1,44 @@
-EndpointInfo in iroh::address_lookup - Rust EndpointInfo
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: impl IntoIterator<Item = TransportAddr>) -> EndpointData
pub fn new(addrs: impl IntoIterator<Item = TransportAddr>) -> EndpointData
Creates a new EndpointData with a relay URL and a set of direct addresses.
Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> EndpointData
pub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> EndpointData
Sets the relay URL and returns the updated endpoint data.
-Sourcepub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> EndpointData
pub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> EndpointData
Sets the direct addresses and returns the updated endpoint data.
-Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> EndpointData
pub fn with_user_data(self, user_data: Option<UserData>) -> EndpointData
Sets the user-defined data and returns the updated 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 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 add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
pub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
-Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
pub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
pub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
-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<EndpointAddr> for EndpointData
impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> EndpointData
fn from(endpoint_addr: EndpointAddr) -> EndpointData
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§
Implementations§
Source§impl EndpointData
impl EndpointData
Sourcepub fn new(addrs: impl IntoIterator<Item = TransportAddr>) -> EndpointData
pub fn new(addrs: impl IntoIterator<Item = TransportAddr>) -> EndpointData
Creates a new EndpointData with a relay URL and a set of direct addresses.
Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> EndpointData
pub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> EndpointData
Sets the relay URL and returns the updated endpoint data.
+Sourcepub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> EndpointData
pub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> EndpointData
Sets the direct addresses and returns the updated endpoint data.
+Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> EndpointData
pub fn with_user_data(self, user_data: Option<UserData>) -> EndpointData
Sets the user-defined data and returns the updated 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 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 add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
pub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
+Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
pub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
pub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
+Sourcepub fn filtered_addrs(&self, filter: &AddrFilter) -> Vec<TransportAddr>
pub fn filtered_addrs(&self, filter: &AddrFilter) -> Vec<TransportAddr>
Apply the given filter to the current addresses.
+Returns a vec to allow re-ordering of addresses.
+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 more