From f048ed52f1ebfcb6cc2cc88405e21e768b0c38ea Mon Sep 17 00:00:00 2001 From: dignifiedquire Date: Tue, 9 Dec 2025 16:48:01 +0000 Subject: [PATCH] deploy: d8e021fab3fce8ffed84dff5a26f12cac4f091e8 --- .../docs/iroh/endpoint/struct.PathInfo.html | 18 +- .../iroh/endpoint/struct.PathInfoList.html | 14 +- .../client/struct.ClientBuilder.html | 4 +- .../iroh_relay/dns/struct.DnsResolver.html | 8 +- .../endpoint_info/enum.DecodingError.html | 4 +- .../docs/iroh_relay/endpoint_info/index.html | 10 +- .../endpoint_info/struct.EndpointData.html | 18 +- .../endpoint_info/struct.EndpointInfo.html | 28 +- .../endpoint_info/trait.EndpointIdExt.html | 10 +- pr/3742/docs/iroh_relay/index.html | 2 +- .../protos/relay/enum.ClientToRelayMsg.html | 4 +- .../iroh_relay/protos/relay/enum.Error.html | 6 +- .../protos/relay/enum.RelayToClientMsg.html | 8 +- .../iroh_relay/server/enum.AccessConfig.html | 6 +- .../docs/iroh_relay/server/struct.Server.html | 4 +- .../docs/iroh_relay/struct.RelayConfig.html | 6 +- pr/3742/docs/iroh_relay/struct.RelayMap.html | 14 +- .../docs/search.index/path/4d7b9dd7fd8d.js | 1 - .../docs/search.index/path/e4e507671511.js | 1 + pr/3742/docs/search.index/root.js | 2 +- .../magicsock/remote_map/remote_state.rs.html | 2863 ++++++++--------- .../trait.impl/core/convert/trait.From.js | 4 +- .../iter/traits/collect/trait.FromIterator.js | 4 +- 23 files changed, 1444 insertions(+), 1595 deletions(-) delete mode 100644 pr/3742/docs/search.index/path/4d7b9dd7fd8d.js create mode 100644 pr/3742/docs/search.index/path/e4e507671511.js diff --git a/pr/3742/docs/iroh/endpoint/struct.PathInfo.html b/pr/3742/docs/iroh/endpoint/struct.PathInfo.html index 8bda7f2b50..8783a33fa1 100644 --- a/pr/3742/docs/iroh/endpoint/struct.PathInfo.html +++ b/pr/3742/docs/iroh/endpoint/struct.PathInfo.html @@ -1,12 +1,12 @@ -PathInfo in iroh::endpoint - Rust

PathInfo

Struct PathInfo 

Source
pub struct PathInfo { /* private fields */ }
Expand description

Information about a network path used by a Connection.

-

Implementations§

Source§

impl PathInfo

Source

pub fn remote_addr(&self) -> &TransportAddr

The remote transport address used by this network path.

-
Source

pub fn is_selected(&self) -> bool

Returns true if this path is currently the main transmission path for this Connection.

-
Source

pub fn is_ip(&self) -> bool

Whether this is an IP transport address.

-
Source

pub fn is_relay(&self) -> bool

Whether this is a transport address via a relay server.

-
Source

pub fn stats(&self) -> PathStats

Returns stats for this transmission path.

-
Source

pub fn rtt(&self) -> Duration

Current best estimate of this paths’s latency (round-trip-time)

-

Trait Implementations§

Source§

impl Clone for PathInfo

Source§

fn clone(&self) -> PathInfo

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PathInfo

Source§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for PathInfo

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, -and should not be overridden without very good reason.
Source§

impl Eq for PathInfo

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where +PathInfo in iroh::endpoint - Rust

PathInfo

Struct PathInfo 

Source
pub struct PathInfo { /* private fields */ }
Expand description

Information about a network path used by a Connection.

+

Implementations§

Source§

impl PathInfo

Source

pub fn remote_addr(&self) -> &TransportAddr

The remote transport address used by this network path.

+
Source

pub fn is_selected(&self) -> bool

Returns true if this path is currently the main transmission path for this Connection.

+
Source

pub fn is_ip(&self) -> bool

Whether this is an IP transport address.

+
Source

pub fn is_relay(&self) -> bool

Whether this is a transport address via a relay server.

+
Source

pub fn stats(&self) -> PathStats

Returns stats for this transmission path.

+
Source

pub fn rtt(&self) -> Duration

Current best estimate of this paths’s latency (round-trip-time)

+

Trait Implementations§

Source§

impl Clone for PathInfo

Source§

fn clone(&self) -> PathInfo

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PathInfo

Source§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for PathInfo

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, +and should not be overridden without very good reason.
Source§

impl Eq for PathInfo

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( diff --git a/pr/3742/docs/iroh/endpoint/struct.PathInfoList.html b/pr/3742/docs/iroh/endpoint/struct.PathInfoList.html index b3e2094ca4..e562dbf27d 100644 --- a/pr/3742/docs/iroh/endpoint/struct.PathInfoList.html +++ b/pr/3742/docs/iroh/endpoint/struct.PathInfoList.html @@ -1,11 +1,11 @@ -PathInfoList in iroh::endpoint - Rust

PathInfoList

Struct PathInfoList 

Source
pub struct PathInfoList(/* private fields */);
Expand description

List of PathInfo for the network paths of a Connection.

+PathInfoList in iroh::endpoint - Rust

PathInfoList

Struct PathInfoList 

Source
pub struct PathInfoList(/* private fields */);
Expand description

List of PathInfo for the network paths of a Connection.

This struct implements IntoIterator.

-

Implementations§

Source§

impl PathInfoList

Source

pub fn iter(&self) -> impl Iterator<Item = &PathInfo>

Returns an iterator over the path infos.

-
Source

pub fn is_empty(&self) -> bool

Returns true if the list is empty.

-
Source

pub fn len(&self) -> usize

Returns the number of paths.

-

Trait Implementations§

Source§

impl Clone for PathInfoList

Source§

fn clone(&self) -> PathInfoList

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PathInfoList

Source§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl IntoIterator for PathInfoList
where - SmallVec<[PathInfo; 4]>: IntoIterator,

Source§

type Item = <SmallVec<[PathInfo; 4]> as IntoIterator>::Item

The type of the elements being iterated over.
Source§

type IntoIter = <SmallVec<[PathInfo; 4]> as IntoIterator>::IntoIter

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl PartialEq for PathInfoList

Source§

fn eq(&self, other: &PathInfoList) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, -and should not be overridden without very good reason.
Source§

impl Eq for PathInfoList

Source§

impl StructuralPartialEq for PathInfoList

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where +

Implementations§

Source§

impl PathInfoList

Source

pub fn iter(&self) -> impl Iterator<Item = &PathInfo>

Returns an iterator over the path infos.

+
Source

pub fn is_empty(&self) -> bool

Returns true if the list is empty.

+
Source

pub fn len(&self) -> usize

Returns the number of paths.

+

Trait Implementations§

Source§

impl Clone for PathInfoList

Source§

fn clone(&self) -> PathInfoList

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PathInfoList

Source§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl IntoIterator for PathInfoList
where + SmallVec<[PathInfo; 4]>: IntoIterator,

Source§

type Item = <SmallVec<[PathInfo; 4]> as IntoIterator>::Item

The type of the elements being iterated over.
Source§

type IntoIter = <SmallVec<[PathInfo; 4]> as IntoIterator>::IntoIter

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl PartialEq for PathInfoList

Source§

fn eq(&self, other: &PathInfoList) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, +and should not be overridden without very good reason.
Source§

impl Eq for PathInfoList

Source§

impl StructuralPartialEq for PathInfoList

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( diff --git a/pr/3742/docs/iroh_relay/client/struct.ClientBuilder.html b/pr/3742/docs/iroh_relay/client/struct.ClientBuilder.html index fb799dd5f5..97e2aed038 100644 --- a/pr/3742/docs/iroh_relay/client/struct.ClientBuilder.html +++ b/pr/3742/docs/iroh_relay/client/struct.ClientBuilder.html @@ -1,7 +1,7 @@ ClientBuilder in iroh_relay::client - Rust

ClientBuilder

Struct ClientBuilder 

Source
pub struct ClientBuilder { /* private fields */ }
Expand description

Build a Client.

Implementations§

Source§

impl ClientBuilder

Source

pub fn new( - url: impl Into<RelayUrl>, - secret_key: SecretKey, + url: impl Into<RelayUrl>, + secret_key: SecretKey, dns_resolver: DnsResolver, ) -> Self

Create a new ClientBuilder

Source

pub fn address_family_selector<S>(self, selector: S) -> Self
where diff --git a/pr/3742/docs/iroh_relay/dns/struct.DnsResolver.html b/pr/3742/docs/iroh_relay/dns/struct.DnsResolver.html index 17bb8c0664..28a871687d 100644 --- a/pr/3742/docs/iroh_relay/dns/struct.DnsResolver.html +++ b/pr/3742/docs/iroh_relay/dns/struct.DnsResolver.html @@ -73,9 +73,9 @@ at T+0ms, T+200ms and T+300ms. The timeout is applied as stated in summary of all errors otherwise.

Source

pub async fn lookup_endpoint_by_id( &self, - endpoint_id: &EndpointId, + endpoint_id: &EndpointId, origin: &str, -) -> Result<EndpointInfo, LookupError>

Looks up endpoint info by [EndpointId] and origin domain name.

+) -> Result<EndpointInfo, LookupError>

Looks up endpoint info by EndpointId and origin domain name.

To lookup endpoints that published their endpoint info to the DNS servers run by n0, pass N0_DNS_ENDPOINT_ORIGIN_PROD as origin.

Source

pub async fn lookup_endpoint_by_domain_name( @@ -93,10 +93,10 @@ at T+0ms, T+200ms and T+300ms. The result of the first successful call is return summary of all errors otherwise.

Source

pub async fn lookup_endpoint_by_id_staggered( &self, - endpoint_id: &EndpointId, + endpoint_id: &EndpointId, origin: &str, delays_ms: &[u64], -) -> Result<EndpointInfo, StaggeredError<LookupError>>

Looks up endpoint info by [EndpointId] and origin domain name.

+) -> Result<EndpointInfo, StaggeredError<LookupError>>

Looks up endpoint info by EndpointId and origin domain name.

From the moment this function is called, each lookup is scheduled after the delays in delays_ms with the first call being done immediately. [200ms, 300ms] results in calls at T+0ms, T+200ms and T+300ms. The result of the first successful call is returned, or a diff --git a/pr/3742/docs/iroh_relay/endpoint_info/enum.DecodingError.html b/pr/3742/docs/iroh_relay/endpoint_info/enum.DecodingError.html index 054088b89b..2e8891302b 100644 --- a/pr/3742/docs/iroh_relay/endpoint_info/enum.DecodingError.html +++ b/pr/3742/docs/iroh_relay/endpoint_info/enum.DecodingError.html @@ -8,12 +8,12 @@ meta: Meta, }, InvalidKey { - source: KeyParsingError, + source: KeyParsingError, meta: Meta, }, }

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.
§

InvalidEncodingZ32

Fields

§source: Z32Error
§meta: Meta

Captured call-site metadata

§

InvalidLength

Fields

§len: usize
§meta: Meta

Captured call-site metadata

-
§

InvalidKey

Fields

§source: KeyParsingError
§meta: Meta

Captured call-site metadata

+
§

InvalidKey

Fields

§meta: Meta

Captured call-site metadata

Trait Implementations§

Source§

impl Debug for DecodingError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for DecodingError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for DecodingError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<DecodingError> for AnyError

Source§

fn from(value: DecodingError) -> AnyError

Converts to this type from the input type.
Source§

impl From<DecodingError> for ParseError

Source§

fn from(source: DecodingError) -> Self

Converts to this type from the input type.
Source§

impl StackError for DecodingError

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 as_dyn(&self) -> &dyn StackError

Returns this error as a dyn StackError.
Source§

fn fmt_message(&self, f: &mut Formatter<'_>) -> Result

Returns the next source in the chain, if any.
Source§

fn meta(&self) -> Option<&Meta>

Returns metadata captured at creation time, if available.
Source§

fn source(&self) -> Option<ErrorRef<'_>>

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.
§

fn as_ref(&self) -> ErrorRef<'_>

Returns this error as an [ErrorRef]. Read more
§

fn stack(&self) -> Chain<'_>

Returns an iterator over this error followed by its sources.
§

fn sources(&self) -> Chain<'_>

Returns an iterator over sources of this error (skipping self).
§

fn report(&self) -> Report<'_>

Returns a [Report] to output the error with configurable formatting.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where diff --git a/pr/3742/docs/iroh_relay/endpoint_info/index.html b/pr/3742/docs/iroh_relay/endpoint_info/index.html index 4a43824b7c..9de61c4142 100644 --- a/pr/3742/docs/iroh_relay/endpoint_info/index.html +++ b/pr/3742/docs/iroh_relay/endpoint_info/index.html @@ -1,5 +1,5 @@ -iroh_relay::endpoint_info - Rust

Module endpoint_info

Module endpoint_info 

Source
Expand description

Support for handling DNS resource records for dialing by [EndpointId].

-

Dialing by [EndpointId] is supported by iroh endpoints publishing Pkarr records to DNS +iroh_relay::endpoint_info - Rust

Module endpoint_info

Module endpoint_info 

Source
Expand description

Support for handling DNS resource records for dialing by EndpointId.

+

Dialing by EndpointId is supported by iroh endpoints publishing Pkarr records to DNS servers or the Mainline DHT. This module supports creating and parsing these records.

DNS records are published under the following names:

_iroh.<z32-endpoint-id>.<origin-domain> TXT

@@ -8,7 +8,7 @@ servers or the Mainline DHT. This module supports creating and parsing these re

_iroh is the record name as defined by IROH_TXT_NAME.

  • -

    <z32-endpoint-id> is the z-base-32 encoding of the [EndpointId].

    +

    <z32-endpoint-id> is the z-base-32 encoding of the EndpointId.

  • <origin-domain> is the domain name of the publishing DNS server, @@ -23,12 +23,12 @@ servers or the Mainline DHT. This module supports creating and parsing these re in RFC1464. The following attributes are defined:

    • -

      relay=<url>: The home RelayUrl of this endpoint.

      +

      relay=<url>: The home RelayUrl of this endpoint.

    • addr=<addr> <addr>: A space-separated list of sockets addresses for this iroh endpoint. Each address is an IPv4 or IPv6 address with a port.

    -
  • Structs§

    EndpointData
    Data about an endpoint that may be published to and resolved from discovery services.
    EndpointInfo
    Information about an endpoint that may be published to and resolved from discovery services.
    MaxLengthExceededError
    Error returned when an input value is too long for UserData.
    UserData
    Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.

    Enums§

    DecodingError
    EncodingError
    ParseError

    Constants§

    IROH_TXT_NAME
    The DNS name for the iroh TXT record.

    Traits§

    EndpointIdExt
    Extension methods for [EndpointId] to encode to and decode from [z32], +

    Structs§

    EndpointData
    Data about an endpoint that may be published to and resolved from discovery services.
    EndpointInfo
    Information about an endpoint that may be published to and resolved from discovery services.
    MaxLengthExceededError
    Error returned when an input value is too long for UserData.
    UserData
    Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.

    Enums§

    DecodingError
    EncodingError
    ParseError

    Constants§

    IROH_TXT_NAME
    The DNS name for the iroh TXT record.

    Traits§

    EndpointIdExt
    Extension methods for EndpointId to encode to and decode from [z32], which is the encoding used in [pkarr] domain names.
    \ No newline at end of file diff --git a/pr/3742/docs/iroh_relay/endpoint_info/struct.EndpointData.html b/pr/3742/docs/iroh_relay/endpoint_info/struct.EndpointData.html index b554e5269f..14e56d0930 100644 --- a/pr/3742/docs/iroh_relay/endpoint_info/struct.EndpointData.html +++ b/pr/3742/docs/iroh_relay/endpoint_info/struct.EndpointData.html @@ -1,23 +1,23 @@ EndpointData in iroh_relay::endpoint_info - Rust

    EndpointData

    Struct EndpointData 

    Source
    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 +

    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

    Source

    pub fn new(addrs: impl IntoIterator<Item = TransportAddr>) -> Self

    Creates a new EndpointData with a relay URL and a set of direct addresses.

    -
    Source

    pub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> Self

    Sets the relay URL and returns the updated endpoint data.

    +

    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

    Source

    pub fn new(addrs: impl IntoIterator<Item = TransportAddr>) -> Self

    Creates a new EndpointData with a relay URL and a set of direct addresses.

    +
    Source

    pub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> Self

    Sets the relay URL and returns the updated endpoint data.

    Source

    pub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> Self

    Sets the direct addresses and returns the updated endpoint data.

    Source

    pub fn with_user_data(self, user_data: Option<UserData>) -> Self

    Sets the user-defined data and returns the updated endpoint data.

    -
    Source

    pub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>

    Returns the relay URL of the endpoint.

    +
    Source

    pub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>

    Returns the relay URL of the endpoint.

    Source

    pub fn user_data(&self) -> Option<&UserData>

    Returns the optional user-defined data of the endpoint.

    Source

    pub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>

    Returns the direct addresses of the endpoint.

    Source

    pub fn clear_ip_addrs(&mut self)

    Removes all direct addresses from the endpoint data.

    Source

    pub fn clear_relay_urls(&mut self)

    Removes all direct addresses from the endpoint data.

    -
    Source

    pub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)

    Add addresses to the endpoint data.

    +
    Source

    pub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)

    Add addresses to the endpoint data.

    Source

    pub fn set_user_data(&mut self, user_data: Option<UserData>)

    Sets the user-defined data of the endpoint data.

    -
    Source

    pub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>

    Returns the full list of all known addresses

    +
    Source

    pub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>

    Returns the full list of all known addresses

    Source

    pub fn has_addrs(&self) -> bool

    Does this have any addresses?

    -

    Trait Implementations§

    Source§

    impl Clone for EndpointData

    Source§

    fn clone(&self) -> EndpointData

    Returns a duplicate of the value. Read more
    1.0.0 · Source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    Source§

    impl Debug for EndpointData

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl Default for EndpointData

    Source§

    fn default() -> EndpointData

    Returns the “default value” for a type. Read more
    Source§

    impl From<EndpointAddr> for EndpointData

    Source§

    fn from(endpoint_addr: EndpointAddr) -> Self

    Converts to this type from the input type.
    Source§

    impl PartialEq for EndpointData

    Source§

    fn eq(&self, other: &EndpointData) -> bool

    Tests for self and other values to be equal, and is used by ==.
    1.0.0 · Source§

    fn ne(&self, other: &Rhs) -> bool

    Tests for !=. The default implementation is almost always sufficient, +

    Trait Implementations§

    Source§

    impl Clone for EndpointData

    Source§

    fn clone(&self) -> EndpointData

    Returns a duplicate of the value. Read more
    1.0.0 · Source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    Source§

    impl Debug for EndpointData

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl Default for EndpointData

    Source§

    fn default() -> EndpointData

    Returns the “default value” for a type. Read more
    Source§

    impl From<EndpointAddr> for EndpointData

    Source§

    fn from(endpoint_addr: EndpointAddr) -> Self

    Converts to this type from the input type.
    Source§

    impl PartialEq for EndpointData

    Source§

    fn eq(&self, other: &EndpointData) -> bool

    Tests for self and other values to be equal, and is used by ==.
    1.0.0 · Source§

    fn ne(&self, other: &Rhs) -> bool

    Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
    Source§

    impl Eq for EndpointData

    Source§

    impl StructuralPartialEq for EndpointData

    Auto Trait Implementations§

    Blanket Implementations§

    Source§

    impl<T> Any for T
    where T: 'static + ?Sized,

    Source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    §

    impl<'a, T, E> AsTaggedExplicit<'a, E> for T
    where T: 'a,

    §

    fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

    §

    impl<'a, T, E> AsTaggedImplicit<'a, E> for T
    where diff --git a/pr/3742/docs/iroh_relay/endpoint_info/struct.EndpointInfo.html b/pr/3742/docs/iroh_relay/endpoint_info/struct.EndpointInfo.html index c45773e867..45881b1946 100644 --- a/pr/3742/docs/iroh_relay/endpoint_info/struct.EndpointInfo.html +++ b/pr/3742/docs/iroh_relay/endpoint_info/struct.EndpointInfo.html @@ -1,17 +1,17 @@ EndpointInfo in iroh_relay::endpoint_info - Rust

    EndpointInfo

    Struct EndpointInfo 

    Source
    pub struct EndpointInfo {
    -    pub endpoint_id: EndpointId,
    +    pub endpoint_id: EndpointId,
         pub data: EndpointData,
     }
    Expand description

    Information about an endpoint that may be published to and resolved from discovery services.

    -

    This struct couples a [EndpointId] with its associated EndpointData.

    -

    Fields§

    §endpoint_id: EndpointId

    The [EndpointId] of the endpoint this is about.

    +

    This struct couples a EndpointId with its associated EndpointData.

    +

    Fields§

    §endpoint_id: EndpointId

    The EndpointId of the endpoint this is about.

    §data: EndpointData

    The information published about the endpoint.

    -

    Implementations§

    Source§

    impl EndpointInfo

    Source

    pub fn new(endpoint_id: EndpointId) -> Self

    Creates a new EndpointInfo with an empty EndpointData.

    -
    Source

    pub fn from_parts(endpoint_id: EndpointId, data: EndpointData) -> Self

    Creates a new EndpointInfo from its parts.

    -
    Source

    pub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> Self

    Sets the relay URL and returns the updated endpoint info.

    +

    Implementations§

    Source§

    impl EndpointInfo

    Source

    pub fn new(endpoint_id: EndpointId) -> Self

    Creates a new EndpointInfo with an empty EndpointData.

    +
    Source

    pub fn from_parts(endpoint_id: EndpointId, data: EndpointData) -> Self

    Creates a new EndpointInfo from its parts.

    +
    Source

    pub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> Self

    Sets the relay URL and returns the updated endpoint info.

    Source

    pub fn with_ip_addrs(self, addrs: BTreeSet<SocketAddr>) -> Self

    Sets the IP based addresses and returns the updated endpoint info.

    Source

    pub fn with_user_data(self, user_data: Option<UserData>) -> Self

    Sets the user-defined data and returns the updated endpoint info.

    -
    Source

    pub fn to_endpoint_addr(&self) -> EndpointAddr

    Converts into a [EndpointAddr] by cloning the needed fields.

    -
    Source

    pub fn into_endpoint_addr(self) -> EndpointAddr

    Converts into a [EndpointAddr] without cloning.

    +
    Source

    pub fn to_endpoint_addr(&self) -> EndpointAddr

    Converts into a EndpointAddr by cloning the needed fields.

    +
    Source

    pub fn into_endpoint_addr(self) -> EndpointAddr

    Converts into a EndpointAddr without cloning.

    Source

    pub fn from_txt_lookup( domain_name: String, lookup: impl Iterator<Item = TxtRecordData>, @@ -21,21 +21,21 @@ ) -> Result<Self, ParseError>

    Parses a EndpointInfo from a [pkarr::SignedPacket].

    Source

    pub fn to_pkarr_signed_packet( &self, - secret_key: &SecretKey, + secret_key: &SecretKey, ttl: u32, ) -> Result<SignedPacket, EncodingError>

    Creates a [pkarr::SignedPacket].

    -

    This constructs a DNS packet and signs it with a [SecretKey].

    +

    This constructs a DNS packet and signs it with a SecretKey.

    Source

    pub fn to_txt_strings(&self) -> Vec<String>

    Converts into a list of {key}={value} strings.

    -

    Methods from Deref<Target = EndpointData>§

    Source

    pub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>

    Returns the relay URL of the endpoint.

    +

    Methods from Deref<Target = EndpointData>§

    Source

    pub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>

    Returns the relay URL of the endpoint.

    Source

    pub fn user_data(&self) -> Option<&UserData>

    Returns the optional user-defined data of the endpoint.

    Source

    pub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>

    Returns the direct addresses of the endpoint.

    Source

    pub fn clear_ip_addrs(&mut self)

    Removes all direct addresses from the endpoint data.

    Source

    pub fn clear_relay_urls(&mut self)

    Removes all direct addresses from the endpoint data.

    -
    Source

    pub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)

    Add addresses to the endpoint data.

    +
    Source

    pub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)

    Add addresses to the endpoint data.

    Source

    pub fn set_user_data(&mut self, user_data: Option<UserData>)

    Sets the user-defined data of the endpoint data.

    -
    Source

    pub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>

    Returns the full list of all known addresses

    +
    Source

    pub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>

    Returns the full list of all known addresses

    Source

    pub fn has_addrs(&self) -> bool

    Does this have any addresses?

    -

    Trait Implementations§

    Source§

    impl Clone for EndpointInfo

    Source§

    fn clone(&self) -> EndpointInfo

    Returns a duplicate of the value. Read more
    1.0.0 · Source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    Source§

    impl Debug for EndpointInfo

    Source§

    fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl Deref for EndpointInfo

    Source§

    type Target = EndpointData

    The resulting type after dereferencing.
    Source§

    fn deref(&self) -> &Self::Target

    Dereferences the value.
    Source§

    impl DerefMut for EndpointInfo

    Source§

    fn deref_mut(&mut self) -> &mut Self::Target

    Mutably dereferences the value.
    Source§

    impl From<EndpointAddr> for EndpointInfo

    Source§

    fn from(addr: EndpointAddr) -> Self

    Converts to this type from the input type.
    Source§

    impl From<EndpointInfo> for EndpointAddr

    Source§

    fn from(value: EndpointInfo) -> Self

    Converts to this type from the input type.
    Source§

    impl PartialEq for EndpointInfo

    Source§

    fn eq(&self, other: &EndpointInfo) -> bool

    Tests for self and other values to be equal, and is used by ==.
    1.0.0 · Source§

    fn ne(&self, other: &Rhs) -> bool

    Tests for !=. The default implementation is almost always sufficient, +

    Trait Implementations§

    Source§

    impl Clone for EndpointInfo

    Source§

    fn clone(&self) -> EndpointInfo

    Returns a duplicate of the value. Read more
    1.0.0 · Source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    Source§

    impl Debug for EndpointInfo

    Source§

    fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl Deref for EndpointInfo

    Source§

    type Target = EndpointData

    The resulting type after dereferencing.
    Source§

    fn deref(&self) -> &Self::Target

    Dereferences the value.
    Source§

    impl DerefMut for EndpointInfo

    Source§

    fn deref_mut(&mut self) -> &mut Self::Target

    Mutably dereferences the value.
    Source§

    impl From<EndpointAddr> for EndpointInfo

    Source§

    fn from(addr: EndpointAddr) -> Self

    Converts to this type from the input type.
    Source§

    impl From<EndpointInfo> for EndpointAddr

    Source§

    fn from(value: EndpointInfo) -> Self

    Converts to this type from the input type.
    Source§

    impl PartialEq for EndpointInfo

    Source§

    fn eq(&self, other: &EndpointInfo) -> bool

    Tests for self and other values to be equal, and is used by ==.
    1.0.0 · Source§

    fn ne(&self, other: &Rhs) -> bool

    Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
    Source§

    impl Eq for EndpointInfo

    Source§

    impl StructuralPartialEq for EndpointInfo

    Auto Trait Implementations§

    Blanket Implementations§

    Source§

    impl<T> Any for T
    where T: 'static + ?Sized,

    Source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    §

    impl<'a, T, E> AsTaggedExplicit<'a, E> for T
    where T: 'a,

    §

    fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

    §

    impl<'a, T, E> AsTaggedImplicit<'a, E> for T
    where diff --git a/pr/3742/docs/iroh_relay/endpoint_info/trait.EndpointIdExt.html b/pr/3742/docs/iroh_relay/endpoint_info/trait.EndpointIdExt.html index 2cfafe8d14..103efb1882 100644 --- a/pr/3742/docs/iroh_relay/endpoint_info/trait.EndpointIdExt.html +++ b/pr/3742/docs/iroh_relay/endpoint_info/trait.EndpointIdExt.html @@ -1,9 +1,9 @@ EndpointIdExt in iroh_relay::endpoint_info - Rust

    EndpointIdExt

    Trait EndpointIdExt 

    Source
    pub trait EndpointIdExt {
         // Required methods
         fn to_z32(&self) -> String;
    -    fn from_z32(s: &str) -> Result<EndpointId, DecodingError>;
    -}
    Expand description

    Extension methods for [EndpointId] to encode to and decode from [z32], + fn from_z32(s: &str) -> Result<EndpointId, DecodingError>; +}

    Expand description

    Extension methods for EndpointId to encode to and decode from [z32], which is the encoding used in [pkarr] domain names.

    -

    Required Methods§

    Source

    fn to_z32(&self) -> String

    Encodes a [EndpointId] in z-base-32 encoding.

    -
    Source

    fn from_z32(s: &str) -> Result<EndpointId, DecodingError>

    Parses a [EndpointId] from z-base-32 encoding.

    -

    Dyn Compatibility§

    This trait is not dyn compatible.

    In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

    Implementations on Foreign Types§

    Source§

    impl EndpointIdExt for EndpointId

    Source§

    fn to_z32(&self) -> String

    Source§

    fn from_z32(s: &str) -> Result<EndpointId, DecodingError>

    Implementors§

    \ No newline at end of file +

    Required Methods§

    Source

    fn to_z32(&self) -> String

    Encodes a EndpointId in z-base-32 encoding.

    +
    Source

    fn from_z32(s: &str) -> Result<EndpointId, DecodingError>

    Parses a EndpointId from z-base-32 encoding.

    +

    Dyn Compatibility§

    This trait is not dyn compatible.

    In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

    Implementations on Foreign Types§

    Source§

    impl EndpointIdExt for EndpointId

    Implementors§

    \ No newline at end of file diff --git a/pr/3742/docs/iroh_relay/index.html b/pr/3742/docs/iroh_relay/index.html index 9fd890b801..d16544ab4a 100644 --- a/pr/3742/docs/iroh_relay/index.html +++ b/pr/3742/docs/iroh_relay/index.html @@ -25,6 +25,6 @@ Tailscale.

    QAD support and expose metrics.

    -

    Re-exports§

    pub use protos::relay::MAX_PACKET_SIZE;

    Modules§

    client
    Exposes Client, which allows to establish connections to a relay server.
    defaults
    Default values used in the relay.
    dnsNon-wasm_browser
    DNS resolver
    endpoint_info
    Support for handling DNS resource records for dialing by [EndpointId].
    http
    HTTP-specific constants for the relay server and client.
    protos
    Protocols used by the iroh-relay
    quic
    Create a QUIC server that accepts connections +

    Re-exports§

    pub use protos::relay::MAX_PACKET_SIZE;

    Modules§

    client
    Exposes Client, which allows to establish connections to a relay server.
    defaults
    Default values used in the relay.
    dnsNon-wasm_browser
    DNS resolver
    endpoint_info
    Support for handling DNS resource records for dialing by EndpointId.
    http
    HTTP-specific constants for the relay server and client.
    protos
    Protocols used by the iroh-relay
    quic
    Create a QUIC server that accepts connections for QUIC address discovery.
    serverserver
    A fully-fledged iroh-relay server over HTTP or HTTPS.

    Structs§

    PingTracker
    Tracks pings on a single relay connection.
    RelayConfig
    Information on a specific relay server.
    RelayMap
    List of relay server configurations to be used in an iroh endpoint.
    RelayQuicConfig
    Configuration for speaking to the QUIC endpoint on the relay server to do QUIC address discovery.
    \ No newline at end of file diff --git a/pr/3742/docs/iroh_relay/protos/relay/enum.ClientToRelayMsg.html b/pr/3742/docs/iroh_relay/protos/relay/enum.ClientToRelayMsg.html index b44d4888e9..00e0233652 100644 --- a/pr/3742/docs/iroh_relay/protos/relay/enum.ClientToRelayMsg.html +++ b/pr/3742/docs/iroh_relay/protos/relay/enum.ClientToRelayMsg.html @@ -2,7 +2,7 @@ Ping([u8; 8]), Pong([u8; 8]), Datagrams { - dst_endpoint_id: EndpointId, + dst_endpoint_id: EndpointId, datagrams: Datagrams, }, }
    Expand description

    Messages that clients send to relays.

    @@ -11,7 +11,7 @@ other side with a §

    Pong([u8; 8])

    Reply to a RelayToClientMsg::Ping from a server with the payload sent previously in the ping.

    §

    Datagrams

    Request from the client to relay datagrams to given remote endpoint.

    -

    Fields

    §dst_endpoint_id: EndpointId

    The remote endpoint to relay to.

    +

    Fields

    §dst_endpoint_id: EndpointId

    The remote endpoint to relay to.

    §datagrams: Datagrams

    The datagrams and related metadata to relay.

    Trait Implementations§

    Source§

    impl Clone for ClientToRelayMsg

    Source§

    fn clone(&self) -> ClientToRelayMsg

    Returns a duplicate of the value. Read more
    1.0.0 · Source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    Source§

    impl Debug for ClientToRelayMsg

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl PartialEq for ClientToRelayMsg

    Source§

    fn eq(&self, other: &ClientToRelayMsg) -> bool

    Tests for self and other values to be equal, and is used by ==.
    1.0.0 · Source§

    fn ne(&self, other: &Rhs) -> bool

    Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
    Source§

    impl Sink<ClientToRelayMsg> for Client

    Source§

    type Error = SendError

    The type of value produced by the sink when an error occurs.
    Source§

    fn poll_ready( diff --git a/pr/3742/docs/iroh_relay/protos/relay/enum.Error.html b/pr/3742/docs/iroh_relay/protos/relay/enum.Error.html index 9e3130d785..9473ded461 100644 --- a/pr/3742/docs/iroh_relay/protos/relay/enum.Error.html +++ b/pr/3742/docs/iroh_relay/protos/relay/enum.Error.html @@ -17,7 +17,7 @@ meta: Meta, }, InvalidPublicKey { - source: KeyParsingError, + source: KeyParsingError, meta: Meta, }, InvalidFrame { @@ -39,12 +39,12 @@

    §

    FrameTooLarge

    Fields

    §frame_len: usize
    §meta: Meta

    Captured call-site metadata

    §

    SerDe

    Fields

    §source: Error
    §meta: Meta

    Captured call-site metadata

    §

    FrameTypeError

    Fields

    §meta: Meta

    Captured call-site metadata

    -
    §

    InvalidPublicKey

    Fields

    §source: KeyParsingError
    §meta: Meta

    Captured call-site metadata

    +
    §

    InvalidPublicKey

    Fields

    §meta: Meta

    Captured call-site metadata

    §

    InvalidFrame

    Fields

    §meta: Meta

    Captured call-site metadata

    §

    InvalidFrameType

    Fields

    §frame_type: FrameType
    §meta: Meta

    Captured call-site metadata

    §

    InvalidProtocolMessageEncoding

    Fields

    §source: Utf8Error
    §meta: Meta

    Captured call-site metadata

    §

    TooSmall

    Fields

    §meta: Meta

    Captured call-site metadata

    -

    Trait Implementations§

    Source§

    impl Debug for Error

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl Display for Error

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl Error for Error

    Source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    Returns the lower-level source of this error, if any. Read more
    1.0.0 · Source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · Source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    Source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type-based access to context intended for error reports. Read more
    Source§

    impl From<Error> for AnyError

    Source§

    fn from(value: Error) -> AnyError

    Converts to this type from the input type.
    Source§

    impl From<Error> for Error

    Source§

    fn from(source: Error) -> Self

    Converts to this type from the input type.
    Source§

    impl From<Error> for RecvError

    Source§

    fn from(source: ProtoError) -> Self

    Converts to this type from the input type.
    Source§

    impl From<FrameTypeError> for Error

    Source§

    fn from(source: FrameTypeError) -> Self

    Converts to this type from the input type.
    Source§

    impl From<KeyParsingError> for Error

    Source§

    fn from(source: KeyParsingError) -> Self

    Converts to this type from the input type.
    Source§

    impl From<Utf8Error> for Error

    Source§

    fn from(source: Utf8Error) -> 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 as_dyn(&self) -> &dyn StackError

    Returns this error as a dyn StackError.
    Source§

    fn fmt_message(&self, f: &mut Formatter<'_>) -> Result

    Returns the next source in the chain, if any.
    Source§

    fn meta(&self) -> Option<&Meta>

    Returns metadata captured at creation time, if available.
    Source§

    fn source(&self) -> Option<ErrorRef<'_>>

    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.
    §

    fn as_ref(&self) -> ErrorRef<'_>

    Returns this error as an [ErrorRef]. Read more
    §

    fn stack(&self) -> Chain<'_>

    Returns an iterator over this error followed by its sources.
    §

    fn sources(&self) -> Chain<'_>

    Returns an iterator over sources of this error (skipping self).
    §

    fn report(&self) -> Report<'_>

    Returns a [Report] to output the error with configurable formatting.

    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§

    Source§

    impl<T> Any for T
    where +

    Trait Implementations§

    Source§

    impl Debug for Error

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl Display for Error

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl Error for Error

    Source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    Returns the lower-level source of this error, if any. Read more
    1.0.0 · Source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · Source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    Source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type-based access to context intended for error reports. Read more
    Source§

    impl From<Error> for AnyError

    Source§

    fn from(value: Error) -> AnyError

    Converts to this type from the input type.
    Source§

    impl From<Error> for Error

    Source§

    fn from(source: Error) -> Self

    Converts to this type from the input type.
    Source§

    impl From<Error> for RecvError

    Source§

    fn from(source: ProtoError) -> Self

    Converts to this type from the input type.
    Source§

    impl From<FrameTypeError> for Error

    Source§

    fn from(source: FrameTypeError) -> Self

    Converts to this type from the input type.
    Source§

    impl From<KeyParsingError> for Error

    Source§

    fn from(source: KeyParsingError) -> Self

    Converts to this type from the input type.
    Source§

    impl From<Utf8Error> for Error

    Source§

    fn from(source: Utf8Error) -> 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 as_dyn(&self) -> &dyn StackError

    Returns this error as a dyn StackError.
    Source§

    fn fmt_message(&self, f: &mut Formatter<'_>) -> Result

    Returns the next source in the chain, if any.
    Source§

    fn meta(&self) -> Option<&Meta>

    Returns metadata captured at creation time, if available.
    Source§

    fn source(&self) -> Option<ErrorRef<'_>>

    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.
    §

    fn as_ref(&self) -> ErrorRef<'_>

    Returns this error as an [ErrorRef]. Read more
    §

    fn stack(&self) -> Chain<'_>

    Returns an iterator over this error followed by its sources.
    §

    fn sources(&self) -> Chain<'_>

    Returns an iterator over sources of this error (skipping self).
    §

    fn report(&self) -> Report<'_>

    Returns a [Report] to output the error with configurable formatting.

    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§

    Source§

    impl<T> Any for T
    where T: 'static + ?Sized,

    Source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    §

    impl<'a, T, E> AsTaggedExplicit<'a, E> for T
    where T: 'a,

    §

    fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

    §

    impl<'a, T, E> AsTaggedImplicit<'a, E> for T
    where T: 'a,

    §

    fn implicit( diff --git a/pr/3742/docs/iroh_relay/protos/relay/enum.RelayToClientMsg.html b/pr/3742/docs/iroh_relay/protos/relay/enum.RelayToClientMsg.html index a030b9800f..dcd6337d55 100644 --- a/pr/3742/docs/iroh_relay/protos/relay/enum.RelayToClientMsg.html +++ b/pr/3742/docs/iroh_relay/protos/relay/enum.RelayToClientMsg.html @@ -1,9 +1,9 @@ RelayToClientMsg in iroh_relay::protos::relay - Rust

    RelayToClientMsg

    Enum RelayToClientMsg 

    Source
    pub enum RelayToClientMsg {
         Datagrams {
    -        remote_endpoint_id: EndpointId,
    +        remote_endpoint_id: EndpointId,
             datagrams: Datagrams,
         },
    -    EndpointGone(EndpointId),
    +    EndpointGone(EndpointId),
         Health {
             problem: String,
         },
    @@ -15,9 +15,9 @@
         Pong([u8; 8]),
     }
    Expand description

    The messages that a relay sends to clients or the clients receive from the relay.

    Variants§

    §

    Datagrams

    Represents datagrams sent from relays (originally sent to them by another client).

    -

    Fields

    §remote_endpoint_id: EndpointId

    The [EndpointId] of the original sender.

    +

    Fields

    §remote_endpoint_id: EndpointId

    The EndpointId of the original sender.

    §datagrams: Datagrams

    The datagrams and related metadata.

    -
    §

    EndpointGone(EndpointId)

    Indicates that the client identified by the underlying public key had previously sent you a +

    §

    EndpointGone(EndpointId)

    Indicates that the client identified by the underlying public key had previously sent you a packet but has now disconnected from the relay.

    §

    Health

    A one-way message from relay to client, declaring the connection health state.

    Fields

    §problem: String

    If set, is a description of why the connection is unhealthy.

    diff --git a/pr/3742/docs/iroh_relay/server/enum.AccessConfig.html b/pr/3742/docs/iroh_relay/server/enum.AccessConfig.html index a08837843d..c5822ac488 100644 --- a/pr/3742/docs/iroh_relay/server/enum.AccessConfig.html +++ b/pr/3742/docs/iroh_relay/server/enum.AccessConfig.html @@ -1,10 +1,10 @@ AccessConfig in iroh_relay::server - Rust

    AccessConfig

    Enum AccessConfig 

    Source
    pub enum AccessConfig {
         Everyone,
    -    Restricted(Box<dyn Fn(EndpointId) -> Boxed<Access> + Send + Sync + 'static>),
    +    Restricted(Box<dyn Fn(EndpointId) -> Boxed<Access> + Send + Sync + 'static>),
     }
    Available on crate feature server only.
    Expand description

    Controls which endpoints are allowed to use the relay.

    Variants§

    §

    Everyone

    Everyone

    -
    §

    Restricted(Box<dyn Fn(EndpointId) -> Boxed<Access> + Send + Sync + 'static>)

    Only endpoints for which the function returns Access::Allow.

    -

    Implementations§

    Source§

    impl AccessConfig

    Source

    pub async fn is_allowed(&self, endpoint: EndpointId) -> bool

    Is this endpoint allowed?

    +
    §

    Restricted(Box<dyn Fn(EndpointId) -> Boxed<Access> + Send + Sync + 'static>)

    Only endpoints for which the function returns Access::Allow.

    +

    Implementations§

    Source§

    impl AccessConfig

    Source

    pub async fn is_allowed(&self, endpoint: EndpointId) -> bool

    Is this endpoint allowed?

    Trait Implementations§

    Source§

    impl Debug for AccessConfig

    Source§

    fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    Source§

    impl<T> Any for T
    where T: 'static + ?Sized,

    Source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    §

    impl<'a, T, E> AsTaggedExplicit<'a, E> for T
    where T: 'a,

    §

    fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

    §

    impl<'a, T, E> AsTaggedImplicit<'a, E> for T
    where diff --git a/pr/3742/docs/iroh_relay/server/struct.Server.html b/pr/3742/docs/iroh_relay/server/struct.Server.html index 45bcf05fe7..45b27cd994 100644 --- a/pr/3742/docs/iroh_relay/server/struct.Server.html +++ b/pr/3742/docs/iroh_relay/server/struct.Server.html @@ -17,9 +17,9 @@ case there is an error in the server before it is shut down.

    Source

    pub fn http_addr(&self) -> Option<SocketAddr>

    The socket address the HTTP server is listening on.

    Source

    pub fn quic_addr(&self) -> Option<SocketAddr>

    The socket address the QUIC server is listening on.

    Source

    pub fn certificates(&self) -> Option<Vec<CertificateDer<'static>>>

    The certificates chain if configured with manual TLS certificates.

    -
    Source

    pub fn https_url(&self) -> Option<RelayUrl>

    Available on crate feature test-utils only.

    Get the server’s https [RelayUrl].

    +
    Source

    pub fn https_url(&self) -> Option<RelayUrl>

    Available on crate feature test-utils only.

    Get the server’s https RelayUrl.

    This uses Self::https_addr so it’s mostly useful for local development.

    -
    Source

    pub fn http_url(&self) -> Option<RelayUrl>

    Available on crate feature test-utils only.

    Get the server’s http [RelayUrl].

    +
    Source

    pub fn http_url(&self) -> Option<RelayUrl>

    Available on crate feature test-utils only.

    Get the server’s http RelayUrl.

    This uses Self::http_addr so it’s mostly useful for local development.

    Source

    pub fn metrics(&self) -> &RelayMetrics

    Returns the metrics collected in the relay server.

    Trait Implementations§

    Source§

    impl Debug for Server

    Source§

    fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more

    Auto Trait Implementations§

    §

    impl Freeze for Server

    §

    impl RefUnwindSafe for Server

    §

    impl Send for Server

    §

    impl Sync for Server

    §

    impl Unpin for Server

    §

    impl UnwindSafe for Server

    Blanket Implementations§

    Source§

    impl<T> Any for T
    where diff --git a/pr/3742/docs/iroh_relay/struct.RelayConfig.html b/pr/3742/docs/iroh_relay/struct.RelayConfig.html index 973a4fa8ee..8b5d862466 100644 --- a/pr/3742/docs/iroh_relay/struct.RelayConfig.html +++ b/pr/3742/docs/iroh_relay/struct.RelayConfig.html @@ -1,14 +1,14 @@ RelayConfig in iroh_relay - Rust

    RelayConfig

    Struct RelayConfig 

    Source
    pub struct RelayConfig {
    -    pub url: RelayUrl,
    +    pub url: RelayUrl,
         pub quic: Option<RelayQuicConfig>,
     }
    Expand description

    Information on a specific relay server.

    Includes the Url where it can be dialed.

    -

    Fields§

    §url: RelayUrl

    The [RelayUrl] where this relay server can be dialed.

    +

    Fields§

    §url: RelayUrl

    The RelayUrl where this relay server can be dialed.

    §quic: Option<RelayQuicConfig>

    Configuration to speak to the QUIC endpoint on the relay server.

    When None, we will not attempt to do QUIC address discovery with this relay server.

    Trait Implementations§

    Source§

    impl Clone for RelayConfig

    Source§

    fn clone(&self) -> RelayConfig

    Returns a duplicate of the value. Read more
    1.0.0 · Source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    Source§

    impl Debug for RelayConfig

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl<'de> Deserialize<'de> for RelayConfig

    Source§

    fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
    where - __D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more
    Source§

    impl Display for RelayConfig

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl From<RelayConfig> for RelayMap

    Source§

    fn from(value: RelayConfig) -> Self

    Converts to this type from the input type.
    Source§

    impl From<RelayUrl> for RelayConfig

    Source§

    fn from(value: RelayUrl) -> Self

    Converts to this type from the input type.
    Source§

    impl FromIterator<RelayConfig> for RelayMap

    Source§

    fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self

    Creates a value from an iterator. Read more
    Source§

    impl Ord for RelayConfig

    Source§

    fn cmp(&self, other: &RelayConfig) -> Ordering

    This method returns an Ordering between self and other. Read more
    1.21.0 · Source§

    fn max(self, other: Self) -> Self
    where + __D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more
    Source§

    impl Display for RelayConfig

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl From<RelayConfig> for RelayMap

    Source§

    fn from(value: RelayConfig) -> Self

    Converts to this type from the input type.
    Source§

    impl From<RelayUrl> for RelayConfig

    Source§

    fn from(value: RelayUrl) -> Self

    Converts to this type from the input type.
    Source§

    impl FromIterator<RelayConfig> for RelayMap

    Source§

    fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self

    Creates a value from an iterator. Read more
    Source§

    impl Ord for RelayConfig

    Source§

    fn cmp(&self, other: &RelayConfig) -> Ordering

    This method returns an Ordering between self and other. Read more
    1.21.0 · Source§

    fn max(self, other: Self) -> Self
    where Self: Sized,

    Compares and returns the maximum of two values. Read more
    1.21.0 · Source§

    fn min(self, other: Self) -> Self
    where Self: Sized,

    Compares and returns the minimum of two values. Read more
    1.50.0 · Source§

    fn clamp(self, min: Self, max: Self) -> Self
    where Self: Sized,

    Restrict a value to a certain interval. Read more
    Source§

    impl PartialEq for RelayConfig

    Source§

    fn eq(&self, other: &RelayConfig) -> bool

    Tests for self and other values to be equal, and is used by ==.
    1.0.0 · Source§

    fn ne(&self, other: &Rhs) -> bool

    Tests for !=. The default implementation is almost always sufficient, diff --git a/pr/3742/docs/iroh_relay/struct.RelayMap.html b/pr/3742/docs/iroh_relay/struct.RelayMap.html index 7d74389f2d..d2f1d7c67b 100644 --- a/pr/3742/docs/iroh_relay/struct.RelayMap.html +++ b/pr/3742/docs/iroh_relay/struct.RelayMap.html @@ -8,28 +8,28 @@ or by creating an empty relay map with let relay2 = RelayUrl::from_str("https://relay2.example.org").unwrap(); let map = RelayMap::from_iter(vec![relay1, relay2]);

    Implementations§

    Source§

    impl RelayMap

    Source

    pub fn empty() -> Self

    Creates an empty relay map.

    Source

    pub fn urls<T>(&self) -> T
    where - T: FromIterator<RelayUrl>,

    Returns the URLs of all servers in this relay map.

    + T: FromIterator<RelayUrl>,

    Returns the URLs of all servers in this relay map.

    This function is generic over the container to collect into. If you simply want a list of URLs, call this with map.urls::<Vec<_>>() to get a Vec<RelayUrl>.

    Source

    pub fn relays<T>(&self) -> T

    Returns a list with the RelayConfig for each relay in this relay map.

    This function is generic over the container to collect into. If you simply want a list of URLs, call this with map.relays::<Vec<_>>() to get a Vec<RelayConfig>.

    -
    Source

    pub fn contains(&self, url: &RelayUrl) -> bool

    Returns true if a relay with url is contained in this this relay map.

    -
    Source

    pub fn get(&self, url: &RelayUrl) -> Option<Arc<RelayConfig>>

    Returns the config for a relay.

    +
    Source

    pub fn contains(&self, url: &RelayUrl) -> bool

    Returns true if a relay with url is contained in this this relay map.

    +
    Source

    pub fn get(&self, url: &RelayUrl) -> Option<Arc<RelayConfig>>

    Returns the config for a relay.

    Source

    pub fn len(&self) -> usize

    Returns the number of relays in this relay map.

    Source

    pub fn is_empty(&self) -> bool

    Returns true if this relay map is empty.

    Source

    pub fn insert( &self, - url: RelayUrl, + url: RelayUrl, endpoint: Arc<RelayConfig>, ) -> Option<Arc<RelayConfig>>

    Inserts a new relay into the relay map.

    -
    Source

    pub fn remove(&self, url: &RelayUrl) -> Option<Arc<RelayConfig>>

    Removes an existing relay by its URL.

    +
    Source

    pub fn remove(&self, url: &RelayUrl) -> Option<Arc<RelayConfig>>

    Removes an existing relay by its URL.

    Source

    pub fn extend(&self, other: &RelayMap)

    Extends this RelayMap with another one.

    -

    Trait Implementations§

    Source§

    impl Clone for RelayMap

    Source§

    fn clone(&self) -> RelayMap

    Returns a duplicate of the value. Read more
    1.0.0 · Source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    Source§

    impl Debug for RelayMap

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl Display for RelayMap

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl From<RelayConfig> for RelayMap

    Source§

    fn from(value: RelayConfig) -> Self

    Converts to this type from the input type.
    Source§

    impl From<RelayUrl> for RelayMap

    Source§

    fn from(value: RelayUrl) -> Self

    Creates a RelayMap from a [RelayUrl].

    +

    Trait Implementations§

    Source§

    impl Clone for RelayMap

    Source§

    fn clone(&self) -> RelayMap

    Returns a duplicate of the value. Read more
    1.0.0 · Source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    Source§

    impl Debug for RelayMap

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl Display for RelayMap

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl From<RelayConfig> for RelayMap

    Source§

    fn from(value: RelayConfig) -> Self

    Converts to this type from the input type.
    Source§

    impl From<RelayUrl> for RelayMap

    Source§

    fn from(value: RelayUrl) -> Self

    Creates a RelayMap from a RelayUrl.

    The RelayConfigs in the RelayMap will have the default QUIC address discovery ports.

    -
    Source§

    impl FromIterator<Arc<RelayConfig>> for RelayMap

    Source§

    fn from_iter<T: IntoIterator<Item = Arc<RelayConfig>>>(iter: T) -> Self

    Creates a value from an iterator. Read more
    Source§

    impl FromIterator<RelayConfig> for RelayMap

    Source§

    fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self

    Creates a value from an iterator. Read more
    Source§

    impl FromIterator<RelayUrl> for RelayMap

    Source§

    fn from_iter<T: IntoIterator<Item = RelayUrl>>(iter: T) -> Self

    Creates a RelayMap from an iterator of [RelayUrl].

    +
    Source§

    impl FromIterator<Arc<RelayConfig>> for RelayMap

    Source§

    fn from_iter<T: IntoIterator<Item = Arc<RelayConfig>>>(iter: T) -> Self

    Creates a value from an iterator. Read more
    Source§

    impl FromIterator<RelayConfig> for RelayMap

    Source§

    fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self

    Creates a value from an iterator. Read more
    Source§

    impl FromIterator<RelayUrl> for RelayMap

    Source§

    fn from_iter<T: IntoIterator<Item = RelayUrl>>(iter: T) -> Self

    Creates a RelayMap from an iterator of RelayUrl.

    The RelayConfigs in the RelayMap will have the default QUIC address discovery ports.

    Source§

    impl PartialEq for RelayMap

    Source§

    fn eq(&self, other: &Self) -> bool

    Tests for self and other values to be equal, and is used by ==.
    1.0.0 · Source§

    fn ne(&self, other: &Rhs) -> bool

    Tests for !=. The default implementation is almost always sufficient, diff --git a/pr/3742/docs/search.index/path/4d7b9dd7fd8d.js b/pr/3742/docs/search.index/path/4d7b9dd7fd8d.js deleted file mode 100644 index 99f9d32361..0000000000 --- a/pr/3742/docs/search.index/path/4d7b9dd7fd8d.js +++ /dev/null @@ -1 +0,0 @@ -rd_("f[1,\"\"]0Al[10,\"core::cmp\",\"core::cmp\"]Al[10,\"core::ops\",\"core::ops\"]Ce[5,\"clap_builder::util::id\",\"clap_builder::util::id\"]Bd[15,\"iroh_relay::client::DialError\"]Bf[15,\"iroh::endpoint::TransportConfig\"]Cg[5,\"iroh::endpoint::presets\",\"iroh::endpoint::presets\"]Eg[5,\"tower_http::follow_redirect::policy::or\",\"tower_http::follow_redirect::policy::or\"]77Ei[5,\"tower_http::follow_redirect::policy::and\",\"tower_http::follow_redirect::policy::and\"]A`[10,\"core::any\"]Ao[5,\"alloc::sync\",\"alloc::sync\"]Ba[5,\"alloc::boxed\",\"alloc::boxed\"]Cb[10,\"bytes::buf::buf_impl\",\"bytes::buf::buf_impl\"]Bi[6,\"iroh_quinn_proto\",\"iroh_quinn_proto\"]9Am[5,\"n0_watcher\",\"n0_watcher\"]Ae[10,\"core::ops::bit\"]Am[5,\"iroh_bench\",\"iroh_bench\"]Bg[5,\"iroh_bench::s2n\",\"iroh_bench::s2n\"]A`[10,\"core::cmp\"]Ak[5,\"core::pin\",\"core::pin\"]Bg[15,\"iroh_relay::client::ConnectError\"]o[5,\"url\",\"url\"]Am[5,\"alloc::vec\",\"alloc::vec\"]Al[2,\"iroh::discovery::pkarr\"]j[2,\"iroh\"]Ae[2,\"iroh::discovery\"]A`[2,\"iroh_relay\"]Ae[2,\"iroh_dns_server\"]f[1,\"\"]00Ao[2,\"iroh::net_report::options\"]o[2,\"iroh_base\"]f[0,\"\"]A`[2,\"iroh_bench\"]4Ak[2,\"iroh_dns_server::http\"]555Ak[10,\"clap_builder::derive\"]>Af[10,\"core::ops::drop\"]Ad[10,\"core::convert\"]Aa[10,\"core::hash\"]1g[17,\"\"]Ci[5,\"iroh_quinn_proto::crypto\",\"iroh_quinn_proto::crypto\"]Be[5,\"n0_error::meta\",\"n0_error::meta\"]Cc[5,\"reqwest::dns::resolve\",\"reqwest::dns::resolve\"]Dg[5,\"hickory_proto::rr::domain::name\",\"hickory_proto::rr::domain::name\"]Ak[5,\"std::path\",\"std::path\"]Am[15,\"iroh::endpoint::Source\"]Bi[6,\"core::task::poll\",\"core::task::poll\"]Bb[10,\"core::marker\",\"core::marker\"]Ad[6,\"iroh::endpoint\"]Ac[10,\"futures_sink\"]2Bf[15,\"iroh::discovery::DiscoveryError\"]Bj[15,\"iroh::discovery::IntoDiscoveryError\"]Bb[15,\"iroh::protocol::AcceptError\"]Bb[15,\"iroh::discovery::ParseError\"]Bl[15,\"iroh_relay::endpoint_info::ParseError\"]Ah[10,\"ppv_lite86::types\"]f[1,\"\"]f[3,\"\"]Ah[2,\"iroh_relay::client\"]A`[2,\"iroh_relay\"]Ae[2,\"iroh_dns_server\"]A`[2,\"iroh_bench\"]4Ae[2,\"iroh::discovery\"]Ad[2,\"iroh::defaults\"]Af[2,\"iroh::test_utils\"]An[2,\"iroh_quinn_proto::config\"]Ad[2,\"iroh::endpoint\"]7Bk[2,\"iroh_quinn_proto::connection::streams\"];;Bd[10,\"core::convert\",\"core::convert\"]Ca[8,\"futures_lite::future\",\"futures_lite::future\"]Ca[8,\"futures_lite::stream\",\"futures_lite::stream\"]Ba[5,\"bytes::bytes\",\"bytes::bytes\"]Ad[5,\"iroh::endpoint\"]Ab[10,\"core::clone\"]Cg[6,\"iroh_quinn_proto::frame\",\"iroh_quinn_proto::frame\"]Ao[10,\"iroh_quinn_proto::coding\"]A`[10,\"core::fmt\"]Ag[10,\"core::ops::deref\"]Ak[5,\"core::fmt\",\"core::fmt\"]Ab[10,\"core::error\"]Be[5,\"std::io::error\",\"std::io::error\"]Bc[6,\"rustls::error\",\"rustls::error\"]Ba[8,\"clap_builder\",\"clap_builder\"]Bi[5,\"signature::error\",\"signature::error\"]Af[2,\"iroh_relay::quic\"]Bc[2,\"iroh_relay::protos::handshake\"]Ao[2,\"iroh_relay::protos::relay\"]Ba[5,\"hyper::error\",\"hyper::error\"]Ee[6,\"iroh_quinn_proto::transport_parameters\",\"iroh_quinn_proto::transport_parameters\"]Be[5,\"reqwest::error\",\"reqwest::error\"]Bg[6,\"postcard::error\",\"postcard::error\"]Cg[6,\"tokio_websockets::error\",\"tokio_websockets::error\"]Bi[6,\"iroh_relay::quic\",\"iroh_relay::quic\"]Dc[6,\"iroh_relay::protos::handshake\",\"iroh_relay::protos::handshake\"]Ck[6,\"iroh_relay::protos::relay\",\"iroh_relay::protos::relay\"]Ca[6,\"iroh::net_report\",\"iroh::net_report::probes\"]Bk[15,\"iroh::endpoint::ConnectWithOptsError\"]Bf[15,\"iroh::endpoint::TransportConfig\"]Bg[15,\"iroh_relay::protos::relay::Error\"]Bb[10,\"core::marker\",\"core::marker\"]Bk[5,\"iroh_bench::stats\",\"iroh_bench::stats\"]Am[5,\"n0_watcher\",\"n0_watcher\"]2g[17,\"\"]Ah[10,\"std::io\",\"std::io\"]f[1,\"\"]Ah[2,\"iroh_relay::protos\"]Af[2,\"iroh_quinn_proto\"]Ad[2,\"iroh::endpoint\"]Ae[2,\"iroh::discovery\"]A`[2,\"iroh_bench\"]45Ae[2,\"iroh_dns_server\"]1Bb[2,\"iroh_quinn_proto::connection\"]177Ca[5,\"iroh::endpoint\",\"iroh::endpoint::connection\"]Bm[6,\"iroh_relay::server\",\"iroh_relay::server\"]Ac[10,\"core::borrow\"]C`[10,\"bytes::buf::buf_mut\",\"bytes::buf::buf_mut\"]Bc[5,\"pkarr::client\",\"pkarr::client\"]Bm[5,\"iroh_relay::client\",\"iroh_relay::client\"]Ba[5,\"async_compat\",\"async_compat\"]Cg[5,\"iroh_dns_server::config\",\"iroh_dns_server::config\"]Cb[10,\"core::future::future\",\"core::future::future\"]Ca[5,\"iroh_dns_server::dns\",\"iroh_dns_server::dns\"]An[10,\"core::hash\",\"core::hash\"]Cb[15,\"iroh_relay::protos::relay::RelayToClientMsg\"]Bm[6,\"core::net::ip_addr\",\"core::net::ip_addr\"]Bm[5,\"iroh_relay::server\",\"iroh_relay::server\"]Bh[10,\"reloadable_core\",\"reloadable_core\"]Be[15,\"iroh_relay::server::CertConfig\"]Bj[15,\"iroh::endpoint::AuthenticationError\"]Ad[5,\"iroh::endpoint\"]Ba[6,\"core::option\",\"core::option\"]g[17,\"\"]Do[5,\"iroh_quinn_proto::connection::paths\",\"iroh_quinn_proto::connection::paths\"]E`[10,\"tower_http::follow_redirect::policy\",\"tower_http::follow_redirect::policy\"]Ch[10,\"iroh::endpoint::presets\",\"iroh::endpoint::presets\"]Co[5,\"hickory_proto::rr::resource\",\"hickory_proto::rr::resource\"]Bl[15,\"iroh::endpoint::AfterHandshakeOutcome\"]Ca[5,\"iroh::net_report\",\"iroh::net_report::report\"]Ak[8,\"core::fmt\",\"core::fmt\"]Ba[6,\"core::result\",\"core::result\"]Be[8,\"std::io::error\",\"std::io::error\"]Ai[8,\"n0_error\",\"n0_error\"]Be[5,\"iroh::protocol\",\"iroh::protocol\"]Cg[5,\"iroh_dns_server::server\",\"iroh_dns_server::server\"]Bm[5,\"iroh_relay::server\",\"iroh_relay::server\"]Ad[2,\"iroh::endpoint\"]Cb[6,\"iroh::endpoint\",\"iroh::magicsock::remote_map\"]Ak[10,\"futures_core::stream\"]Am[5,\"n0_watcher\",\"n0_watcher\"]Bc[5,\"alloc::string\",\"alloc::string\"]Ak[5,\"core::any\",\"core::any\"]Ci[5,\"iroh_quinn_proto::varint\",\"iroh_quinn_proto::varint\"]Ad[5,\"iroh::endpoint\"]Bi[15,\"iroh::discovery::pkarr::PkarrError\"]A`[2,\"iroh_relay\"]Ah[2,\"iroh_relay::protos\"]Af[2,\"iroh_quinn_proto\"]Ae[2,\"iroh_dns_server\"]1Af[2,\"iroh::net_report\"]40412Ae[10,\"iroh::endpoint\"]Bg[8,\"iroh_relay::dns\",\"iroh_relay::dns\"]Be[5,\"iroh::endpoint\",\"iroh::endpoint\"]Co[5,\"iroh::discovery::pkarr::dht\",\"iroh::discovery::pkarr::dht\"]Bg[5,\"iroh_relay::dns\",\"iroh_relay::dns\"]De[5,\"clap_builder::builder::command\",\"clap_builder::builder::command\"]Bc[15,\"iroh::endpoint::ConnectError\"]An[15,\"iroh_relay::quic::Error\"]Bi[5,\"core::task::wake\",\"core::task::wake\"]Cc[5,\"iroh_metrics::metrics\",\"iroh_metrics::metrics\"]Ad[10,\"core::default\"]A`[10,\"core::fmt\"]Bm[5,\"tokio::time::error\",\"tokio::time::error\"]Bl[15,\"iroh::discovery::mdns::DiscoveryEvent\"]Bc[10,\"axum_core::extract::from_ref\"]Ah[10,\"core::str::traits\"]Ak[5,\"std::time\",\"std::time\"]Bj[15,\"iroh_relay::server::SupervisorError\"]Cb[5,\"iroh::net_report\",\"iroh::net_report::metrics\"]Ci[5,\"iroh_dns_server::metrics\",\"iroh_dns_server::metrics\"]Cf[5,\"iroh_relay::server\",\"iroh_relay::server::metrics\"]Am[5,\"n0_watcher\",\"n0_watcher\"]Ad[5,\"iroh::endpoint\"]Cg[5,\"iroh::net_report\",\"iroh::net_report::options::imp\"]Ak[5,\"std::path\",\"std::path\"]Bk[5,\"dyn_clone::sealed\",\"dyn_clone::sealed\"]Bo[5,\"tokio::io::read_buf\",\"tokio::io::read_buf\"]Eg[5,\"hickory_server::server::request_handler\",\"hickory_server::server::request_handler\"]B`[15,\"iroh_relay::dns::DnsError\"]Al[10,\"reqwest::dns::resolve\"]Cg[5,\"tokio::runtime::runtime\",\"tokio::runtime::runtime\"]Cj[10,\"iroh_quinn_proto::crypto\",\"iroh_quinn_proto::crypto\"]Bd[15,\"iroh_relay::client::DialError\"]4Ad[10,\"alloc::borrow\"]Ad[10,\"core::convert\"]0Bg[15,\"iroh_relay::client::ConnectError\"]k[10,\"iroh\"]>j[2,\"iroh\"]Af[2,\"iroh::net_report\"]Ah[2,\"iroh_relay::server\"]Ae[2,\"iroh_dns_server\"]f[1,\"\"]Ad[2,\"iroh::endpoint\"]Ad[2,\"iroh::defaults\"]Bb[2,\"iroh_quinn_proto::connection\"]5Ad[5,\"iroh::endpoint\"]Bc[5,\"n0_error::any\",\"n0_error::any\"]Ce[5,\"iroh_dns_server::state\",\"iroh_dns_server::state\"]De[5,\"alloc::collections::btree::set\",\"alloc::collections::btree::set\"]Ch[6,\"iroh_dns_server::http\",\"iroh_dns_server::http::tls\"]Am[6,\"iroh_bench\",\"iroh_bench\"]Ag[10,\"core::ops::deref\"]Ae[2,\"iroh_relay::dns\"]Bg[6,\"iroh_relay::dns\",\"iroh_relay::dns\"]Am[5,\"core::time\",\"core::time\"]A`[10,\"dyn_clone\"]Bi[15,\"iroh::discovery::pkarr::PkarrError\"]Ca[5,\"iroh_quinn::endpoint\",\"iroh_quinn::endpoint\"]Be[5,\"iroh::endpoint\",\"iroh::endpoint\"]Bg[6,\"n0_error::error\",\"n0_error::error\"]3Ca[5,\"iroh_quinn::incoming\",\"iroh_quinn::incoming\"]Ca[5,\"iroh::endpoint\",\"iroh::endpoint::connection\"]Bm[5,\"core::net::ip_addr\",\"core::net::ip_addr\"]0Ck[6,\"iroh_relay::endpoint_info\",\"iroh_relay::endpoint_info\"]Am[10,\"iroh_metrics::iterable\"]Db[10,\"core::iter::traits::iterator\",\"core::iter::traits::iterator\"]Am[15,\"iroh::endpoint::Source\"]An[10,\"n0_watcher\",\"n0_watcher\"]Ak[6,\"core::cmp\",\"core::cmp\"]D`[5,\"iroh::endpoint\",\"iroh::magicsock::remote_map::remote_state\"]Bd[15,\"iroh_relay::client::RecvError\"]j[5,\"iroh\"]Bh[5,\"iroh_relay\",\"iroh_relay::relay_map\"]Ca[5,\"iroh_base::relay_url\",\"iroh_base::relay_url\"]2Bf[5,\"iroh_base\",\"iroh_base::relay_url\"]Bj[15,\"iroh::endpoint::AuthenticationError\"]Bh[10,\"iroh_relay::dns\",\"iroh_relay::dns\"]Ad[5,\"iroh::endpoint\"]Ad[10,\"alloc::string\"]Bg[15,\"iroh_relay::protos::relay::Error\"]Ck[5,\"iroh_relay::endpoint_info\",\"iroh_relay::endpoint_info\"]3Ae[5,\"iroh::discovery\"]1o[6,\"z32\",\"z32\"]j[2,\"iroh\"]A`[2,\"iroh_relay\"]1A`[2,\"iroh_quinn\"]2Ah[2,\"iroh_relay::server\"]B`[2,\"iroh::net_report::defaults\"]:Ca[5,\"iroh::endpoint\",\"iroh::endpoint::connection\"]Ci[5,\"tokio_rustls_acme::state\",\"tokio_rustls_acme::state\"]Ad[2,\"iroh::endpoint\"]Ca[6,\"iroh::endpoint\",\"iroh::endpoint::connection\"]Al[10,\"tokio::io::async_read\"]2Be[6,\"iroh::endpoint\",\"iroh::endpoint\"]Ac[10,\"core::borrow\"]Ac[10,\"async_compat\"]Al[10,\"rand_core\",\"rand_core\"]Cb[15,\"iroh_relay::protos::relay::ClientToRelayMsg\"]Cb[15,\"iroh_relay::protos::relay::RelayToClientMsg\"]Ck[5,\"iroh_relay::protos::relay\",\"iroh_relay::protos::relay\"]Ah[2,\"iroh_relay::client\"]Bm[6,\"iroh_relay::client\",\"iroh_relay::client\"]Am[15,\"iroh::endpoint::Source\"]B`[15,\"iroh::endpoint::BindError\"]Bh[10,\"iroh::discovery\",\"iroh::discovery\"]Ca[5,\"iroh_dns_server::dns\",\"iroh_dns_server::dns\"]0Ak[5,\"core::fmt\",\"core::fmt\"]Cm[6,\"iroh_relay::protos::common\",\"iroh_relay::protos::common\"]Bg[15,\"iroh_relay::client::ConnectError\"]Ba[5,\"hdrhistogram\",\"hdrhistogram\"]Co[5,\"tokio::runtime::task::error\",\"tokio::runtime::task::error\"]Bj[15,\"iroh_relay::server::SupervisorError\"]Be[15,\"iroh_relay::server::SpawnError\"]Bk[15,\"iroh::endpoint::ConnectWithOptsError\"]Bf[15,\"iroh::discovery::DiscoveryError\"]Bb[15,\"iroh::discovery::ParseError\"]Bl[15,\"iroh_relay::endpoint_info::ParseError\"]A`[10,\"core::cmp\"]Ad[5,\"iroh::endpoint\"]An[10,\"crossbeam_epoch::atomic\"]Bj[10,\"tower_http::follow_redirect::policy\"]Bi[15,\"iroh::discovery::pkarr::PkarrError\"]j[5,\"iroh\"]B`[5,\"iroh_base\",\"iroh_base::key\"];Ad[6,\"iroh::endpoint\"]Ck[5,\"hickory_proto::rr::rr_set\",\"hickory_proto::rr::rr_set\"]Ck[5,\"tokio::sync::watch::error\",\"tokio::sync::watch::error\"]Ah[2,\"iroh_relay::client\"]Cc[6,\"iroh_relay::client\",\"iroh_relay::client::conn\"]Be[6,\"iroh::endpoint\",\"iroh::endpoint\"]Cc[8,\"reqwest::dns::resolve\",\"reqwest::dns::resolve\"]Be[5,\"iroh_base::key\",\"iroh_base::key\"]9843Af[10,\"serde_core::ser\"]:9Bm[5,\"iroh_relay::server\",\"iroh_relay::server\"]Ak[10,\"futures_core::future\"]Ak[10,\"futures_core::stream\"]Bi[5,\"core::str::error\",\"core::str::error\"]An[15,\"iroh_relay::quic::Error\"]Bg[15,\"iroh_relay::client::ConnectError\"]Bk[15,\"iroh_relay::protos::handshake::Error\"]Bn[5,\"iroh_dns_server\",\"iroh_dns_server::store\"]Bb[2,\"iroh_quinn_proto::connection\"]j[2,\"iroh\"]Ah[2,\"iroh_relay::protos\"]f[3,\"\"]2f[1,\"\"]A`[2,\"iroh_relay\"]o[2,\"iroh_base\"]Af[2,\"iroh::net_report\"]An[2,\"iroh_quinn_proto::config\"]Em[5,\"clap_builder::parser::matches::arg_matches\",\"clap_builder::parser::matches::arg_matches\"]Am[10,\"tokio::io::async_write\"]Ah[2,\"iroh_relay::server\"]Bm[6,\"iroh_relay::server\",\"iroh_relay::server\"]Bm[5,\"iroh_relay::client\",\"iroh_relay::client\"]Aa[10,\"equivalent\"]Bc[15,\"iroh::endpoint::ConnectError\"]Bb[15,\"iroh::protocol::AcceptError\"]Ca[5,\"iroh::endpoint\",\"iroh::endpoint::connection\"]Am[15,\"iroh::endpoint::Source\"]Cm[5,\"iroh::endpoint::connection\",\"iroh::endpoint::connection\"]43An[15,\"iroh_relay::quic::Error\"]Ce[5,\"iroh_quinn::connection\",\"iroh_quinn::connection\"]4Ae[10,\"iroh::endpoint\"]Bf[5,\"iroh::endpoint\",\"iroh::magicsock\"]Bl[15,\"iroh::discovery::mdns::DiscoveryEvent\"]Ca[5,\"iroh_dns_server::dns\",\"iroh_dns_server::dns\"]Ak[8,\"iroh\",\"iroh_base::key\"]B`[8,\"iroh_base\",\"iroh_base::key\"]Be[8,\"iroh_base::key\",\"iroh_base::key\"]A`[10,\"hashbrown\"]?Ad[5,\"iroh::endpoint\"]Bm[5,\"http::header::name\",\"http::header::name\"]Cc[5,\"iroh_dns_server::http\",\"iroh_dns_server::http\"]0B`[10,\"core::future::into_future\"]Bi[15,\"iroh::endpoint_info::DecodingError\"]Bo[15,\"iroh_relay::endpoint_info::DecodingError\"]Bd[15,\"iroh_relay::client::DialError\"]B`[15,\"iroh::endpoint::BindError\"]Bm[5,\"iroh_metrics::base\",\"iroh_metrics::base\"]B`[15,\"iroh_relay::dns::DnsError\"]Bm[8,\"core::num::nonzero\",\"core::num::nonzero\"]Bb[15,\"iroh::protocol::AcceptError\"]Ae[2,\"iroh::discovery\"]Ao[6,\"url::parser\",\"url::parser\"]Bc[15,\"iroh_relay::dns::LookupError\"]Ao[2,\"iroh_relay::endpoint_info\"]Ae[6,\"iroh::discovery\"]Ck[6,\"iroh_relay::endpoint_info\",\"iroh_relay::endpoint_info\"]A`[10,\"core::cmp\"]Al[2,\"iroh::discovery::pkarr\"]Ce[6,\"iroh::discovery::pkarr\",\"iroh::discovery::pkarr\"]Ad[5,\"iroh::endpoint\"]Bi[5,\"iroh_relay::quic\",\"iroh_relay::quic\"]Cd[5,\"iroh::net_report\",\"iroh::net_report::reportgen\"]Bm[5,\"iroh_relay::server\",\"iroh_relay::server\"]De[6,\"hickory_proto::rr::record_type\",\"hickory_proto::rr::record_type\"]4Ad[6,\"iroh::endpoint\"]Cb[15,\"iroh_relay::protos::relay::RelayToClientMsg\"]66Bh[10,\"serde_core::ser\",\"serde_core::ser\"]Ce[6,\"core::net::socket_addr\",\"core::net::socket_addr\"]Ah[2,\"iroh_relay::server\"]Bm[6,\"iroh_relay::server\",\"iroh_relay::server\"]Af[10,\"n0_error::error\"]Ba[5,\"http::status\",\"http::status\"]Ak[10,\"clap_builder::derive\"]Cj[10,\"iroh_quinn_proto::config\",\"iroh_quinn_proto::config\"]9Af[2,\"iroh_quinn_proto\"]Ad[2,\"iroh::endpoint\"]1A`[2,\"iroh_quinn\"]f[3,\"\"]00j[2,\"iroh\"]Ae[2,\"iroh::magicsock\"]10Ad[2,\"iroh::protocol\"]Be[6,\"iroh::protocol\",\"iroh::protocol\"]Be[5,\"iroh::protocol\",\"iroh::protocol\"]Am[15,\"iroh::endpoint::Source\"]Co[5,\"rustls::server::server_conn\",\"rustls::server::server_conn\"]Am[5,\"iroh_bench\",\"iroh_bench\"]Do[6,\"iroh_quinn_proto::connection::state\",\"iroh_quinn_proto::connection::state\"]Ad[5,\"iroh::endpoint\"]Bc[5,\"data_encoding\",\"data_encoding\"]Ae[10,\"serde_core::de\"]Bg[6,\"iroh_relay::dns\",\"iroh_relay::dns\"]o[5,\"iroh::dns\"]Bg[5,\"iroh_relay::dns\",\"iroh_relay::dns\"]Bd[15,\"iroh_relay::client::SendError\"]Bo[5,\"http::header::value\",\"http::header::value\"]Bi[15,\"iroh::discovery::pkarr::PkarrError\"]0Cc[5,\"iroh_dns_server::http\",\"iroh_dns_server::http\"]9Be[15,\"iroh_relay::server::CertConfig\"]Ae[2,\"iroh_relay::dns\"]8B`[15,\"iroh_relay::dns::DnsError\"]Bg[15,\"iroh_relay::client::ConnectError\"]Be[15,\"iroh_relay::server::SpawnError\"]Bk[5,\"iroh_relay\",\"iroh_relay::ping_tracker\"]Ae[10,\"iroh::endpoint\"]j[5,\"iroh\"]Bh[5,\"iroh_relay\",\"iroh_relay::relay_map\"]Bm[5,\"iroh_relay::server\",\"iroh_relay::server\"]7Bk[15,\"iroh::endpoint::ConnectWithOptsError\"]Cg[5,\"iroh_dns_server::config\",\"iroh_dns_server::config\"]Bd[15,\"iroh_relay::client::RecvError\"]Bd[15,\"iroh_relay::client::SendError\"]Bk[5,\"iroh_bench::stats\",\"iroh_bench::stats\"]B`[15,\"iroh::endpoint::AlpnError\"]Ci[5,\"ring::error::unspecified\",\"ring::error::unspecified\"]A`[2,\"iroh_quinn\"]0Bm[6,\"iroh_relay::server\",\"iroh_relay::server\"]Ce[5,\"rustls::crypto::signer\",\"rustls::crypto::signer\"]Co[5,\"rustls::client::client_conn\",\"rustls::client::client_conn\"]Bm[5,\"iroh_relay::client\",\"iroh_relay::client\"]Ad[5,\"iroh::endpoint\"]Ad[2,\"iroh::endpoint\"]Ah[2,\"iroh_relay::client\"]Cm[6,\"iroh_quinn_proto::endpoint\",\"iroh_quinn_proto::endpoint\"]Be[6,\"iroh::endpoint\",\"iroh::endpoint\"]Bm[6,\"iroh_relay::client\",\"iroh_relay::client\"]Ci[5,\"iroh_quinn_proto::shared\",\"iroh_quinn_proto::shared\"]Bf[10,\"serde_core::de\",\"serde_core::de\"]Co[5,\"iroh::discovery::pkarr::dht\",\"iroh::discovery::pkarr::dht\"]Am[5,\"n0_watcher\",\"n0_watcher\"]Ca[5,\"iroh::discovery::dns\",\"iroh::discovery::dns\"]Ci[5,\"iroh_base::endpoint_addr\",\"iroh_base::endpoint_addr\"]j[5,\"iroh\"]Bj[5,\"iroh_base\",\"iroh_base::endpoint_addr\"]Ae[5,\"iroh::discovery\"]Ck[5,\"iroh_relay::endpoint_info\",\"iroh_relay::endpoint_info\"]10Bb[10,\"core::iter::traits::collect\"]Am[10,\"iroh_metrics::iterable\"]D`[10,\"core::iter::traits::collect\",\"core::iter::traits::collect\"]Bg[15,\"iroh_relay::protos::relay::Error\"]Cg[5,\"iroh_quinn_proto::frame\",\"iroh_quinn_proto::frame\"]Bc[15,\"iroh_relay::dns::LookupError\"]Ai[10,\"iroh_metrics::base\"]D`[5,\"iroh::endpoint\",\"iroh::magicsock::remote_map::remote_state\"]Bd[15,\"iroh_relay::client::DialError\"]Ad[5,\"iroh::endpoint\"]Ac[5,\"iroh::metrics\"]Cf[5,\"iroh_relay::server\",\"iroh_relay::server::metrics\"]Cg[5,\"hickory_resolver::error\",\"hickory_resolver::error\"]Do[5,\"iroh_quinn_proto::connection::paths\",\"iroh_quinn_proto::connection::paths\"]Co[5,\"rustls::server::server_conn\",\"rustls::server::server_conn\"]5Bm[5,\"iroh_relay::server\",\"iroh_relay::server\"]Ca[5,\"pkarr::signed_packet\",\"pkarr::signed_packet\"]Ce[5,\"core::net::socket_addr\",\"core::net::socket_addr\"]0Ad[6,\"iroh::endpoint\"]A`[2,\"iroh_relay\"]Ba[2,\"iroh::magicsock::remote_map\"]Bm[5,\"iroh_relay::client\",\"iroh_relay::client\"]Ab[10,\"core::clone\"]Bb[15,\"iroh::discovery::ParseError\"]Ai[2,\"iroh::endpoint_info\"]Ao[2,\"iroh_relay::endpoint_info\"]Bl[15,\"iroh_relay::endpoint_info::ParseError\"]Ai[6,\"iroh::endpoint_info\"]Ck[6,\"iroh_relay::endpoint_info\",\"iroh_relay::endpoint_info\"]Bg[5,\"iroh::discovery\",\"iroh::discovery\"]5421Bm[10,\"iroh::endpoint\",\"iroh::endpoint::hooks\"]Aj[10,\"iroh::endpoint_info\"]Cl[10,\"iroh_relay::endpoint_info\",\"iroh_relay::endpoint_info\"]Bg[15,\"iroh_relay::protos::relay::Error\"]Bh[10,\"iroh::discovery\",\"iroh::discovery\"]Bi[15,\"iroh::endpoint_info::DecodingError\"]Bo[15,\"iroh_relay::endpoint_info::DecodingError\"]Cc[5,\"iroh::discovery::mdns\",\"iroh::discovery::mdns\"]Cg[5,\"iroh_dns_server::config\",\"iroh_dns_server::config\"]Ce[5,\"iroh::discovery::pkarr\",\"iroh::discovery::pkarr\"]Bi[6,\"rustls_pki_types\",\"rustls_pki_types\"]Bo[5,\"iroh::test_utils\",\"iroh::test_utils::qlog\"]Eo[6,\"iroh_quinn_proto::connection::streams::recv\",\"iroh_quinn_proto::connection::streams::recv\"]Be[5,\"iroh::protocol\",\"iroh::protocol\"]Bj[15,\"iroh_relay::server::SupervisorError\"]Ci[6,\"iroh_base::endpoint_addr\",\"iroh_base::endpoint_addr\"]j[6,\"iroh\"]Bj[6,\"iroh_base\",\"iroh_base::endpoint_addr\"]Bg[5,\"iroh_relay::dns\",\"iroh_relay::dns\"]Ca[15,\"iroh_relay::protos::common::FrameTypeError\"]Bk[15,\"iroh_relay::protos::handshake::Error\"]Ci[5,\"iroh_quinn_proto::coding\",\"iroh_quinn_proto::coding\"]Ca[6,\"iroh::endpoint\",\"iroh::endpoint::connection\"]o[2,\"iroh_base\"]j[2,\"iroh\"]A`[2,\"iroh_relay\"]Ak[2,\"iroh_dns_server::http\"]Bb[15,\"iroh::discovery::ParseError\"]Bl[15,\"iroh_relay::endpoint_info::ParseError\"]Bi[5,\"rustls_pki_types\",\"rustls_pki_types\"]Ak[10,\"clap_builder::derive\"]Be[5,\"iroh::endpoint\",\"iroh::endpoint\"]Ca[5,\"iroh::endpoint\",\"iroh::endpoint::connection\"]Bf[6,\"iroh::endpoint\",\"iroh::magicsock\"]Ae[2,\"iroh::discovery\"]Bg[6,\"iroh::discovery\",\"iroh::discovery\"]Ak[2,\"iroh::discovery::mdns\"]Cc[6,\"iroh::discovery::mdns\",\"iroh::discovery::mdns\"]D`[5,\"iroh::test_utils\",\"iroh::test_utils::dns_and_pkarr_servers\"]B`[2,\"iroh_relay::protos::common\"]Bk[15,\"iroh_relay::protos::handshake::Error\"]Bg[15,\"iroh_relay::protos::relay::Error\"]Cm[6,\"iroh_relay::protos::common\",\"iroh_relay::protos::common\"]Af[10,\"core::ops::drop\"]Ad[10,\"core::convert\"]Aa[10,\"core::hash\"]1g[17,\"\"]Ci[5,\"iroh_quinn_proto::crypto\",\"iroh_quinn_proto::crypto\"]Be[5,\"n0_error::meta\",\"n0_error::meta\"]Cc[5,\"reqwest::dns::resolve\",\"reqwest::dns::resolve\"]Dg[5,\"hickory_proto::rr::domain::name\",\"hickory_proto::rr::domain::name\"]Ak[5,\"std::path\",\"std::path\"]Am[15,\"iroh::endpoint::Source\"]Bi[6,\"core::task::poll\",\"core::task::poll\"]Bb[10,\"core::marker\",\"core::marker\"]Ad[6,\"iroh::endpoint\"]Ac[10,\"futures_sink\"]2Bf[15,\"iroh::discovery::DiscoveryError\"]Bj[15,\"iroh::discovery::IntoDiscoveryError\"]Bb[15,\"iroh::protocol::AcceptError\"]Bb[15,\"iroh::discovery::ParseError\"]Bl[15,\"iroh_relay::endpoint_info::ParseError\"]Ah[10,\"ppv_lite86::types\"]f[1,\"\"]f[3,\"\"]Ah[2,\"iroh_relay::client\"]A`[2,\"iroh_relay\"]Ae[2,\"iroh_dns_server\"]A`[2,\"iroh_bench\"]4Ae[2,\"iroh::discovery\"]Ad[2,\"iroh::defaults\"]Af[2,\"iroh::test_utils\"]An[2,\"iroh_quinn_proto::config\"]Ad[2,\"iroh::endpoint\"]7Bk[2,\"iroh_quinn_proto::connection::streams\"];;Ad[10,\"core::convert\"]Ca[8,\"futures_lite::future\",\"futures_lite::future\"]Ca[8,\"futures_lite::stream\",\"futures_lite::stream\"]Ba[5,\"bytes::bytes\",\"bytes::bytes\"]Ad[5,\"iroh::endpoint\"]Ab[10,\"core::clone\"]Cg[6,\"iroh_quinn_proto::frame\",\"iroh_quinn_proto::frame\"]Ao[10,\"iroh_quinn_proto::coding\"]A`[10,\"core::fmt\"]Ag[10,\"core::ops::deref\"]Ak[5,\"core::fmt\",\"core::fmt\"]Ab[10,\"core::error\"]Be[5,\"std::io::error\",\"std::io::error\"]Bc[6,\"rustls::error\",\"rustls::error\"]Ba[8,\"clap_builder\",\"clap_builder\"]Bi[5,\"signature::error\",\"signature::error\"]Af[2,\"iroh_relay::quic\"]Bc[2,\"iroh_relay::protos::handshake\"]Ao[2,\"iroh_relay::protos::relay\"]Ba[5,\"hyper::error\",\"hyper::error\"]Ee[6,\"iroh_quinn_proto::transport_parameters\",\"iroh_quinn_proto::transport_parameters\"]Be[5,\"reqwest::error\",\"reqwest::error\"]Bg[6,\"postcard::error\",\"postcard::error\"]Cg[6,\"tokio_websockets::error\",\"tokio_websockets::error\"]Bi[6,\"iroh_relay::quic\",\"iroh_relay::quic\"]Dc[6,\"iroh_relay::protos::handshake\",\"iroh_relay::protos::handshake\"]Ck[6,\"iroh_relay::protos::relay\",\"iroh_relay::protos::relay\"]Ca[6,\"iroh::net_report\",\"iroh::net_report::probes\"]Bk[15,\"iroh::endpoint::ConnectWithOptsError\"]Bf[15,\"iroh::endpoint::TransportConfig\"]Bg[15,\"iroh_relay::protos::relay::Error\"]Bb[10,\"core::marker\",\"core::marker\"]Bk[5,\"iroh_bench::stats\",\"iroh_bench::stats\"]Am[5,\"n0_watcher\",\"n0_watcher\"]2g[17,\"\"]Ah[10,\"std::io\",\"std::io\"]f[1,\"\"]Ah[2,\"iroh_relay::protos\"]Af[2,\"iroh_quinn_proto\"]Ad[2,\"iroh::endpoint\"]Ae[2,\"iroh::discovery\"]A`[2,\"iroh_bench\"]45Ae[2,\"iroh_dns_server\"]1Bb[2,\"iroh_quinn_proto::connection\"]177Ca[5,\"iroh::endpoint\",\"iroh::endpoint::connection\"]Bm[6,\"iroh_relay::server\",\"iroh_relay::server\"]Ac[10,\"core::borrow\"]C`[10,\"bytes::buf::buf_mut\",\"bytes::buf::buf_mut\"]Bc[5,\"pkarr::client\",\"pkarr::client\"]Bm[5,\"iroh_relay::client\",\"iroh_relay::client\"]Ba[5,\"async_compat\",\"async_compat\"]Cg[5,\"iroh_dns_server::config\",\"iroh_dns_server::config\"]Cb[10,\"core::future::future\",\"core::future::future\"]Ca[5,\"iroh_dns_server::dns\",\"iroh_dns_server::dns\"]An[10,\"core::hash\",\"core::hash\"]Cb[15,\"iroh_relay::protos::relay::RelayToClientMsg\"]Bm[6,\"core::net::ip_addr\",\"core::net::ip_addr\"]Bm[5,\"iroh_relay::server\",\"iroh_relay::server\"]Bh[10,\"reloadable_core\",\"reloadable_core\"]Be[15,\"iroh_relay::server::CertConfig\"]Bj[15,\"iroh::endpoint::AuthenticationError\"]Ad[5,\"iroh::endpoint\"]Ba[6,\"core::option\",\"core::option\"]g[17,\"\"]Do[5,\"iroh_quinn_proto::connection::paths\",\"iroh_quinn_proto::connection::paths\"]E`[10,\"tower_http::follow_redirect::policy\",\"tower_http::follow_redirect::policy\"]Ch[10,\"iroh::endpoint::presets\",\"iroh::endpoint::presets\"]Co[5,\"hickory_proto::rr::resource\",\"hickory_proto::rr::resource\"]Bl[15,\"iroh::endpoint::AfterHandshakeOutcome\"]Ca[5,\"iroh::net_report\",\"iroh::net_report::report\"]Ak[8,\"core::fmt\",\"core::fmt\"]Ba[6,\"core::result\",\"core::result\"]Be[8,\"std::io::error\",\"std::io::error\"]Ai[8,\"n0_error\",\"n0_error\"]Be[5,\"iroh::protocol\",\"iroh::protocol\"]Cg[5,\"iroh_dns_server::server\",\"iroh_dns_server::server\"]Bm[5,\"iroh_relay::server\",\"iroh_relay::server\"]Ad[2,\"iroh::endpoint\"]Cb[6,\"iroh::endpoint\",\"iroh::magicsock::remote_map\"]Ak[10,\"futures_core::stream\"]Am[5,\"n0_watcher\",\"n0_watcher\"]Bc[5,\"alloc::string\",\"alloc::string\"]Ak[5,\"core::any\",\"core::any\"]Ci[5,\"iroh_quinn_proto::varint\",\"iroh_quinn_proto::varint\"]Ad[5,\"iroh::endpoint\"]Bi[15,\"iroh::discovery::pkarr::PkarrError\"]A`[2,\"iroh_relay\"]Ah[2,\"iroh_relay::protos\"]Af[2,\"iroh_quinn_proto\"]Ae[2,\"iroh_dns_server\"]1Af[2,\"iroh::net_report\"]40412Ae[10,\"iroh::endpoint\"]Bg[8,\"iroh_relay::dns\",\"iroh_relay::dns\"]Be[5,\"iroh::endpoint\",\"iroh::endpoint\"]Co[5,\"iroh::discovery::pkarr::dht\",\"iroh::discovery::pkarr::dht\"]Bg[5,\"iroh_relay::dns\",\"iroh_relay::dns\"]De[5,\"clap_builder::builder::command\",\"clap_builder::builder::command\"]Bc[15,\"iroh::endpoint::ConnectError\"]An[15,\"iroh_relay::quic::Error\"]Bi[5,\"core::task::wake\",\"core::task::wake\"]Cc[5,\"iroh_metrics::metrics\",\"iroh_metrics::metrics\"]Ad[10,\"core::default\"]A`[10,\"core::fmt\"]Bm[5,\"tokio::time::error\",\"tokio::time::error\"]Bl[15,\"iroh::discovery::mdns::DiscoveryEvent\"]Bc[10,\"axum_core::extract::from_ref\"]Ah[10,\"core::str::traits\"]Ak[5,\"std::time\",\"std::time\"]Bj[15,\"iroh_relay::server::SupervisorError\"]Cb[5,\"iroh::net_report\",\"iroh::net_report::metrics\"]Ci[5,\"iroh_dns_server::metrics\",\"iroh_dns_server::metrics\"]Cf[5,\"iroh_relay::server\",\"iroh_relay::server::metrics\"]Am[5,\"n0_watcher\",\"n0_watcher\"]Ad[5,\"iroh::endpoint\"]Cg[5,\"iroh::net_report\",\"iroh::net_report::options::imp\"]Ak[5,\"std::path\",\"std::path\"]Bk[5,\"dyn_clone::sealed\",\"dyn_clone::sealed\"]Bo[5,\"tokio::io::read_buf\",\"tokio::io::read_buf\"]Eg[5,\"hickory_server::server::request_handler\",\"hickory_server::server::request_handler\"]B`[15,\"iroh_relay::dns::DnsError\"]Al[10,\"reqwest::dns::resolve\"]Cg[5,\"tokio::runtime::runtime\",\"tokio::runtime::runtime\"]Cj[10,\"iroh_quinn_proto::crypto\",\"iroh_quinn_proto::crypto\"]Bd[15,\"iroh_relay::client::DialError\"]4Ad[10,\"alloc::borrow\"]Ad[10,\"core::convert\"]0Bg[15,\"iroh_relay::client::ConnectError\"]k[10,\"iroh\"]>j[2,\"iroh\"]Af[2,\"iroh::net_report\"]Ah[2,\"iroh_relay::server\"]Ae[2,\"iroh_dns_server\"]f[1,\"\"]Ad[2,\"iroh::endpoint\"]Ad[2,\"iroh::defaults\"]Bb[2,\"iroh_quinn_proto::connection\"]5Ad[5,\"iroh::endpoint\"]Bc[5,\"n0_error::any\",\"n0_error::any\"]Ce[5,\"iroh_dns_server::state\",\"iroh_dns_server::state\"]De[5,\"alloc::collections::btree::set\",\"alloc::collections::btree::set\"]Ch[6,\"iroh_dns_server::http\",\"iroh_dns_server::http::tls\"]Am[6,\"iroh_bench\",\"iroh_bench\"]Ag[10,\"core::ops::deref\"]Ae[2,\"iroh_relay::dns\"]Bg[6,\"iroh_relay::dns\",\"iroh_relay::dns\"]Am[5,\"core::time\",\"core::time\"]A`[10,\"dyn_clone\"]Bi[15,\"iroh::discovery::pkarr::PkarrError\"]Ca[5,\"iroh_quinn::endpoint\",\"iroh_quinn::endpoint\"]Be[5,\"iroh::endpoint\",\"iroh::endpoint\"]Bg[6,\"n0_error::error\",\"n0_error::error\"]3Ca[5,\"iroh_quinn::incoming\",\"iroh_quinn::incoming\"]Ca[5,\"iroh::endpoint\",\"iroh::endpoint::connection\"]Bm[5,\"core::net::ip_addr\",\"core::net::ip_addr\"]0Ck[6,\"iroh_relay::endpoint_info\",\"iroh_relay::endpoint_info\"]Am[10,\"iroh_metrics::iterable\"]Db[10,\"core::iter::traits::iterator\",\"core::iter::traits::iterator\"]Am[15,\"iroh::endpoint::Source\"]An[10,\"n0_watcher\",\"n0_watcher\"]Ak[6,\"core::cmp\",\"core::cmp\"]D`[5,\"iroh::endpoint\",\"iroh::magicsock::remote_map::remote_state\"]Bd[15,\"iroh_relay::client::RecvError\"]j[5,\"iroh\"]Bh[5,\"iroh_relay\",\"iroh_relay::relay_map\"]Ca[5,\"iroh_base::relay_url\",\"iroh_base::relay_url\"]2Bf[5,\"iroh_base\",\"iroh_base::relay_url\"]Bj[15,\"iroh::endpoint::AuthenticationError\"]Bh[10,\"iroh_relay::dns\",\"iroh_relay::dns\"]Ad[5,\"iroh::endpoint\"]Ad[10,\"alloc::string\"]Bg[15,\"iroh_relay::protos::relay::Error\"]Ck[5,\"iroh_relay::endpoint_info\",\"iroh_relay::endpoint_info\"]3Ae[5,\"iroh::discovery\"]1o[6,\"z32\",\"z32\"]j[2,\"iroh\"]A`[2,\"iroh_relay\"]1A`[2,\"iroh_quinn\"]2Ah[2,\"iroh_relay::server\"]B`[2,\"iroh::net_report::defaults\"]:Ca[5,\"iroh::endpoint\",\"iroh::endpoint::connection\"]Ci[5,\"tokio_rustls_acme::state\",\"tokio_rustls_acme::state\"]Ad[2,\"iroh::endpoint\"]Ca[6,\"iroh::endpoint\",\"iroh::endpoint::connection\"]Al[10,\"tokio::io::async_read\"]2Be[6,\"iroh::endpoint\",\"iroh::endpoint\"]Ac[10,\"core::borrow\"]Ac[10,\"async_compat\"]Al[10,\"rand_core\",\"rand_core\"]Cb[15,\"iroh_relay::protos::relay::ClientToRelayMsg\"]Cb[15,\"iroh_relay::protos::relay::RelayToClientMsg\"]Ck[5,\"iroh_relay::protos::relay\",\"iroh_relay::protos::relay\"]Ah[2,\"iroh_relay::client\"]Bm[6,\"iroh_relay::client\",\"iroh_relay::client\"]Am[15,\"iroh::endpoint::Source\"]B`[15,\"iroh::endpoint::BindError\"]Bh[10,\"iroh::discovery\",\"iroh::discovery\"]Ca[5,\"iroh_dns_server::dns\",\"iroh_dns_server::dns\"]0Ak[5,\"core::fmt\",\"core::fmt\"]Cm[6,\"iroh_relay::protos::common\",\"iroh_relay::protos::common\"]Bg[15,\"iroh_relay::client::ConnectError\"]Ba[5,\"hdrhistogram\",\"hdrhistogram\"]Co[5,\"tokio::runtime::task::error\",\"tokio::runtime::task::error\"]Bj[15,\"iroh_relay::server::SupervisorError\"]Be[15,\"iroh_relay::server::SpawnError\"]Bk[15,\"iroh::endpoint::ConnectWithOptsError\"]Bf[15,\"iroh::discovery::DiscoveryError\"]Bb[15,\"iroh::discovery::ParseError\"]Bl[15,\"iroh_relay::endpoint_info::ParseError\"]A`[10,\"core::cmp\"]Ad[5,\"iroh::endpoint\"]An[10,\"crossbeam_epoch::atomic\"]Bj[10,\"tower_http::follow_redirect::policy\"]Bi[15,\"iroh::discovery::pkarr::PkarrError\"]j[5,\"iroh\"]B`[5,\"iroh_base\",\"iroh_base::key\"];Ad[6,\"iroh::endpoint\"]Ck[5,\"hickory_proto::rr::rr_set\",\"hickory_proto::rr::rr_set\"]Ck[5,\"tokio::sync::watch::error\",\"tokio::sync::watch::error\"]Ah[2,\"iroh_relay::client\"]Cc[6,\"iroh_relay::client\",\"iroh_relay::client::conn\"]Be[6,\"iroh::endpoint\",\"iroh::endpoint\"]Cc[8,\"reqwest::dns::resolve\",\"reqwest::dns::resolve\"]Be[5,\"iroh_base::key\",\"iroh_base::key\"]9843Af[10,\"serde_core::ser\"]:9Bm[5,\"iroh_relay::server\",\"iroh_relay::server\"]Ak[10,\"futures_core::future\"]Ak[10,\"futures_core::stream\"]Bi[5,\"core::str::error\",\"core::str::error\"]An[15,\"iroh_relay::quic::Error\"]Bg[15,\"iroh_relay::client::ConnectError\"]Bk[15,\"iroh_relay::protos::handshake::Error\"]Bn[5,\"iroh_dns_server\",\"iroh_dns_server::store\"]Bb[2,\"iroh_quinn_proto::connection\"]j[2,\"iroh\"]Ah[2,\"iroh_relay::protos\"]f[3,\"\"]2f[1,\"\"]A`[2,\"iroh_relay\"]o[2,\"iroh_base\"]Af[2,\"iroh::net_report\"]An[2,\"iroh_quinn_proto::config\"]Em[5,\"clap_builder::parser::matches::arg_matches\",\"clap_builder::parser::matches::arg_matches\"]Am[10,\"tokio::io::async_write\"]Ah[2,\"iroh_relay::server\"]Bm[6,\"iroh_relay::server\",\"iroh_relay::server\"]Bm[5,\"iroh_relay::client\",\"iroh_relay::client\"]Aa[10,\"equivalent\"]Bc[15,\"iroh::endpoint::ConnectError\"]Bb[15,\"iroh::protocol::AcceptError\"]Ca[5,\"iroh::endpoint\",\"iroh::endpoint::connection\"]Am[15,\"iroh::endpoint::Source\"]Cm[5,\"iroh::endpoint::connection\",\"iroh::endpoint::connection\"]43An[15,\"iroh_relay::quic::Error\"]Ce[5,\"iroh_quinn::connection\",\"iroh_quinn::connection\"]4Ae[10,\"iroh::endpoint\"]Bf[5,\"iroh::endpoint\",\"iroh::magicsock\"]Bl[15,\"iroh::discovery::mdns::DiscoveryEvent\"]Ca[5,\"iroh_dns_server::dns\",\"iroh_dns_server::dns\"]Ak[8,\"iroh\",\"iroh_base::key\"]B`[8,\"iroh_base\",\"iroh_base::key\"]Be[8,\"iroh_base::key\",\"iroh_base::key\"]A`[10,\"hashbrown\"]?Ad[5,\"iroh::endpoint\"]Bm[5,\"http::header::name\",\"http::header::name\"]Cc[5,\"iroh_dns_server::http\",\"iroh_dns_server::http\"]0B`[10,\"core::future::into_future\"]Bi[15,\"iroh::endpoint_info::DecodingError\"]Bo[15,\"iroh_relay::endpoint_info::DecodingError\"]Bd[15,\"iroh_relay::client::DialError\"]B`[15,\"iroh::endpoint::BindError\"]Bm[5,\"iroh_metrics::base\",\"iroh_metrics::base\"]B`[15,\"iroh_relay::dns::DnsError\"]Bm[8,\"core::num::nonzero\",\"core::num::nonzero\"]Bb[15,\"iroh::protocol::AcceptError\"]Ae[2,\"iroh::discovery\"]Ao[6,\"url::parser\",\"url::parser\"]Bc[15,\"iroh_relay::dns::LookupError\"]Ao[2,\"iroh_relay::endpoint_info\"]Ae[6,\"iroh::discovery\"]Ck[6,\"iroh_relay::endpoint_info\",\"iroh_relay::endpoint_info\"]A`[10,\"core::cmp\"]Al[2,\"iroh::discovery::pkarr\"]Ce[6,\"iroh::discovery::pkarr\",\"iroh::discovery::pkarr\"]Ad[5,\"iroh::endpoint\"]Bi[5,\"iroh_relay::quic\",\"iroh_relay::quic\"]Cd[5,\"iroh::net_report\",\"iroh::net_report::reportgen\"]Bm[5,\"iroh_relay::server\",\"iroh_relay::server\"]De[6,\"hickory_proto::rr::record_type\",\"hickory_proto::rr::record_type\"]4Ad[6,\"iroh::endpoint\"]Cb[15,\"iroh_relay::protos::relay::RelayToClientMsg\"]66Bh[10,\"serde_core::ser\",\"serde_core::ser\"]Ce[6,\"core::net::socket_addr\",\"core::net::socket_addr\"]Ah[2,\"iroh_relay::server\"]Bm[6,\"iroh_relay::server\",\"iroh_relay::server\"]Af[10,\"n0_error::error\"]Ba[5,\"http::status\",\"http::status\"]Ak[10,\"clap_builder::derive\"]Cj[10,\"iroh_quinn_proto::config\",\"iroh_quinn_proto::config\"]9Af[2,\"iroh_quinn_proto\"]Ad[2,\"iroh::endpoint\"]1A`[2,\"iroh_quinn\"]f[3,\"\"]00j[2,\"iroh\"]Ae[2,\"iroh::magicsock\"]10Ad[2,\"iroh::protocol\"]Be[6,\"iroh::protocol\",\"iroh::protocol\"]Be[5,\"iroh::protocol\",\"iroh::protocol\"]Am[15,\"iroh::endpoint::Source\"]Co[5,\"rustls::server::server_conn\",\"rustls::server::server_conn\"]Am[5,\"iroh_bench\",\"iroh_bench\"]Do[6,\"iroh_quinn_proto::connection::state\",\"iroh_quinn_proto::connection::state\"]Ad[5,\"iroh::endpoint\"]Bc[5,\"data_encoding\",\"data_encoding\"]Ae[10,\"serde_core::de\"]Bg[6,\"iroh_relay::dns\",\"iroh_relay::dns\"]o[5,\"iroh::dns\"]Bg[5,\"iroh_relay::dns\",\"iroh_relay::dns\"]Bd[15,\"iroh_relay::client::SendError\"]Bo[5,\"http::header::value\",\"http::header::value\"]Bi[15,\"iroh::discovery::pkarr::PkarrError\"]0Cc[5,\"iroh_dns_server::http\",\"iroh_dns_server::http\"]9Be[15,\"iroh_relay::server::CertConfig\"]Ae[2,\"iroh_relay::dns\"]8B`[15,\"iroh_relay::dns::DnsError\"]Bg[15,\"iroh_relay::client::ConnectError\"]Be[15,\"iroh_relay::server::SpawnError\"]Bk[5,\"iroh_relay\",\"iroh_relay::ping_tracker\"]Ae[10,\"iroh::endpoint\"]j[5,\"iroh\"]Bh[5,\"iroh_relay\",\"iroh_relay::relay_map\"]Bm[5,\"iroh_relay::server\",\"iroh_relay::server\"]7Bk[15,\"iroh::endpoint::ConnectWithOptsError\"]Cg[5,\"iroh_dns_server::config\",\"iroh_dns_server::config\"]Bd[15,\"iroh_relay::client::RecvError\"]Bd[15,\"iroh_relay::client::SendError\"]Bk[5,\"iroh_bench::stats\",\"iroh_bench::stats\"]B`[15,\"iroh::endpoint::AlpnError\"]Ci[5,\"ring::error::unspecified\",\"ring::error::unspecified\"]A`[2,\"iroh_quinn\"]0Bm[6,\"iroh_relay::server\",\"iroh_relay::server\"]Ce[5,\"rustls::crypto::signer\",\"rustls::crypto::signer\"]Co[5,\"rustls::client::client_conn\",\"rustls::client::client_conn\"]Bm[5,\"iroh_relay::client\",\"iroh_relay::client\"]Ad[5,\"iroh::endpoint\"]Ad[2,\"iroh::endpoint\"]Ah[2,\"iroh_relay::client\"]Cm[6,\"iroh_quinn_proto::endpoint\",\"iroh_quinn_proto::endpoint\"]Be[6,\"iroh::endpoint\",\"iroh::endpoint\"]Bm[6,\"iroh_relay::client\",\"iroh_relay::client\"]Ci[5,\"iroh_quinn_proto::shared\",\"iroh_quinn_proto::shared\"]Bf[10,\"serde_core::de\",\"serde_core::de\"]Co[5,\"iroh::discovery::pkarr::dht\",\"iroh::discovery::pkarr::dht\"]Am[5,\"n0_watcher\",\"n0_watcher\"]Ca[5,\"iroh::discovery::dns\",\"iroh::discovery::dns\"]Ci[5,\"iroh_base::endpoint_addr\",\"iroh_base::endpoint_addr\"]j[5,\"iroh\"]Bj[5,\"iroh_base\",\"iroh_base::endpoint_addr\"]Ae[5,\"iroh::discovery\"]Ck[5,\"iroh_relay::endpoint_info\",\"iroh_relay::endpoint_info\"]10Bb[10,\"core::iter::traits::collect\"]Am[10,\"iroh_metrics::iterable\"]D`[10,\"core::iter::traits::collect\",\"core::iter::traits::collect\"]Bg[15,\"iroh_relay::protos::relay::Error\"]Cg[5,\"iroh_quinn_proto::frame\",\"iroh_quinn_proto::frame\"]Bc[15,\"iroh_relay::dns::LookupError\"]Ai[10,\"iroh_metrics::base\"]D`[5,\"iroh::endpoint\",\"iroh::magicsock::remote_map::remote_state\"]Bd[15,\"iroh_relay::client::DialError\"]Ad[5,\"iroh::endpoint\"]Ac[5,\"iroh::metrics\"]Cf[5,\"iroh_relay::server\",\"iroh_relay::server::metrics\"]Cg[5,\"hickory_resolver::error\",\"hickory_resolver::error\"]Do[5,\"iroh_quinn_proto::connection::paths\",\"iroh_quinn_proto::connection::paths\"]Co[5,\"rustls::server::server_conn\",\"rustls::server::server_conn\"]5Bm[5,\"iroh_relay::server\",\"iroh_relay::server\"]Ca[5,\"pkarr::signed_packet\",\"pkarr::signed_packet\"]Ce[5,\"core::net::socket_addr\",\"core::net::socket_addr\"]0Ad[6,\"iroh::endpoint\"]A`[2,\"iroh_relay\"]Ba[2,\"iroh::magicsock::remote_map\"]Bm[5,\"iroh_relay::client\",\"iroh_relay::client\"]Ab[10,\"core::clone\"]Bb[15,\"iroh::discovery::ParseError\"]Ai[2,\"iroh::endpoint_info\"]Ao[2,\"iroh_relay::endpoint_info\"]Bl[15,\"iroh_relay::endpoint_info::ParseError\"]Ai[6,\"iroh::endpoint_info\"]Ck[6,\"iroh_relay::endpoint_info\",\"iroh_relay::endpoint_info\"]Bg[5,\"iroh::discovery\",\"iroh::discovery\"]5421Bm[10,\"iroh::endpoint\",\"iroh::endpoint::hooks\"]Aj[10,\"iroh::endpoint_info\"]Cl[10,\"iroh_relay::endpoint_info\",\"iroh_relay::endpoint_info\"]Bg[15,\"iroh_relay::protos::relay::Error\"]Bh[10,\"iroh::discovery\",\"iroh::discovery\"]Bi[15,\"iroh::endpoint_info::DecodingError\"]Bo[15,\"iroh_relay::endpoint_info::DecodingError\"]Cc[5,\"iroh::discovery::mdns\",\"iroh::discovery::mdns\"]Cg[5,\"iroh_dns_server::config\",\"iroh_dns_server::config\"]Ce[5,\"iroh::discovery::pkarr\",\"iroh::discovery::pkarr\"]Bi[6,\"rustls_pki_types\",\"rustls_pki_types\"]Bo[5,\"iroh::test_utils\",\"iroh::test_utils::qlog\"]Eo[6,\"iroh_quinn_proto::connection::streams::recv\",\"iroh_quinn_proto::connection::streams::recv\"]Be[5,\"iroh::protocol\",\"iroh::protocol\"]Bj[15,\"iroh_relay::server::SupervisorError\"]Ci[6,\"iroh_base::endpoint_addr\",\"iroh_base::endpoint_addr\"]j[6,\"iroh\"]Bj[6,\"iroh_base\",\"iroh_base::endpoint_addr\"]Bg[5,\"iroh_relay::dns\",\"iroh_relay::dns\"]Ca[15,\"iroh_relay::protos::common::FrameTypeError\"]Bk[15,\"iroh_relay::protos::handshake::Error\"]Ci[5,\"iroh_quinn_proto::coding\",\"iroh_quinn_proto::coding\"]Ca[6,\"iroh::endpoint\",\"iroh::endpoint::connection\"]o[2,\"iroh_base\"]j[2,\"iroh\"]A`[2,\"iroh_relay\"]Ak[2,\"iroh_dns_server::http\"]Bb[15,\"iroh::discovery::ParseError\"]Bl[15,\"iroh_relay::endpoint_info::ParseError\"]Bi[5,\"rustls_pki_types\",\"rustls_pki_types\"]Ak[10,\"clap_builder::derive\"]Be[5,\"iroh::endpoint\",\"iroh::endpoint\"]Ca[5,\"iroh::endpoint\",\"iroh::endpoint::connection\"]Bf[6,\"iroh::endpoint\",\"iroh::magicsock\"]Ae[2,\"iroh::discovery\"]Bg[6,\"iroh::discovery\",\"iroh::discovery\"]Ak[2,\"iroh::discovery::mdns\"]Cc[6,\"iroh::discovery::mdns\",\"iroh::discovery::mdns\"]D`[5,\"iroh::test_utils\",\"iroh::test_utils::dns_and_pkarr_servers\"]B`[2,\"iroh_relay::protos::common\"]Bk[15,\"iroh_relay::protos::handshake::Error\"]Bg[15,\"iroh_relay::protos::relay::Error\"]Cm[6,\"iroh_relay::protos::common\",\"iroh_relay::protos::common\"]77/// The minimum RTT difference to make it worth switching IP paths 78const RTT_SWITCHING_MIN_IP: Duration = Duration::from_millis(5); 79 -80/// The minimum RTT difference to make it worth switching relay paths -81const RTT_SWITCHING_MIN_RELAY: Duration = Duration::from_millis(3); +80/// How much do we prefer IPv6 over IPv4? +81const IPV6_RTT_ADVANTAGE: Duration = Duration::from_millis(3); 82 -83/// How much do we prefer IPv6 over IPv4? -84const IPV6_RTT_ADVANTAGE: Duration = Duration::from_millis(3); -85 -86/// A stream of events from all paths for all connections. -87/// -88/// The connection is identified using [`ConnId`]. The event `Err` variant happens when the -89/// actor has lagged processing the events, which is rather critical for us. -90type PathEvents = MergeUnbounded< -91 Pin< -92 Box<dyn Stream<Item = (ConnId, Result<PathEvent, BroadcastStreamRecvError>)> + Send + Sync>, -93 >, -94>; -95 -96/// A stream of events of announced NAT traversal candidate addresses for all connections. -97/// -98/// The connection is identified using [`ConnId`]. -99type AddrEvents = MergeUnbounded< -100 Pin< -101 Box< -102 dyn Stream<Item = (ConnId, Result<iroh_hp::Event, BroadcastStreamRecvError>)> -103 + Send -104 + Sync, -105 >, -106 >, -107>; -108 -109/// Either a stream of incoming results from [`ConcurrentDiscovery::resolve`] or infinitely pending. +83/// A stream of events from all paths for all connections. +84/// +85/// The connection is identified using [`ConnId`]. The event `Err` variant happens when the +86/// actor has lagged processing the events, which is rather critical for us. +87type PathEvents = MergeUnbounded< +88 Pin< +89 Box<dyn Stream<Item = (ConnId, Result<PathEvent, BroadcastStreamRecvError>)> + Send + Sync>, +90 >, +91>; +92 +93/// A stream of events of announced NAT traversal candidate addresses for all connections. +94/// +95/// The connection is identified using [`ConnId`]. +96type AddrEvents = MergeUnbounded< +97 Pin< +98 Box< +99 dyn Stream<Item = (ConnId, Result<iroh_hp::Event, BroadcastStreamRecvError>)> +100 + Send +101 + Sync, +102 >, +103 >, +104>; +105 +106/// Either a stream of incoming results from [`ConcurrentDiscovery::resolve`] or infinitely pending. +107/// +108/// Set to [`Either::Left`] with an always-pending stream while discovery is not running, and to +109/// [`Either::Right`] while discovery is running. 110/// -111/// Set to [`Either::Left`] with an always-pending stream while discovery is not running, and to -112/// [`Either::Right`] while discovery is running. -113/// -114/// The stream returned from [`ConcurrentDiscovery::resolve`] is `!Sync`. We use the (safe) [`SyncStream`] -115/// wrapper to make it `Sync` so that the [`RemoteStateActor::run`] future stays `Send`. -116type DiscoveryStream = Either< -117 n0_future::stream::Pending<Result<DiscoveryItem, DiscoveryError>>, -118 SyncStream<BoxStream<Result<DiscoveryItem, DiscoveryError>>>, -119>; +111/// The stream returned from [`ConcurrentDiscovery::resolve`] is `!Sync`. We use the (safe) [`SyncStream`] +112/// wrapper to make it `Sync` so that the [`RemoteStateActor::run`] future stays `Send`. +113type DiscoveryStream = Either< +114 n0_future::stream::Pending<Result<DiscoveryItem, DiscoveryError>>, +115 SyncStream<BoxStream<Result<DiscoveryItem, DiscoveryError>>>, +116>; +117 +118/// List of addrs and path ids for open paths in a connection. +119pub(crate) type PathAddrList = SmallVec<[(TransportAddr, PathId); 4]>; 120 -121/// List of addrs and path ids for open paths in a connection. -122pub(crate) type PathAddrList = SmallVec<[(TransportAddr, PathId); 4]>; -123 -124/// The state we need to know about a single remote endpoint. -125/// -126/// This actor manages all connections to the remote endpoint. It will trigger holepunching -127/// and select the best path etc. -128pub(super) struct RemoteStateActor { -129 /// The endpoint ID of the remote endpoint. -130 endpoint_id: EndpointId, -131 /// The endpoint ID of the local endpoint. -132 local_endpoint_id: EndpointId, -133 -134 // Hooks into the rest of the MagicSocket. -135 // -136 /// Metrics. -137 metrics: Arc<MagicsockMetrics>, -138 /// Our local addresses. -139 /// -140 /// These are our local addresses and any reflexive transport addresses. -141 local_direct_addrs: n0_watcher::Direct<BTreeSet<DirectAddr>>, -142 /// The mapping between endpoints via a relay and their [`RelayMappedAddr`]s. -143 relay_mapped_addrs: AddrMap<(RelayUrl, EndpointId), RelayMappedAddr>, -144 /// Discovery service, cloned from the magicsock. -145 discovery: ConcurrentDiscovery, -146 -147 // Internal state - Quinn Connections we are managing. -148 // -149 /// All connections we have to this remote endpoint. -150 connections: FxHashMap<ConnId, ConnectionState>, -151 /// Notifications when connections are closed. -152 connections_close: FuturesUnordered<OnClosed>, -153 /// Events emitted by Quinn about path changes, for all paths, all connections. -154 path_events: PathEvents, -155 /// A stream of events of announced NAT traversal candidate addresses for all connections. -156 addr_events: AddrEvents, -157 -158 // Internal state - Holepunching and path state. -159 // -160 /// All possible paths we are aware of. -161 /// -162 /// These paths might be entirely impossible to use, since they are added by discovery -163 /// mechanisms. The are only potentially usable. -164 paths: RemotePathState, -165 /// Information about the last holepunching attempt. -166 last_holepunch: Option<HolepunchAttempt>, -167 /// The path we currently consider the preferred path to the remote endpoint. -168 /// -169 /// **We expect this path to work.** If we become aware this path is broken then it is -170 /// set back to `None`. Having a selected path does not mean we may not be able to get -171 /// a better path: e.g. when the selected path is a relay path we still need to trigger -172 /// holepunching regularly. -173 /// -174 /// We only select a path once the path is functional in Quinn. -175 selected_path: Watchable<Option<transports::Addr>>, -176 /// Time at which we should schedule the next holepunch attempt. -177 scheduled_holepunch: Option<Instant>, -178 /// When to next attempt opening paths in [`Self::pending_open_paths`]. -179 scheduled_open_path: Option<Instant>, -180 /// Paths which we still need to open. -181 /// -182 /// They failed to open because we did not have enough CIDs issued by the remote. -183 pending_open_paths: VecDeque<transports::Addr>, -184 -185 // Internal state - Discovery -186 // -187 /// Stream of discovery results, or always pending if discovery is not running. -188 discovery_stream: DiscoveryStream, -189} -190 -191impl RemoteStateActor { -192 #[allow(clippy::too_many_arguments)] -193 pub(super) fn new( -194 endpoint_id: EndpointId, -195 local_endpoint_id: EndpointId, -196 local_direct_addrs: n0_watcher::Direct<BTreeSet<DirectAddr>>, -197 relay_mapped_addrs: AddrMap<(RelayUrl, EndpointId), RelayMappedAddr>, -198 metrics: Arc<MagicsockMetrics>, -199 discovery: ConcurrentDiscovery, -200 ) -> Self { -201 Self { -202 endpoint_id, -203 local_endpoint_id, -204 metrics: metrics.clone(), -205 local_direct_addrs, -206 relay_mapped_addrs, -207 discovery, -208 connections: FxHashMap::default(), -209 connections_close: Default::default(), -210 path_events: Default::default(), -211 addr_events: Default::default(), -212 paths: RemotePathState::new(metrics), -213 last_holepunch: None, -214 selected_path: Default::default(), -215 scheduled_holepunch: None, -216 scheduled_open_path: None, -217 pending_open_paths: VecDeque::new(), -218 discovery_stream: Either::Left(n0_future::stream::pending()), -219 } -220 } -221 -222 pub(super) fn start(self) -> RemoteStateHandle { -223 let (tx, rx) = guarded_channel(16); -224 let me = self.local_endpoint_id; -225 let endpoint_id = self.endpoint_id; -226 -227 // Ideally we'd use the endpoint span as parent. We'd have to plug that span into -228 // here somehow. Instead we have no parent and explicitly set the me attribute. If -229 // we don't explicitly set a span we get the spans from whatever call happens to -230 // first create the actor, which is often very confusing as it then keeps those -231 // spans for all logging of the actor. -232 let task = task::spawn(self.run(rx).instrument(info_span!( -233 parent: None, -234 "RemoteStateActor", -235 me = %me.fmt_short(), -236 remote = %endpoint_id.fmt_short(), -237 ))); -238 RemoteStateHandle { -239 sender: tx, -240 _task: AbortOnDropHandle::new(task), -241 } -242 } -243 -244 /// Runs the main loop of the actor. -245 /// -246 /// Note that the actor uses async handlers for tasks from the main loop. The actor is -247 /// not processing items from the inbox while waiting on any async calls. So some -248 /// discipline is needed to not turn pending for a long time. -249 async fn run(mut self, mut inbox: GuardedReceiver<RemoteStateMessage>) { -250 trace!("actor started"); -251 let idle_timeout = time::sleep(ACTOR_MAX_IDLE_TIMEOUT); -252 n0_future::pin!(idle_timeout); -253 loop { -254 let scheduled_path_open = match self.scheduled_open_path { -255 Some(when) => MaybeFuture::Some(time::sleep_until(when)), -256 None => MaybeFuture::None, -257 }; -258 n0_future::pin!(scheduled_path_open); -259 let scheduled_hp = match self.scheduled_holepunch { -260 Some(when) => MaybeFuture::Some(time::sleep_until(when)), -261 None => MaybeFuture::None, -262 }; -263 n0_future::pin!(scheduled_hp); -264 if !inbox.is_idle() || !self.connections.is_empty() { -265 idle_timeout -266 .as_mut() -267 .reset(Instant::now() + ACTOR_MAX_IDLE_TIMEOUT); -268 } -269 tokio::select! { -270 biased; -271 msg = inbox.recv() => { -272 match msg { -273 Some(msg) => self.handle_message(msg).await, -274 None => break, -275 } +121/// The state we need to know about a single remote endpoint. +122/// +123/// This actor manages all connections to the remote endpoint. It will trigger holepunching +124/// and select the best path etc. +125pub(super) struct RemoteStateActor { +126 /// The endpoint ID of the remote endpoint. +127 endpoint_id: EndpointId, +128 /// The endpoint ID of the local endpoint. +129 local_endpoint_id: EndpointId, +130 +131 // Hooks into the rest of the MagicSocket. +132 // +133 /// Metrics. +134 metrics: Arc<MagicsockMetrics>, +135 /// Our local addresses. +136 /// +137 /// These are our local addresses and any reflexive transport addresses. +138 local_direct_addrs: n0_watcher::Direct<BTreeSet<DirectAddr>>, +139 /// The mapping between endpoints via a relay and their [`RelayMappedAddr`]s. +140 relay_mapped_addrs: AddrMap<(RelayUrl, EndpointId), RelayMappedAddr>, +141 /// Discovery service, cloned from the magicsock. +142 discovery: ConcurrentDiscovery, +143 +144 // Internal state - Quinn Connections we are managing. +145 // +146 /// All connections we have to this remote endpoint. +147 connections: FxHashMap<ConnId, ConnectionState>, +148 /// Notifications when connections are closed. +149 connections_close: FuturesUnordered<OnClosed>, +150 /// Events emitted by Quinn about path changes, for all paths, all connections. +151 path_events: PathEvents, +152 /// A stream of events of announced NAT traversal candidate addresses for all connections. +153 addr_events: AddrEvents, +154 +155 // Internal state - Holepunching and path state. +156 // +157 /// All possible paths we are aware of. +158 /// +159 /// These paths might be entirely impossible to use, since they are added by discovery +160 /// mechanisms. The are only potentially usable. +161 paths: RemotePathState, +162 /// Information about the last holepunching attempt. +163 last_holepunch: Option<HolepunchAttempt>, +164 /// The path we currently consider the preferred path to the remote endpoint. +165 /// +166 /// **We expect this path to work.** If we become aware this path is broken then it is +167 /// set back to `None`. Having a selected path does not mean we may not be able to get +168 /// a better path: e.g. when the selected path is a relay path we still need to trigger +169 /// holepunching regularly. +170 /// +171 /// We only select a path once the path is functional in Quinn. +172 selected_path: Watchable<Option<transports::Addr>>, +173 /// Time at which we should schedule the next holepunch attempt. +174 scheduled_holepunch: Option<Instant>, +175 /// When to next attempt opening paths in [`Self::pending_open_paths`]. +176 scheduled_open_path: Option<Instant>, +177 /// Paths which we still need to open. +178 /// +179 /// They failed to open because we did not have enough CIDs issued by the remote. +180 pending_open_paths: VecDeque<transports::Addr>, +181 +182 // Internal state - Discovery +183 // +184 /// Stream of discovery results, or always pending if discovery is not running. +185 discovery_stream: DiscoveryStream, +186} +187 +188impl RemoteStateActor { +189 #[allow(clippy::too_many_arguments)] +190 pub(super) fn new( +191 endpoint_id: EndpointId, +192 local_endpoint_id: EndpointId, +193 local_direct_addrs: n0_watcher::Direct<BTreeSet<DirectAddr>>, +194 relay_mapped_addrs: AddrMap<(RelayUrl, EndpointId), RelayMappedAddr>, +195 metrics: Arc<MagicsockMetrics>, +196 discovery: ConcurrentDiscovery, +197 ) -> Self { +198 Self { +199 endpoint_id, +200 local_endpoint_id, +201 metrics: metrics.clone(), +202 local_direct_addrs, +203 relay_mapped_addrs, +204 discovery, +205 connections: FxHashMap::default(), +206 connections_close: Default::default(), +207 path_events: Default::default(), +208 addr_events: Default::default(), +209 paths: RemotePathState::new(metrics), +210 last_holepunch: None, +211 selected_path: Default::default(), +212 scheduled_holepunch: None, +213 scheduled_open_path: None, +214 pending_open_paths: VecDeque::new(), +215 discovery_stream: Either::Left(n0_future::stream::pending()), +216 } +217 } +218 +219 pub(super) fn start(self) -> RemoteStateHandle { +220 let (tx, rx) = guarded_channel(16); +221 let me = self.local_endpoint_id; +222 let endpoint_id = self.endpoint_id; +223 +224 // Ideally we'd use the endpoint span as parent. We'd have to plug that span into +225 // here somehow. Instead we have no parent and explicitly set the me attribute. If +226 // we don't explicitly set a span we get the spans from whatever call happens to +227 // first create the actor, which is often very confusing as it then keeps those +228 // spans for all logging of the actor. +229 let task = task::spawn(self.run(rx).instrument(info_span!( +230 parent: None, +231 "RemoteStateActor", +232 me = %me.fmt_short(), +233 remote = %endpoint_id.fmt_short(), +234 ))); +235 RemoteStateHandle { +236 sender: tx, +237 _task: AbortOnDropHandle::new(task), +238 } +239 } +240 +241 /// Runs the main loop of the actor. +242 /// +243 /// Note that the actor uses async handlers for tasks from the main loop. The actor is +244 /// not processing items from the inbox while waiting on any async calls. So some +245 /// discipline is needed to not turn pending for a long time. +246 async fn run(mut self, mut inbox: GuardedReceiver<RemoteStateMessage>) { +247 trace!("actor started"); +248 let idle_timeout = time::sleep(ACTOR_MAX_IDLE_TIMEOUT); +249 n0_future::pin!(idle_timeout); +250 loop { +251 let scheduled_path_open = match self.scheduled_open_path { +252 Some(when) => MaybeFuture::Some(time::sleep_until(when)), +253 None => MaybeFuture::None, +254 }; +255 n0_future::pin!(scheduled_path_open); +256 let scheduled_hp = match self.scheduled_holepunch { +257 Some(when) => MaybeFuture::Some(time::sleep_until(when)), +258 None => MaybeFuture::None, +259 }; +260 n0_future::pin!(scheduled_hp); +261 if !inbox.is_idle() || !self.connections.is_empty() { +262 idle_timeout +263 .as_mut() +264 .reset(Instant::now() + ACTOR_MAX_IDLE_TIMEOUT); +265 } +266 tokio::select! { +267 biased; +268 msg = inbox.recv() => { +269 match msg { +270 Some(msg) => self.handle_message(msg).await, +271 None => break, +272 } +273 } +274 Some((id, evt)) = self.path_events.next() => { +275 self.handle_path_event(id, evt); 276 } -277 Some((id, evt)) = self.path_events.next() => { -278 self.handle_path_event(id, evt); -279 } -280 Some((id, evt)) = self.addr_events.next() => { -281 trace!(?id, ?evt, "remote addrs updated, triggering holepunching"); -282 self.trigger_holepunching().await; +277 Some((id, evt)) = self.addr_events.next() => { +278 trace!(?id, ?evt, "remote addrs updated, triggering holepunching"); +279 self.trigger_holepunching().await; +280 } +281 Some(conn_id) = self.connections_close.next(), if !self.connections_close.is_empty() => { +282 self.handle_connection_close(conn_id); 283 } -284 Some(conn_id) = self.connections_close.next(), if !self.connections_close.is_empty() => { -285 self.handle_connection_close(conn_id); -286 } -287 res = self.local_direct_addrs.updated() => { -288 if let Err(n0_watcher::Disconnected) = res { -289 trace!("direct address watcher disconnected, shutting down"); -290 break; -291 } -292 self.local_addrs_updated(); -293 trace!("local addrs updated, triggering holepunching"); -294 self.trigger_holepunching().await; -295 } -296 _ = &mut scheduled_path_open => { -297 trace!("triggering scheduled path_open"); -298 self.scheduled_open_path = None; -299 let mut addrs = std::mem::take(&mut self.pending_open_paths); -300 while let Some(addr) = addrs.pop_front() { -301 self.open_path(&addr); -302 } -303 } -304 _ = &mut scheduled_hp => { -305 trace!("triggering scheduled holepunching"); -306 self.scheduled_holepunch = None; -307 self.trigger_holepunching().await; +284 res = self.local_direct_addrs.updated() => { +285 if let Err(n0_watcher::Disconnected) = res { +286 trace!("direct address watcher disconnected, shutting down"); +287 break; +288 } +289 self.local_addrs_updated(); +290 trace!("local addrs updated, triggering holepunching"); +291 self.trigger_holepunching().await; +292 } +293 _ = &mut scheduled_path_open => { +294 trace!("triggering scheduled path_open"); +295 self.scheduled_open_path = None; +296 let mut addrs = std::mem::take(&mut self.pending_open_paths); +297 while let Some(addr) = addrs.pop_front() { +298 self.open_path(&addr); +299 } +300 } +301 _ = &mut scheduled_hp => { +302 trace!("triggering scheduled holepunching"); +303 self.scheduled_holepunch = None; +304 self.trigger_holepunching().await; +305 } +306 item = self.discovery_stream.next() => { +307 self.handle_discovery_item(item); 308 } -309 item = self.discovery_stream.next() => { -310 self.handle_discovery_item(item); -311 } -312 _ = &mut idle_timeout => { -313 if self.connections.is_empty() && inbox.close_if_idle() { -314 trace!("idle timeout expired and still idle: terminate actor"); -315 break; -316 } else { -317 // Seems like we weren't really idle, so we reset -318 idle_timeout.as_mut().reset(Instant::now() + ACTOR_MAX_IDLE_TIMEOUT); -319 } -320 } -321 } -322 } -323 trace!("actor terminating"); -324 } -325 -326 /// Handles an actor message. -327 /// -328 /// Error returns are fatal and kill the actor. -329 #[instrument(skip(self))] -330 async fn handle_message(&mut self, msg: RemoteStateMessage) { -331 // trace!("handling message"); -332 match msg { -333 RemoteStateMessage::SendDatagram(sender, transmit) => { -334 self.handle_msg_send_datagram(sender, transmit).await; +309 _ = &mut idle_timeout => { +310 if self.connections.is_empty() && inbox.close_if_idle() { +311 trace!("idle timeout expired and still idle: terminate actor"); +312 break; +313 } else { +314 // Seems like we weren't really idle, so we reset +315 idle_timeout.as_mut().reset(Instant::now() + ACTOR_MAX_IDLE_TIMEOUT); +316 } +317 } +318 } +319 } +320 trace!("actor terminating"); +321 } +322 +323 /// Handles an actor message. +324 /// +325 /// Error returns are fatal and kill the actor. +326 #[instrument(skip(self))] +327 async fn handle_message(&mut self, msg: RemoteStateMessage) { +328 // trace!("handling message"); +329 match msg { +330 RemoteStateMessage::SendDatagram(sender, transmit) => { +331 self.handle_msg_send_datagram(sender, transmit).await; +332 } +333 RemoteStateMessage::AddConnection(handle, tx) => { +334 self.handle_msg_add_connection(handle, tx).await; 335 } -336 RemoteStateMessage::AddConnection(handle, tx) => { -337 self.handle_msg_add_connection(handle, tx).await; +336 RemoteStateMessage::ResolveRemote(addrs, tx) => { +337 self.handle_msg_resolve_remote(addrs, tx); 338 } -339 RemoteStateMessage::ResolveRemote(addrs, tx) => { -340 self.handle_msg_resolve_remote(addrs, tx); -341 } -342 } -343 } -344 -345 /// Handles [`RemoteStateMessage::SendDatagram`]. -346 async fn handle_msg_send_datagram( -347 &mut self, -348 mut sender: TransportsSender, -349 transmit: OwnedTransmit, -350 ) { -351 // Sending datagrams might fail, e.g. because we don't have the right transports set -352 // up to handle sending this owned transmit to. -353 // After all, we try every single path that we know (relay URL, IP address), even -354 // though we might not have a relay transport or ip-capable transport set up. -355 // So these errors must not be fatal for this actor (or even this operation). +339 } +340 } +341 +342 /// Handles [`RemoteStateMessage::SendDatagram`]. +343 async fn handle_msg_send_datagram( +344 &mut self, +345 mut sender: TransportsSender, +346 transmit: OwnedTransmit, +347 ) { +348 // Sending datagrams might fail, e.g. because we don't have the right transports set +349 // up to handle sending this owned transmit to. +350 // After all, we try every single path that we know (relay URL, IP address), even +351 // though we might not have a relay transport or ip-capable transport set up. +352 // So these errors must not be fatal for this actor (or even this operation). +353 +354 if let Some(addr) = self.selected_path.get() { +355 trace!(?addr, "sending datagram to selected path"); 356 -357 if let Some(addr) = self.selected_path.get() { -358 trace!(?addr, "sending datagram to selected path"); -359 -360 if let Err(err) = send_datagram(&mut sender, addr.clone(), transmit).await { -361 debug!(?addr, "failed to send datagram on selected_path: {err:#}"); -362 } -363 } else { -364 trace!( -365 paths = ?self.paths.addrs().collect::<Vec<_>>(), -366 "sending datagram to all known paths", -367 ); -368 if self.paths.is_empty() { -369 warn!("Cannot send datagrams: No paths to remote endpoint known"); -370 } -371 -372 for addr in self.paths.addrs() { -373 // We never want to send to our local addresses. -374 // The local address set is updated in the main loop so we can use `peek` here. -375 if let transports::Addr::Ip(sockaddr) = addr -376 && self -377 .local_direct_addrs -378 .peek() -379 .iter() -380 .any(|a| a.addr == *sockaddr) -381 { -382 trace!(%sockaddr, "not sending datagram to our own address"); -383 } else if let Err(err) = -384 send_datagram(&mut sender, addr.clone(), transmit.clone()).await -385 { -386 debug!(?addr, "failed to send datagram: {err:#}"); -387 } -388 } -389 // This message is received *before* a connection is added. So we do -390 // not yet have a connection to holepunch. Instead we trigger -391 // holepunching when AddConnection is received. -392 } -393 } -394 -395 /// Handles [`RemoteStateMessage::AddConnection`]. -396 /// -397 /// Error returns are fatal and kill the actor. -398 async fn handle_msg_add_connection( -399 &mut self, -400 handle: WeakConnectionHandle, -401 tx: oneshot::Sender<PathsWatcher>, -402 ) { -403 let pub_open_paths = Watchable::default(); -404 if let Some(conn) = handle.upgrade() { -405 self.metrics.num_conns_opened.inc(); -406 // Remove any conflicting stable_ids from the local state. -407 let conn_id = ConnId(conn.stable_id()); -408 self.connections.remove(&conn_id); -409 -410 // Hook up paths, NAT addresses and connection closed event streams. -411 self.path_events.push(Box::pin( -412 BroadcastStream::new(conn.path_events()).map(move |evt| (conn_id, evt)), +357 if let Err(err) = send_datagram(&mut sender, addr.clone(), transmit).await { +358 debug!(?addr, "failed to send datagram on selected_path: {err:#}"); +359 } +360 } else { +361 trace!( +362 paths = ?self.paths.addrs().collect::<Vec<_>>(), +363 "sending datagram to all known paths", +364 ); +365 if self.paths.is_empty() { +366 warn!("Cannot send datagrams: No paths to remote endpoint known"); +367 } +368 +369 for addr in self.paths.addrs() { +370 // We never want to send to our local addresses. +371 // The local address set is updated in the main loop so we can use `peek` here. +372 if let transports::Addr::Ip(sockaddr) = addr +373 && self +374 .local_direct_addrs +375 .peek() +376 .iter() +377 .any(|a| a.addr == *sockaddr) +378 { +379 trace!(%sockaddr, "not sending datagram to our own address"); +380 } else if let Err(err) = +381 send_datagram(&mut sender, addr.clone(), transmit.clone()).await +382 { +383 debug!(?addr, "failed to send datagram: {err:#}"); +384 } +385 } +386 // This message is received *before* a connection is added. So we do +387 // not yet have a connection to holepunch. Instead we trigger +388 // holepunching when AddConnection is received. +389 } +390 } +391 +392 /// Handles [`RemoteStateMessage::AddConnection`]. +393 /// +394 /// Error returns are fatal and kill the actor. +395 async fn handle_msg_add_connection( +396 &mut self, +397 handle: WeakConnectionHandle, +398 tx: oneshot::Sender<PathsWatcher>, +399 ) { +400 let pub_open_paths = Watchable::default(); +401 if let Some(conn) = handle.upgrade() { +402 self.metrics.num_conns_opened.inc(); +403 // Remove any conflicting stable_ids from the local state. +404 let conn_id = ConnId(conn.stable_id()); +405 self.connections.remove(&conn_id); +406 +407 // Hook up paths, NAT addresses and connection closed event streams. +408 self.path_events.push(Box::pin( +409 BroadcastStream::new(conn.path_events()).map(move |evt| (conn_id, evt)), +410 )); +411 self.addr_events.push(Box::pin( +412 BroadcastStream::new(conn.nat_traversal_updates()).map(move |evt| (conn_id, evt)), 413 )); -414 self.addr_events.push(Box::pin( -415 BroadcastStream::new(conn.nat_traversal_updates()).map(move |evt| (conn_id, evt)), -416 )); -417 self.connections_close.push(OnClosed::new(&conn)); -418 -419 // Add local addrs to the connection -420 let local_addrs = self -421 .local_direct_addrs -422 .get() -423 .iter() -424 .map(|d| d.addr) -425 .collect::<BTreeSet<_>>(); -426 Self::set_local_addrs(&conn, &local_addrs); -427 -428 // Store the connection -429 let conn_state = self -430 .connections -431 .entry(conn_id) -432 .insert_entry(ConnectionState { -433 handle: handle.clone(), -434 pub_open_paths: pub_open_paths.clone(), -435 paths: Default::default(), -436 open_paths: Default::default(), -437 path_ids: Default::default(), -438 }) -439 .into_mut(); -440 -441 // Store PathId(0), set path_status and select best path, check if holepunching -442 // is needed. -443 if let Some(path) = conn.path(PathId::ZERO) -444 && let Ok(socketaddr) = path.remote_address() -445 && let Some(path_remote) = self.relay_mapped_addrs.to_transport_addr(socketaddr) -446 { -447 trace!(?path_remote, "added new connection"); -448 let path_remote_is_ip = path_remote.is_ip(); -449 let status = match path_remote { -450 transports::Addr::Ip(_) => PathStatus::Available, -451 transports::Addr::Relay(_, _) => PathStatus::Backup, -452 }; -453 path.set_status(status).ok(); -454 conn_state.add_open_path(path_remote.clone(), PathId::ZERO); -455 self.paths -456 .insert_open_path(path_remote.clone(), Source::Connection { _0: Private }); -457 self.select_path(); -458 -459 if path_remote_is_ip { -460 // We may have raced this with a relay address. Try and add any -461 // relay addresses we have back. -462 let relays = self -463 .paths -464 .addrs() -465 .filter(|a| a.is_relay()) -466 .cloned() -467 .collect::<Vec<_>>(); -468 for remote in relays { -469 self.open_path(&remote); -470 } -471 } -472 } -473 self.trigger_holepunching().await; -474 } -475 tx.send(PathsWatcher::new( -476 pub_open_paths.watch(), -477 self.selected_path.watch(), -478 handle, -479 )) -480 .ok(); -481 } -482 -483 /// Handles [`RemoteStateMessage::ResolveRemote`]. -484 fn handle_msg_resolve_remote( -485 &mut self, -486 addrs: BTreeSet<TransportAddr>, -487 tx: oneshot::Sender<Result<(), DiscoveryError>>, -488 ) { -489 let addrs = to_transports_addr(self.endpoint_id, addrs); -490 self.paths.insert_multiple(addrs, Source::App); -491 self.paths.resolve_remote(tx); -492 // Start discovery if we have no selected path. -493 self.trigger_discovery(); -494 } -495 -496 fn handle_connection_close(&mut self, conn_id: ConnId) { -497 if self.connections.remove(&conn_id).is_some() { -498 self.metrics.num_conns_closed.inc(); -499 } -500 if self.connections.is_empty() { -501 trace!("last connection closed - clearing selected_path"); -502 self.selected_path.set(None).ok(); -503 } -504 } -505 -506 fn handle_discovery_item(&mut self, item: Option<Result<DiscoveryItem, DiscoveryError>>) { -507 match item { -508 None => { -509 self.discovery_stream = Either::Left(n0_future::stream::pending()); -510 self.paths.discovery_finished(Ok(())); -511 } -512 Some(Err(err)) => { -513 warn!("Discovery failed: {err:#}"); -514 self.discovery_stream = Either::Left(n0_future::stream::pending()); -515 self.paths.discovery_finished(Err(err)); -516 } -517 Some(Ok(item)) => { -518 if item.endpoint_id() != self.endpoint_id { -519 warn!(?item, "Discovery emitted item for wrong remote endpoint"); -520 } else { -521 let source = Source::Discovery { -522 name: item.provenance().to_string(), -523 }; -524 let addrs = -525 to_transports_addr(self.endpoint_id, item.into_endpoint_addr().addrs); -526 self.paths.insert_multiple(addrs, source); -527 } -528 } -529 } -530 } -531 -532 /// Triggers discovery for the remote endpoint, if needed. -533 /// -534 /// Does not start discovery if we have a selected path or if discovery is currently running. -535 fn trigger_discovery(&mut self) { -536 if self.selected_path.get().is_some() || matches!(self.discovery_stream, Either::Right(_)) { -537 return; -538 } -539 match self.discovery.resolve(self.endpoint_id) { -540 Some(stream) => self.discovery_stream = Either::Right(SyncStream::new(stream)), -541 None => self.paths.discovery_finished(Ok(())), -542 } -543 } -544 -545 /// Sets the current local addresses to QNT's state to all connections -546 fn local_addrs_updated(&mut self) { -547 let local_addrs = self -548 .local_direct_addrs -549 .get() -550 .iter() -551 .map(|d| d.addr) -552 .collect::<BTreeSet<_>>(); -553 -554 for conn in self.connections.values().filter_map(|s| s.handle.upgrade()) { -555 Self::set_local_addrs(&conn, &local_addrs); -556 } -557 // todo: trace -558 } -559 -560 /// Sets the current local addresses to QNT's state -561 fn set_local_addrs(conn: &quinn::Connection, local_addrs: &BTreeSet<SocketAddr>) { -562 let quinn_local_addrs = match conn.get_local_nat_traversal_addresses() { -563 Ok(addrs) => BTreeSet::from_iter(addrs), -564 Err(err) => { -565 warn!("failed to get local nat candidates: {err:#}"); -566 return; -567 } -568 }; -569 for addr in local_addrs.difference(&quinn_local_addrs) { -570 if let Err(err) = conn.add_nat_traversal_address(*addr) { -571 warn!("failed adding local addr: {err:#}",); -572 } -573 } -574 for addr in quinn_local_addrs.difference(local_addrs) { -575 if let Err(err) = conn.remove_nat_traversal_address(*addr) { -576 warn!("failed removing local addr: {err:#}"); -577 } -578 } -579 trace!(?local_addrs, "updated local QNT addresses"); -580 } -581 -582 /// Triggers holepunching to the remote endpoint. -583 /// -584 /// This will manage the entire process of holepunching with the remote endpoint. -585 /// -586 /// - Holepunching happens on the Connection with the lowest [`ConnId`] which is a -587 /// client. -588 /// - Both endpoints may initiate holepunching if both have a client connection. -589 /// - Any opened paths are opened on all other connections without holepunching. -590 /// - If there are no changes in local or remote candidate addresses since the -591 /// last attempt **and** there was a recent attempt, a trigger_holepunching call -592 /// will be scheduled instead. -593 async fn trigger_holepunching(&mut self) { -594 if self.connections.is_empty() { -595 trace!("not holepunching: no connections"); -596 return; -597 } -598 -599 let Some(conn) = self -600 .connections -601 .iter() -602 .filter_map(|(id, state)| state.handle.upgrade().map(|conn| (*id, conn))) -603 .filter(|(_, conn)| conn.side().is_client()) -604 .min_by_key(|(id, _)| *id) -605 .map(|(_, conn)| conn) -606 else { -607 trace!("not holepunching: no client connection"); -608 return; -609 }; -610 let remote_candidates = match conn.get_remote_nat_traversal_addresses() { -611 Ok(addrs) => BTreeSet::from_iter(addrs), -612 Err(err) => { -613 warn!("failed to get nat candidate addresses: {err:#}"); -614 return; -615 } -616 }; -617 let local_candidates: BTreeSet<SocketAddr> = self -618 .local_direct_addrs -619 .get() -620 .iter() -621 .map(|daddr| daddr.addr) -622 .collect(); -623 let new_candidates = self -624 .last_holepunch -625 .as_ref() -626 .map(|last_hp| { -627 // Addrs are allowed to disappear, but if there are new ones we need to -628 // holepunch again. -629 trace!( -630 ?last_hp, -631 ?local_candidates, -632 ?remote_candidates, -633 "candidates to holepunch?" -634 ); -635 !remote_candidates.is_subset(&last_hp.remote_candidates) -636 || !local_candidates.is_subset(&last_hp.local_candidates) -637 }) -638 .unwrap_or(true); -639 if !new_candidates { -640 if let Some(ref last_hp) = self.last_holepunch { -641 let next_hp = last_hp.when + HOLEPUNCH_ATTEMPTS_INTERVAL; -642 let now = Instant::now(); -643 if next_hp > now { -644 trace!(scheduled_in = ?(next_hp - now), "not holepunching: no new addresses"); -645 self.scheduled_holepunch = Some(next_hp); -646 return; -647 } -648 } -649 } +414 self.connections_close.push(OnClosed::new(&conn)); +415 +416 // Add local addrs to the connection +417 let local_addrs = self +418 .local_direct_addrs +419 .get() +420 .iter() +421 .map(|d| d.addr) +422 .collect::<BTreeSet<_>>(); +423 Self::set_local_addrs(&conn, &local_addrs); +424 +425 // Store the connection +426 let conn_state = self +427 .connections +428 .entry(conn_id) +429 .insert_entry(ConnectionState { +430 handle: handle.clone(), +431 pub_open_paths: pub_open_paths.clone(), +432 paths: Default::default(), +433 open_paths: Default::default(), +434 path_ids: Default::default(), +435 }) +436 .into_mut(); +437 +438 // Store PathId(0), set path_status and select best path, check if holepunching +439 // is needed. +440 if let Some(path) = conn.path(PathId::ZERO) +441 && let Ok(socketaddr) = path.remote_address() +442 && let Some(path_remote) = self.relay_mapped_addrs.to_transport_addr(socketaddr) +443 { +444 trace!(?path_remote, "added new connection"); +445 let path_remote_is_ip = path_remote.is_ip(); +446 let status = match path_remote { +447 transports::Addr::Ip(_) => PathStatus::Available, +448 transports::Addr::Relay(_, _) => PathStatus::Backup, +449 }; +450 path.set_status(status).ok(); +451 conn_state.add_open_path(path_remote.clone(), PathId::ZERO); +452 self.paths +453 .insert_open_path(path_remote.clone(), Source::Connection { _0: Private }); +454 self.select_path(); +455 +456 if path_remote_is_ip { +457 // We may have raced this with a relay address. Try and add any +458 // relay addresses we have back. +459 let relays = self +460 .paths +461 .addrs() +462 .filter(|a| a.is_relay()) +463 .cloned() +464 .collect::<Vec<_>>(); +465 for remote in relays { +466 self.open_path(&remote); +467 } +468 } +469 } +470 self.trigger_holepunching().await; +471 } +472 tx.send(PathsWatcher::new( +473 pub_open_paths.watch(), +474 self.selected_path.watch(), +475 handle, +476 )) +477 .ok(); +478 } +479 +480 /// Handles [`RemoteStateMessage::ResolveRemote`]. +481 fn handle_msg_resolve_remote( +482 &mut self, +483 addrs: BTreeSet<TransportAddr>, +484 tx: oneshot::Sender<Result<(), DiscoveryError>>, +485 ) { +486 let addrs = to_transports_addr(self.endpoint_id, addrs); +487 self.paths.insert_multiple(addrs, Source::App); +488 self.paths.resolve_remote(tx); +489 // Start discovery if we have no selected path. +490 self.trigger_discovery(); +491 } +492 +493 fn handle_connection_close(&mut self, conn_id: ConnId) { +494 if self.connections.remove(&conn_id).is_some() { +495 self.metrics.num_conns_closed.inc(); +496 } +497 if self.connections.is_empty() { +498 trace!("last connection closed - clearing selected_path"); +499 self.selected_path.set(None).ok(); +500 } +501 } +502 +503 fn handle_discovery_item(&mut self, item: Option<Result<DiscoveryItem, DiscoveryError>>) { +504 match item { +505 None => { +506 self.discovery_stream = Either::Left(n0_future::stream::pending()); +507 self.paths.discovery_finished(Ok(())); +508 } +509 Some(Err(err)) => { +510 warn!("Discovery failed: {err:#}"); +511 self.discovery_stream = Either::Left(n0_future::stream::pending()); +512 self.paths.discovery_finished(Err(err)); +513 } +514 Some(Ok(item)) => { +515 if item.endpoint_id() != self.endpoint_id { +516 warn!(?item, "Discovery emitted item for wrong remote endpoint"); +517 } else { +518 let source = Source::Discovery { +519 name: item.provenance().to_string(), +520 }; +521 let addrs = +522 to_transports_addr(self.endpoint_id, item.into_endpoint_addr().addrs); +523 self.paths.insert_multiple(addrs, source); +524 } +525 } +526 } +527 } +528 +529 /// Triggers discovery for the remote endpoint, if needed. +530 /// +531 /// Does not start discovery if we have a selected path or if discovery is currently running. +532 fn trigger_discovery(&mut self) { +533 if self.selected_path.get().is_some() || matches!(self.discovery_stream, Either::Right(_)) { +534 return; +535 } +536 match self.discovery.resolve(self.endpoint_id) { +537 Some(stream) => self.discovery_stream = Either::Right(SyncStream::new(stream)), +538 None => self.paths.discovery_finished(Ok(())), +539 } +540 } +541 +542 /// Sets the current local addresses to QNT's state to all connections +543 fn local_addrs_updated(&mut self) { +544 let local_addrs = self +545 .local_direct_addrs +546 .get() +547 .iter() +548 .map(|d| d.addr) +549 .collect::<BTreeSet<_>>(); +550 +551 for conn in self.connections.values().filter_map(|s| s.handle.upgrade()) { +552 Self::set_local_addrs(&conn, &local_addrs); +553 } +554 // todo: trace +555 } +556 +557 /// Sets the current local addresses to QNT's state +558 fn set_local_addrs(conn: &quinn::Connection, local_addrs: &BTreeSet<SocketAddr>) { +559 let quinn_local_addrs = match conn.get_local_nat_traversal_addresses() { +560 Ok(addrs) => BTreeSet::from_iter(addrs), +561 Err(err) => { +562 warn!("failed to get local nat candidates: {err:#}"); +563 return; +564 } +565 }; +566 for addr in local_addrs.difference(&quinn_local_addrs) { +567 if let Err(err) = conn.add_nat_traversal_address(*addr) { +568 warn!("failed adding local addr: {err:#}",); +569 } +570 } +571 for addr in quinn_local_addrs.difference(local_addrs) { +572 if let Err(err) = conn.remove_nat_traversal_address(*addr) { +573 warn!("failed removing local addr: {err:#}"); +574 } +575 } +576 trace!(?local_addrs, "updated local QNT addresses"); +577 } +578 +579 /// Triggers holepunching to the remote endpoint. +580 /// +581 /// This will manage the entire process of holepunching with the remote endpoint. +582 /// +583 /// - Holepunching happens on the Connection with the lowest [`ConnId`] which is a +584 /// client. +585 /// - Both endpoints may initiate holepunching if both have a client connection. +586 /// - Any opened paths are opened on all other connections without holepunching. +587 /// - If there are no changes in local or remote candidate addresses since the +588 /// last attempt **and** there was a recent attempt, a trigger_holepunching call +589 /// will be scheduled instead. +590 async fn trigger_holepunching(&mut self) { +591 if self.connections.is_empty() { +592 trace!("not holepunching: no connections"); +593 return; +594 } +595 +596 let Some(conn) = self +597 .connections +598 .iter() +599 .filter_map(|(id, state)| state.handle.upgrade().map(|conn| (*id, conn))) +600 .filter(|(_, conn)| conn.side().is_client()) +601 .min_by_key(|(id, _)| *id) +602 .map(|(_, conn)| conn) +603 else { +604 trace!("not holepunching: no client connection"); +605 return; +606 }; +607 let remote_candidates = match conn.get_remote_nat_traversal_addresses() { +608 Ok(addrs) => BTreeSet::from_iter(addrs), +609 Err(err) => { +610 warn!("failed to get nat candidate addresses: {err:#}"); +611 return; +612 } +613 }; +614 let local_candidates: BTreeSet<SocketAddr> = self +615 .local_direct_addrs +616 .get() +617 .iter() +618 .map(|daddr| daddr.addr) +619 .collect(); +620 let new_candidates = self +621 .last_holepunch +622 .as_ref() +623 .map(|last_hp| { +624 // Addrs are allowed to disappear, but if there are new ones we need to +625 // holepunch again. +626 trace!( +627 ?last_hp, +628 ?local_candidates, +629 ?remote_candidates, +630 "candidates to holepunch?" +631 ); +632 !remote_candidates.is_subset(&last_hp.remote_candidates) +633 || !local_candidates.is_subset(&last_hp.local_candidates) +634 }) +635 .unwrap_or(true); +636 if !new_candidates { +637 if let Some(ref last_hp) = self.last_holepunch { +638 let next_hp = last_hp.when + HOLEPUNCH_ATTEMPTS_INTERVAL; +639 let now = Instant::now(); +640 if next_hp > now { +641 trace!(scheduled_in = ?(next_hp - now), "not holepunching: no new addresses"); +642 self.scheduled_holepunch = Some(next_hp); +643 return; +644 } +645 } +646 } +647 +648 self.do_holepunching(conn).await; +649 } 650 -651 self.do_holepunching(conn).await; -652 } -653 -654 /// Unconditionally perform holepunching. -655 #[instrument(skip_all)] -656 async fn do_holepunching(&mut self, conn: quinn::Connection) { -657 self.metrics.nat_traversal.inc(); -658 let local_candidates = self -659 .local_direct_addrs -660 .get() -661 .iter() -662 .map(|daddr| daddr.addr) -663 .collect::<BTreeSet<_>>(); -664 match conn.initiate_nat_traversal_round() { -665 Ok(remote_candidates) => { -666 let remote_candidates = remote_candidates -667 .iter() -668 .map(|addr| SocketAddr::new(addr.ip().to_canonical(), addr.port())) -669 .collect(); -670 event!( -671 target: "iroh::_events::qnt::init", -672 Level::DEBUG, -673 remote = %self.endpoint_id.fmt_short(), -674 ?local_candidates, -675 ?remote_candidates, -676 ); -677 self.last_holepunch = Some(HolepunchAttempt { -678 when: Instant::now(), -679 local_candidates, -680 remote_candidates, -681 }); +651 /// Unconditionally perform holepunching. +652 #[instrument(skip_all)] +653 async fn do_holepunching(&mut self, conn: quinn::Connection) { +654 self.metrics.nat_traversal.inc(); +655 let local_candidates = self +656 .local_direct_addrs +657 .get() +658 .iter() +659 .map(|daddr| daddr.addr) +660 .collect::<BTreeSet<_>>(); +661 match conn.initiate_nat_traversal_round() { +662 Ok(remote_candidates) => { +663 let remote_candidates = remote_candidates +664 .iter() +665 .map(|addr| SocketAddr::new(addr.ip().to_canonical(), addr.port())) +666 .collect(); +667 event!( +668 target: "iroh::_events::qnt::init", +669 Level::DEBUG, +670 remote = %self.endpoint_id.fmt_short(), +671 ?local_candidates, +672 ?remote_candidates, +673 ); +674 self.last_holepunch = Some(HolepunchAttempt { +675 when: Instant::now(), +676 local_candidates, +677 remote_candidates, +678 }); +679 } +680 Err(err) => { +681 warn!("failed to initiate NAT traversal: {err:#}"); 682 } -683 Err(err) => { -684 warn!("failed to initiate NAT traversal: {err:#}"); -685 } -686 } -687 } -688 -689 /// Open the path on all connections. -690 /// -691 /// This goes through all the connections for which we are the client, and makes sure -692 /// the path exists, or opens it. -693 #[instrument(level = "warn", skip(self))] -694 fn open_path(&mut self, open_addr: &transports::Addr) { -695 let path_status = match open_addr { -696 transports::Addr::Ip(_) => PathStatus::Available, -697 transports::Addr::Relay(_, _) => PathStatus::Backup, -698 }; -699 let quic_addr = match &open_addr { -700 transports::Addr::Ip(socket_addr) => *socket_addr, -701 transports::Addr::Relay(relay_url, eid) => self -702 .relay_mapped_addrs -703 .get(&(relay_url.clone(), *eid)) -704 .private_socket_addr(), -705 }; -706 -707 for (conn_id, conn_state) in self.connections.iter_mut() { -708 if conn_state.path_ids.contains_key(open_addr) { +683 } +684 } +685 +686 /// Open the path on all connections. +687 /// +688 /// This goes through all the connections for which we are the client, and makes sure +689 /// the path exists, or opens it. +690 #[instrument(level = "warn", skip(self))] +691 fn open_path(&mut self, open_addr: &transports::Addr) { +692 let path_status = match open_addr { +693 transports::Addr::Ip(_) => PathStatus::Available, +694 transports::Addr::Relay(_, _) => PathStatus::Backup, +695 }; +696 let quic_addr = match &open_addr { +697 transports::Addr::Ip(socket_addr) => *socket_addr, +698 transports::Addr::Relay(relay_url, eid) => self +699 .relay_mapped_addrs +700 .get(&(relay_url.clone(), *eid)) +701 .private_socket_addr(), +702 }; +703 +704 for (conn_id, conn_state) in self.connections.iter_mut() { +705 if conn_state.path_ids.contains_key(open_addr) { +706 continue; +707 } +708 let Some(conn) = conn_state.handle.upgrade() else { 709 continue; -710 } -711 let Some(conn) = conn_state.handle.upgrade() else { +710 }; +711 if conn.side().is_server() { 712 continue; -713 }; -714 if conn.side().is_server() { -715 continue; -716 } -717 let fut = conn.open_path_ensure(quic_addr, path_status); -718 match fut.path_id() { -719 Some(path_id) => { -720 trace!(?conn_id, ?path_id, "opening new path"); -721 conn_state.add_path(open_addr.clone(), path_id); -722 } -723 None => { -724 let ret = now_or_never(fut); -725 match ret { -726 Some(Err(PathError::RemoteCidsExhausted)) => { -727 self.scheduled_open_path = -728 Some(Instant::now() + Duration::from_millis(333)); -729 self.pending_open_paths.push_back(open_addr.clone()); -730 trace!(?open_addr, "scheduling open_path"); -731 } -732 _ => warn!(?ret, "Opening path failed"), -733 } -734 } -735 } -736 } -737 } -738 -739 #[instrument(skip(self))] -740 fn handle_path_event( -741 &mut self, -742 conn_id: ConnId, -743 event: Result<PathEvent, BroadcastStreamRecvError>, -744 ) { -745 let Ok(event) = event else { -746 warn!("missed a PathEvent, RemoteStateActor lagging"); -747 // TODO: Is it possible to recover using the sync APIs to figure out what the -748 // state of the connection and it's paths are? -749 return; -750 }; -751 let Some(conn_state) = self.connections.get_mut(&conn_id) else { -752 trace!("event for removed connection"); -753 return; -754 }; -755 let Some(conn) = conn_state.handle.upgrade() else { -756 trace!("event for closed connection"); -757 return; -758 }; -759 trace!("path event"); -760 match event { -761 PathEvent::Opened { id: path_id } => { -762 let Some(path) = conn.path(path_id) else { -763 trace!("path open event for unknown path"); -764 return; -765 }; -766 -767 if let Ok(socketaddr) = path.remote_address() -768 && let Some(path_remote) = self.relay_mapped_addrs.to_transport_addr(socketaddr) -769 { -770 event!( -771 target: "iroh::_events::path::open", -772 Level::DEBUG, -773 remote = %self.endpoint_id.fmt_short(), -774 ?path_remote, -775 ?conn_id, -776 ?path_id, -777 ); -778 conn_state.add_open_path(path_remote.clone(), path_id); -779 self.paths -780 .insert_open_path(path_remote.clone(), Source::Connection { _0: Private }); -781 } -782 -783 self.select_path(); -784 } -785 PathEvent::Abandoned { id, path_stats } => { -786 trace!(?path_stats, "path abandoned"); -787 // This is the last event for this path. -788 if let Some(addr) = conn_state.remove_path(&id) { -789 self.paths.abandoned_path(&addr); -790 } -791 } -792 PathEvent::Closed { id, .. } | PathEvent::LocallyClosed { id, .. } => { -793 let Some(path_remote) = conn_state.paths.get(&id).cloned() else { -794 debug!("path not in path_id_map"); -795 return; -796 }; -797 event!( -798 target: "iroh::_events::path::closed", -799 Level::DEBUG, -800 remote = %self.endpoint_id.fmt_short(), -801 ?path_remote, -802 ?conn_id, -803 path_id = ?id, -804 ); -805 conn_state.remove_open_path(&id); -806 -807 // If one connection closes this path, close it on all connections. -808 for (conn_id, conn_state) in self.connections.iter_mut() { -809 let Some(path_id) = conn_state.path_ids.get(&path_remote) else { +713 } +714 let fut = conn.open_path_ensure(quic_addr, path_status); +715 match fut.path_id() { +716 Some(path_id) => { +717 trace!(?conn_id, ?path_id, "opening new path"); +718 conn_state.add_path(open_addr.clone(), path_id); +719 } +720 None => { +721 let ret = now_or_never(fut); +722 match ret { +723 Some(Err(PathError::RemoteCidsExhausted)) => { +724 self.scheduled_open_path = +725 Some(Instant::now() + Duration::from_millis(333)); +726 self.pending_open_paths.push_back(open_addr.clone()); +727 trace!(?open_addr, "scheduling open_path"); +728 } +729 _ => warn!(?ret, "Opening path failed"), +730 } +731 } +732 } +733 } +734 } +735 +736 #[instrument(skip(self))] +737 fn handle_path_event( +738 &mut self, +739 conn_id: ConnId, +740 event: Result<PathEvent, BroadcastStreamRecvError>, +741 ) { +742 let Ok(event) = event else { +743 warn!("missed a PathEvent, RemoteStateActor lagging"); +744 // TODO: Is it possible to recover using the sync APIs to figure out what the +745 // state of the connection and it's paths are? +746 return; +747 }; +748 let Some(conn_state) = self.connections.get_mut(&conn_id) else { +749 trace!("event for removed connection"); +750 return; +751 }; +752 let Some(conn) = conn_state.handle.upgrade() else { +753 trace!("event for closed connection"); +754 return; +755 }; +756 trace!("path event"); +757 match event { +758 PathEvent::Opened { id: path_id } => { +759 let Some(path) = conn.path(path_id) else { +760 trace!("path open event for unknown path"); +761 return; +762 }; +763 +764 if let Ok(socketaddr) = path.remote_address() +765 && let Some(path_remote) = self.relay_mapped_addrs.to_transport_addr(socketaddr) +766 { +767 event!( +768 target: "iroh::_events::path::open", +769 Level::DEBUG, +770 remote = %self.endpoint_id.fmt_short(), +771 ?path_remote, +772 ?conn_id, +773 ?path_id, +774 ); +775 conn_state.add_open_path(path_remote.clone(), path_id); +776 self.paths +777 .insert_open_path(path_remote.clone(), Source::Connection { _0: Private }); +778 } +779 +780 self.select_path(); +781 } +782 PathEvent::Abandoned { id, path_stats } => { +783 trace!(?path_stats, "path abandoned"); +784 // This is the last event for this path. +785 if let Some(addr) = conn_state.remove_path(&id) { +786 self.paths.abandoned_path(&addr); +787 } +788 } +789 PathEvent::Closed { id, .. } | PathEvent::LocallyClosed { id, .. } => { +790 let Some(path_remote) = conn_state.paths.get(&id).cloned() else { +791 debug!("path not in path_id_map"); +792 return; +793 }; +794 event!( +795 target: "iroh::_events::path::closed", +796 Level::DEBUG, +797 remote = %self.endpoint_id.fmt_short(), +798 ?path_remote, +799 ?conn_id, +800 path_id = ?id, +801 ); +802 conn_state.remove_open_path(&id); +803 +804 // If one connection closes this path, close it on all connections. +805 for (conn_id, conn_state) in self.connections.iter_mut() { +806 let Some(path_id) = conn_state.path_ids.get(&path_remote) else { +807 continue; +808 }; +809 let Some(conn) = conn_state.handle.upgrade() else { 810 continue; 811 }; -812 let Some(conn) = conn_state.handle.upgrade() else { -813 continue; -814 }; -815 if let Some(path) = conn.path(*path_id) { -816 trace!(?path_remote, ?conn_id, ?path_id, "closing path"); -817 if let Err(err) = path.close() { -818 trace!( -819 ?path_remote, -820 ?conn_id, -821 ?path_id, -822 "path close failed: {err:#}" -823 ); -824 } -825 } -826 } -827 -828 // If the remote closed our selected path, select a new one. -829 self.select_path(); -830 } -831 PathEvent::RemoteStatus { .. } | PathEvent::ObservedAddr { .. } => { -832 // Nothing to do for these events. -833 } -834 } -835 } -836 -837 /// Selects the path with the lowest RTT, prefers direct paths. +812 if let Some(path) = conn.path(*path_id) { +813 trace!(?path_remote, ?conn_id, ?path_id, "closing path"); +814 if let Err(err) = path.close() { +815 trace!( +816 ?path_remote, +817 ?conn_id, +818 ?path_id, +819 "path close failed: {err:#}" +820 ); +821 } +822 } +823 } +824 +825 // If the remote closed our selected path, select a new one. +826 self.select_path(); +827 } +828 PathEvent::RemoteStatus { .. } | PathEvent::ObservedAddr { .. } => { +829 // Nothing to do for these events. +830 } +831 } +832 } +833 +834 /// Selects the path with the lowest RTT, prefers direct paths. +835 /// +836 /// If there are direct paths, this selects the direct path with the lowest RTT. If +837 /// there are only relay paths, the relay path with the lowest RTT is chosen. 838 /// -839 /// If there are direct paths, this selects the direct path with the lowest RTT. If -840 /// there are only relay paths, the relay path with the lowest RTT is chosen. -841 /// -842 /// The selected path is added to any connections which do not yet have it. Any unused -843 /// direct paths are closed for all connections. -844 #[instrument(skip_all)] -845 fn select_path(&mut self) { -846 // Find the lowest RTT across all connections for each open path. The long way, so -847 // we get to log *all* RTTs. -848 let mut all_path_rtts: FxHashMap<transports::Addr, Vec<Duration>> = FxHashMap::default(); -849 for conn_state in self.connections.values() { -850 let Some(conn) = conn_state.handle.upgrade() else { -851 continue; -852 }; -853 for (path_id, addr) in conn_state.open_paths.iter() { -854 if let Some(stats) = conn.path_stats(*path_id) { -855 all_path_rtts -856 .entry(addr.clone()) -857 .or_default() -858 .push(stats.rtt); -859 } -860 } -861 } -862 trace!(?all_path_rtts, "dumping all path RTTs"); -863 let path_rtts: FxHashMap<transports::Addr, Duration> = all_path_rtts -864 .into_iter() -865 .filter_map(|(addr, rtts)| rtts.into_iter().min().map(|rtt| (addr, rtt))) -866 .collect(); -867 -868 // Find the fastest direct IPv4 path. -869 let direct_path_ipv4 = path_rtts -870 .iter() -871 .filter_map(|(addr, rtt)| { -872 if let transports::Addr::Ip(SocketAddr::V4(addr)) = *addr { -873 Some((addr, *rtt)) -874 } else { -875 None -876 } -877 }) -878 .min_by_key(|(_addr, rtt)| *rtt); -879 -880 // Find the fastest direct IPv6 path. -881 let direct_path_ipv6 = path_rtts -882 .iter() -883 .filter_map(|(addr, rtt)| { -884 if let transports::Addr::Ip(SocketAddr::V6(addr)) = *addr { -885 Some((addr, *rtt)) -886 } else { -887 None -888 } -889 }) -890 .min_by_key(|(_addr, rtt)| *rtt); -891 -892 // Find the fastest relay path. -893 let relay_path = path_rtts -894 .iter() -895 .filter(|(addr, _rtt)| addr.is_relay()) -896 .min_by_key(|(_addr, rtt)| *rtt) -897 .map(|(addr, rtt)| (addr.clone(), *rtt)); -898 -899 let current_path = self -900 .selected_path -901 .get() -902 .and_then(|addr| path_rtts.get(&addr).copied().map(|rtt| (addr, rtt))); -903 let selected_path = select_best_path( -904 current_path.clone(), -905 direct_path_ipv4, -906 direct_path_ipv6, -907 relay_path, -908 ); -909 -910 // Apply our new path -911 if let Some((addr, rtt)) = selected_path { -912 let prev = self.selected_path.set(Some(addr.clone())); -913 if prev.is_ok() { -914 debug!(?addr, ?rtt, ?prev, "selected new path"); -915 } -916 self.open_path(&addr); -917 self.close_redundant_paths(&addr); -918 } else { -919 trace!(?current_path, "keeping current path"); -920 } -921 } -922 -923 /// Closes any direct paths not selected if we are the client. +839 /// The selected path is added to any connections which do not yet have it. Any unused +840 /// direct paths are closed for all connections. +841 #[instrument(skip_all)] +842 fn select_path(&mut self) { +843 // Find the lowest RTT across all connections for each open path. The long way, so +844 // we get to log *all* RTTs. +845 let mut all_path_rtts: FxHashMap<transports::Addr, Vec<Duration>> = FxHashMap::default(); +846 for conn_state in self.connections.values() { +847 let Some(conn) = conn_state.handle.upgrade() else { +848 continue; +849 }; +850 for (path_id, addr) in conn_state.open_paths.iter() { +851 if let Some(stats) = conn.path_stats(*path_id) { +852 all_path_rtts +853 .entry(addr.clone()) +854 .or_default() +855 .push(stats.rtt); +856 } +857 } +858 } +859 trace!(?all_path_rtts, "dumping all path RTTs"); +860 let path_rtts: FxHashMap<transports::Addr, Duration> = all_path_rtts +861 .into_iter() +862 .filter_map(|(addr, rtts)| rtts.into_iter().min().map(|rtt| (addr, rtt))) +863 .collect(); +864 +865 // Find the fastest direct IPv4 path. +866 let direct_path_ipv4 = path_rtts +867 .iter() +868 .filter_map(|(addr, rtt)| { +869 if let transports::Addr::Ip(SocketAddr::V4(addr)) = *addr { +870 Some((addr, *rtt)) +871 } else { +872 None +873 } +874 }) +875 .min_by_key(|(_addr, rtt)| *rtt); +876 +877 // Find the fastest direct IPv6 path. +878 let direct_path_ipv6 = path_rtts +879 .iter() +880 .filter_map(|(addr, rtt)| { +881 if let transports::Addr::Ip(SocketAddr::V6(addr)) = *addr { +882 Some((addr, *rtt)) +883 } else { +884 None +885 } +886 }) +887 .min_by_key(|(_addr, rtt)| *rtt); +888 +889 // Find the fastest relay path. +890 let relay_path = path_rtts +891 .iter() +892 .filter(|(addr, _rtt)| addr.is_relay()) +893 .min_by_key(|(_addr, rtt)| *rtt) +894 .map(|(addr, rtt)| (addr.clone(), *rtt)); +895 +896 let current_path = self +897 .selected_path +898 .get() +899 .and_then(|addr| path_rtts.get(&addr).copied().map(|rtt| (addr, rtt))); +900 let selected_path = select_best_path( +901 current_path.clone(), +902 direct_path_ipv4, +903 direct_path_ipv6, +904 relay_path, +905 ); +906 +907 // Apply our new path +908 if let Some((addr, rtt)) = selected_path { +909 let prev = self.selected_path.set(Some(addr.clone())); +910 if prev.is_ok() { +911 debug!(?addr, ?rtt, ?prev, "selected new path"); +912 } +913 self.open_path(&addr); +914 self.close_redundant_paths(&addr); +915 } else { +916 trace!(?current_path, "keeping current path"); +917 } +918 } +919 +920 /// Closes any direct paths not selected if we are the client. +921 /// +922 /// Makes sure not to close the last direct path. Relay paths are never closed +923 /// currently, because we only have one relay path at this time. 924 /// -925 /// Makes sure not to close the last direct path. Relay paths are never closed -926 /// currently, because we only have one relay path at this time. -927 /// -928 /// Only the client closes paths, just like only the client opens paths. This is to -929 /// avoid the client and server selecting different paths and accidentally closing all -930 /// paths. -931 fn close_redundant_paths(&mut self, selected_path: &transports::Addr) { -932 debug_assert_eq!(self.selected_path.get().as_ref(), Some(selected_path),); -933 -934 for (conn_id, conn_state) in self.connections.iter() { -935 for (path_id, path_remote) in conn_state -936 .open_paths -937 .iter() -938 .filter(|(_, addr)| addr.is_ip()) -939 .filter(|(_, addr)| *addr != selected_path) -940 { -941 if conn_state.open_paths.values().filter(|a| a.is_ip()).count() <= 1 { -942 continue; // Do not close the last direct path. -943 } -944 if let Some(path) = conn_state -945 .handle -946 .upgrade() -947 .filter(|conn| conn.side().is_client()) -948 .and_then(|conn| conn.path(*path_id)) -949 { -950 trace!(?path_remote, ?conn_id, ?path_id, "closing direct path"); -951 match path.close() { -952 Err(quinn_proto::ClosePathError::LastOpenPath) => { -953 error!("could not close last open path"); -954 } -955 Err(quinn_proto::ClosePathError::ClosedPath) => { -956 // We already closed this. +925 /// Only the client closes paths, just like only the client opens paths. This is to +926 /// avoid the client and server selecting different paths and accidentally closing all +927 /// paths. +928 fn close_redundant_paths(&mut self, selected_path: &transports::Addr) { +929 debug_assert_eq!(self.selected_path.get().as_ref(), Some(selected_path),); +930 +931 for (conn_id, conn_state) in self.connections.iter() { +932 for (path_id, path_remote) in conn_state +933 .open_paths +934 .iter() +935 .filter(|(_, addr)| addr.is_ip()) +936 .filter(|(_, addr)| *addr != selected_path) +937 { +938 if conn_state.open_paths.values().filter(|a| a.is_ip()).count() <= 1 { +939 continue; // Do not close the last direct path. +940 } +941 if let Some(path) = conn_state +942 .handle +943 .upgrade() +944 .filter(|conn| conn.side().is_client()) +945 .and_then(|conn| conn.path(*path_id)) +946 { +947 trace!(?path_remote, ?conn_id, ?path_id, "closing direct path"); +948 match path.close() { +949 Err(quinn_proto::ClosePathError::LastOpenPath) => { +950 error!("could not close last open path"); +951 } +952 Err(quinn_proto::ClosePathError::ClosedPath) => { +953 // We already closed this. +954 } +955 Ok(_fut) => { +956 // We will handle the event in Self::handle_path_events. 957 } -958 Ok(_fut) => { -959 // We will handle the event in Self::handle_path_events. -960 } -961 } -962 } -963 } -964 } -965 } -966} -967 -968/// Returns `Some` if a new path should be selected, `None` if the `current_path` should -969/// continued to be used. -970fn select_best_path( -971 current_path: Option<(transports::Addr, Duration)>, -972 direct_path_ipv4: Option<(SocketAddrV4, Duration)>, -973 direct_path_ipv6: Option<(SocketAddrV6, Duration)>, -974 new_relay_path: Option<(transports::Addr, Duration)>, -975) -> Option<(transports::Addr, Duration)> { -976 let (current_path, current_rtt) = current_path.unzip(); -977 match (current_path, direct_path_ipv4, direct_path_ipv6) { -978 ( -979 Some(transports::Addr::Ip(SocketAddr::V4(addr_v4))), -980 Some((new_direct_addr, new_rtt)), -981 None, -982 ) => { -983 // IPv4 -> IPv4, no IPv6 -984 if let Some(current_rtt) = current_rtt { -985 if current_rtt > new_rtt + RTT_SWITCHING_MIN_IP && addr_v4 != new_direct_addr { -986 // Switch to a new path -987 Some((transports::Addr::Ip(new_direct_addr.into()), new_rtt)) -988 } else { -989 // Current path is good enough -990 None -991 } -992 } else { -993 // Use new path, we have no RTT information for the current path -994 Some((transports::Addr::Ip(new_direct_addr.into()), new_rtt)) -995 } -996 } -997 (Some(transports::Addr::Ip(SocketAddr::V4(_))), None, Some((new_direct_addr, new_rtt))) => { -998 // IPv4 -> IPv6, no IPv4 -999 if let Some(current_rtt) = current_rtt { -1000 if current_rtt > new_rtt + IPV6_RTT_ADVANTAGE { -1001 // Switch to a new path -1002 Some((transports::Addr::Ip(new_direct_addr.into()), new_rtt)) -1003 } else { -1004 // Current path is good enough -1005 None -1006 } -1007 } else { -1008 // Use new path, we have no RTT information for the current path -1009 Some((transports::Addr::Ip(new_direct_addr.into()), new_rtt)) -1010 } -1011 } -1012 ( -1013 Some(transports::Addr::Ip(SocketAddr::V6(addr_v6))), -1014 None, -1015 Some((new_direct_addr, new_rtt)), -1016 ) => { -1017 // IPv6 -> IPv6, no IPv4 -1018 if let Some(current_rtt) = current_rtt { -1019 if current_rtt > new_rtt + RTT_SWITCHING_MIN_IP && addr_v6 != new_direct_addr { -1020 // Switch to a new path -1021 Some((transports::Addr::Ip(new_direct_addr.into()), new_rtt)) -1022 } else { -1023 // Current path is good enough -1024 None -1025 } -1026 } else { -1027 // Use new path, we have no RTT information for the current path -1028 Some((transports::Addr::Ip(new_direct_addr.into()), new_rtt)) -1029 } -1030 } -1031 (Some(transports::Addr::Ip(SocketAddr::V6(_))), Some((new_direct_addr, new_rtt)), None) => { -1032 // IPv6 -> IPv4, no IPv6 -1033 if let Some(current_rtt) = current_rtt { -1034 if current_rtt > new_rtt + RTT_SWITCHING_MIN_IP { -1035 // Switch to a new path -1036 Some((transports::Addr::Ip(new_direct_addr.into()), new_rtt)) -1037 } else { -1038 // Current path is good enough -1039 None -1040 } -1041 } else { -1042 // Use new path, we have no RTT information for the current path -1043 Some((transports::Addr::Ip(new_direct_addr.into()), new_rtt)) -1044 } -1045 } -1046 ( -1047 Some(transports::Addr::Ip(_)), -1048 Some((new_direct_addr_v4, new_rtt_v4)), -1049 Some((new_direct_addr_v6, new_rtt_v6)), -1050 ) => { -1051 // v4/v6, new v4 and new v6 -1052 if let Some(current_rtt) = current_rtt { -1053 if current_rtt >= new_rtt_v4 + RTT_SWITCHING_MIN_IP -1054 || current_rtt >= new_rtt_v6 + RTT_SWITCHING_MIN_RELAY -1055 { -1056 Some(select_v4_v6( -1057 new_direct_addr_v4, -1058 new_rtt_v4, -1059 new_direct_addr_v6, -1060 new_rtt_v6, -1061 )) -1062 } else { -1063 None -1064 } -1065 } else { -1066 // no current rtt available -1067 Some(select_v4_v6( -1068 new_direct_addr_v4, -1069 new_rtt_v4, -1070 new_direct_addr_v6, -1071 new_rtt_v6, -1072 )) -1073 } -1074 } -1075 ( -1076 Some(transports::Addr::Relay(_, _)), -1077 Some((new_direct_addr_v4, new_rtt_v4)), -1078 Some((new_direct_addr_v6, new_rtt_v6)), -1079 ) => { -1080 // relay path previously, new v4 and new v6 -1081 if let Some(current_rtt) = current_rtt { -1082 // anything at least as good, that is direct we want to use -1083 if current_rtt >= new_rtt_v4 || current_rtt >= new_rtt_v6 { -1084 Some(select_v4_v6( -1085 new_direct_addr_v4, -1086 new_rtt_v4, -1087 new_direct_addr_v6, -1088 new_rtt_v6, -1089 )) -1090 } else { -1091 None -1092 } -1093 } else { -1094 // no current rtt available -1095 Some(select_v4_v6( -1096 new_direct_addr_v4, -1097 new_rtt_v4, -1098 new_direct_addr_v6, -1099 new_rtt_v6, -1100 )) -1101 } -1102 } -1103 (Some(transports::Addr::Relay(_, _)), Some((new_direct_addr, new_rtt)), None) => { -1104 // relay path previously, use our new selection IPv4 -1105 Some((transports::Addr::Ip(new_direct_addr.into()), new_rtt)) -1106 } -1107 (Some(transports::Addr::Relay(_, _)), None, Some((new_direct_addr, new_rtt))) => { -1108 // relay path previously, use our new selection IPv6 -1109 Some((transports::Addr::Ip(new_direct_addr.into()), new_rtt)) -1110 } -1111 (None, Some((new_direct_addr, new_rtt)), None) => { -1112 // no direct path previously, use our new selection IPv4 -1113 Some((transports::Addr::Ip(new_direct_addr.into()), new_rtt)) -1114 } -1115 (None, None, Some((new_direct_addr, new_rtt))) => { -1116 // no direct path previously, use our new selection IPv6 -1117 Some((transports::Addr::Ip(new_direct_addr.into()), new_rtt)) -1118 } -1119 (None, Some((new_direct_addr_v4, new_rtt_v4)), Some((new_direct_addr_v6, new_rtt_v6))) => { -1120 // no existing path, new v4 and new v6 -1121 Some(select_v4_v6( -1122 new_direct_addr_v4, -1123 new_rtt_v4, -1124 new_direct_addr_v6, -1125 new_rtt_v6, -1126 )) -1127 } -1128 -1129 (None, None, None) => { -1130 // no direct paths available -1131 new_relay_path -1132 } -1133 (Some(transports::Addr::Ip(_)), None, None) => { -1134 // existing direct, no new direct -1135 -1136 // compare direct with relay -1137 if let Some(current_rtt) = current_rtt { -1138 if let Some((relay_addr, new_rtt)) = new_relay_path { -1139 if current_rtt > new_rtt + RTT_SWITCHING_MIN_IP { -1140 // Switch to a new path -1141 Some((relay_addr, new_rtt)) -1142 } else { -1143 // Current path is good enough -1144 None -1145 } -1146 } else { -1147 None -1148 } -1149 } else { -1150 // no new option available -1151 None -1152 } -1153 } -1154 (Some(transports::Addr::Relay(_, _)), None, None) => { -1155 // existing relay +958 } +959 } +960 } +961 } +962 } +963} +964 +965/// Returns `Some` if a new path should be selected, `None` if the `current_path` should +966/// continued to be used. +967fn select_best_path( +968 current_path: Option<(transports::Addr, Duration)>, +969 direct_path_ipv4: Option<(SocketAddrV4, Duration)>, +970 direct_path_ipv6: Option<(SocketAddrV6, Duration)>, +971 new_relay_path: Option<(transports::Addr, Duration)>, +972) -> Option<(transports::Addr, Duration)> { +973 // Determine the best new IP path. +974 let best_ip_path = match (direct_path_ipv4, direct_path_ipv6) { +975 (Some((addr_v4, rtt_v4)), Some((addr_v6, rtt_v6))) => { +976 Some(select_v4_v6(addr_v4, rtt_v4, addr_v6, rtt_v6)) +977 } +978 (None, Some((addr_v6, rtt_v6))) => Some((addr_v6.into(), rtt_v6)), +979 (Some((addr_v4, rtt_v4)), None) => Some((addr_v4.into(), rtt_v4)), +980 (None, None) => None, +981 }; +982 let best_ip_path = best_ip_path.map(|(addr, rtt)| (transports::Addr::Ip(addr), rtt)); +983 +984 match current_path { +985 None => { +986 // If we currently have no path +987 if best_ip_path.is_some() { +988 // Use the best IP path +989 best_ip_path +990 } else { +991 // Use the new relay path +992 new_relay_path +993 } +994 } +995 Some((transports::Addr::Relay(..), _)) => { +996 // If we have a current path, but it is relay +997 if best_ip_path.is_some() { +998 // Use the best IP path +999 best_ip_path +1000 } else { +1001 // Use the new relay path +1002 new_relay_path +1003 } +1004 } +1005 Some((transports::Addr::Ip(_), current_rtt)) => { +1006 match &best_ip_path { +1007 Some((_, new_rtt)) => { +1008 // Comparing available IP paths +1009 if current_rtt >= *new_rtt + RTT_SWITCHING_MIN_IP { +1010 // New IP path is faster +1011 best_ip_path +1012 } else { +1013 // New IP is not faster +1014 None +1015 } +1016 } +1017 None => { +1018 // No new IP path, don't switch away +1019 None +1020 } +1021 } +1022 } +1023 } +1024} +1025 +1026/// Compare two IP addrs v4 & v6 and selects the "best" one. +1027/// +1028/// This prefers IPv6 paths over IPv4 paths. +1029fn select_v4_v6( +1030 addr_v4: SocketAddrV4, +1031 rtt_v4: Duration, +1032 addr_v6: SocketAddrV6, +1033 rtt_v6: Duration, +1034) -> (SocketAddr, Duration) { +1035 if rtt_v6 <= rtt_v4 + IPV6_RTT_ADVANTAGE { +1036 (addr_v6.into(), rtt_v6) +1037 } else { +1038 (addr_v4.into(), rtt_v4) +1039 } +1040} +1041 +1042fn send_datagram<'a>( +1043 sender: &'a mut TransportsSender, +1044 dst: transports::Addr, +1045 owned_transmit: OwnedTransmit, +1046) -> impl Future<Output = n0_error::Result<()>> + 'a { +1047 std::future::poll_fn(move |cx| { +1048 let transmit = transports::Transmit { +1049 ecn: owned_transmit.ecn, +1050 contents: owned_transmit.contents.as_ref(), +1051 segment_size: owned_transmit.segment_size, +1052 }; +1053 +1054 Pin::new(&mut *sender) +1055 .poll_send(cx, &dst, None, &transmit) +1056 .map(|res| res.with_context(|_| format!("failed to send datagram to {dst:?}"))) +1057 }) +1058} +1059 +1060/// Messages to send to the [`RemoteStateActor`]. +1061#[derive(derive_more::Debug)] +1062pub(crate) enum RemoteStateMessage { +1063 /// Sends a datagram to all known paths. +1064 /// +1065 /// Used to send QUIC Initial packets. If there is no working direct path this will +1066 /// trigger holepunching. +1067 /// +1068 /// This is not acceptable to use on the normal send path, as it is an async send +1069 /// operation with a bunch more copying. So it should only be used for sending QUIC +1070 /// Initial packets. +1071 #[debug("SendDatagram(..)")] +1072 SendDatagram(TransportsSender, OwnedTransmit), +1073 /// Adds an active connection to this remote endpoint. +1074 /// +1075 /// The connection will now be managed by this actor. Holepunching will happen when +1076 /// needed, any new paths discovered via holepunching will be added. And closed paths +1077 /// will be removed etc. +1078 #[debug("AddConnection(..)")] +1079 AddConnection(WeakConnectionHandle, oneshot::Sender<PathsWatcher>), +1080 /// Asks if there is any possible path that could be used. +1081 /// +1082 /// This adds the provided transport addresses to the list of potential paths for this remote +1083 /// and starts discovery if needed. +1084 /// +1085 /// Returns `Ok` immediately if the provided address list is non-empy or we have are other known paths. +1086 /// Otherwise returns `Ok` once discovery produces a result, or the discovery error if discovery fails +1087 /// or produces no results, +1088 #[debug("ResolveRemote(..)")] +1089 ResolveRemote( +1090 BTreeSet<TransportAddr>, +1091 oneshot::Sender<Result<(), DiscoveryError>>, +1092 ), +1093} +1094 +1095/// A handle to a [`RemoteStateActor`]. +1096/// +1097/// Dropping this will stop the actor. The actor will also stop after an idle timeout +1098/// if it has no connections, an empty inbox, and no other senders than the one stored +1099/// in the endpoint map exist. +1100#[derive(Debug)] +1101pub(super) struct RemoteStateHandle { +1102 /// Sender for the channel into the [`RemoteStateActor`]. +1103 /// +1104 /// This is a [`GuardedSender`], from which we can get a sender but only if the receiver +1105 /// hasn't been closed. +1106 pub(super) sender: GuardedSender<RemoteStateMessage>, +1107 _task: AbortOnDropHandle<()>, +1108} +1109 +1110/// Information about a holepunch attempt. +1111/// +1112/// Addresses are always stored in canonical form. +1113#[derive(Debug)] +1114struct HolepunchAttempt { +1115 when: Instant, +1116 /// The set of local addresses which could take part in holepunching. +1117 /// +1118 /// This does not mean every address here participated in the holepunching. E.g. we +1119 /// could have tried only a sub-set of the addresses because a previous attempt already +1120 /// covered part of the range. +1121 /// +1122 /// We do not store this as a [`DirectAddr`] because this is checked for equality and we +1123 /// do not want to compare the sources of these addresses. +1124 local_candidates: BTreeSet<SocketAddr>, +1125 /// The set of remote addresses which could take part in holepunching. +1126 /// +1127 /// Like [`Self::local_candidates`] we may not have used them. +1128 remote_candidates: BTreeSet<SocketAddr>, +1129} +1130 +1131/// Newtype to track Connections. +1132/// +1133/// The wrapped value is the [`quinn::Connection::stable_id`] value, and is thus only valid +1134/// for active connections. +1135#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] +1136struct ConnId(usize); +1137 +1138/// State about one connection. +1139#[derive(Debug)] +1140struct ConnectionState { +1141 /// Weak handle to the connection. +1142 handle: WeakConnectionHandle, +1143 /// The information we publish to users about the paths used in this connection. +1144 pub_open_paths: Watchable<PathAddrList>, +1145 /// The paths that exist on this connection. +1146 /// +1147 /// This could be in any state, e.g. while still validating the path or already closed +1148 /// but not yet fully removed from the connection. This exists as long as Quinn knows +1149 /// about the [`PathId`]. +1150 paths: FxHashMap<PathId, transports::Addr>, +1151 /// The open paths on this connection, a subset of [`Self::paths`]. +1152 open_paths: FxHashMap<PathId, transports::Addr>, +1153 /// Reverse map of [`Self::paths]. +1154 path_ids: FxHashMap<transports::Addr, PathId>, +1155} 1156 -1157 // compare relay paths -1158 if let Some(current_rtt) = current_rtt { -1159 if let Some((relay_addr, new_rtt)) = new_relay_path { -1160 if current_rtt > new_rtt + RTT_SWITCHING_MIN_RELAY { -1161 // Switch to a new path -1162 Some((relay_addr, new_rtt)) -1163 } else { -1164 // Current path is good enough -1165 None -1166 } -1167 } else { -1168 // no new option available -1169 None -1170 } -1171 } else { -1172 // no new option available -1173 None -1174 } -1175 } -1176 } -1177} -1178 -1179/// Compare two IP addrs v4 & v6 and selects the "best" one. -1180fn select_v4_v6( -1181 addr_v4: SocketAddrV4, -1182 rtt_v4: Duration, -1183 addr_v6: SocketAddrV6, -1184 rtt_v6: Duration, -1185) -> (transports::Addr, Duration) { -1186 if rtt_v6 <= rtt_v4 + IPV6_RTT_ADVANTAGE { -1187 (transports::Addr::Ip(addr_v6.into()), rtt_v6) -1188 } else { -1189 (transports::Addr::Ip(addr_v4.into()), rtt_v4) -1190 } -1191} -1192 -1193fn send_datagram<'a>( -1194 sender: &'a mut TransportsSender, -1195 dst: transports::Addr, -1196 owned_transmit: OwnedTransmit, -1197) -> impl Future<Output = n0_error::Result<()>> + 'a { -1198 std::future::poll_fn(move |cx| { -1199 let transmit = transports::Transmit { -1200 ecn: owned_transmit.ecn, -1201 contents: owned_transmit.contents.as_ref(), -1202 segment_size: owned_transmit.segment_size, -1203 }; -1204 -1205 Pin::new(&mut *sender) -1206 .poll_send(cx, &dst, None, &transmit) -1207 .map(|res| res.with_context(|_| format!("failed to send datagram to {dst:?}"))) -1208 }) -1209} -1210 -1211/// Messages to send to the [`RemoteStateActor`]. -1212#[derive(derive_more::Debug)] -1213pub(crate) enum RemoteStateMessage { -1214 /// Sends a datagram to all known paths. -1215 /// -1216 /// Used to send QUIC Initial packets. If there is no working direct path this will -1217 /// trigger holepunching. -1218 /// -1219 /// This is not acceptable to use on the normal send path, as it is an async send -1220 /// operation with a bunch more copying. So it should only be used for sending QUIC -1221 /// Initial packets. -1222 #[debug("SendDatagram(..)")] -1223 SendDatagram(TransportsSender, OwnedTransmit), -1224 /// Adds an active connection to this remote endpoint. -1225 /// -1226 /// The connection will now be managed by this actor. Holepunching will happen when -1227 /// needed, any new paths discovered via holepunching will be added. And closed paths -1228 /// will be removed etc. -1229 #[debug("AddConnection(..)")] -1230 AddConnection(WeakConnectionHandle, oneshot::Sender<PathsWatcher>), -1231 /// Asks if there is any possible path that could be used. -1232 /// -1233 /// This adds the provided transport addresses to the list of potential paths for this remote -1234 /// and starts discovery if needed. -1235 /// -1236 /// Returns `Ok` immediately if the provided address list is non-empy or we have are other known paths. -1237 /// Otherwise returns `Ok` once discovery produces a result, or the discovery error if discovery fails -1238 /// or produces no results, -1239 #[debug("ResolveRemote(..)")] -1240 ResolveRemote( -1241 BTreeSet<TransportAddr>, -1242 oneshot::Sender<Result<(), DiscoveryError>>, -1243 ), -1244} -1245 -1246/// A handle to a [`RemoteStateActor`]. -1247/// -1248/// Dropping this will stop the actor. The actor will also stop after an idle timeout -1249/// if it has no connections, an empty inbox, and no other senders than the one stored -1250/// in the endpoint map exist. -1251#[derive(Debug)] -1252pub(super) struct RemoteStateHandle { -1253 /// Sender for the channel into the [`RemoteStateActor`]. -1254 /// -1255 /// This is a [`GuardedSender`], from which we can get a sender but only if the receiver -1256 /// hasn't been closed. -1257 pub(super) sender: GuardedSender<RemoteStateMessage>, -1258 _task: AbortOnDropHandle<()>, -1259} -1260 -1261/// Information about a holepunch attempt. -1262/// -1263/// Addresses are always stored in canonical form. -1264#[derive(Debug)] -1265struct HolepunchAttempt { -1266 when: Instant, -1267 /// The set of local addresses which could take part in holepunching. -1268 /// -1269 /// This does not mean every address here participated in the holepunching. E.g. we -1270 /// could have tried only a sub-set of the addresses because a previous attempt already -1271 /// covered part of the range. -1272 /// -1273 /// We do not store this as a [`DirectAddr`] because this is checked for equality and we -1274 /// do not want to compare the sources of these addresses. -1275 local_candidates: BTreeSet<SocketAddr>, -1276 /// The set of remote addresses which could take part in holepunching. -1277 /// -1278 /// Like [`Self::local_candidates`] we may not have used them. -1279 remote_candidates: BTreeSet<SocketAddr>, -1280} -1281 -1282/// Newtype to track Connections. -1283/// -1284/// The wrapped value is the [`quinn::Connection::stable_id`] value, and is thus only valid -1285/// for active connections. -1286#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -1287struct ConnId(usize); -1288 -1289/// State about one connection. -1290#[derive(Debug)] -1291struct ConnectionState { -1292 /// Weak handle to the connection. -1293 handle: WeakConnectionHandle, -1294 /// The information we publish to users about the paths used in this connection. -1295 pub_open_paths: Watchable<PathAddrList>, -1296 /// The paths that exist on this connection. -1297 /// -1298 /// This could be in any state, e.g. while still validating the path or already closed -1299 /// but not yet fully removed from the connection. This exists as long as Quinn knows -1300 /// about the [`PathId`]. -1301 paths: FxHashMap<PathId, transports::Addr>, -1302 /// The open paths on this connection, a subset of [`Self::paths`]. -1303 open_paths: FxHashMap<PathId, transports::Addr>, -1304 /// Reverse map of [`Self::paths]. -1305 path_ids: FxHashMap<transports::Addr, PathId>, -1306} -1307 -1308impl ConnectionState { -1309 /// Tracks a path for the connection. -1310 fn add_path(&mut self, remote: transports::Addr, path_id: PathId) { -1311 self.paths.insert(path_id, remote.clone()); -1312 self.path_ids.insert(remote, path_id); -1313 } -1314 -1315 /// Tracks an open path for the connection. -1316 fn add_open_path(&mut self, remote: transports::Addr, path_id: PathId) { -1317 self.paths.insert(path_id, remote.clone()); -1318 self.open_paths.insert(path_id, remote.clone()); -1319 self.path_ids.insert(remote, path_id); -1320 self.update_pub_path_info(); +1157impl ConnectionState { +1158 /// Tracks a path for the connection. +1159 fn add_path(&mut self, remote: transports::Addr, path_id: PathId) { +1160 self.paths.insert(path_id, remote.clone()); +1161 self.path_ids.insert(remote, path_id); +1162 } +1163 +1164 /// Tracks an open path for the connection. +1165 fn add_open_path(&mut self, remote: transports::Addr, path_id: PathId) { +1166 self.paths.insert(path_id, remote.clone()); +1167 self.open_paths.insert(path_id, remote.clone()); +1168 self.path_ids.insert(remote, path_id); +1169 self.update_pub_path_info(); +1170 } +1171 +1172 /// Completely removes a path from this connection. +1173 fn remove_path(&mut self, path_id: &PathId) -> Option<transports::Addr> { +1174 let addr = self.paths.remove(path_id); +1175 if let Some(ref addr) = addr { +1176 self.path_ids.remove(addr); +1177 } +1178 self.open_paths.remove(path_id); +1179 addr +1180 } +1181 +1182 /// Removes the path from the open paths. +1183 fn remove_open_path(&mut self, path_id: &PathId) { +1184 self.open_paths.remove(path_id); +1185 +1186 self.update_pub_path_info(); +1187 } +1188 +1189 /// Sets the new [`PathInfo`] structs for the public [`Connection`]. +1190 /// +1191 /// [`Connection`]: crate::endpoint::Connection +1192 fn update_pub_path_info(&self) { +1193 let new = self +1194 .open_paths +1195 .iter() +1196 .map(|(path_id, remote)| { +1197 let remote = TransportAddr::from(remote.clone()); +1198 (remote, *path_id) +1199 }) +1200 .collect::<PathAddrList>(); +1201 +1202 self.pub_open_paths.set(new).ok(); +1203 } +1204} +1205 +1206/// Watcher for the open paths and selected transmission path in a connection. +1207/// +1208/// This is stored in the [`Connection`], and the watchables are set from within the endpoint state actor. +1209/// +1210/// Internally, this contains a boxed-mapped-joined watcher over the open paths in the connection and the +1211/// selected path to the remote endpoint. The watcher is boxed because the mapped-joined watcher with +1212/// `SmallVec<PathInfoList>` has a size of over 800 bytes, which we don't want to put upon the [`Connection`]. +1213/// +1214/// [`Connection`]: crate::endpoint::Connection +1215#[derive(Clone, derive_more::Debug)] +1216#[debug("PathsWatcher")] +1217#[allow(clippy::type_complexity)] +1218pub(crate) struct PathsWatcher( +1219 Box< +1220 n0_watcher::Map< +1221 n0_watcher::Tuple< +1222 n0_watcher::Direct<PathAddrList>, +1223 n0_watcher::Direct<Option<transports::Addr>>, +1224 >, +1225 PathInfoList, +1226 >, +1227 >, +1228); +1229 +1230impl n0_watcher::Watcher for PathsWatcher { +1231 type Value = PathInfoList; +1232 +1233 fn update(&mut self) -> bool { +1234 self.0.update() +1235 } +1236 +1237 fn peek(&self) -> &Self::Value { +1238 self.0.peek() +1239 } +1240 +1241 fn is_connected(&self) -> bool { +1242 self.0.is_connected() +1243 } +1244 +1245 fn poll_updated( +1246 &mut self, +1247 cx: &mut std::task::Context<'_>, +1248 ) -> Poll<Result<(), n0_watcher::Disconnected>> { +1249 self.0.poll_updated(cx) +1250 } +1251} +1252 +1253impl PathsWatcher { +1254 fn new( +1255 open_paths: n0_watcher::Direct<PathAddrList>, +1256 selected_path: n0_watcher::Direct<Option<transports::Addr>>, +1257 conn_handle: WeakConnectionHandle, +1258 ) -> Self { +1259 Self(Box::new(open_paths.or(selected_path).map( +1260 move |(open_paths, selected_path)| { +1261 let selected_path: Option<TransportAddr> = selected_path.map(Into::into); +1262 let Some(conn) = conn_handle.upgrade() else { +1263 return PathInfoList(Default::default()); +1264 }; +1265 let list = open_paths +1266 .into_iter() +1267 .flat_map(move |(remote, path_id)| { +1268 PathInfo::new(path_id, &conn, remote, selected_path.as_ref()) +1269 }) +1270 .collect(); +1271 PathInfoList(list) +1272 }, +1273 ))) +1274 } +1275} +1276 +1277/// List of [`PathInfo`] for the network paths of a [`Connection`]. +1278/// +1279/// This struct implements [`IntoIterator`]. +1280/// +1281/// [`Connection`]: crate::endpoint::Connection +1282#[derive(derive_more::Debug, derive_more::IntoIterator, Eq, PartialEq, Clone)] +1283#[debug("{_0:?}")] +1284pub struct PathInfoList(SmallVec<[PathInfo; 4]>); +1285 +1286impl PathInfoList { +1287 /// Returns an iterator over the path infos. +1288 pub fn iter(&self) -> impl Iterator<Item = &PathInfo> { +1289 self.0.iter() +1290 } +1291 +1292 /// Returns `true` if the list is empty. +1293 pub fn is_empty(&self) -> bool { +1294 self.0.is_empty() +1295 } +1296 +1297 /// Returns the number of paths. +1298 pub fn len(&self) -> usize { +1299 self.0.len() +1300 } +1301} +1302 +1303/// Information about a network path used by a [`Connection`]. +1304/// +1305/// [`Connection`]: crate::endpoint::Connection +1306#[derive(derive_more::Debug, Clone)] +1307pub struct PathInfo { +1308 path_id: PathId, +1309 #[debug(skip)] +1310 handle: WeakConnectionHandle, +1311 stats: PathStats, +1312 remote: TransportAddr, +1313 is_selected: bool, +1314} +1315 +1316impl PartialEq for PathInfo { +1317 fn eq(&self, other: &Self) -> bool { +1318 self.path_id == other.path_id +1319 && self.remote == other.remote +1320 && self.is_selected == other.is_selected 1321 } -1322 -1323 /// Completely removes a path from this connection. -1324 fn remove_path(&mut self, path_id: &PathId) -> Option<transports::Addr> { -1325 let addr = self.paths.remove(path_id); -1326 if let Some(ref addr) = addr { -1327 self.path_ids.remove(addr); -1328 } -1329 self.open_paths.remove(path_id); -1330 addr -1331 } -1332 -1333 /// Removes the path from the open paths. -1334 fn remove_open_path(&mut self, path_id: &PathId) { -1335 self.open_paths.remove(path_id); -1336 -1337 self.update_pub_path_info(); -1338 } -1339 -1340 /// Sets the new [`PathInfo`] structs for the public [`Connection`]. -1341 /// -1342 /// [`Connection`]: crate::endpoint::Connection -1343 fn update_pub_path_info(&self) { -1344 let new = self -1345 .open_paths -1346 .iter() -1347 .map(|(path_id, remote)| { -1348 let remote = TransportAddr::from(remote.clone()); -1349 (remote, *path_id) -1350 }) -1351 .collect::<PathAddrList>(); -1352 -1353 self.pub_open_paths.set(new).ok(); -1354 } -1355} -1356 -1357/// Watcher for the open paths and selected transmission path in a connection. -1358/// -1359/// This is stored in the [`Connection`], and the watchables are set from within the endpoint state actor. -1360/// -1361/// Internally, this contains a boxed-mapped-joined watcher over the open paths in the connection and the -1362/// selected path to the remote endpoint. The watcher is boxed because the mapped-joined watcher with -1363/// `SmallVec<PathInfoList>` has a size of over 800 bytes, which we don't want to put upon the [`Connection`]. -1364/// -1365/// [`Connection`]: crate::endpoint::Connection -1366#[derive(Clone, derive_more::Debug)] -1367#[debug("PathsWatcher")] -1368#[allow(clippy::type_complexity)] -1369pub(crate) struct PathsWatcher( -1370 Box< -1371 n0_watcher::Map< -1372 n0_watcher::Tuple< -1373 n0_watcher::Direct<PathAddrList>, -1374 n0_watcher::Direct<Option<transports::Addr>>, -1375 >, -1376 PathInfoList, -1377 >, -1378 >, -1379); -1380 -1381impl n0_watcher::Watcher for PathsWatcher { -1382 type Value = PathInfoList; -1383 -1384 fn update(&mut self) -> bool { -1385 self.0.update() -1386 } +1322} +1323 +1324impl Eq for PathInfo {} +1325 +1326impl PathInfo { +1327 fn new( +1328 path_id: PathId, +1329 conn: &quinn::Connection, +1330 remote: TransportAddr, +1331 selected_path: Option<&TransportAddr>, +1332 ) -> Option<Self> { +1333 let stats = conn.path_stats(path_id)?; +1334 Some(Self { +1335 path_id, +1336 handle: conn.weak_handle(), +1337 is_selected: Some(&remote) == selected_path, +1338 remote, +1339 stats, +1340 }) +1341 } +1342 +1343 /// The remote transport address used by this network path. +1344 pub fn remote_addr(&self) -> &TransportAddr { +1345 &self.remote +1346 } +1347 +1348 /// Returns `true` if this path is currently the main transmission path for this [`Connection`]. +1349 /// +1350 /// [`Connection`]: crate::endpoint::Connection +1351 pub fn is_selected(&self) -> bool { +1352 self.is_selected +1353 } +1354 +1355 /// Whether this is an IP transport address. +1356 pub fn is_ip(&self) -> bool { +1357 self.remote.is_ip() +1358 } +1359 +1360 /// Whether this is a transport address via a relay server. +1361 pub fn is_relay(&self) -> bool { +1362 self.remote.is_relay() +1363 } +1364 +1365 /// Returns stats for this transmission path. +1366 pub fn stats(&self) -> PathStats { +1367 self.handle +1368 .upgrade() +1369 .and_then(|conn| conn.path_stats(self.path_id)) +1370 .unwrap_or(self.stats) +1371 } +1372 +1373 /// Current best estimate of this paths's latency (round-trip-time) +1374 pub fn rtt(&self) -> Duration { +1375 self.stats().rtt +1376 } +1377} +1378 +1379/// Poll a future once, like n0_future::future::poll_once but sync. +1380fn now_or_never<T, F: Future<Output = T>>(fut: F) -> Option<T> { +1381 let fut = std::pin::pin!(fut); +1382 match fut.poll(&mut std::task::Context::from_waker(std::task::Waker::noop())) { +1383 Poll::Ready(res) => Some(res), +1384 Poll::Pending => None, +1385 } +1386} 1387 -1388 fn peek(&self) -> &Self::Value { -1389 self.0.peek() -1390 } -1391 -1392 fn is_connected(&self) -> bool { -1393 self.0.is_connected() -1394 } -1395 -1396 fn poll_updated( -1397 &mut self, -1398 cx: &mut std::task::Context<'_>, -1399 ) -> Poll<Result<(), n0_watcher::Disconnected>> { -1400 self.0.poll_updated(cx) -1401 } -1402} -1403 -1404impl PathsWatcher { -1405 fn new( -1406 open_paths: n0_watcher::Direct<PathAddrList>, -1407 selected_path: n0_watcher::Direct<Option<transports::Addr>>, -1408 conn_handle: WeakConnectionHandle, -1409 ) -> Self { -1410 Self(Box::new(open_paths.or(selected_path).map( -1411 move |(open_paths, selected_path)| { -1412 let selected_path: Option<TransportAddr> = selected_path.map(Into::into); -1413 let Some(conn) = conn_handle.upgrade() else { -1414 return PathInfoList(Default::default()); -1415 }; -1416 let list = open_paths -1417 .into_iter() -1418 .flat_map(move |(remote, path_id)| { -1419 PathInfo::new(path_id, &conn, remote, selected_path.as_ref()) -1420 }) -1421 .collect(); -1422 PathInfoList(list) -1423 }, -1424 ))) -1425 } -1426} -1427 -1428/// List of [`PathInfo`] for the network paths of a [`Connection`]. -1429/// -1430/// This struct implements [`IntoIterator`]. -1431/// -1432/// [`Connection`]: crate::endpoint::Connection -1433#[derive(derive_more::Debug, derive_more::IntoIterator, Eq, PartialEq, Clone)] -1434#[debug("{_0:?}")] -1435pub struct PathInfoList(SmallVec<[PathInfo; 4]>); -1436 -1437impl PathInfoList { -1438 /// Returns an iterator over the path infos. -1439 pub fn iter(&self) -> impl Iterator<Item = &PathInfo> { -1440 self.0.iter() -1441 } -1442 -1443 /// Returns `true` if the list is empty. -1444 pub fn is_empty(&self) -> bool { -1445 self.0.is_empty() -1446 } -1447 -1448 /// Returns the number of paths. -1449 pub fn len(&self) -> usize { -1450 self.0.len() -1451 } -1452} -1453 -1454/// Information about a network path used by a [`Connection`]. -1455/// -1456/// [`Connection`]: crate::endpoint::Connection -1457#[derive(derive_more::Debug, Clone)] -1458pub struct PathInfo { -1459 path_id: PathId, -1460 #[debug(skip)] -1461 handle: WeakConnectionHandle, -1462 stats: PathStats, -1463 remote: TransportAddr, -1464 is_selected: bool, -1465} -1466 -1467impl PartialEq for PathInfo { -1468 fn eq(&self, other: &Self) -> bool { -1469 self.path_id == other.path_id -1470 && self.remote == other.remote -1471 && self.is_selected == other.is_selected -1472 } -1473} -1474 -1475impl Eq for PathInfo {} -1476 -1477impl PathInfo { -1478 fn new( -1479 path_id: PathId, -1480 conn: &quinn::Connection, -1481 remote: TransportAddr, -1482 selected_path: Option<&TransportAddr>, -1483 ) -> Option<Self> { -1484 let stats = conn.path_stats(path_id)?; -1485 Some(Self { -1486 path_id, -1487 handle: conn.weak_handle(), -1488 is_selected: Some(&remote) == selected_path, -1489 remote, -1490 stats, -1491 }) -1492 } -1493 -1494 /// The remote transport address used by this network path. -1495 pub fn remote_addr(&self) -> &TransportAddr { -1496 &self.remote -1497 } -1498 -1499 /// Returns `true` if this path is currently the main transmission path for this [`Connection`]. -1500 /// -1501 /// [`Connection`]: crate::endpoint::Connection -1502 pub fn is_selected(&self) -> bool { -1503 self.is_selected -1504 } -1505 -1506 /// Whether this is an IP transport address. -1507 pub fn is_ip(&self) -> bool { -1508 self.remote.is_ip() -1509 } -1510 -1511 /// Whether this is a transport address via a relay server. -1512 pub fn is_relay(&self) -> bool { -1513 self.remote.is_relay() -1514 } -1515 -1516 /// Returns stats for this transmission path. -1517 pub fn stats(&self) -> PathStats { -1518 self.handle -1519 .upgrade() -1520 .and_then(|conn| conn.path_stats(self.path_id)) -1521 .unwrap_or(self.stats) -1522 } -1523 -1524 /// Current best estimate of this paths's latency (round-trip-time) -1525 pub fn rtt(&self) -> Duration { -1526 self.stats().rtt -1527 } -1528} -1529 -1530/// Poll a future once, like n0_future::future::poll_once but sync. -1531fn now_or_never<T, F: Future<Output = T>>(fut: F) -> Option<T> { -1532 let fut = std::pin::pin!(fut); -1533 match fut.poll(&mut std::task::Context::from_waker(std::task::Waker::noop())) { -1534 Poll::Ready(res) => Some(res), -1535 Poll::Pending => None, -1536 } -1537} -1538 -1539/// Future that resolves to the `conn_id` once a connection is closed. -1540/// -1541/// This uses [`quinn::Connection::on_closed`], which does not keep the connection alive -1542/// while awaiting the future. -1543struct OnClosed { -1544 conn_id: ConnId, -1545 inner: quinn::OnClosed, -1546} -1547 -1548impl OnClosed { -1549 fn new(conn: &quinn::Connection) -> Self { -1550 Self { -1551 conn_id: ConnId(conn.stable_id()), -1552 inner: conn.on_closed(), -1553 } -1554 } -1555} -1556 -1557impl Future for OnClosed { -1558 type Output = ConnId; -1559 -1560 fn poll(mut self: Pin<&mut Self>, cx: &mut std::task::Context<'_>) -> Poll<Self::Output> { -1561 let (_close_reason, _stats) = std::task::ready!(Pin::new(&mut self.inner).poll(cx)); -1562 Poll::Ready(self.conn_id) -1563 } -1564} -1565 -1566/// Converts an iterator of [`TransportAddr'] into an iterator of [`transports::Addr`]. -1567fn to_transports_addr( -1568 endpoint_id: EndpointId, -1569 addrs: impl IntoIterator<Item = TransportAddr>, -1570) -> impl Iterator<Item = transports::Addr> { -1571 addrs.into_iter().filter_map(move |addr| match addr { -1572 TransportAddr::Relay(relay_url) => Some(transports::Addr::from((relay_url, endpoint_id))), -1573 TransportAddr::Ip(sockaddr) => Some(transports::Addr::from(sockaddr)), -1574 _ => { -1575 warn!(?addr, "Unsupported TransportAddr"); -1576 None -1577 } -1578 }) -1579} -1580 -1581#[cfg(test)] -1582mod tests { -1583 use std::net::{Ipv4Addr, Ipv6Addr}; -1584 -1585 use super::*; -1586 -1587 #[test] -1588 fn test_select_v4_v6_addr() { -1589 let v4 = SocketAddrV4::new(Ipv4Addr::LOCALHOST, 1); -1590 let v6 = SocketAddrV6::new(Ipv6Addr::LOCALHOST, 1, 0, 0); -1591 -1592 // Same RTT, prefer v6 -1593 let (addr, rtt) = -1594 select_v4_v6(v4, Duration::from_millis(10), v6, Duration::from_millis(10)); -1595 assert_eq!(addr, transports::Addr::Ip(v6.into())); -1596 assert_eq!(rtt, Duration::from_millis(10)); -1597 -1598 // v4 better -1599 let (addr, rtt) = select_v4_v6(v4, Duration::from_millis(1), v6, Duration::from_millis(10)); -1600 assert_eq!(addr, transports::Addr::Ip(v4.into())); -1601 assert_eq!(rtt, Duration::from_millis(1)); -1602 -1603 // v6 better -1604 let (addr, rtt) = select_v4_v6(v4, Duration::from_millis(10), v6, Duration::from_millis(1)); -1605 assert_eq!(addr, transports::Addr::Ip(v6.into())); -1606 assert_eq!(rtt, Duration::from_millis(1)); -1607 } -1608}
    \ No newline at end of file +1388/// Future that resolves to the `conn_id` once a connection is closed. +1389/// +1390/// This uses [`quinn::Connection::on_closed`], which does not keep the connection alive +1391/// while awaiting the future. +1392struct OnClosed { +1393 conn_id: ConnId, +1394 inner: quinn::OnClosed, +1395} +1396 +1397impl OnClosed { +1398 fn new(conn: &quinn::Connection) -> Self { +1399 Self { +1400 conn_id: ConnId(conn.stable_id()), +1401 inner: conn.on_closed(), +1402 } +1403 } +1404} +1405 +1406impl Future for OnClosed { +1407 type Output = ConnId; +1408 +1409 fn poll(mut self: Pin<&mut Self>, cx: &mut std::task::Context<'_>) -> Poll<Self::Output> { +1410 let (_close_reason, _stats) = std::task::ready!(Pin::new(&mut self.inner).poll(cx)); +1411 Poll::Ready(self.conn_id) +1412 } +1413} +1414 +1415/// Converts an iterator of [`TransportAddr'] into an iterator of [`transports::Addr`]. +1416fn to_transports_addr( +1417 endpoint_id: EndpointId, +1418 addrs: impl IntoIterator<Item = TransportAddr>, +1419) -> impl Iterator<Item = transports::Addr> { +1420 addrs.into_iter().filter_map(move |addr| match addr { +1421 TransportAddr::Relay(relay_url) => Some(transports::Addr::from((relay_url, endpoint_id))), +1422 TransportAddr::Ip(sockaddr) => Some(transports::Addr::from(sockaddr)), +1423 _ => { +1424 warn!(?addr, "Unsupported TransportAddr"); +1425 None +1426 } +1427 }) +1428} +1429 +1430#[cfg(test)] +1431mod tests { +1432 use std::net::{Ipv4Addr, Ipv6Addr}; +1433 +1434 use super::*; +1435 +1436 #[test] +1437 fn test_select_v4_v6_addr() { +1438 let v4 = SocketAddrV4::new(Ipv4Addr::LOCALHOST, 1); +1439 let v6 = SocketAddrV6::new(Ipv6Addr::LOCALHOST, 1, 0, 0); +1440 +1441 // Same RTT, prefer v6 +1442 let (addr, rtt) = +1443 select_v4_v6(v4, Duration::from_millis(10), v6, Duration::from_millis(10)); +1444 assert_eq!(addr, v6.into()); +1445 assert_eq!(rtt, Duration::from_millis(10)); +1446 +1447 // v4 better +1448 let (addr, rtt) = select_v4_v6(v4, Duration::from_millis(1), v6, Duration::from_millis(10)); +1449 assert_eq!(addr, v4.into()); +1450 assert_eq!(rtt, Duration::from_millis(1)); +1451 +1452 // v6 better +1453 let (addr, rtt) = select_v4_v6(v4, Duration::from_millis(10), v6, Duration::from_millis(1)); +1454 assert_eq!(addr, v6.into()); +1455 assert_eq!(rtt, Duration::from_millis(1)); +1456 } +1457}
    \ No newline at end of file diff --git a/pr/3742/docs/trait.impl/core/convert/trait.From.js b/pr/3742/docs/trait.impl/core/convert/trait.From.js index 5fe49b9492..49cde58576 100644 --- a/pr/3742/docs/trait.impl/core/convert/trait.From.js +++ b/pr/3742/docs/trait.impl/core/convert/trait.From.js @@ -1,9 +1,9 @@ (function() { - var implementors = Object.fromEntries([["iroh",[["impl From<DiscoveryError> for ConnectWithOptsError"],["impl From<DiscoveryError> for AnyError"],["impl From<IntoDiscoveryError> for BindError"],["impl From<IntoDiscoveryError> for AnyError"],["impl From<PkarrError> for DiscoveryError"],["impl From<PkarrError> for AnyError"],["impl From<AlpnError> for AnyError"],["impl From<AuthenticationError> for ConnectingError"],["impl From<AuthenticationError> for AnyError"],["impl From<BindError> for AnyError"],["impl From<ConnectError> for AnyError"],["impl From<ConnectWithOptsError> for ConnectError"],["impl From<ConnectWithOptsError> for AnyError"],["impl From<ConnectingError> for ConnectError"],["impl From<ConnectingError> for AcceptError"],["impl From<ConnectingError> for AnyError"],["impl From<ConnectionError> for AlpnError"],["impl From<ConnectionError> for ConnectError"],["impl From<ConnectionError> for ConnectingError"],["impl From<ConnectionError> for AcceptError"],["impl From<RelayMode> for Option<TransportConfig>"],["impl From<AcceptError> for AnyError"],["impl From<Error> for AcceptError"],["impl From<DiscoveryItem> for EndpointInfo"],["impl From<ClosedStream> for AcceptError"],["impl From<RemoteEndpointIdError> for AuthenticationError"],["impl From<RemoteEndpointIdError> for AcceptError"],["impl From<RemoteEndpointIdError> for AnyError"],["impl From<AnyError> for AcceptError"],["impl From<ConnectError> for ConnectWithOptsError"],["impl<T> From<T> for ConcurrentDiscovery
    where\n T: IntoIterator<Item = Box<dyn Discovery>>,
    "],["impl<T: ProtocolHandler> From<T> for Box<dyn DynProtocolHandler>"]]],["iroh_base",[["impl From<KeyParsingError> for AnyError"],["impl From<Url> for RelayUrl"],["impl From<PublicKey> for EndpointAddr"],["impl From<RelayUrl> for Url"],["impl From<RelayUrlParseError> for AnyError"],["impl From<SignatureError> for AnyError"],["impl From<DecodeError> for KeyParsingError"],["impl From<Error> for KeyParsingError"],["impl From<[u8; 32]> for SecretKey"]]],["iroh_relay",[["impl From<ConnectError> for AnyError"],["impl From<DialError> for ConnectError"],["impl From<DialError> for AnyError"],["impl From<RecvError> for AnyError"],["impl From<SendError> for AnyError"],["impl From<DnsError> for DialError"],["impl From<DnsError> for LookupError"],["impl From<DnsError> for AnyError"],["impl From<LookupError> for AnyError"],["impl From<DecodingError> for ParseError"],["impl From<DecodingError> for AnyError"],["impl From<EncodingError> for AnyError"],["impl From<ParseError> for LookupError"],["impl From<ParseError> for AnyError"],["impl From<FrameType> for u32"],["impl From<FrameType> for VarInt"],["impl From<FrameTypeError> for Error"],["impl From<FrameTypeError> for Error"],["impl From<FrameTypeError> for AnyError"],["impl From<Error> for ConnectError"],["impl From<Error> for AnyError"],["impl From<Error> for RecvError"],["impl From<Error> for AnyError"],["impl From<Error> for AnyError"],["impl From<SpawnError> for AnyError"],["impl From<SupervisorError> for AnyError"],["impl From<Vec<Box<[u8]>>> for TxtRecordData"],["impl From<Utf8Error> for ParseError"],["impl From<Utf8Error> for Error"],["impl From<Error> for ConnectError"],["impl From<Error> for DialError"],["impl From<EndpointInfo> for EndpointAddr"],["impl From<MaxLengthExceededError> for AnyError"],["impl From<RelayConfig> for RelayMap"],["impl From<ConnectError> for Error"],["impl From<ConnectionError> for Error"],["impl From<Elapsed> for DialError"],["impl From<Elapsed> for DnsError"],["impl From<EndpointAddr> for EndpointData"],["impl From<EndpointAddr> for EndpointInfo"],["impl From<Error> for ConnectError"],["impl From<Error> for ConnectError"],["impl From<Error> for DialError"],["impl From<Error> for RecvError"],["impl From<Error> for SendError"],["impl From<Error> for Error"],["impl From<Error> for Error"],["impl From<JoinError> for SupervisorError"],["impl From<KeyParsingError> for Error"],["impl From<RecvError> for Error"],["impl From<RelayUrl> for RelayConfig"],["impl From<RelayUrl> for RelayMap"],["impl From<ResolveError> for DnsError"],["impl<E: StackError + 'static> From<StaggeredError<E>> for AnyError"],["impl<T: AsRef<[u8]>> From<T> for Datagrams"]]]]); + var implementors = Object.fromEntries([["iroh",[["impl From<DiscoveryError> for ConnectWithOptsError"],["impl From<DiscoveryError> for AnyError"],["impl From<IntoDiscoveryError> for BindError"],["impl From<IntoDiscoveryError> for AnyError"],["impl From<PkarrError> for DiscoveryError"],["impl From<PkarrError> for AnyError"],["impl From<AlpnError> for AnyError"],["impl From<AuthenticationError> for ConnectingError"],["impl From<AuthenticationError> for AnyError"],["impl From<BindError> for AnyError"],["impl From<ConnectError> for AnyError"],["impl From<ConnectWithOptsError> for ConnectError"],["impl From<ConnectWithOptsError> for AnyError"],["impl From<ConnectingError> for ConnectError"],["impl From<ConnectingError> for AcceptError"],["impl From<ConnectingError> for AnyError"],["impl From<ConnectionError> for AlpnError"],["impl From<ConnectionError> for ConnectError"],["impl From<ConnectionError> for ConnectingError"],["impl From<ConnectionError> for AcceptError"],["impl From<RelayMode> for Option<TransportConfig>"],["impl From<AcceptError> for AnyError"],["impl From<Error> for AcceptError"],["impl From<DiscoveryItem> for EndpointInfo"],["impl From<ClosedStream> for AcceptError"],["impl From<RemoteEndpointIdError> for AuthenticationError"],["impl From<RemoteEndpointIdError> for AcceptError"],["impl From<RemoteEndpointIdError> for AnyError"],["impl From<AnyError> for AcceptError"],["impl From<ConnectError> for ConnectWithOptsError"],["impl<T> From<T> for ConcurrentDiscovery
    where\n T: IntoIterator<Item = Box<dyn Discovery>>,
    "],["impl<T: ProtocolHandler> From<T> for Box<dyn DynProtocolHandler>"]]],["iroh_base",[["impl From<KeyParsingError> for AnyError"],["impl From<Url> for RelayUrl"],["impl From<PublicKey> for EndpointAddr"],["impl From<RelayUrl> for Url"],["impl From<RelayUrlParseError> for AnyError"],["impl From<SignatureError> for AnyError"],["impl From<DecodeError> for KeyParsingError"],["impl From<Error> for KeyParsingError"],["impl From<[u8; 32]> for SecretKey"]]],["iroh_relay",[["impl From<KeyParsingError> for Error"],["impl From<ConnectError> for AnyError"],["impl From<DialError> for ConnectError"],["impl From<DialError> for AnyError"],["impl From<RecvError> for AnyError"],["impl From<SendError> for AnyError"],["impl From<DnsError> for DialError"],["impl From<DnsError> for LookupError"],["impl From<DnsError> for AnyError"],["impl From<LookupError> for AnyError"],["impl From<DecodingError> for ParseError"],["impl From<DecodingError> for AnyError"],["impl From<EncodingError> for AnyError"],["impl From<ParseError> for LookupError"],["impl From<ParseError> for AnyError"],["impl From<FrameType> for u32"],["impl From<FrameType> for VarInt"],["impl From<FrameTypeError> for Error"],["impl From<FrameTypeError> for Error"],["impl From<FrameTypeError> for AnyError"],["impl From<Error> for ConnectError"],["impl From<Error> for AnyError"],["impl From<Error> for RecvError"],["impl From<Error> for AnyError"],["impl From<Error> for AnyError"],["impl From<SpawnError> for AnyError"],["impl From<SupervisorError> for AnyError"],["impl From<Vec<Box<[u8]>>> for TxtRecordData"],["impl From<Utf8Error> for ParseError"],["impl From<Utf8Error> for Error"],["impl From<Error> for ConnectError"],["impl From<Error> for DialError"],["impl From<EndpointAddr> for EndpointData"],["impl From<EndpointAddr> for EndpointInfo"],["impl From<RelayUrl> for RelayConfig"],["impl From<RelayUrl> for RelayMap"],["impl From<EndpointInfo> for EndpointAddr"],["impl From<MaxLengthExceededError> for AnyError"],["impl From<RelayConfig> for RelayMap"],["impl From<ConnectError> for Error"],["impl From<ConnectionError> for Error"],["impl From<Elapsed> for DialError"],["impl From<Elapsed> for DnsError"],["impl From<Error> for ConnectError"],["impl From<Error> for ConnectError"],["impl From<Error> for DialError"],["impl From<Error> for RecvError"],["impl From<Error> for SendError"],["impl From<Error> for Error"],["impl From<Error> for Error"],["impl From<JoinError> for SupervisorError"],["impl From<RecvError> for Error"],["impl From<ResolveError> for DnsError"],["impl<E: StackError + 'static> From<StaggeredError<E>> for AnyError"],["impl<T: AsRef<[u8]>> From<T> for Datagrams"]]]]); if (window.register_implementors) { window.register_implementors(implementors); } else { window.pending_implementors = implementors; } })() -//{"start":57,"fragment_lengths":[12661,3090,18835]} \ No newline at end of file +//{"start":57,"fragment_lengths":[12661,3090,19611]} \ No newline at end of file diff --git a/pr/3742/docs/trait.impl/core/iter/traits/collect/trait.FromIterator.js b/pr/3742/docs/trait.impl/core/iter/traits/collect/trait.FromIterator.js index 53eb8f19b7..6823ee20ab 100644 --- a/pr/3742/docs/trait.impl/core/iter/traits/collect/trait.FromIterator.js +++ b/pr/3742/docs/trait.impl/core/iter/traits/collect/trait.FromIterator.js @@ -1,9 +1,9 @@ (function() { - var implementors = Object.fromEntries([["iroh_relay",[["impl FromIterator<Box<[u8]>> for TxtRecordData"],["impl FromIterator<Arc<RelayConfig>> for RelayMap"],["impl FromIterator<RelayConfig> for RelayMap"],["impl FromIterator<RelayUrl> for RelayMap"]]]]); + var implementors = Object.fromEntries([["iroh_relay",[["impl FromIterator<Box<[u8]>> for TxtRecordData"],["impl FromIterator<Arc<RelayConfig>> for RelayMap"],["impl FromIterator<RelayUrl> for RelayMap"],["impl FromIterator<RelayConfig> for RelayMap"]]]]); if (window.register_implementors) { window.register_implementors(implementors); } else { window.pending_implementors = implementors; } })() -//{"start":57,"fragment_lengths":[1940]} \ No newline at end of file +//{"start":57,"fragment_lengths":[2062]} \ No newline at end of file