pub enum KeyParsingError {
- Base32(HexOrBase32ParseError),
+KeyParsingError in iroh - Rust Enum KeyParsingError
pub enum KeyParsingError {
+ Base32(HexOrBase32ParseError),
Key(Error),
}
Variants§
§Base32(HexOrBase32ParseError)
Error when decoding the base32.
+Variants§
§Base32(HexOrBase32ParseError)
Error when decoding the base32.
§Key(Error)
Error when decoding the public key.
-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<Error> for KeyParsingError
Source§fn from(source: Error) -> KeyParsingError
Converts to this type from the input type.Source§impl From<HexOrBase32ParseError> for KeyParsingError
Source§fn from(source: HexOrBase32ParseError) -> 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<Error> for KeyParsingError
§fn from(source: Error) -> KeyParsingError
Converts to this type from the input type.§impl From<HexOrBase32ParseError> for KeyParsingError
§fn from(source: HexOrBase32ParseError) -> 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/2806/docs/iroh/struct.NodeAddr.html b/pr/2806/docs/iroh/struct.NodeAddr.html
index f105b5ee78..374ea4e8c3 100644
--- a/pr/2806/docs/iroh/struct.NodeAddr.html
+++ b/pr/2806/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 @@
Fields§
§node_id: PublicKey
The 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/2806/docs/iroh/struct.PublicKey.html b/pr/2806/docs/iroh/struct.PublicKey.html
index 2b23745c99..8d84d2db93 100644
--- a/pr/2806/docs/iroh/struct.PublicKey.html
+++ b/pr/2806/docs/iroh/struct.PublicKey.html
@@ -1,45 +1,45 @@
-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 just a 32 byte array, but a key has associated crypto
information that is cached for performance reasons.
The cache item will be refreshed every time a crypto operation is performed,
or when a key is deserialised or created from a byte array.
Serialisation or creation from a byte array is cheap if the key is already
in the cache, but expensive if it is not.
-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 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/2806/docs/iroh/struct.RelayUrl.html b/pr/2806/docs/iroh/struct.RelayUrl.html
index 8f18bf2dfe..198f39bcfa 100644
--- a/pr/2806/docs/iroh/struct.RelayUrl.html
+++ b/pr/2806/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 */);
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/2806/docs/iroh/struct.SecretKey.html b/pr/2806/docs/iroh/struct.SecretKey.html
index 7f18461b22..8595681a60 100644
--- a/pr/2806/docs/iroh/struct.SecretKey.html
+++ b/pr/2806/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() -> SecretKey
Generate a new SecretKey
with the default randomness generator.
-Sourcepub fn generate_with_rng<R>(csprng: &mut R) -> SecretKeywhere
+SecretKey in iroh - Rust Struct SecretKey
pub struct SecretKey { /* private fields */ }
Expand description
A secret key.
+Implementations§
§impl SecretKey
pub fn generate_with_rng<R>(csprng: &mut R) -> SecretKeywhere
R: CryptoRngCore + ?Sized,
Generate a new SecretKey
with a randomness generator.
-Sourcepub fn to_openssh(&self) -> Result<Zeroizing<String>, Error>
Serialise this key to OpenSSH format.
-Sourcepub fn try_from_openssh<T>(data: T) -> Result<SecretKey, Error>where
+
pub fn to_openssh(&self) -> Result<Zeroizing<String>, Error>
Serialise this key to OpenSSH format.
+pub fn try_from_openssh<T>(data: T) -> Result<SecretKey, Error>
Deserialise this key from OpenSSH format.
-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§
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/2806/docs/iroh/type.NodeId.html b/pr/2806/docs/iroh/type.NodeId.html
index e628621e88..495d1964e5 100644
--- a/pr/2806/docs/iroh/type.NodeId.html
+++ b/pr/2806/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/2806/docs/iroh_relay/client/struct.Client.html b/pr/2806/docs/iroh_relay/client/struct.Client.html
index 3bdc9b7ac3..994084b8eb 100644
--- a/pr/2806/docs/iroh_relay/client/struct.Client.html
+++ b/pr/2806/docs/iroh_relay/client/struct.Client.html
@@ -1,6 +1,6 @@
Client in iroh_relay::client - Rust pub struct Client { /* private fields */ }
Expand description
An HTTP Relay client.
Cheaply clonable.
-Implementations§
Source§impl Client
Sourcepub fn public_key(&self) -> PublicKey
The public key for this client
+Implementations§
Source§impl Client
Sourcepub fn public_key(&self) -> PublicKey
The public key for this client
Sourcepub async fn connect(&self) -> Result<Conn, ClientError>
Connects to a relay Server and returns the underlying relay connection.
Returns ClientError::Closed
if the Client
is closed.
If there is already an active relay connection, returns the already
@@ -17,7 +17,7 @@
returning.
Sourcepub async fn send(
&self,
- dst_key: PublicKey,
+ dst_key: PublicKey,
b: Bytes,
) -> Result<(), ClientError>
Send a packet to the server.
If there is no underlying active relay connection, it creates one before attempting to
diff --git a/pr/2806/docs/iroh_relay/client/struct.ClientBuilder.html b/pr/2806/docs/iroh_relay/client/struct.ClientBuilder.html
index 11aaf2b6d5..7ed9b8be06 100644
--- a/pr/2806/docs/iroh_relay/client/struct.ClientBuilder.html
+++ b/pr/2806/docs/iroh_relay/client/struct.ClientBuilder.html
@@ -1,6 +1,6 @@
ClientBuilder in iroh_relay::client - Rust pub struct ClientBuilder { /* private fields */ }
Expand description
Build a Client.
-Implementations§
Source§impl ClientBuilder
Sourcepub fn new(url: impl Into<RelayUrl>) -> Self
Create a new ClientBuilder
-Sourcepub fn server_url(self, url: impl Into<RelayUrl>) -> Self
Sets the server url
+Implementations§
Source§impl ClientBuilder
Sourcepub fn new(url: impl Into<RelayUrl>) -> Self
Create a new ClientBuilder
+Sourcepub fn server_url(self, url: impl Into<RelayUrl>) -> Self
Sets the server url
Sourcepub fn protocol(self, protocol: Protocol) -> Self
Sets whether to connect to the relay via websockets or not.
Set to use non-websocket, normal relaying by default.
Sourcepub fn address_family_selector<S>(self, selector: S) -> Selfwhere
@@ -11,17 +11,17 @@
chance of winning. We only return true when we believe IPv6 will
work anyway, so we don’t artificially delay the connection speed.
Sourcepub fn is_preferred(self, is: bool) -> Self
Indicate this client is the preferred way to communicate
-to the peer with this client’s PublicKey
+to the peer with this client’s [PublicKey
]
Sourcepub fn insecure_skip_cert_verify(self, skip: bool) -> Self
Available on crate feature test-utils
only.
Skip the verification of the relay server’s SSL certificates.
May only be used in tests.
Sourcepub fn proxy_url(self, url: Url) -> Self
Set an explicit proxy url to proxy all HTTP(S) traffic through.
Sourcepub fn build(
self,
- key: SecretKey,
+ key: SecretKey,
dns_resolver: DnsResolver,
) -> (Client, ClientReceiver)
Build the Client
-Sourcepub fn server_public_key(self, server_public_key: PublicKey) -> Self
The expected PublicKey
of the relay server we are connecting to.
+Sourcepub fn server_public_key(self, server_public_key: PublicKey) -> Self
The expected [PublicKey
] of the relay server we are connecting to.
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for ClientBuilder
§impl !RefUnwindSafe for ClientBuilder
§impl Send for ClientBuilder
§impl Sync for ClientBuilder
§impl Unpin for ClientBuilder
§impl !UnwindSafe for ClientBuilder
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/2806/docs/iroh_relay/enum.ReceivedMessage.html b/pr/2806/docs/iroh_relay/enum.ReceivedMessage.html
index fd1283eaa7..c5b2a26fb9 100644
--- a/pr/2806/docs/iroh_relay/enum.ReceivedMessage.html
+++ b/pr/2806/docs/iroh_relay/enum.ReceivedMessage.html
@@ -1,9 +1,9 @@
ReceivedMessage in iroh_relay - Rust pub enum ReceivedMessage {
ReceivedPacket {
- remote_node_id: NodeId,
+ remote_node_id: NodeId,
data: Bytes,
},
- NodeGone(NodeId),
+ NodeGone(NodeId),
Ping([u8; 8]),
Pong([u8; 8]),
KeepAlive,
@@ -16,9 +16,9 @@
},
}
Expand description
The type of message received by the Conn
from a relay server.
Variants§
§ReceivedPacket
Represents an incoming packet.
-Fields
§NodeGone(NodeId)
Indicates that the client identified by the underlying public key had previously sent you a
packet but has now disconnected from the server.
§Ping([u8; 8])
Request from a client or server to reply to the
other side with a ReceivedMessage::Pong
with the given payload.
diff --git a/pr/2806/docs/iroh_relay/server/struct.Server.html b/pr/2806/docs/iroh_relay/server/struct.Server.html
index e467cb7957..2e793bc6a5 100644
--- a/pr/2806/docs/iroh_relay/server/struct.Server.html
+++ b/pr/2806/docs/iroh_relay/server/struct.Server.html
@@ -14,9 +14,9 @@
Sourcepub fn quic_addr(&self) -> Option<SocketAddr>
The socket address the QUIC server is listening on.
Sourcepub fn stun_addr(&self) -> Option<SocketAddr>
The socket address the STUN server is listening on.
Sourcepub fn certificates(&self) -> Option<Vec<CertificateDer<'static>>>
The certificates chain if configured with manual TLS certificates.
-Sourcepub fn https_url(&self) -> Option<RelayUrl>
Available on crate feature test-utils
only.
Get the server’s https RelayUrl
.
+Sourcepub fn https_url(&self) -> Option<RelayUrl>
Available on crate feature test-utils
only.
Get the server’s https [RelayUrl
].
This uses Self::https_addr
so it’s mostly useful for local development.
-Sourcepub fn http_url(&self) -> Option<RelayUrl>
Available on crate feature test-utils
only.
Get the server’s http RelayUrl
.
+Sourcepub fn http_url(&self) -> Option<RelayUrl>
Available on crate feature test-utils
only.
Get the server’s http [RelayUrl
].
This uses Self::http_addr
so it’s mostly useful for local development.
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Server
§impl RefUnwindSafe for Server
§impl Send for Server
§impl Sync for Server
§impl Unpin for Server
§impl UnwindSafe for Server
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/2806/docs/iroh_relay/struct.RelayConn.html b/pr/2806/docs/iroh_relay/struct.RelayConn.html
index 8249cad794..5daa33b381 100644
--- a/pr/2806/docs/iroh_relay/struct.RelayConn.html
+++ b/pr/2806/docs/iroh_relay/struct.RelayConn.html
@@ -1,7 +1,7 @@
RelayConn in iroh_relay - Rust pub struct RelayConn { /* private fields */ }
Expand description
A connection to a relay server.
Cheaply clonable.
Call close
to shut down the write loop and read functionality.
-Implementations§
Source§impl Conn
Sourcepub async fn send(&self, dst: NodeId, packet: Bytes) -> Result<()>
Sends a packet to the node identified by dstkey
+Implementations§
Source§impl Conn
Sourcepub async fn send(&self, dst: NodeId, packet: Bytes) -> Result<()>
Sends a packet to the node identified by dstkey
Errors if the packet is larger than MAX_PACKET_SIZE
Sourcepub async fn send_ping(&self, data: [u8; 8]) -> Result<()>
Send a ping with 8 bytes of random data.
Sourcepub async fn send_pong(&self, data: [u8; 8]) -> Result<()>
Respond to a ping request. The data
field should be filled
diff --git a/pr/2806/docs/iroh_relay/struct.RelayMap.html b/pr/2806/docs/iroh_relay/struct.RelayMap.html
index 7cff698b0f..3d7b223e19 100644
--- a/pr/2806/docs/iroh_relay/struct.RelayMap.html
+++ b/pr/2806/docs/iroh_relay/struct.RelayMap.html
@@ -1,16 +1,16 @@
RelayMap in iroh_relay - Rust pub struct RelayMap { /* private fields */ }
Expand description
Configuration of all the relay servers that can be used.
-Implementations§
Source§impl RelayMap
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 contains_node(&self, url: &RelayUrl) -> bool
Is this a known node?
+Sourcepub fn default_from_node(url: RelayUrl, stun_port: u16) -> Self
Creates a new RelayMap
with a single relay server configured.
+Sourcepub fn default_from_node(url: RelayUrl, stun_port: u16) -> Self
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_url(url: RelayUrl) -> Self
Returns a RelayMap
from a [RelayUrl
].
This will use the default STUN port, the default QUIC port
(as defined by the iroh-relay
crate) and IP addresses
resolved from the URL’s host name via DNS.
diff --git a/pr/2806/docs/iroh_relay/struct.RelayNode.html b/pr/2806/docs/iroh_relay/struct.RelayNode.html
index 176a3b668a..ac70896801 100644
--- a/pr/2806/docs/iroh_relay/struct.RelayNode.html
+++ b/pr/2806/docs/iroh_relay/struct.RelayNode.html
@@ -1,11 +1,11 @@
RelayNode in iroh_relay - Rust pub struct RelayNode {
- pub url: RelayUrl,
+ pub url: RelayUrl,
pub stun_only: bool,
pub stun_port: u16,
pub quic: Option<RelayQuicConfig>,
}
Expand description
Information on a specific relay server.
Includes the Url where it can be dialed.
-Fields§
§url: RelayUrl
The RelayUrl
where this relay server can be dialed.
+Fields§
§url: RelayUrl
The [RelayUrl
] where this relay server can be dialed.
§stun_only: bool
Whether this relay server should only be used for STUN requests.
This essentially allows you to use a normal STUN server as a relay node, no relay
functionality is used.
diff --git a/pr/2806/docs/src/iroh/discovery/local_swarm_discovery.rs.html b/pr/2806/docs/src/iroh/discovery/local_swarm_discovery.rs.html
index fb4fcfac94..ab17e5b3f5 100644
--- a/pr/2806/docs/src/iroh/discovery/local_swarm_discovery.rs.html
+++ b/pr/2806/docs/src/iroh/discovery/local_swarm_discovery.rs.html
@@ -640,7 +640,7 @@
)?;
let local_addrs: Watchable<Option<(Option<RelayUrl>, BTreeSet<SocketAddr>)>> =
- Watchable::new(None);
+ Watchable::default();
let mut addrs_change = local_addrs.watch();
let discovery_fut = async move {
let mut node_addrs: HashMap<PublicKey, Peer> = HashMap::default();
diff --git a/pr/2806/docs/src/iroh/discovery/pkarr.rs.html b/pr/2806/docs/src/iroh/discovery/pkarr.rs.html
index c291d9dd61..7e2c9e1e87 100644
--- a/pr/2806/docs/src/iroh/discovery/pkarr.rs.html
+++ b/pr/2806/docs/src/iroh/discovery/pkarr.rs.html
@@ -565,7 +565,7 @@
debug!("creating pkarr publisher that publishes to {pkarr_relay}");
let node_id = secret_key.public();
let pkarr_client = PkarrRelayClient::new(pkarr_relay);
- let watchable = Watchable::new(None);
+ let watchable = Watchable::default();
let service = PublisherService {
ttl,
watcher: watchable.watch(),
diff --git a/pr/2806/docs/type.impl/iroh/struct.PublicKey.js b/pr/2806/docs/type.impl/iroh/struct.PublicKey.js
index eb19c81775..2abb82ed90 100644
--- a/pr/2806/docs/type.impl/iroh/struct.PublicKey.js
+++ b/pr/2806/docs/type.impl/iroh/struct.PublicKey.js
@@ -1,9 +1,9 @@
(function() {
- var type_impls = Object.fromEntries([["iroh",[["","AsRef<[u8]>","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"],["","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 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":[42819]}
\ No newline at end of file
+//{"start":55,"fragment_lengths":[39858]}
\ No newline at end of file