pub const DEFAULT_RELAY_QUIC_PORT: u16 = 7842; // 7_842u16Expand description
The default QUIC port used by the Relay server to accept QUIC connections +
Constant DEFAULT_RELAY_QUIC_PORT
pub const DEFAULT_RELAY_QUIC_PORT: u16 = 7842; // 7_842u16Expand description
The default QUIC port used by the Relay server to accept QUIC connections for QUIC address discovery
The port is “QUIC” typed on a phone keypad. The default QUIC port used by the Relay server to accept QUIC connections diff --git a/pr/3062/docs/iroh/defaults/constant.DEFAULT_STUN_PORT.html b/pr/3062/docs/iroh/defaults/constant.DEFAULT_STUN_PORT.html index 27042a1b0b..35b76bab1d 100644 --- a/pr/3062/docs/iroh/defaults/constant.DEFAULT_STUN_PORT.html +++ b/pr/3062/docs/iroh/defaults/constant.DEFAULT_STUN_PORT.html @@ -1,4 +1,4 @@ -
pub const DEFAULT_STUN_PORT: u16 = 3478; // 3_478u16Expand description
The default STUN port used by the Relay server.
+Constant DEFAULT_STUN_PORT
pub const DEFAULT_STUN_PORT: u16 = 3478; // 3_478u16Expand description
The default STUN port used by the Relay server.
The STUN port as defined by RFC 8489 The default STUN port used by the Relay server.
diff --git a/pr/3062/docs/iroh/endpoint/enum.DirectAddrType.html b/pr/3062/docs/iroh/endpoint/enum.DirectAddrType.html index a87c347562..614297dd04 100644 --- a/pr/3062/docs/iroh/endpoint/enum.DirectAddrType.html +++ b/pr/3062/docs/iroh/endpoint/enum.DirectAddrType.html @@ -1,4 +1,4 @@ -pub enum DirectAddrType {
+DirectAddrType in iroh::endpoint - Rust pub enum DirectAddrType {
Unknown,
Local,
Stun,
@@ -20,16 +20,16 @@ get a publicly routable direct address.
It is possible to configure iroh to bound to a specific port and independently
configure the router to forward this port to the iroh node. This indicates a
situation like this, which still uses STUN to discover the public address.
-
Trait Implementations§
Source§impl Clone for DirectAddrType
impl Clone for DirectAddrType
Source§fn clone(&self) -> DirectAddrType
fn clone(&self) -> DirectAddrType
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DirectAddrType
impl Debug for DirectAddrType
Source§impl Display for DirectAddrType
impl Display for DirectAddrType
Source§impl Hash for DirectAddrType
impl Hash for DirectAddrType
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
+
fn hash_slice<H>(data: &[Self], state: &mut H)where
+
Trait Implementations§
Source§impl Clone for DirectAddrType
impl Clone for DirectAddrType
Source§fn clone(&self) -> DirectAddrType
fn clone(&self) -> DirectAddrType
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DirectAddrType
impl Debug for DirectAddrType
Source§impl Display for DirectAddrType
impl Display for DirectAddrType
Source§impl Hash for DirectAddrType
impl Hash for DirectAddrType
Source§impl Ord for DirectAddrType
impl Ord for DirectAddrType
Source§impl Ord for DirectAddrType
impl Ord for DirectAddrType
Source§fn cmp(&self, other: &DirectAddrType) -> Ordering
fn cmp(&self, other: &DirectAddrType) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for DirectAddrType
impl PartialEq for DirectAddrType
Source§impl PartialOrd for DirectAddrType
impl PartialOrd for DirectAddrType
Source§impl PartialEq for DirectAddrType
impl PartialEq for DirectAddrType
Source§impl PartialOrd for DirectAddrType
impl PartialOrd for DirectAddrType
impl Copy for DirectAddrType
impl Eq for DirectAddrType
impl StructuralPartialEq for DirectAddrType
Auto Trait Implementations§
impl Freeze for DirectAddrType
impl RefUnwindSafe for DirectAddrType
impl Send for DirectAddrType
impl Sync for DirectAddrType
impl Unpin for DirectAddrType
impl UnwindSafe for DirectAddrType
Blanket Implementations§
impl Copy for DirectAddrType
impl Eq for DirectAddrType
impl StructuralPartialEq for DirectAddrType
Auto Trait Implementations§
impl Freeze for DirectAddrType
impl RefUnwindSafe for DirectAddrType
impl Send for DirectAddrType
impl Sync for DirectAddrType
impl Unpin for DirectAddrType
impl UnwindSafe for DirectAddrType
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
fn implicit(
diff --git a/pr/3062/docs/iroh/endpoint/struct.DirectAddr.html b/pr/3062/docs/iroh/endpoint/struct.DirectAddr.html
index 3ae988bdb8..5c9694ccd6 100644
--- a/pr/3062/docs/iroh/endpoint/struct.DirectAddr.html
+++ b/pr/3062/docs/iroh/endpoint/struct.DirectAddr.html
@@ -1,4 +1,4 @@
-DirectAddr in iroh::endpoint - Rust pub struct DirectAddr {
+DirectAddr in iroh::endpoint - Rust pub struct DirectAddr {
pub addr: SocketAddr,
pub typ: DirectAddrType,
}
Expand description
A direct address on which an iroh-node might be contactable.
@@ -7,16 +7,16 @@ contacted. These can come from various sources depending on the network topolog
iroh node, see DirectAddrType for the several kinds of sources.
Fields§
§addr: SocketAddrThe address.
§typ: DirectAddrTypeThe origin of this direct address.
-Trait Implementations§
Source§impl Clone for DirectAddr
Source§fn clone(&self) -> DirectAddr
Returns a copy of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for DirectAddr
Source§impl Hash for DirectAddr
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
+Trait Implementations§
Source§impl Clone for DirectAddr
Source§fn clone(&self) -> DirectAddr
Returns a copy of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for DirectAddr
Source§impl Hash for DirectAddr
Source§impl Ord for DirectAddr
Source§impl Ord for DirectAddr
Source§fn cmp(&self, other: &DirectAddr) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read moreSource§impl PartialEq for DirectAddr
Source§impl PartialOrd for DirectAddr
Source§impl PartialEq for DirectAddr
Source§impl PartialOrd for DirectAddr
Source§impl Eq for DirectAddr
Source§impl StructuralPartialEq for DirectAddr
Auto Trait Implementations§
§impl Freeze for DirectAddr
§impl RefUnwindSafe for DirectAddr
§impl Send for DirectAddr
§impl Sync for DirectAddr
§impl Unpin for DirectAddr
§impl UnwindSafe for DirectAddr
Blanket Implementations§
Source§impl Eq for DirectAddr
Source§impl StructuralPartialEq for DirectAddr
Auto Trait Implementations§
§impl Freeze for DirectAddr
§impl RefUnwindSafe for DirectAddr
§impl Send for DirectAddr
§impl Sync for DirectAddr
§impl Unpin for DirectAddr
§impl UnwindSafe for DirectAddr
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3062/docs/iroh/endpoint/struct.Endpoint.html b/pr/3062/docs/iroh/endpoint/struct.Endpoint.html
index 3577ac70f7..42a1813f00 100644
--- a/pr/3062/docs/iroh/endpoint/struct.Endpoint.html
+++ b/pr/3062/docs/iroh/endpoint/struct.Endpoint.html
@@ -24,7 +24,7 @@ Note that this overrides the current list of ALPNs.
alpn: &[u8],
) -> Result<Connection>
Connects to a remote Endpoint.
A value that can be converted into a NodeAddr is required. This can be either a
-NodeAddr, a NodeId or a iroh_base::ticket::NodeTicket.
+NodeAddr, a NodeId or a [iroh_base::ticket::NodeTicket].
The NodeAddr must contain the NodeId to dial and may also contain a RelayUrl
and direct addresses. If direct addresses are provided, they will be used to try and
establish a direct connection without involving a relay server.
diff --git a/pr/3062/docs/iroh/enum.KeyParsingError.html b/pr/3062/docs/iroh/enum.KeyParsingError.html
index 10db6d3b8a..51e9a40cd8 100644
--- a/pr/3062/docs/iroh/enum.KeyParsingError.html
+++ b/pr/3062/docs/iroh/enum.KeyParsingError.html
@@ -1,4 +1,4 @@
-KeyParsingError in iroh - Rust pub enum KeyParsingError {
+KeyParsingError in iroh - Rust Enum KeyParsingError
pub enum KeyParsingError {
Decode(DecodeError),
Key(Error),
DecodeInvalidLength,
@@ -6,7 +6,7 @@
Variants§
§Decode(DecodeError)
Error when decoding.
§Key(Error)
Error when decoding the public key.
§DecodeInvalidLength
The encoded information had the wrong length.
-Trait Implementations§
Source§impl Debug for KeyParsingError
Source§impl Display for KeyParsingError
Source§impl Error for KeyParsingError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Source§impl From<DecodeError> for KeyParsingError
Source§fn from(source: DecodeError) -> KeyParsingError
Converts to this type from the input type.Source§impl From<Error> for KeyParsingError
Source§fn from(source: Error) -> KeyParsingError
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for KeyParsingError
§impl !RefUnwindSafe for KeyParsingError
§impl Send for KeyParsingError
§impl Sync for KeyParsingError
§impl Unpin for KeyParsingError
§impl !UnwindSafe for KeyParsingError
Blanket Implementations§
Trait Implementations§
§impl Debug for KeyParsingError
§impl Display for KeyParsingError
§impl Error for KeyParsingError
§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()§impl From<DecodeError> for KeyParsingError
§fn from(source: DecodeError) -> KeyParsingError
Converts to this type from the input type.§impl From<Error> for KeyParsingError
§fn from(source: Error) -> KeyParsingError
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for KeyParsingError
§impl !RefUnwindSafe for KeyParsingError
§impl Send for KeyParsingError
§impl Sync for KeyParsingError
§impl Unpin for KeyParsingError
§impl !UnwindSafe for KeyParsingError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3062/docs/iroh/metrics/struct.RelayMetrics.html b/pr/3062/docs/iroh/metrics/struct.RelayMetrics.html
index e6cb96f81d..1c26fe358e 100644
--- a/pr/3062/docs/iroh/metrics/struct.RelayMetrics.html
+++ b/pr/3062/docs/iroh/metrics/struct.RelayMetrics.html
@@ -1,4 +1,4 @@
-RelayMetrics in iroh::metrics - Rust pub struct RelayMetrics {Show 21 fields
+RelayMetrics in iroh::metrics - Rust Struct RelayMetrics
pub struct RelayMetrics {Show 21 fields
pub bytes_sent: Counter,
pub bytes_recv: Counter,
pub send_packets_sent: Counter,
@@ -42,7 +42,7 @@
§unique_client_keys: CounterNumber of unique client keys per day
§websocket_accepts: CounterNumber of accepted websocket connections
§derp_accepts: CounterNumber of accepted ‘iroh derp http’ connection upgrades
-Trait Implementations§
Source§impl Metric for Metrics
§fn new(registry: &mut Registry) -> Self
Available on crate feature metrics only.Initializes this metric group.§fn with_metric<T, F>(f: F)where
+Trait Implementations§
§impl Metric for Metrics
§fn new(registry: &mut Registry) -> Self
Available on crate feature metrics only.Initializes this metric group.§fn with_metric<T, F>(f: F)where
F: FnOnce(&Self) -> T,
Available on crate feature metrics only.Access to this metrics group to record a metric.
Only records if this metric is registered in the global registry.Auto Trait Implementations§
§impl Freeze for Metrics
§impl RefUnwindSafe for Metrics
§impl Send for Metrics
§impl Sync for Metrics
§impl Unpin for Metrics
§impl UnwindSafe for Metrics
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/3062/docs/iroh/struct.NodeAddr.html b/pr/3062/docs/iroh/struct.NodeAddr.html
index f681252bf9..18b496c519 100644
--- a/pr/3062/docs/iroh/struct.NodeAddr.html
+++ b/pr/3062/docs/iroh/struct.NodeAddr.html
@@ -1,4 +1,4 @@
-NodeAddr in iroh - Rust pub struct NodeAddr {
+NodeAddr in iroh - Rust Struct NodeAddr
pub struct NodeAddr {
pub node_id: PublicKey,
pub relay_url: Option<RelayUrl>,
pub direct_addresses: BTreeSet<SocketAddr>,
@@ -27,36 +27,36 @@ whenever a connection to other nodes needs to be established.
Fields§
§node_id: PublicKeyThe node’s identifier.
§relay_url: Option<RelayUrl>The node’s home relay url.
§direct_addresses: BTreeSet<SocketAddr>Socket addresses where the peer might be reached directly.
-Implementations§
Source§impl NodeAddr
Sourcepub fn new(node_id: PublicKey) -> NodeAddr
Creates a new NodeAddr with no relay_url and no direct_addresses.
-Sourcepub fn with_relay_url(self, relay_url: RelayUrl) -> NodeAddr
Adds a relay url.
-Sourcepub fn with_direct_addresses(
+
Implementations§
§impl NodeAddr
pub fn new(node_id: PublicKey) -> NodeAddr
Creates a new NodeAddr with no relay_url and no direct_addresses.
+pub fn with_relay_url(self, relay_url: RelayUrl) -> NodeAddr
Adds a relay url.
+pub fn with_direct_addresses(
self,
addresses: impl IntoIterator<Item = SocketAddr>,
) -> NodeAddr
Adds the given direct addresses.
-Sourcepub fn from_parts(
+
pub fn from_parts(
node_id: PublicKey,
relay_url: Option<RelayUrl>,
direct_addresses: impl IntoIterator<Item = SocketAddr>,
) -> NodeAddr
Creates a new NodeAddr from its parts.
-Sourcepub fn direct_addresses(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of this peer.
-Trait Implementations§
Source§impl<'de> Deserialize<'de> for NodeAddr
Source§fn deserialize<__D>(
+
pub fn direct_addresses(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of this peer.
+
Trait Implementations§
§impl<'de> Deserialize<'de> for NodeAddr
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<NodeAddr, <__D as Deserializer<'de>>::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl From<NodeTicket> for NodeAddr
Source§fn from(ticket: NodeTicket) -> NodeAddr
Returns the addressing info from given ticket.
-Source§impl From<RemoteInfo> for NodeAddr
Source§fn from(info: RemoteInfo) -> Self
Converts to this type from the input type.Source§impl From<RemoteInfo> for NodeAddr
Source§fn from(info: RemoteInfo) -> Self
Converts to this type from the input type.§impl Ord for NodeAddr
Source§impl PartialOrd for NodeAddr
§impl Serialize for NodeAddr
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
- __S: Serializer,
Serialize this value into the given Serde serializer. Read moreSource§impl Eq for NodeAddr
Source§impl StructuralPartialEq for NodeAddr
Auto Trait Implementations§
§impl Freeze for NodeAddr
§impl RefUnwindSafe for NodeAddr
§impl Send for NodeAddr
§impl Sync for NodeAddr
§impl Unpin for NodeAddr
§impl UnwindSafe for NodeAddr
Blanket Implementations§
Source§impl<T> Any for Twhere
+ __S: Serializer,
Serialize this value into the given Serde serializer. Read more
§impl Eq for NodeAddr
§impl StructuralPartialEq for NodeAddr
Auto Trait Implementations§
§impl Freeze for NodeAddr
§impl RefUnwindSafe for NodeAddr
§impl Send for NodeAddr
§impl Sync for NodeAddr
§impl Unpin for NodeAddr
§impl UnwindSafe for NodeAddr
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3062/docs/iroh/struct.PublicKey.html b/pr/3062/docs/iroh/struct.PublicKey.html
index 71cb99695b..6d317decce 100644
--- a/pr/3062/docs/iroh/struct.PublicKey.html
+++ b/pr/3062/docs/iroh/struct.PublicKey.html
@@ -1,43 +1,43 @@
-PublicKey in iroh - Rust pub struct PublicKey(/* private fields */);
Expand description
A public key.
+PublicKey in iroh - Rust Struct PublicKey
pub struct PublicKey(/* private fields */);
Expand description
A public key.
The key itself is stored as the CompressedEdwards y coordinate of the public key
It is verified to decompress into a valid key when created.
-Implementations§
Source§impl PublicKey
Sourcepub fn from_bytes(bytes: &[u8; 32]) -> Result<PublicKey, Error>
Construct a PublicKey from a slice of bytes.
+Implementations§
§impl PublicKey
pub fn public(&self) -> VerifyingKey
Returns the [VerifyingKey] for this PublicKey.
+pub fn from_bytes(bytes: &[u8; 32]) -> Result<PublicKey, Error>
Construct a PublicKey from a slice of bytes.
§Warning
This will return a [SignatureError] if the bytes passed into this method do not represent
a valid ed25519_dalek curve point. Will never fail for bytes return from Self::as_bytes.
See [VerifyingKey::from_bytes] for details.
-Sourcepub fn verify(&self, message: &[u8], signature: &Signature) -> Result<(), Error>
Verify a signature on a message with this secret key’s public key.
+pub fn verify(&self, message: &[u8], signature: &Signature) -> Result<(), Error>
Verify a signature on a message with this secret key’s public key.
§Return
Returns Ok(()) if the signature is valid, and Err otherwise.
-Trait Implementations§
Trait Implementations§
§impl<'de> Deserialize<'de> for PublicKey
§fn deserialize<D>(
deserializer: D,
) -> Result<PublicKey, <D as Deserializer<'de>>::Error>where
- D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more§impl FromStr for PublicKey
Source§impl Hash for PublicKey
§impl Ord for PublicKey
Source§impl PartialOrd for PublicKey
§impl Serialize for PublicKey
§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
- S: Serializer,
Serialize this value into the given Serde serializer. Read moreSource§impl Copy for PublicKey
Source§impl Eq for PublicKey
Source§impl StructuralPartialEq for PublicKey
Auto Trait Implementations§
§impl Freeze for PublicKey
§impl RefUnwindSafe for PublicKey
§impl Send for PublicKey
§impl Sync for PublicKey
§impl Unpin for PublicKey
§impl UnwindSafe for PublicKey
Blanket Implementations§
§impl Copy for PublicKey
§impl Eq for PublicKey
§impl StructuralPartialEq for PublicKey
Auto Trait Implementations§
§impl Freeze for PublicKey
§impl RefUnwindSafe for PublicKey
§impl Send for PublicKey
§impl Sync for PublicKey
§impl Unpin for PublicKey
§impl UnwindSafe for PublicKey
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3062/docs/iroh/struct.RelayMap.html b/pr/3062/docs/iroh/struct.RelayMap.html
index 6455a2a69f..db261a0740 100644
--- a/pr/3062/docs/iroh/struct.RelayMap.html
+++ b/pr/3062/docs/iroh/struct.RelayMap.html
@@ -1,26 +1,26 @@
-RelayMap in iroh - Rust pub struct RelayMap { /* private fields */ }
Expand description
Configuration of all the relay servers that can be used.
-Implementations§
Source§impl RelayMap
Sourcepub fn nodes(&self) -> impl Iterator<Item = &Arc<RelayNode>>
Returns an Iterator over all known nodes.
-Sourcepub fn contains_node(&self, url: &RelayUrl) -> bool
Is this a known node?
-Sourcepub fn default_from_node(url: RelayUrl, stun_port: u16) -> RelayMap
Creates a new RelayMap with a single relay server configured.
+RelayMap in iroh - Rust Struct RelayMap
pub struct RelayMap { /* private fields */ }
Expand description
Configuration of all the relay servers that can be used.
+Implementations§
§impl RelayMap
pub fn nodes(&self) -> impl Iterator<Item = &Arc<RelayNode>>
Returns an Iterator over all known nodes.
+pub fn contains_node(&self, url: &RelayUrl) -> bool
Is this a known node?
+pub fn default_from_node(url: RelayUrl, stun_port: u16) -> RelayMap
Creates a new RelayMap with a single relay server configured.
Allows to set a custom STUN port and different IP addresses for IPv4 and IPv6.
If IP addresses are provided, no DNS lookup will be performed.
Sets the port to the default DEFAULT_RELAY_QUIC_PORT.
-Sourcepub fn from_nodes<I>(
+
pub fn from_nodes<I>(
value: impl IntoIterator<Item = I>,
) -> Result<RelayMap, Error>
Trait Implementations§
Source§impl Eq for RelayMap
Source§impl StructuralPartialEq for RelayMap
Auto Trait Implementations§
§impl Freeze for RelayMap
§impl RefUnwindSafe for RelayMap
§impl Send for RelayMap
§impl Sync for RelayMap
§impl Unpin for RelayMap
§impl UnwindSafe for RelayMap
Blanket Implementations§
Trait Implementations§
§impl Eq for RelayMap
§impl StructuralPartialEq for RelayMap
Auto Trait Implementations§
§impl Freeze for RelayMap
§impl RefUnwindSafe for RelayMap
§impl Send for RelayMap
§impl Sync for RelayMap
§impl Unpin for RelayMap
§impl UnwindSafe for RelayMap
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3062/docs/iroh/struct.RelayNode.html b/pr/3062/docs/iroh/struct.RelayNode.html
index 7da0ec16ae..1ddae9195e 100644
--- a/pr/3062/docs/iroh/struct.RelayNode.html
+++ b/pr/3062/docs/iroh/struct.RelayNode.html
@@ -1,8 +1,8 @@
-RelayNode in iroh - Rust pub struct RelayNode {
+RelayNode in iroh - Rust Struct RelayNode
pub struct RelayNode {
pub url: RelayUrl,
pub stun_only: bool,
pub stun_port: u16,
- pub quic: Option<RelayQuicConfig>,
+ pub quic: Option<RelayQuicConfig>,
}
Expand description
Information on a specific relay server.
Includes the Url where it can be dialed.
Fields§
§url: RelayUrlThe RelayUrl where this relay server can be dialed.
@@ -11,24 +11,24 @@
functionality is used.
§stun_port: u16The stun port of the relay server.
Setting this to 0 means the default STUN port is used.
-§quic: Option<RelayQuicConfig>Configuration to speak to the QUIC endpoint on the relay server.
+§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<'de> Deserialize<'de> for RelayNode
Source§fn deserialize<__D>(
+
Trait Implementations§
§impl<'de> Deserialize<'de> for RelayNode
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<RelayNode, <__D as Deserializer<'de>>::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more§impl Ord for RelayNode
Source§impl PartialOrd for RelayNode
§impl Serialize for RelayNode
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
- __S: Serializer,
Serialize this value into the given Serde serializer. Read moreSource§impl Eq for RelayNode
Source§impl StructuralPartialEq for RelayNode
Auto Trait Implementations§
§impl Freeze for RelayNode
§impl RefUnwindSafe for RelayNode
§impl Send for RelayNode
§impl Sync for RelayNode
§impl Unpin for RelayNode
§impl UnwindSafe for RelayNode
Blanket Implementations§
Source§impl<T> Any for Twhere
+ __S: Serializer,
Serialize this value into the given Serde serializer. Read more§impl Eq for RelayNode
§impl StructuralPartialEq for RelayNode
Auto Trait Implementations§
§impl Freeze for RelayNode
§impl RefUnwindSafe for RelayNode
§impl Send for RelayNode
§impl Sync for RelayNode
§impl Unpin for RelayNode
§impl UnwindSafe for RelayNode
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3062/docs/iroh/struct.RelayUrl.html b/pr/3062/docs/iroh/struct.RelayUrl.html
index 01b1dbf533..e9cdef13bb 100644
--- a/pr/3062/docs/iroh/struct.RelayUrl.html
+++ b/pr/3062/docs/iroh/struct.RelayUrl.html
@@ -1,4 +1,4 @@
-RelayUrl in iroh - Rust pub struct RelayUrl(/* private fields */);
Expand description
A URL identifying a relay server.
+RelayUrl in iroh - Rust Struct RelayUrl
pub struct RelayUrl(/* private fields */);
Expand description
A URL identifying a relay server.
This is but a wrapper around Url, with a few custom tweaks:
-
@@ -443,30 +443,30 @@ or if
Path::new_opt() returns None.
(That is, if the percent-decoded path contains a NUL byte or,
for a Windows path, is not UTF-8.)
This method is only available if the std Cargo feature is enabled.
-
Trait Implementations§
Trait Implementations§
§impl Deref for RelayUrl
Source§impl<'de> Deserialize<'de> for RelayUrl
Source§fn deserialize<__D>(
+
§impl<'de> Deserialize<'de> for RelayUrl
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<RelayUrl, <__D as Deserializer<'de>>::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more§impl FromStr for RelayUrl
Support for parsing strings directly.
If you need more control over the error first create a Url and use RelayUrl::from
instead.
-Source§impl Hash for RelayUrl
§impl Ord for RelayUrl
Source§impl PartialOrd for RelayUrl
§impl Serialize for RelayUrl
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
- __S: Serializer,
Serialize this value into the given Serde serializer. Read moreSource§impl Eq for RelayUrl
Source§impl StructuralPartialEq for RelayUrl
Auto Trait Implementations§
§impl Freeze for RelayUrl
§impl RefUnwindSafe for RelayUrl
§impl Send for RelayUrl
§impl Sync for RelayUrl
§impl Unpin for RelayUrl
§impl UnwindSafe for RelayUrl
Blanket Implementations§
Source§impl<T> Any for Twhere
+ __S: Serializer,
Serialize this value into the given Serde serializer. Read more§impl Eq for RelayUrl
§impl StructuralPartialEq for RelayUrl
Auto Trait Implementations§
§impl Freeze for RelayUrl
§impl RefUnwindSafe for RelayUrl
§impl Send for RelayUrl
§impl Sync for RelayUrl
§impl Unpin for RelayUrl
§impl UnwindSafe for RelayUrl
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3062/docs/iroh/struct.RelayUrlParseError.html b/pr/3062/docs/iroh/struct.RelayUrlParseError.html
index 88a4b6bae1..3ddedd374b 100644
--- a/pr/3062/docs/iroh/struct.RelayUrlParseError.html
+++ b/pr/3062/docs/iroh/struct.RelayUrlParseError.html
@@ -1,5 +1,5 @@
-RelayUrlParseError in iroh - Rust pub struct RelayUrlParseError(/* private fields */);
Expand description
Can occur when parsing a string into a RelayUrl.
-Trait Implementations§
Source§impl Debug for RelayUrlParseError
Source§impl Display for RelayUrlParseError
Source§impl Error for RelayUrlParseError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Source§impl From<ParseError> for RelayUrlParseError
Source§fn from(source: ParseError) -> RelayUrlParseError
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for RelayUrlParseError
§impl RefUnwindSafe for RelayUrlParseError
§impl Send for RelayUrlParseError
§impl Sync for RelayUrlParseError
§impl Unpin for RelayUrlParseError
§impl UnwindSafe for RelayUrlParseError
Blanket Implementations§
Source§impl<T> Any for Twhere
+RelayUrlParseError in iroh - Rust Struct RelayUrlParseError
pub struct RelayUrlParseError(/* private fields */);
Expand description
Can occur when parsing a string into a RelayUrl.
+Trait Implementations§
§impl Debug for RelayUrlParseError
§impl Display for RelayUrlParseError
§impl Error for RelayUrlParseError
§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()§impl From<ParseError> for RelayUrlParseError
§fn from(source: ParseError) -> RelayUrlParseError
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for RelayUrlParseError
§impl RefUnwindSafe for RelayUrlParseError
§impl Send for RelayUrlParseError
§impl Sync for RelayUrlParseError
§impl Unpin for RelayUrlParseError
§impl UnwindSafe for RelayUrlParseError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3062/docs/iroh/struct.SecretKey.html b/pr/3062/docs/iroh/struct.SecretKey.html
index 458c9086b6..81e34a05f8 100644
--- a/pr/3062/docs/iroh/struct.SecretKey.html
+++ b/pr/3062/docs/iroh/struct.SecretKey.html
@@ -1,24 +1,24 @@
-SecretKey in iroh - Rust pub struct SecretKey { /* private fields */ }
Expand description
A secret key.
-Implementations§
Source§impl SecretKey
Sourcepub fn generate<R>(csprng: R) -> SecretKeywhere
+SecretKey in iroh - Rust Struct SecretKey
pub struct SecretKey { /* private fields */ }
Expand description
A secret key.
+Implementations§
§impl SecretKey
pub fn generate<R>(csprng: R) -> SecretKeywhere
R: CryptoRngCore,
Generate a new SecretKey with a randomness generator.
// use the OsRng option for OS depedndent most secure RNG.
let mut rng = rand::rngs::OsRng;
let _key = iroh_base::SecretKey::generate(&mut rng);
-Sourcepub fn sign(&self, msg: &[u8]) -> Signature
Sign the given message and return a digital signature
-pub fn to_bytes(&self) -> [u8; 32]
Convert this to the bytes representing the secret part.
The public part can always be recovered.
-Sourcepub fn from_bytes(bytes: &[u8; 32]) -> SecretKey
Create a secret key from its byte representation.
-Trait Implementations§
Source§impl<'de> Deserialize<'de> for SecretKey
Source§fn deserialize<D>(
+
pub fn from_bytes(bytes: &[u8; 32]) -> SecretKey
Create a secret key from its byte representation.
+pub fn secret(&self) -> &SigningKey
Returns the [SigningKey] for this SecretKey.
+Trait Implementations§
§impl<'de> Deserialize<'de> for SecretKey
§fn deserialize<D>(
deserializer: D,
) -> Result<SecretKey, <D as Deserializer<'de>>::Error>where
- D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more§impl Serialize for SecretKey
§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
- S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
§impl Freeze for SecretKey
§impl RefUnwindSafe for SecretKey
§impl Send for SecretKey
§impl Sync for SecretKey
§impl Unpin for SecretKey
§impl UnwindSafe for SecretKey
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/3062/docs/iroh/test_utils/fn.run_relay_server.html b/pr/3062/docs/iroh/test_utils/fn.run_relay_server.html
index befdb59842..4ebdc2a805 100644
--- a/pr/3062/docs/iroh/test_utils/fn.run_relay_server.html
+++ b/pr/3062/docs/iroh/test_utils/fn.run_relay_server.html
@@ -1,4 +1,4 @@
-run_relay_server in iroh::test_utils - Rust pub async fn run_relay_server() -> Result<(RelayMap, RelayUrl, Server)>
Available on crate feature test-utils only.Expand description
Runs a relay server with STUN and QUIC enabled suitable for tests.
+run_relay_server in iroh::test_utils - Rust
\ No newline at end of file
diff --git a/pr/3062/docs/iroh/test_utils/fn.run_relay_server_with.html b/pr/3062/docs/iroh/test_utils/fn.run_relay_server_with.html
index a73916f65e..ba6f84cdfd 100644
--- a/pr/3062/docs/iroh/test_utils/fn.run_relay_server_with.html
+++ b/pr/3062/docs/iroh/test_utils/fn.run_relay_server_with.html
@@ -1,9 +1,9 @@
run_relay_server_with in iroh::test_utils - Rust pub async fn run_relay_server_with(
- stun: Option<StunConfig>,
+ stun: Option<StunConfig>,
quic: bool,
-) -> Result<(RelayMap, RelayUrl, Server)>
Available on crate feature test-utils only.Expand description
Runs a relay server.
+) -> Result<(RelayMap, RelayUrl, Server)>Available on crate feature test-utils only.Expand description
Runs a relay server.
stun can be set to None to disable stun, or set to Some StunConfig,
to enable stun on a specific socket.
-If quic is set to true, it will make the appropriate QuicConfig from the generated tls certificates and run the quic server at a random free port.
+If quic is set to true, it will make the appropriate [QuicConfig] from the generated tls certificates and run the quic server at a random free port.
The return value is similar to run_relay_server.
\ No newline at end of file
diff --git a/pr/3062/docs/iroh/test_utils/fn.run_relay_server_with_stun.html b/pr/3062/docs/iroh/test_utils/fn.run_relay_server_with_stun.html
index bdff0055f8..974d3f306b 100644
--- a/pr/3062/docs/iroh/test_utils/fn.run_relay_server_with_stun.html
+++ b/pr/3062/docs/iroh/test_utils/fn.run_relay_server_with_stun.html
@@ -1,4 +1,4 @@
-run_relay_server_with_stun in iroh::test_utils - Rust pub async fn run_relay_server_with_stun() -> Result<(RelayMap, RelayUrl, Server)>
Available on crate feature test-utils only.Expand description
Runs a relay server with STUN enabled suitable for tests.
+run_relay_server_with_stun in iroh::test_utils - Rust
\ No newline at end of file
diff --git a/pr/3062/docs/iroh/type.NodeId.html b/pr/3062/docs/iroh/type.NodeId.html
index 893e85f42a..c9c873e0e6 100644
--- a/pr/3062/docs/iroh/type.NodeId.html
+++ b/pr/3062/docs/iroh/type.NodeId.html
@@ -1,4 +1,4 @@
-NodeId in iroh - Rust pub type NodeId = PublicKey;
Expand description
The identifier for a node in the (iroh) network.
+NodeId in iroh - Rust Type Alias NodeId
pub type NodeId = PublicKey;
Expand description
The identifier for a node in the (iroh) network.
Each node in iroh has a unique identifier created as a cryptographic key. This can be
used to globally identify a node. Since it is also a cryptographic key it is also the
mechanism by which all traffic is always encrypted for a specific node only.
diff --git a/pr/3062/docs/iroh_net_report/struct.Client.html b/pr/3062/docs/iroh_net_report/struct.Client.html
index 4d9507ffb0..c27924b10a 100644
--- a/pr/3062/docs/iroh_net_report/struct.Client.html
+++ b/pr/3062/docs/iroh_net_report/struct.Client.html
@@ -16,7 +16,7 @@ stop running.
allows sending messages to the actor.
Sourcepub async fn get_report(
&mut self,
- relay_map: RelayMap,
+ relay_map: RelayMap,
stun_sock_v4: Option<Arc<UdpSocket>>,
stun_sock_v6: Option<Arc<UdpSocket>>,
quic_config: Option<QuicConfig>,
@@ -38,14 +38,14 @@ using QUIC address discovery.
This will attempt to use all probe protocols.
Sourcepub async fn get_report_with_opts(
&mut self,
- relay_map: RelayMap,
+ relay_map: RelayMap,
opts: Options,
) -> Result<Arc<Report>>
Runs a net_report, returning the report.
It may not be called concurrently with itself, &mut self takes care of that.
Look at Options for the different configuration options.
Sourcepub async fn get_report_channel(
&mut self,
- relay_map: RelayMap,
+ relay_map: RelayMap,
opts: Options,
) -> Result<Receiver<Result<Arc<Report>>>>
Get report with channel
Look at Options for the different configuration options.
diff --git a/pr/3062/docs/iroh_net_report/struct.RelayLatencies.html b/pr/3062/docs/iroh_net_report/struct.RelayLatencies.html
index 010850c89d..17bdf83c57 100644
--- a/pr/3062/docs/iroh_net_report/struct.RelayLatencies.html
+++ b/pr/3062/docs/iroh_net_report/struct.RelayLatencies.html
@@ -1,5 +1,5 @@
RelayLatencies in iroh_net_report - Rust pub struct RelayLatencies(/* private fields */);
Expand description
Latencies per relay node.
-Implementations§
Source§impl RelayLatencies
Sourcepub fn iter(&self) -> impl Iterator<Item = (&RelayUrl, Duration)> + '_
Returns an iterator over all the relays and their latencies.
+Implementations§
Trait Implementations§
Source§impl Clone for RelayLatencies
Source§fn clone(&self) -> RelayLatencies
Returns a copy of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for RelayLatencies
Source§impl Default for RelayLatencies
Source§fn default() -> RelayLatencies
Returns the “default value” for a type. Read moreSource§impl PartialEq for RelayLatencies
Source§impl Eq for RelayLatencies
Source§impl StructuralPartialEq for RelayLatencies
Auto Trait Implementations§
§impl Freeze for RelayLatencies
§impl RefUnwindSafe for RelayLatencies
§impl Send for RelayLatencies
§impl Sync for RelayLatencies
§impl Unpin for RelayLatencies
§impl UnwindSafe for RelayLatencies
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/3062/docs/iroh_net_report/struct.Report.html b/pr/3062/docs/iroh_net_report/struct.Report.html
index 1a2175c6da..dffd956afd 100644
--- a/pr/3062/docs/iroh_net_report/struct.Report.html
+++ b/pr/3062/docs/iroh_net_report/struct.Report.html
@@ -11,7 +11,7 @@
pub mapping_varies_by_dest_ipv6: Option<bool>,
pub hair_pinning: Option<bool>,
pub portmap_probe: Option<ProbeOutput>,
- pub preferred_relay: Option<RelayUrl>,
+ pub preferred_relay: Option<RelayUrl>,
pub relay_latency: RelayLatencies,
pub relay_v4_latency: RelayLatencies,
pub relay_v6_latency: RelayLatencies,
@@ -35,7 +35,7 @@ detecting rather than using it. For now.
§hair_pinning: Option<bool>Whether the router supports communicating between two local devices through the NATted
public IP address (on IPv4).
§portmap_probe: Option<ProbeOutput>Probe indicating the presence of port mapping protocols on the LAN.
-§preferred_relay: Option<RelayUrl>None for unknown
+§preferred_relay: Option<RelayUrl>None for unknown
§relay_latency: RelayLatencieskeyed by relay Url
§relay_v4_latency: RelayLatencieskeyed by relay Url
§relay_v6_latency: RelayLatencieskeyed by relay Url
diff --git a/pr/3062/docs/src/iroh/magicsock.rs.html b/pr/3062/docs/src/iroh/magicsock.rs.html
index 39045536b3..a0b3a87eb4 100644
--- a/pr/3062/docs/src/iroh/magicsock.rs.html
+++ b/pr/3062/docs/src/iroh/magicsock.rs.html
@@ -4119,61 +4119,7 @@
4118
4119
4120
-4121
-4122
-4123
-4124
-4125
-4126
-4127
-4128
-4129
-4130
-4131
-4132
-4133
-4134
-4135
-4136
-4137
-4138
-4139
-4140
-4141
-4142
-4143
-4144
-4145
-4146
-4147
-4148
-4149
-4150
-4151
-4152
-4153
-4154
-4155
-4156
-4157
-4158
-4159
-4160
-4161
-4162
-4163
-4164
-4165
-4166
-4167
-4168
-4169
-4170
-4171
-4172
-4173
-4174
-4175//! Implements a socket that can change its communication path while in use, actively searching for the best way to communicate.
+4121
//! Implements a socket that can change its communication path while in use, actively searching for the best way to communicate.
//!
//! Based on tailscale/wgengine/magicsock
//!
@@ -4359,9 +4305,9 @@
/// Relay datagrams received by relays are put into this queue and consumed by
/// [`AsyncUdpSocket`]. This queue takes care of the wakers needed by
/// [`AsyncUdpSocket::poll_recv`].
- relay_datagrams_queue: Arc<RelayDatagramRecvQueue>,
+ relay_datagram_recv_queue: Arc<RelayDatagramRecvQueue>,
/// Channel on which to send datagrams via a relay server.
- relay_datagrams_send_channel: RelayDatagramSendChannelSender,
+ relay_datagram_send_channel: RelayDatagramSendChannelSender,
/// Counter for ordering of [`MagicSock::poll_recv`] polling order.
poll_recv_counter: AtomicUsize,
@@ -4611,7 +4557,7 @@
// ready.
let ipv4_poller = self.pconn4.create_io_poller();
let ipv6_poller = self.pconn6.as_ref().map(|sock| sock.create_io_poller());
- let relay_sender = self.relay_datagrams_send_channel.clone();
+ let relay_sender = self.relay_datagram_send_channel.clone();
Box::pin(IoPoller {
ipv4_poller,
ipv6_poller,
@@ -4777,7 +4723,7 @@
url: url.clone(),
datagrams: contents,
};
- match self.relay_datagrams_send_channel.try_send(msg) {
+ match self.relay_datagram_send_channel.try_send(msg) {
Ok(_) => {
trace!(node = %node.fmt_short(), relay_url = %url,
"send relay: message queued");
@@ -5039,7 +4985,7 @@
// For each output buffer keep polling the datagrams from the relay until one is
// a QUIC datagram to be placed into the output buffer. Or the channel is empty.
loop {
- let recv = match self.relay_datagrams_queue.poll_recv(cx) {
+ let recv = match self.relay_datagram_recv_queue.poll_recv(cx) {
Poll::Ready(Ok(recv)) => recv,
Poll::Ready(Err(err)) => {
error!("relay_recv_channel closed: {err:#}");
@@ -5736,8 +5682,8 @@
local_addrs: std::sync::RwLock::new((ipv4_addr, ipv6_addr)),
closing: AtomicBool::new(false),
closed: AtomicBool::new(false),
- relay_datagrams_queue: relay_datagram_recv_queue.clone(),
- relay_datagrams_send_channel: relay_datagram_send_tx,
+ relay_datagram_recv_queue: relay_datagram_recv_queue.clone(),
+ relay_datagram_send_channel: relay_datagram_send_tx,
poll_recv_counter: AtomicUsize::new(0),
actor_sender: actor_sender.clone(),
ipv6_reported: Arc::new(AtomicBool::new(false)),
@@ -5902,7 +5848,11 @@
Parse(anyhow::Error),
}
-fn relay_datagram_sender() -> (
+/// Creates a sender and receiver pair for sending datagrams to the [`RelayActor`].
+///
+/// These includes the waker coordination required to support [`AsyncUdpSocket::try_send`]
+/// and [`quinn::UdpPoller::poll_writable`].
+fn relay_datagram_sender() -> (
RelayDatagramSendChannelSender,
RelayDatagramSendChannelReceiver,
) {
@@ -5916,7 +5866,11 @@
(tx, rx)
}
-#[derive(Debug, Clone)]
+/// Sender to send datagrams to the [`RelayActor`].
+///
+/// This includes the waker coordination required to support [`AsyncUdpSocket::try_send`]
+/// and [`quinn::UdpPoller::poll_writable`].
+#[derive(Debug, Clone)]
struct RelayDatagramSendChannelSender {
sender: mpsc::Sender<RelaySendItem>,
waker: Arc<AtomicWaker>,
@@ -5941,7 +5895,11 @@
}
}
-#[derive(Debug)]
+/// Receiver to send datagrams to the [`RelayActor`].
+///
+/// This includes the waker coordination required to support [`AsyncUdpSocket::try_send`]
+/// and [`quinn::UdpPoller::poll_writable`].
+#[derive(Debug)]
struct RelayDatagramSendChannelReceiver {
receiver: mpsc::Receiver<RelaySendItem>,
waker: Arc<AtomicWaker>,
@@ -5955,73 +5913,7 @@
}
}
-// #[derive(Debug)]
-// struct RelayDatagramSendQueue {
-// queue: ConcurrentQueue<RelaySendItem>,
-// writable_waker: AtomicWaker,
-// readable_waker: AtomicWaker,
-// }
-
-// impl RelayDatagramSendQueue {
-// fn new() -> Self {
-// Self {
-// queue: ConcurrentQueue::bounded(256),
-// writable_waker: AtomicWaker::new(),
-// readable_waker: AtomicWaker::new(),
-// }
-// }
-
-// fn try_send(&self, item: RelaySendItem) -> Result<(), io::Error> {
-// match self.queue.push(item) {
-// Ok(_) => {
-// self.readable_waker.wake();
-// Ok(())
-// }
-// Err(err) => match err {
-// concurrent_queue::PushError::Full(_) => Err(io::Error::new(
-// io::ErrorKind::ConnectionReset,
-// "queue to RelayActor is closed",
-// )),
-// concurrent_queue::PushError::Closed(_) => Err(io::Error::new(
-// io::ErrorKind::WouldBlock,
-// "queue to RelayActor is full",
-// )),
-// },
-// }
-// }
-
-// fn poll_writable(&self, cx: &mut Context) -> Poll<io::Result<()>> {
-// if self.queue.is_full() {
-// self.writable_waker.register(cx.waker());
-// Poll::Pending
-// } else {
-// Poll::Ready(Ok(()))
-// }
-// }
-
-// fn recv(&self) -> impl Future<Output = Option<RelaySendItem>> {
-// future::poll_fn(|cx| match self.queue.pop {
-// Ok(item) => Poll::Ready(item),
-// Err(concurrent_queue::PopError::Closed) => Poll::Ready(None),
-// Err(concurrent_queue::PopError::Empty) => {
-// self.readable_waker.register(cx.waker());
-// match self.queue.pop() {
-// Ok(value) => {
-// self.readable_waker.take();
-// Poll::Ready(Ok(value))
-// }
-// Err(concurrent_queue::PopError::Empty) => Poll::Pending,
-// Err(concurrent_queue::PopError::Closed) => {
-// self.readlable_waker.take();
-// Poll::Ready(Err(anyhow!("Queue closed")))
-// }
-// }
-// }
-// })
-// }
-// }
-
-/// A queue holding [`RelayRecvDatagram`]s that can be polled in async
+/// A queue holding [`RelayRecvDatagram`]s that can be polled in async
/// contexts, and wakes up tasks when something adds items using [`try_send`].
///
/// This is used to transfer relay datagrams between the [`RelayActor`]
diff --git a/pr/3062/docs/src/iroh/magicsock/relay_actor.rs.html b/pr/3062/docs/src/iroh/magicsock/relay_actor.rs.html
index 949fe876bc..ba986a0ae7 100644
--- a/pr/3062/docs/src/iroh/magicsock/relay_actor.rs.html
+++ b/pr/3062/docs/src/iroh/magicsock/relay_actor.rs.html
@@ -1131,9 +1131,7 @@
1130
1131
1132
-1133
-1134
-1135
//! The relay actor.
+1133
//! The relay actor.
//!
//! The [`RelayActor`] handles all the relay connections. It is helped by the
//! [`ActiveRelayActor`] which handles a single relay connection.
@@ -1166,14 +1164,13 @@
use tracing::{debug, error, info, info_span, trace, warn, Instrument};
use url::Url;
+use super::RelayDatagramSendChannelReceiver;
use crate::{
dns::DnsResolver,
magicsock::{MagicSock, Metrics as MagicsockMetrics, RelayContents, RelayDatagramRecvQueue},
util::MaybeFuture,
};
-use super::RelayDatagramSendChannelReceiver;
-
/// How long a non-home relay connection needs to be idle (last written to) before we close it.
const RELAY_INACTIVE_CLEANUP_TIME: Duration = Duration::from_secs(60);
@@ -1573,8 +1570,7 @@
pub(super) fn new(
msock: Arc<MagicSock>,
relay_datagram_recv_queue: Arc<RelayDatagramRecvQueue>,
- // relay_datagram_send_queue: RelayDatagramsQueue,
- ) -> Self {
+ ) -> Self {
let cancel_token = CancellationToken::new();
Self {
msock,
diff --git a/pr/3062/docs/type.impl/iroh/struct.PublicKey.js b/pr/3062/docs/type.impl/iroh/struct.PublicKey.js
index 710526ed35..b8452f9b79 100644
--- a/pr/3062/docs/type.impl/iroh/struct.PublicKey.js
+++ b/pr/3062/docs/type.impl/iroh/struct.PublicKey.js
@@ -1,9 +1,9 @@
(function() {
- var type_impls = Object.fromEntries([["iroh",[["","AsRef<[u8]>","iroh::NodeId"],["","Borrow<[u8; 32]>","iroh::NodeId"],["","Clone","iroh::NodeId"],["","Debug","iroh::NodeId"],["Source§impl<'de> Deserialize<'de> for PublicKey
Source§fn deserialize<D>(\n deserializer: D,\n) -> Result<PublicKey, <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh::NodeId"],["","Display","iroh::NodeId"],["","From","iroh::NodeId"],["Source§impl FromStr for PublicKey
","FromStr","iroh::NodeId"],["","Hash","iroh::NodeId"],["Source§impl Ord for PublicKey
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh::NodeId"],["","PartialEq","iroh::NodeId"],["Source§impl PartialOrd for PublicKey
","PartialOrd","iroh::NodeId"],["Source§impl PublicKey
Sourcepub fn from_bytes(bytes: &[u8; 32]) -> Result<PublicKey, Error>
Construct a PublicKey from a slice of bytes.
\n§Warning
\nThis will return a [SignatureError] if the bytes passed into this method do not represent\na valid ed25519_dalek curve point. Will never fail for bytes return from Self::as_bytes.\nSee [VerifyingKey::from_bytes] for details.
\n",0,"iroh::NodeId"],["Source§impl Serialize for PublicKey
Source§fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
Serialize this value into the given Serde serializer. Read more","Serialize","iroh::NodeId"],["","TryFrom<&[u8]>","iroh::NodeId"],["","TryFrom<&[u8; 32]>","iroh::NodeId"],["Source§impl Copy for PublicKey
","Copy","iroh::NodeId"],["Source§impl Eq for PublicKey
","Eq","iroh::NodeId"],["Source§impl StructuralPartialEq for PublicKey
","StructuralPartialEq","iroh::NodeId"]]]]);
+ var type_impls = Object.fromEntries([["iroh",[["","AsRef<[u8]>","iroh::NodeId"],["","Borrow<[u8; 32]>","iroh::NodeId"],["","Clone","iroh::NodeId"],["","Debug","iroh::NodeId"],["§impl<'de> Deserialize<'de> for PublicKey
§fn deserialize<D>(\n deserializer: D,\n) -> Result<PublicKey, <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh::NodeId"],["","Display","iroh::NodeId"],["","From","iroh::NodeId"],["§impl FromStr for PublicKey
","FromStr","iroh::NodeId"],["","Hash","iroh::NodeId"],["§impl Ord for PublicKey
","Ord","iroh::NodeId"],["","PartialEq","iroh::NodeId"],["§impl PartialOrd for PublicKey
","PartialOrd","iroh::NodeId"],["§impl PublicKey
pub fn public(&self) -> VerifyingKey
Returns the [VerifyingKey] for this PublicKey.
\npub fn from_bytes(bytes: &[u8; 32]) -> Result<PublicKey, Error>
Construct a PublicKey from a slice of bytes.
\n§Warning
\nThis will return a [SignatureError] if the bytes passed into this method do not represent\na valid ed25519_dalek curve point. Will never fail for bytes return from Self::as_bytes.\nSee [VerifyingKey::from_bytes] for details.
\n",0,"iroh::NodeId"],["§impl Serialize for PublicKey
§fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
Serialize this value into the given Serde serializer. Read more","Serialize","iroh::NodeId"],["","TryFrom<&[u8]>","iroh::NodeId"],["","TryFrom<&[u8; 32]>","iroh::NodeId"],["§impl Copy for PublicKey
","Copy","iroh::NodeId"],["§impl Eq for PublicKey
","Eq","iroh::NodeId"],["§impl StructuralPartialEq for PublicKey
","StructuralPartialEq","iroh::NodeId"]]]]);
if (window.register_type_impls) {
window.register_type_impls(type_impls);
} else {
window.pending_type_impls = type_impls;
}
})()
-//{"start":55,"fragment_lengths":[45511]}
\ No newline at end of file
+//{"start":55,"fragment_lengths":[42259]}
\ No newline at end of file
pub struct DirectAddr {
+DirectAddr in iroh::endpoint - Rust pub struct DirectAddr {
pub addr: SocketAddr,
pub typ: DirectAddrType,
}
Expand description
A direct address on which an iroh-node might be contactable.
@@ -7,16 +7,16 @@ contacted. These can come from various sources depending on the network topolog
iroh node, see DirectAddrType for the several kinds of sources.
Fields§
§addr: SocketAddrThe address.
§typ: DirectAddrTypeThe origin of this direct address.
-Trait Implementations§
Source§impl Clone for DirectAddr
Source§fn clone(&self) -> DirectAddr
Returns a copy of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for DirectAddr
Source§impl Hash for DirectAddr
1.3.0 · Source§fn hash_slice<H>(data: &[Self], state: &mut H)where
+Trait Implementations§
Source§impl Clone for DirectAddr
Source§fn clone(&self) -> DirectAddr
Returns a copy of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for DirectAddr
Source§impl Hash for DirectAddr
Source§impl Ord for DirectAddr
Source§impl Ord for DirectAddr
Source§fn cmp(&self, other: &DirectAddr) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read moreSource§impl PartialEq for DirectAddr
Source§impl PartialOrd for DirectAddr
Source§impl PartialEq for DirectAddr
Source§impl PartialOrd for DirectAddr
Source§impl Eq for DirectAddr
Source§impl StructuralPartialEq for DirectAddr
Auto Trait Implementations§
§impl Freeze for DirectAddr
§impl RefUnwindSafe for DirectAddr
§impl Send for DirectAddr
§impl Sync for DirectAddr
§impl Unpin for DirectAddr
§impl UnwindSafe for DirectAddr
Blanket Implementations§
Source§impl Eq for DirectAddr
Source§impl StructuralPartialEq for DirectAddr
Auto Trait Implementations§
§impl Freeze for DirectAddr
§impl RefUnwindSafe for DirectAddr
§impl Send for DirectAddr
§impl Sync for DirectAddr
§impl Unpin for DirectAddr
§impl UnwindSafe for DirectAddr
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3062/docs/iroh/endpoint/struct.Endpoint.html b/pr/3062/docs/iroh/endpoint/struct.Endpoint.html
index 3577ac70f7..42a1813f00 100644
--- a/pr/3062/docs/iroh/endpoint/struct.Endpoint.html
+++ b/pr/3062/docs/iroh/endpoint/struct.Endpoint.html
@@ -24,7 +24,7 @@ Note that this overrides the current list of ALPNs.
alpn: &[u8],
) -> Result<Connection>
Connects to a remote Endpoint.
A value that can be converted into a NodeAddr is required. This can be either a
-NodeAddr, a NodeId or a iroh_base::ticket::NodeTicket.
+NodeAddr, a NodeId or a [iroh_base::ticket::NodeTicket].
The NodeAddr must contain the NodeId to dial and may also contain a RelayUrl
and direct addresses. If direct addresses are provided, they will be used to try and
establish a direct connection without involving a relay server.
diff --git a/pr/3062/docs/iroh/enum.KeyParsingError.html b/pr/3062/docs/iroh/enum.KeyParsingError.html
index 10db6d3b8a..51e9a40cd8 100644
--- a/pr/3062/docs/iroh/enum.KeyParsingError.html
+++ b/pr/3062/docs/iroh/enum.KeyParsingError.html
@@ -1,4 +1,4 @@
-KeyParsingError in iroh - Rust pub enum KeyParsingError {
+KeyParsingError in iroh - Rust Enum KeyParsingError
pub enum KeyParsingError {
Decode(DecodeError),
Key(Error),
DecodeInvalidLength,
@@ -6,7 +6,7 @@
Variants§
§Decode(DecodeError)
Error when decoding.
§Key(Error)
Error when decoding the public key.
§DecodeInvalidLength
The encoded information had the wrong length.
-Trait Implementations§
Source§impl Debug for KeyParsingError
Source§impl Display for KeyParsingError
Source§impl Error for KeyParsingError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Source§impl From<DecodeError> for KeyParsingError
Source§fn from(source: DecodeError) -> KeyParsingError
Converts to this type from the input type.Source§impl From<Error> for KeyParsingError
Source§fn from(source: Error) -> KeyParsingError
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for KeyParsingError
§impl !RefUnwindSafe for KeyParsingError
§impl Send for KeyParsingError
§impl Sync for KeyParsingError
§impl Unpin for KeyParsingError
§impl !UnwindSafe for KeyParsingError
Blanket Implementations§
Trait Implementations§
§impl Debug for KeyParsingError
§impl Display for KeyParsingError
§impl Error for KeyParsingError
§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()§impl From<DecodeError> for KeyParsingError
§fn from(source: DecodeError) -> KeyParsingError
Converts to this type from the input type.§impl From<Error> for KeyParsingError
§fn from(source: Error) -> KeyParsingError
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for KeyParsingError
§impl !RefUnwindSafe for KeyParsingError
§impl Send for KeyParsingError
§impl Sync for KeyParsingError
§impl Unpin for KeyParsingError
§impl !UnwindSafe for KeyParsingError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3062/docs/iroh/metrics/struct.RelayMetrics.html b/pr/3062/docs/iroh/metrics/struct.RelayMetrics.html
index e6cb96f81d..1c26fe358e 100644
--- a/pr/3062/docs/iroh/metrics/struct.RelayMetrics.html
+++ b/pr/3062/docs/iroh/metrics/struct.RelayMetrics.html
@@ -1,4 +1,4 @@
-RelayMetrics in iroh::metrics - Rust pub struct RelayMetrics {Show 21 fields
+RelayMetrics in iroh::metrics - Rust Struct RelayMetrics
pub struct RelayMetrics {Show 21 fields
pub bytes_sent: Counter,
pub bytes_recv: Counter,
pub send_packets_sent: Counter,
@@ -42,7 +42,7 @@
§unique_client_keys: CounterNumber of unique client keys per day
§websocket_accepts: CounterNumber of accepted websocket connections
§derp_accepts: CounterNumber of accepted ‘iroh derp http’ connection upgrades
-Trait Implementations§
Source§impl Metric for Metrics
§fn new(registry: &mut Registry) -> Self
Available on crate feature metrics only.Initializes this metric group.§fn with_metric<T, F>(f: F)where
+Trait Implementations§
§impl Metric for Metrics
§fn new(registry: &mut Registry) -> Self
Available on crate feature metrics only.Initializes this metric group.§fn with_metric<T, F>(f: F)where
F: FnOnce(&Self) -> T,
Available on crate feature metrics only.Access to this metrics group to record a metric.
Only records if this metric is registered in the global registry.Auto Trait Implementations§
§impl Freeze for Metrics
§impl RefUnwindSafe for Metrics
§impl Send for Metrics
§impl Sync for Metrics
§impl Unpin for Metrics
§impl UnwindSafe for Metrics
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/3062/docs/iroh/struct.NodeAddr.html b/pr/3062/docs/iroh/struct.NodeAddr.html
index f681252bf9..18b496c519 100644
--- a/pr/3062/docs/iroh/struct.NodeAddr.html
+++ b/pr/3062/docs/iroh/struct.NodeAddr.html
@@ -1,4 +1,4 @@
-NodeAddr in iroh - Rust pub struct NodeAddr {
+NodeAddr in iroh - Rust Struct NodeAddr
pub struct NodeAddr {
pub node_id: PublicKey,
pub relay_url: Option<RelayUrl>,
pub direct_addresses: BTreeSet<SocketAddr>,
@@ -27,36 +27,36 @@ whenever a connection to other nodes needs to be established.
Fields§
§node_id: PublicKeyThe node’s identifier.
§relay_url: Option<RelayUrl>The node’s home relay url.
§direct_addresses: BTreeSet<SocketAddr>Socket addresses where the peer might be reached directly.
-Implementations§
Source§impl NodeAddr
Sourcepub fn new(node_id: PublicKey) -> NodeAddr
Creates a new NodeAddr with no relay_url and no direct_addresses.
-Sourcepub fn with_relay_url(self, relay_url: RelayUrl) -> NodeAddr
Adds a relay url.
-Sourcepub fn with_direct_addresses(
+
Implementations§
§impl NodeAddr
pub fn new(node_id: PublicKey) -> NodeAddr
Creates a new NodeAddr with no relay_url and no direct_addresses.
+pub fn with_relay_url(self, relay_url: RelayUrl) -> NodeAddr
Adds a relay url.
+pub fn with_direct_addresses(
self,
addresses: impl IntoIterator<Item = SocketAddr>,
) -> NodeAddr
Adds the given direct addresses.
-Sourcepub fn from_parts(
+
pub fn from_parts(
node_id: PublicKey,
relay_url: Option<RelayUrl>,
direct_addresses: impl IntoIterator<Item = SocketAddr>,
) -> NodeAddr
Creates a new NodeAddr from its parts.
-Sourcepub fn direct_addresses(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of this peer.
-Trait Implementations§
Source§impl<'de> Deserialize<'de> for NodeAddr
Source§fn deserialize<__D>(
+
pub fn direct_addresses(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of this peer.
+
Trait Implementations§
§impl<'de> Deserialize<'de> for NodeAddr
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<NodeAddr, <__D as Deserializer<'de>>::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreSource§impl From<NodeTicket> for NodeAddr
Source§fn from(ticket: NodeTicket) -> NodeAddr
Returns the addressing info from given ticket.
-Source§impl From<RemoteInfo> for NodeAddr
Source§fn from(info: RemoteInfo) -> Self
Converts to this type from the input type.Source§impl From<RemoteInfo> for NodeAddr
Source§fn from(info: RemoteInfo) -> Self
Converts to this type from the input type.§impl Ord for NodeAddr
Source§impl PartialOrd for NodeAddr
§impl Serialize for NodeAddr
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
- __S: Serializer,
Serialize this value into the given Serde serializer. Read moreSource§impl Eq for NodeAddr
Source§impl StructuralPartialEq for NodeAddr
Auto Trait Implementations§
§impl Freeze for NodeAddr
§impl RefUnwindSafe for NodeAddr
§impl Send for NodeAddr
§impl Sync for NodeAddr
§impl Unpin for NodeAddr
§impl UnwindSafe for NodeAddr
Blanket Implementations§
Source§impl<T> Any for Twhere
+ __S: Serializer,
Serialize this value into the given Serde serializer. Read more
§impl Eq for NodeAddr
§impl StructuralPartialEq for NodeAddr
Auto Trait Implementations§
§impl Freeze for NodeAddr
§impl RefUnwindSafe for NodeAddr
§impl Send for NodeAddr
§impl Sync for NodeAddr
§impl Unpin for NodeAddr
§impl UnwindSafe for NodeAddr
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3062/docs/iroh/struct.PublicKey.html b/pr/3062/docs/iroh/struct.PublicKey.html
index 71cb99695b..6d317decce 100644
--- a/pr/3062/docs/iroh/struct.PublicKey.html
+++ b/pr/3062/docs/iroh/struct.PublicKey.html
@@ -1,43 +1,43 @@
-PublicKey in iroh - Rust pub struct PublicKey(/* private fields */);
Expand description
A public key.
+PublicKey in iroh - Rust Struct PublicKey
pub struct PublicKey(/* private fields */);
Expand description
A public key.
The key itself is stored as the CompressedEdwards y coordinate of the public key
It is verified to decompress into a valid key when created.
-Implementations§
Source§impl PublicKey
Sourcepub fn from_bytes(bytes: &[u8; 32]) -> Result<PublicKey, Error>
Construct a PublicKey from a slice of bytes.
+Implementations§
§impl PublicKey
pub fn public(&self) -> VerifyingKey
Returns the [VerifyingKey] for this PublicKey.
+pub fn from_bytes(bytes: &[u8; 32]) -> Result<PublicKey, Error>
Construct a PublicKey from a slice of bytes.
§Warning
This will return a [SignatureError] if the bytes passed into this method do not represent
a valid ed25519_dalek curve point. Will never fail for bytes return from Self::as_bytes.
See [VerifyingKey::from_bytes] for details.
-Sourcepub fn verify(&self, message: &[u8], signature: &Signature) -> Result<(), Error>
Verify a signature on a message with this secret key’s public key.
+pub fn verify(&self, message: &[u8], signature: &Signature) -> Result<(), Error>
Verify a signature on a message with this secret key’s public key.
§Return
Returns Ok(()) if the signature is valid, and Err otherwise.
-Trait Implementations§
Trait Implementations§
§impl<'de> Deserialize<'de> for PublicKey
§fn deserialize<D>(
deserializer: D,
) -> Result<PublicKey, <D as Deserializer<'de>>::Error>where
- D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more§impl FromStr for PublicKey
Source§impl Hash for PublicKey
§impl Ord for PublicKey
Source§impl PartialOrd for PublicKey
§impl Serialize for PublicKey
§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
- S: Serializer,
Serialize this value into the given Serde serializer. Read moreSource§impl Copy for PublicKey
Source§impl Eq for PublicKey
Source§impl StructuralPartialEq for PublicKey
Auto Trait Implementations§
§impl Freeze for PublicKey
§impl RefUnwindSafe for PublicKey
§impl Send for PublicKey
§impl Sync for PublicKey
§impl Unpin for PublicKey
§impl UnwindSafe for PublicKey
Blanket Implementations§
§impl Copy for PublicKey
§impl Eq for PublicKey
§impl StructuralPartialEq for PublicKey
Auto Trait Implementations§
§impl Freeze for PublicKey
§impl RefUnwindSafe for PublicKey
§impl Send for PublicKey
§impl Sync for PublicKey
§impl Unpin for PublicKey
§impl UnwindSafe for PublicKey
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3062/docs/iroh/struct.RelayMap.html b/pr/3062/docs/iroh/struct.RelayMap.html
index 6455a2a69f..db261a0740 100644
--- a/pr/3062/docs/iroh/struct.RelayMap.html
+++ b/pr/3062/docs/iroh/struct.RelayMap.html
@@ -1,26 +1,26 @@
-RelayMap in iroh - Rust pub struct RelayMap { /* private fields */ }
Expand description
Configuration of all the relay servers that can be used.
-Implementations§
Source§impl RelayMap
Sourcepub fn nodes(&self) -> impl Iterator<Item = &Arc<RelayNode>>
Returns an Iterator over all known nodes.
-Sourcepub fn contains_node(&self, url: &RelayUrl) -> bool
Is this a known node?
-Sourcepub fn default_from_node(url: RelayUrl, stun_port: u16) -> RelayMap
Creates a new RelayMap with a single relay server configured.
+RelayMap in iroh - Rust Struct RelayMap
pub struct RelayMap { /* private fields */ }
Expand description
Configuration of all the relay servers that can be used.
+Implementations§
§impl RelayMap
pub fn nodes(&self) -> impl Iterator<Item = &Arc<RelayNode>>
Returns an Iterator over all known nodes.
+pub fn contains_node(&self, url: &RelayUrl) -> bool
Is this a known node?
+pub fn default_from_node(url: RelayUrl, stun_port: u16) -> RelayMap
Creates a new RelayMap with a single relay server configured.
Allows to set a custom STUN port and different IP addresses for IPv4 and IPv6.
If IP addresses are provided, no DNS lookup will be performed.
Sets the port to the default DEFAULT_RELAY_QUIC_PORT.
-Sourcepub fn from_nodes<I>(
+
pub fn from_nodes<I>(
value: impl IntoIterator<Item = I>,
) -> Result<RelayMap, Error>
Trait Implementations§
Source§impl Eq for RelayMap
Source§impl StructuralPartialEq for RelayMap
Auto Trait Implementations§
§impl Freeze for RelayMap
§impl RefUnwindSafe for RelayMap
§impl Send for RelayMap
§impl Sync for RelayMap
§impl Unpin for RelayMap
§impl UnwindSafe for RelayMap
Blanket Implementations§
Trait Implementations§
§impl Eq for RelayMap
§impl StructuralPartialEq for RelayMap
Auto Trait Implementations§
§impl Freeze for RelayMap
§impl RefUnwindSafe for RelayMap
§impl Send for RelayMap
§impl Sync for RelayMap
§impl Unpin for RelayMap
§impl UnwindSafe for RelayMap
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3062/docs/iroh/struct.RelayNode.html b/pr/3062/docs/iroh/struct.RelayNode.html
index 7da0ec16ae..1ddae9195e 100644
--- a/pr/3062/docs/iroh/struct.RelayNode.html
+++ b/pr/3062/docs/iroh/struct.RelayNode.html
@@ -1,8 +1,8 @@
-RelayNode in iroh - Rust pub struct RelayNode {
+RelayNode in iroh - Rust Struct RelayNode
pub struct RelayNode {
pub url: RelayUrl,
pub stun_only: bool,
pub stun_port: u16,
- pub quic: Option<RelayQuicConfig>,
+ pub quic: Option<RelayQuicConfig>,
}
Expand description
Information on a specific relay server.
Includes the Url where it can be dialed.
Fields§
§url: RelayUrlThe RelayUrl where this relay server can be dialed.
@@ -11,24 +11,24 @@
functionality is used.
§stun_port: u16The stun port of the relay server.
Setting this to 0 means the default STUN port is used.
-§quic: Option<RelayQuicConfig>Configuration to speak to the QUIC endpoint on the relay server.
+§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<'de> Deserialize<'de> for RelayNode
Source§fn deserialize<__D>(
+
Trait Implementations§
§impl<'de> Deserialize<'de> for RelayNode
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<RelayNode, <__D as Deserializer<'de>>::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more§impl Ord for RelayNode
Source§impl PartialOrd for RelayNode
§impl Serialize for RelayNode
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
- __S: Serializer,
Serialize this value into the given Serde serializer. Read moreSource§impl Eq for RelayNode
Source§impl StructuralPartialEq for RelayNode
Auto Trait Implementations§
§impl Freeze for RelayNode
§impl RefUnwindSafe for RelayNode
§impl Send for RelayNode
§impl Sync for RelayNode
§impl Unpin for RelayNode
§impl UnwindSafe for RelayNode
Blanket Implementations§
Source§impl<T> Any for Twhere
+ __S: Serializer,
Serialize this value into the given Serde serializer. Read more§impl Eq for RelayNode
§impl StructuralPartialEq for RelayNode
Auto Trait Implementations§
§impl Freeze for RelayNode
§impl RefUnwindSafe for RelayNode
§impl Send for RelayNode
§impl Sync for RelayNode
§impl Unpin for RelayNode
§impl UnwindSafe for RelayNode
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3062/docs/iroh/struct.RelayUrl.html b/pr/3062/docs/iroh/struct.RelayUrl.html
index 01b1dbf533..e9cdef13bb 100644
--- a/pr/3062/docs/iroh/struct.RelayUrl.html
+++ b/pr/3062/docs/iroh/struct.RelayUrl.html
@@ -1,4 +1,4 @@
-RelayUrl in iroh - Rust pub struct RelayUrl(/* private fields */);
Expand description
A URL identifying a relay server.
+RelayUrl in iroh - Rust Struct RelayUrl
pub struct RelayUrl(/* private fields */);
Expand description
A URL identifying a relay server.
This is but a wrapper around Url, with a few custom tweaks:
-
@@ -443,30 +443,30 @@ or if
Path::new_opt() returns None.
(That is, if the percent-decoded path contains a NUL byte or,
for a Windows path, is not UTF-8.)
This method is only available if the std Cargo feature is enabled.
-
Trait Implementations§
Trait Implementations§
§impl Deref for RelayUrl
Source§impl<'de> Deserialize<'de> for RelayUrl
Source§fn deserialize<__D>(
+
§impl<'de> Deserialize<'de> for RelayUrl
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<RelayUrl, <__D as Deserializer<'de>>::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more§impl FromStr for RelayUrl
Support for parsing strings directly.
If you need more control over the error first create a Url and use RelayUrl::from
instead.
-Source§impl Hash for RelayUrl
§impl Ord for RelayUrl
Source§impl PartialOrd for RelayUrl
§impl Serialize for RelayUrl
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
- __S: Serializer,
Serialize this value into the given Serde serializer. Read moreSource§impl Eq for RelayUrl
Source§impl StructuralPartialEq for RelayUrl
Auto Trait Implementations§
§impl Freeze for RelayUrl
§impl RefUnwindSafe for RelayUrl
§impl Send for RelayUrl
§impl Sync for RelayUrl
§impl Unpin for RelayUrl
§impl UnwindSafe for RelayUrl
Blanket Implementations§
Source§impl<T> Any for Twhere
+ __S: Serializer,
Serialize this value into the given Serde serializer. Read more§impl Eq for RelayUrl
§impl StructuralPartialEq for RelayUrl
Auto Trait Implementations§
§impl Freeze for RelayUrl
§impl RefUnwindSafe for RelayUrl
§impl Send for RelayUrl
§impl Sync for RelayUrl
§impl Unpin for RelayUrl
§impl UnwindSafe for RelayUrl
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3062/docs/iroh/struct.RelayUrlParseError.html b/pr/3062/docs/iroh/struct.RelayUrlParseError.html
index 88a4b6bae1..3ddedd374b 100644
--- a/pr/3062/docs/iroh/struct.RelayUrlParseError.html
+++ b/pr/3062/docs/iroh/struct.RelayUrlParseError.html
@@ -1,5 +1,5 @@
-RelayUrlParseError in iroh - Rust pub struct RelayUrlParseError(/* private fields */);
Expand description
Can occur when parsing a string into a RelayUrl.
-Trait Implementations§
Source§impl Debug for RelayUrlParseError
Source§impl Display for RelayUrlParseError
Source§impl Error for RelayUrlParseError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Source§impl From<ParseError> for RelayUrlParseError
Source§fn from(source: ParseError) -> RelayUrlParseError
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for RelayUrlParseError
§impl RefUnwindSafe for RelayUrlParseError
§impl Send for RelayUrlParseError
§impl Sync for RelayUrlParseError
§impl Unpin for RelayUrlParseError
§impl UnwindSafe for RelayUrlParseError
Blanket Implementations§
Source§impl<T> Any for Twhere
+RelayUrlParseError in iroh - Rust Struct RelayUrlParseError
pub struct RelayUrlParseError(/* private fields */);
Expand description
Can occur when parsing a string into a RelayUrl.
+Trait Implementations§
§impl Debug for RelayUrlParseError
§impl Display for RelayUrlParseError
§impl Error for RelayUrlParseError
§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()§impl From<ParseError> for RelayUrlParseError
§fn from(source: ParseError) -> RelayUrlParseError
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for RelayUrlParseError
§impl RefUnwindSafe for RelayUrlParseError
§impl Send for RelayUrlParseError
§impl Sync for RelayUrlParseError
§impl Unpin for RelayUrlParseError
§impl UnwindSafe for RelayUrlParseError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/3062/docs/iroh/struct.SecretKey.html b/pr/3062/docs/iroh/struct.SecretKey.html
index 458c9086b6..81e34a05f8 100644
--- a/pr/3062/docs/iroh/struct.SecretKey.html
+++ b/pr/3062/docs/iroh/struct.SecretKey.html
@@ -1,24 +1,24 @@
-SecretKey in iroh - Rust pub struct SecretKey { /* private fields */ }
Expand description
A secret key.
-Implementations§
Source§impl SecretKey
Sourcepub fn generate<R>(csprng: R) -> SecretKeywhere
+SecretKey in iroh - Rust Struct SecretKey
pub struct SecretKey { /* private fields */ }
Expand description
A secret key.
+Implementations§
§impl SecretKey
pub fn generate<R>(csprng: R) -> SecretKeywhere
R: CryptoRngCore,
Generate a new SecretKey with a randomness generator.
// use the OsRng option for OS depedndent most secure RNG.
let mut rng = rand::rngs::OsRng;
let _key = iroh_base::SecretKey::generate(&mut rng);
-Sourcepub fn sign(&self, msg: &[u8]) -> Signature
Sign the given message and return a digital signature
-pub fn to_bytes(&self) -> [u8; 32]
Convert this to the bytes representing the secret part.
The public part can always be recovered.
-Sourcepub fn from_bytes(bytes: &[u8; 32]) -> SecretKey
Create a secret key from its byte representation.
-Trait Implementations§
Source§impl<'de> Deserialize<'de> for SecretKey
Source§fn deserialize<D>(
+
pub fn from_bytes(bytes: &[u8; 32]) -> SecretKey
Create a secret key from its byte representation.
+pub fn secret(&self) -> &SigningKey
Returns the [SigningKey] for this SecretKey.
+Trait Implementations§
§impl<'de> Deserialize<'de> for SecretKey
§fn deserialize<D>(
deserializer: D,
) -> Result<SecretKey, <D as Deserializer<'de>>::Error>where
- D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more§impl Serialize for SecretKey
§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
- S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
§impl Freeze for SecretKey
§impl RefUnwindSafe for SecretKey
§impl Send for SecretKey
§impl Sync for SecretKey
§impl Unpin for SecretKey
§impl UnwindSafe for SecretKey
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/3062/docs/iroh/test_utils/fn.run_relay_server.html b/pr/3062/docs/iroh/test_utils/fn.run_relay_server.html
index befdb59842..4ebdc2a805 100644
--- a/pr/3062/docs/iroh/test_utils/fn.run_relay_server.html
+++ b/pr/3062/docs/iroh/test_utils/fn.run_relay_server.html
@@ -1,4 +1,4 @@
-run_relay_server in iroh::test_utils - Rust pub async fn run_relay_server() -> Result<(RelayMap, RelayUrl, Server)>
Available on crate feature test-utils only.Expand description
Runs a relay server with STUN and QUIC enabled suitable for tests.
+run_relay_server in iroh::test_utils - Rust
\ No newline at end of file
diff --git a/pr/3062/docs/iroh/test_utils/fn.run_relay_server_with.html b/pr/3062/docs/iroh/test_utils/fn.run_relay_server_with.html
index a73916f65e..ba6f84cdfd 100644
--- a/pr/3062/docs/iroh/test_utils/fn.run_relay_server_with.html
+++ b/pr/3062/docs/iroh/test_utils/fn.run_relay_server_with.html
@@ -1,9 +1,9 @@
run_relay_server_with in iroh::test_utils - Rust pub async fn run_relay_server_with(
- stun: Option<StunConfig>,
+ stun: Option<StunConfig>,
quic: bool,
-) -> Result<(RelayMap, RelayUrl, Server)>
Available on crate feature test-utils only.Expand description
Runs a relay server.
+) -> Result<(RelayMap, RelayUrl, Server)>Available on crate feature test-utils only.Expand description
Runs a relay server.
stun can be set to None to disable stun, or set to Some StunConfig,
to enable stun on a specific socket.
-If quic is set to true, it will make the appropriate QuicConfig from the generated tls certificates and run the quic server at a random free port.
+If quic is set to true, it will make the appropriate [QuicConfig] from the generated tls certificates and run the quic server at a random free port.
The return value is similar to run_relay_server.
\ No newline at end of file
diff --git a/pr/3062/docs/iroh/test_utils/fn.run_relay_server_with_stun.html b/pr/3062/docs/iroh/test_utils/fn.run_relay_server_with_stun.html
index bdff0055f8..974d3f306b 100644
--- a/pr/3062/docs/iroh/test_utils/fn.run_relay_server_with_stun.html
+++ b/pr/3062/docs/iroh/test_utils/fn.run_relay_server_with_stun.html
@@ -1,4 +1,4 @@
-run_relay_server_with_stun in iroh::test_utils - Rust pub async fn run_relay_server_with_stun() -> Result<(RelayMap, RelayUrl, Server)>
Available on crate feature test-utils only.Expand description
Runs a relay server with STUN enabled suitable for tests.
+run_relay_server_with_stun in iroh::test_utils - Rust
\ No newline at end of file
diff --git a/pr/3062/docs/iroh/type.NodeId.html b/pr/3062/docs/iroh/type.NodeId.html
index 893e85f42a..c9c873e0e6 100644
--- a/pr/3062/docs/iroh/type.NodeId.html
+++ b/pr/3062/docs/iroh/type.NodeId.html
@@ -1,4 +1,4 @@
-NodeId in iroh - Rust pub type NodeId = PublicKey;
Expand description
The identifier for a node in the (iroh) network.
+NodeId in iroh - Rust Type Alias NodeId
pub type NodeId = PublicKey;
Expand description
The identifier for a node in the (iroh) network.
Each node in iroh has a unique identifier created as a cryptographic key. This can be
used to globally identify a node. Since it is also a cryptographic key it is also the
mechanism by which all traffic is always encrypted for a specific node only.
diff --git a/pr/3062/docs/iroh_net_report/struct.Client.html b/pr/3062/docs/iroh_net_report/struct.Client.html
index 4d9507ffb0..c27924b10a 100644
--- a/pr/3062/docs/iroh_net_report/struct.Client.html
+++ b/pr/3062/docs/iroh_net_report/struct.Client.html
@@ -16,7 +16,7 @@ stop running.
allows sending messages to the actor.
Sourcepub async fn get_report(
&mut self,
- relay_map: RelayMap,
+ relay_map: RelayMap,
stun_sock_v4: Option<Arc<UdpSocket>>,
stun_sock_v6: Option<Arc<UdpSocket>>,
quic_config: Option<QuicConfig>,
@@ -38,14 +38,14 @@ using QUIC address discovery.
This will attempt to use all probe protocols.
Sourcepub async fn get_report_with_opts(
&mut self,
- relay_map: RelayMap,
+ relay_map: RelayMap,
opts: Options,
) -> Result<Arc<Report>>
Runs a net_report, returning the report.
It may not be called concurrently with itself, &mut self takes care of that.
Look at Options for the different configuration options.
Sourcepub async fn get_report_channel(
&mut self,
- relay_map: RelayMap,
+ relay_map: RelayMap,
opts: Options,
) -> Result<Receiver<Result<Arc<Report>>>>
Get report with channel
Look at Options for the different configuration options.
diff --git a/pr/3062/docs/iroh_net_report/struct.RelayLatencies.html b/pr/3062/docs/iroh_net_report/struct.RelayLatencies.html
index 010850c89d..17bdf83c57 100644
--- a/pr/3062/docs/iroh_net_report/struct.RelayLatencies.html
+++ b/pr/3062/docs/iroh_net_report/struct.RelayLatencies.html
@@ -1,5 +1,5 @@
RelayLatencies in iroh_net_report - Rust pub struct RelayLatencies(/* private fields */);
Expand description
Latencies per relay node.
-Implementations§
Source§impl RelayLatencies
Sourcepub fn iter(&self) -> impl Iterator<Item = (&RelayUrl, Duration)> + '_
Returns an iterator over all the relays and their latencies.
+Implementations§
Trait Implementations§
Source§impl Clone for RelayLatencies
Source§fn clone(&self) -> RelayLatencies
Returns a copy of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for RelayLatencies
Source§impl Default for RelayLatencies
Source§fn default() -> RelayLatencies
Returns the “default value” for a type. Read moreSource§impl PartialEq for RelayLatencies
Source§impl Eq for RelayLatencies
Source§impl StructuralPartialEq for RelayLatencies
Auto Trait Implementations§
§impl Freeze for RelayLatencies
§impl RefUnwindSafe for RelayLatencies
§impl Send for RelayLatencies
§impl Sync for RelayLatencies
§impl Unpin for RelayLatencies
§impl UnwindSafe for RelayLatencies
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/3062/docs/iroh_net_report/struct.Report.html b/pr/3062/docs/iroh_net_report/struct.Report.html
index 1a2175c6da..dffd956afd 100644
--- a/pr/3062/docs/iroh_net_report/struct.Report.html
+++ b/pr/3062/docs/iroh_net_report/struct.Report.html
@@ -11,7 +11,7 @@
pub mapping_varies_by_dest_ipv6: Option<bool>,
pub hair_pinning: Option<bool>,
pub portmap_probe: Option<ProbeOutput>,
- pub preferred_relay: Option<RelayUrl>,
+ pub preferred_relay: Option<RelayUrl>,
pub relay_latency: RelayLatencies,
pub relay_v4_latency: RelayLatencies,
pub relay_v6_latency: RelayLatencies,
@@ -35,7 +35,7 @@ detecting rather than using it. For now.
§hair_pinning: Option<bool>Whether the router supports communicating between two local devices through the NATted
public IP address (on IPv4).
§portmap_probe: Option<ProbeOutput>Probe indicating the presence of port mapping protocols on the LAN.
-§preferred_relay: Option<RelayUrl>None for unknown
+§preferred_relay: Option<RelayUrl>None for unknown
§relay_latency: RelayLatencieskeyed by relay Url
§relay_v4_latency: RelayLatencieskeyed by relay Url
§relay_v6_latency: RelayLatencieskeyed by relay Url
diff --git a/pr/3062/docs/src/iroh/magicsock.rs.html b/pr/3062/docs/src/iroh/magicsock.rs.html
index 39045536b3..a0b3a87eb4 100644
--- a/pr/3062/docs/src/iroh/magicsock.rs.html
+++ b/pr/3062/docs/src/iroh/magicsock.rs.html
@@ -4119,61 +4119,7 @@
4118
4119
4120
-4121
-4122
-4123
-4124
-4125
-4126
-4127
-4128
-4129
-4130
-4131
-4132
-4133
-4134
-4135
-4136
-4137
-4138
-4139
-4140
-4141
-4142
-4143
-4144
-4145
-4146
-4147
-4148
-4149
-4150
-4151
-4152
-4153
-4154
-4155
-4156
-4157
-4158
-4159
-4160
-4161
-4162
-4163
-4164
-4165
-4166
-4167
-4168
-4169
-4170
-4171
-4172
-4173
-4174
-4175//! Implements a socket that can change its communication path while in use, actively searching for the best way to communicate.
+4121
//! Implements a socket that can change its communication path while in use, actively searching for the best way to communicate.
//!
//! Based on tailscale/wgengine/magicsock
//!
@@ -4359,9 +4305,9 @@
/// Relay datagrams received by relays are put into this queue and consumed by
/// [`AsyncUdpSocket`]. This queue takes care of the wakers needed by
/// [`AsyncUdpSocket::poll_recv`].
- relay_datagrams_queue: Arc<RelayDatagramRecvQueue>,
+ relay_datagram_recv_queue: Arc<RelayDatagramRecvQueue>,
/// Channel on which to send datagrams via a relay server.
- relay_datagrams_send_channel: RelayDatagramSendChannelSender,
+ relay_datagram_send_channel: RelayDatagramSendChannelSender,
/// Counter for ordering of [`MagicSock::poll_recv`] polling order.
poll_recv_counter: AtomicUsize,
@@ -4611,7 +4557,7 @@
// ready.
let ipv4_poller = self.pconn4.create_io_poller();
let ipv6_poller = self.pconn6.as_ref().map(|sock| sock.create_io_poller());
- let relay_sender = self.relay_datagrams_send_channel.clone();
+ let relay_sender = self.relay_datagram_send_channel.clone();
Box::pin(IoPoller {
ipv4_poller,
ipv6_poller,
@@ -4777,7 +4723,7 @@
url: url.clone(),
datagrams: contents,
};
- match self.relay_datagrams_send_channel.try_send(msg) {
+ match self.relay_datagram_send_channel.try_send(msg) {
Ok(_) => {
trace!(node = %node.fmt_short(), relay_url = %url,
"send relay: message queued");
@@ -5039,7 +4985,7 @@
// For each output buffer keep polling the datagrams from the relay until one is
// a QUIC datagram to be placed into the output buffer. Or the channel is empty.
loop {
- let recv = match self.relay_datagrams_queue.poll_recv(cx) {
+ let recv = match self.relay_datagram_recv_queue.poll_recv(cx) {
Poll::Ready(Ok(recv)) => recv,
Poll::Ready(Err(err)) => {
error!("relay_recv_channel closed: {err:#}");
@@ -5736,8 +5682,8 @@
local_addrs: std::sync::RwLock::new((ipv4_addr, ipv6_addr)),
closing: AtomicBool::new(false),
closed: AtomicBool::new(false),
- relay_datagrams_queue: relay_datagram_recv_queue.clone(),
- relay_datagrams_send_channel: relay_datagram_send_tx,
+ relay_datagram_recv_queue: relay_datagram_recv_queue.clone(),
+ relay_datagram_send_channel: relay_datagram_send_tx,
poll_recv_counter: AtomicUsize::new(0),
actor_sender: actor_sender.clone(),
ipv6_reported: Arc::new(AtomicBool::new(false)),
@@ -5902,7 +5848,11 @@
Parse(anyhow::Error),
}
-fn relay_datagram_sender() -> (
+/// Creates a sender and receiver pair for sending datagrams to the [`RelayActor`].
+///
+/// These includes the waker coordination required to support [`AsyncUdpSocket::try_send`]
+/// and [`quinn::UdpPoller::poll_writable`].
+fn relay_datagram_sender() -> (
RelayDatagramSendChannelSender,
RelayDatagramSendChannelReceiver,
) {
@@ -5916,7 +5866,11 @@
(tx, rx)
}
-#[derive(Debug, Clone)]
+/// Sender to send datagrams to the [`RelayActor`].
+///
+/// This includes the waker coordination required to support [`AsyncUdpSocket::try_send`]
+/// and [`quinn::UdpPoller::poll_writable`].
+#[derive(Debug, Clone)]
struct RelayDatagramSendChannelSender {
sender: mpsc::Sender<RelaySendItem>,
waker: Arc<AtomicWaker>,
@@ -5941,7 +5895,11 @@
}
}
-#[derive(Debug)]
+/// Receiver to send datagrams to the [`RelayActor`].
+///
+/// This includes the waker coordination required to support [`AsyncUdpSocket::try_send`]
+/// and [`quinn::UdpPoller::poll_writable`].
+#[derive(Debug)]
struct RelayDatagramSendChannelReceiver {
receiver: mpsc::Receiver<RelaySendItem>,
waker: Arc<AtomicWaker>,
@@ -5955,73 +5913,7 @@
}
}
-// #[derive(Debug)]
-// struct RelayDatagramSendQueue {
-// queue: ConcurrentQueue<RelaySendItem>,
-// writable_waker: AtomicWaker,
-// readable_waker: AtomicWaker,
-// }
-
-// impl RelayDatagramSendQueue {
-// fn new() -> Self {
-// Self {
-// queue: ConcurrentQueue::bounded(256),
-// writable_waker: AtomicWaker::new(),
-// readable_waker: AtomicWaker::new(),
-// }
-// }
-
-// fn try_send(&self, item: RelaySendItem) -> Result<(), io::Error> {
-// match self.queue.push(item) {
-// Ok(_) => {
-// self.readable_waker.wake();
-// Ok(())
-// }
-// Err(err) => match err {
-// concurrent_queue::PushError::Full(_) => Err(io::Error::new(
-// io::ErrorKind::ConnectionReset,
-// "queue to RelayActor is closed",
-// )),
-// concurrent_queue::PushError::Closed(_) => Err(io::Error::new(
-// io::ErrorKind::WouldBlock,
-// "queue to RelayActor is full",
-// )),
-// },
-// }
-// }
-
-// fn poll_writable(&self, cx: &mut Context) -> Poll<io::Result<()>> {
-// if self.queue.is_full() {
-// self.writable_waker.register(cx.waker());
-// Poll::Pending
-// } else {
-// Poll::Ready(Ok(()))
-// }
-// }
-
-// fn recv(&self) -> impl Future<Output = Option<RelaySendItem>> {
-// future::poll_fn(|cx| match self.queue.pop {
-// Ok(item) => Poll::Ready(item),
-// Err(concurrent_queue::PopError::Closed) => Poll::Ready(None),
-// Err(concurrent_queue::PopError::Empty) => {
-// self.readable_waker.register(cx.waker());
-// match self.queue.pop() {
-// Ok(value) => {
-// self.readable_waker.take();
-// Poll::Ready(Ok(value))
-// }
-// Err(concurrent_queue::PopError::Empty) => Poll::Pending,
-// Err(concurrent_queue::PopError::Closed) => {
-// self.readlable_waker.take();
-// Poll::Ready(Err(anyhow!("Queue closed")))
-// }
-// }
-// }
-// })
-// }
-// }
-
-/// A queue holding [`RelayRecvDatagram`]s that can be polled in async
+/// A queue holding [`RelayRecvDatagram`]s that can be polled in async
/// contexts, and wakes up tasks when something adds items using [`try_send`].
///
/// This is used to transfer relay datagrams between the [`RelayActor`]
diff --git a/pr/3062/docs/src/iroh/magicsock/relay_actor.rs.html b/pr/3062/docs/src/iroh/magicsock/relay_actor.rs.html
index 949fe876bc..ba986a0ae7 100644
--- a/pr/3062/docs/src/iroh/magicsock/relay_actor.rs.html
+++ b/pr/3062/docs/src/iroh/magicsock/relay_actor.rs.html
@@ -1131,9 +1131,7 @@
1130
1131
1132
-1133
-1134
-1135
//! The relay actor.
+1133
//! The relay actor.
//!
//! The [`RelayActor`] handles all the relay connections. It is helped by the
//! [`ActiveRelayActor`] which handles a single relay connection.
@@ -1166,14 +1164,13 @@
use tracing::{debug, error, info, info_span, trace, warn, Instrument};
use url::Url;
+use super::RelayDatagramSendChannelReceiver;
use crate::{
dns::DnsResolver,
magicsock::{MagicSock, Metrics as MagicsockMetrics, RelayContents, RelayDatagramRecvQueue},
util::MaybeFuture,
};
-use super::RelayDatagramSendChannelReceiver;
-
/// How long a non-home relay connection needs to be idle (last written to) before we close it.
const RELAY_INACTIVE_CLEANUP_TIME: Duration = Duration::from_secs(60);
@@ -1573,8 +1570,7 @@
pub(super) fn new(
msock: Arc<MagicSock>,
relay_datagram_recv_queue: Arc<RelayDatagramRecvQueue>,
- // relay_datagram_send_queue: RelayDatagramsQueue,
- ) -> Self {
+ ) -> Self {
let cancel_token = CancellationToken::new();
Self {
msock,
diff --git a/pr/3062/docs/type.impl/iroh/struct.PublicKey.js b/pr/3062/docs/type.impl/iroh/struct.PublicKey.js
index 710526ed35..b8452f9b79 100644
--- a/pr/3062/docs/type.impl/iroh/struct.PublicKey.js
+++ b/pr/3062/docs/type.impl/iroh/struct.PublicKey.js
@@ -1,9 +1,9 @@
(function() {
- var type_impls = Object.fromEntries([["iroh",[["","AsRef<[u8]>","iroh::NodeId"],["","Borrow<[u8; 32]>","iroh::NodeId"],["","Clone","iroh::NodeId"],["","Debug","iroh::NodeId"],["Source§impl<'de> Deserialize<'de> for PublicKey
Source§fn deserialize<D>(\n deserializer: D,\n) -> Result<PublicKey, <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh::NodeId"],["","Display","iroh::NodeId"],["","From","iroh::NodeId"],["Source§impl FromStr for PublicKey
","FromStr","iroh::NodeId"],["","Hash","iroh::NodeId"],["Source§impl Ord for PublicKey
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh::NodeId"],["","PartialEq","iroh::NodeId"],["Source§impl PartialOrd for PublicKey
","PartialOrd","iroh::NodeId"],["Source§impl PublicKey
Sourcepub fn from_bytes(bytes: &[u8; 32]) -> Result<PublicKey, Error>
Construct a PublicKey from a slice of bytes.
\n§Warning
\nThis will return a [SignatureError] if the bytes passed into this method do not represent\na valid ed25519_dalek curve point. Will never fail for bytes return from Self::as_bytes.\nSee [VerifyingKey::from_bytes] for details.
\n",0,"iroh::NodeId"],["Source§impl Serialize for PublicKey
Source§fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
Serialize this value into the given Serde serializer. Read more","Serialize","iroh::NodeId"],["","TryFrom<&[u8]>","iroh::NodeId"],["","TryFrom<&[u8; 32]>","iroh::NodeId"],["Source§impl Copy for PublicKey
","Copy","iroh::NodeId"],["Source§impl Eq for PublicKey
","Eq","iroh::NodeId"],["Source§impl StructuralPartialEq for PublicKey
","StructuralPartialEq","iroh::NodeId"]]]]);
+ var type_impls = Object.fromEntries([["iroh",[["","AsRef<[u8]>","iroh::NodeId"],["","Borrow<[u8; 32]>","iroh::NodeId"],["","Clone","iroh::NodeId"],["","Debug","iroh::NodeId"],["§impl<'de> Deserialize<'de> for PublicKey
§fn deserialize<D>(\n deserializer: D,\n) -> Result<PublicKey, <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh::NodeId"],["","Display","iroh::NodeId"],["","From","iroh::NodeId"],["§impl FromStr for PublicKey
","FromStr","iroh::NodeId"],["","Hash","iroh::NodeId"],["§impl Ord for PublicKey
","Ord","iroh::NodeId"],["","PartialEq","iroh::NodeId"],["§impl PartialOrd for PublicKey
","PartialOrd","iroh::NodeId"],["§impl PublicKey
pub fn public(&self) -> VerifyingKey
Returns the [VerifyingKey] for this PublicKey.
\npub fn from_bytes(bytes: &[u8; 32]) -> Result<PublicKey, Error>
Construct a PublicKey from a slice of bytes.
\n§Warning
\nThis will return a [SignatureError] if the bytes passed into this method do not represent\na valid ed25519_dalek curve point. Will never fail for bytes return from Self::as_bytes.\nSee [VerifyingKey::from_bytes] for details.
\n",0,"iroh::NodeId"],["§impl Serialize for PublicKey
§fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
Serialize this value into the given Serde serializer. Read more","Serialize","iroh::NodeId"],["","TryFrom<&[u8]>","iroh::NodeId"],["","TryFrom<&[u8; 32]>","iroh::NodeId"],["§impl Copy for PublicKey
","Copy","iroh::NodeId"],["§impl Eq for PublicKey
","Eq","iroh::NodeId"],["§impl StructuralPartialEq for PublicKey
","StructuralPartialEq","iroh::NodeId"]]]]);
if (window.register_type_impls) {
window.register_type_impls(type_impls);
} else {
window.pending_type_impls = type_impls;
}
})()
-//{"start":55,"fragment_lengths":[45511]}
\ No newline at end of file
+//{"start":55,"fragment_lengths":[42259]}
\ No newline at end of file