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/3215/docs/iroh/endpoint/struct.DirectAddr.html b/pr/3215/docs/iroh/endpoint/struct.DirectAddr.html
index b4a6a15773..9f24f5948e 100644
--- a/pr/3215/docs/iroh/endpoint/struct.DirectAddr.html
+++ b/pr/3215/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/3215/docs/iroh/endpoint/struct.Endpoint.html b/pr/3215/docs/iroh/endpoint/struct.Endpoint.html
index 44bed5afc7..2e21adc596 100644
--- a/pr/3215/docs/iroh/endpoint/struct.Endpoint.html
+++ b/pr/3215/docs/iroh/endpoint/struct.Endpoint.html
@@ -26,7 +26,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/3215/docs/iroh/enum.KeyParsingError.html b/pr/3215/docs/iroh/enum.KeyParsingError.html
index ea1d1fc907..ae2385ec9a 100644
--- a/pr/3215/docs/iroh/enum.KeyParsingError.html
+++ b/pr/3215/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/3215/docs/iroh/struct.NodeAddr.html b/pr/3215/docs/iroh/struct.NodeAddr.html
index d7aba73563..55febed3f9 100644
--- a/pr/3215/docs/iroh/struct.NodeAddr.html
+++ b/pr/3215/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/3215/docs/iroh/struct.PublicKey.html b/pr/3215/docs/iroh/struct.PublicKey.html
index 2a306a8932..e20c6288ad 100644
--- a/pr/3215/docs/iroh/struct.PublicKey.html
+++ b/pr/3215/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/3215/docs/iroh/struct.RelayUrl.html b/pr/3215/docs/iroh/struct.RelayUrl.html
index d1f98982e6..d6b1ad8686 100644
--- a/pr/3215/docs/iroh/struct.RelayUrl.html
+++ b/pr/3215/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.
It is cheaply clonable, as the underlying type is wrapped into an Arc.
The main type under the hood though is Url, with a few custom tweaks:
@@ -444,30 +444,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/3215/docs/iroh/struct.RelayUrlParseError.html b/pr/3215/docs/iroh/struct.RelayUrlParseError.html
index aef9f10d8c..e4e07ce0aa 100644
--- a/pr/3215/docs/iroh/struct.RelayUrlParseError.html
+++ b/pr/3215/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/3215/docs/iroh/struct.SecretKey.html b/pr/3215/docs/iroh/struct.SecretKey.html
index 2b1c7d44b2..fbe1b379ea 100644
--- a/pr/3215/docs/iroh/struct.SecretKey.html
+++ b/pr/3215/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/3215/docs/iroh/type.NodeId.html b/pr/3215/docs/iroh/type.NodeId.html
index 6a9e7e4e5d..b03316ea24 100644
--- a/pr/3215/docs/iroh/type.NodeId.html
+++ b/pr/3215/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/3215/docs/src/iroh/discovery/local_swarm_discovery.rs.html b/pr/3215/docs/src/iroh/discovery/local_swarm_discovery.rs.html
index 503c6fbabb..41975662f1 100644
--- a/pr/3215/docs/src/iroh/discovery/local_swarm_discovery.rs.html
+++ b/pr/3215/docs/src/iroh/discovery/local_swarm_discovery.rs.html
@@ -989,8 +989,8 @@
let mut got_ids = BTreeSet::new();
while got_ids.len() != num_nodes {
if let Some(item) = events.next().await {
- if node_ids.contains(&(item.node_id(), item.user_data().cloned())) {
- got_ids.insert((item.node_id(), item.user_data().cloned()));
+ if node_ids.contains(&(item.node_id(), item.user_data())) {
+ got_ids.insert((item.node_id(), item.user_data()));
}
} else {
anyhow::bail!(
diff --git a/pr/3215/docs/src/iroh/magicsock.rs.html b/pr/3215/docs/src/iroh/magicsock.rs.html
index 512ac3e026..555b530a35 100644
--- a/pr/3215/docs/src/iroh/magicsock.rs.html
+++ b/pr/3215/docs/src/iroh/magicsock.rs.html
@@ -4688,17 +4688,7 @@
4687
4688
4689
-4690
-4691
-4692
-4693
-4694
-4695
-4696
-4697
-4698
-4699
-4700//! Implements a socket that can change its communication path while in use, actively searching for the best way to communicate.
+4690
//! 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
//!
@@ -4745,8 +4735,9 @@
use net_report::IpMappedAddresses;
#[cfg(not(wasm_browser))]
use net_report::{IpMappedAddr, QuicConfig};
+use netwatch::{interfaces, netmon};
#[cfg(not(wasm_browser))]
-use netwatch::{interfaces, ip::LocalAddresses, netmon, UdpSocket};
+use netwatch::{ip::LocalAddresses, UdpSocket};
use quinn::{AsyncUdpSocket, ServerConfig};
use rand::{seq::SliceRandom, Rng, SeedableRng};
use relay_actor::RelaySendItem;
@@ -6525,8 +6516,7 @@
}
});
- #[cfg(not(wasm_browser))]
- let network_monitor = netmon::Monitor::new().await?;
+ let network_monitor = netmon::Monitor::new().await?;
let qad_endpoint = endpoint.clone();
// create a client config for the endpoint to use for QUIC address discovery
@@ -6570,8 +6560,7 @@
sockets: actor_sockets,
no_v4_send: false,
net_reporter,
- #[cfg(not(wasm_browser))]
- network_monitor,
+ network_monitor,
net_report_config,
};
@@ -7038,8 +7027,7 @@
/// The prober that discovers local network conditions, including the closest relay relay and NAT mappings.
net_reporter: net_report::Client,
- #[cfg(not(wasm_browser))]
- network_monitor: netmon::Monitor,
+ network_monitor: netmon::Monitor,
}
/// Actor state that relies on sockets being available.
@@ -7125,10 +7113,8 @@
impl Actor {
async fn run(mut self) -> Result<()> {
// Setup network monitoring
- #[cfg(not(wasm_browser))]
let (link_change_s, mut link_change_r) = mpsc::channel(8);
- #[cfg(not(wasm_browser))]
- let _token = self
+ let _token = self
.network_monitor
.subscribe(move |is_major| {
let link_change_s = link_change_s.clone();
@@ -7173,11 +7159,6 @@
#[cfg(wasm_browser)]
let direct_addr_heartbeat_timer_tick = n0_future::future::pending();
- #[cfg(not(wasm_browser))]
- let link_change_r_recv = link_change_r.recv();
- #[cfg(wasm_browser)]
- let link_change_r_recv = n0_future::future::pending();
-
tokio::select! {
msg = self.msg_receiver.recv(), if !receiver_closed => {
let Some(msg) = msg else {
@@ -7242,23 +7223,18 @@
self.refresh_direct_addrs(reason).await;
}
}
- is_major = link_change_r_recv, if !link_change_closed => {
- #[cfg(not(wasm_browser))]
- {
- let Some(is_major) = is_major else {
- trace!("tick: link change receiver closed");
- inc!(Metrics, actor_tick_other);
+ is_major = link_change_r.recv(), if !link_change_closed => {
+ let Some(is_major) = is_major else {
+ trace!("tick: link change receiver closed");
+ inc!(Metrics, actor_tick_other);
- link_change_closed = true;
- continue;
- };
+ link_change_closed = true;
+ continue;
+ };
- trace!("tick: link change {}", is_major);
- inc!(Metrics, actor_link_change);
- self.handle_network_change(is_major).await;
- }
- #[cfg(wasm_browser)]
- let _unused_in_browsers = is_major;
+ trace!("tick: link change {}", is_major);
+ inc!(Metrics, actor_link_change);
+ self.handle_network_change(is_major).await;
}
// Even if `discovery_events` yields `None`, it could begin to yield
// `Some` again in the future, so we don't want to disable this branch
@@ -7282,20 +7258,22 @@
}
}
- #[cfg(not(wasm_browser))]
- async fn handle_network_change(&mut self, is_major: bool) {
+ async fn handle_network_change(&mut self, is_major: bool) {
debug!("link change detected: major? {}", is_major);
if is_major {
- if let Err(err) = self.sockets.v4.rebind() {
- warn!("failed to rebind Udp IPv4 socket: {:?}", err);
- };
- if let Some(ref socket) = self.sockets.v6 {
- if let Err(err) = socket.rebind() {
- warn!("failed to rebind Udp IPv6 socket: {:?}", err);
+ #[cfg(not(wasm_browser))]
+ {
+ if let Err(err) = self.sockets.v4.rebind() {
+ warn!("failed to rebind Udp IPv4 socket: {:?}", err);
};
+ if let Some(ref socket) = self.sockets.v6 {
+ if let Err(err) = socket.rebind() {
+ warn!("failed to rebind Udp IPv6 socket: {:?}", err);
+ };
+ }
+ self.msock.dns_resolver.clear_cache();
}
- self.msock.dns_resolver.clear_cache();
self.msock.re_stun("link-change-major");
self.close_stale_relay_connections().await;
self.reset_endpoint_states();
@@ -7349,8 +7327,7 @@
self.finalize_direct_addrs_update(why);
}
ActorMessage::NetworkChange => {
- #[cfg(not(wasm_browser))]
- self.network_monitor.network_change().await.ok();
+ self.network_monitor.network_change().await.ok();
}
#[cfg(test)]
ActorMessage::ForceNetworkChange(is_major) => {
@@ -7732,15 +7709,18 @@
/// The relay connections who's local endpoints no longer exist after a network change
/// will error out soon enough. Closing them eagerly speeds this up however and allows
/// re-establishing a relay connection faster.
- #[cfg(not(wasm_browser))]
async fn close_stale_relay_connections(&self) {
let ifs = interfaces::State::new().await;
- let local_ips = ifs
+ #[cfg(not(wasm_browser))]
+ let local_ips = ifs
.interfaces
.values()
.flat_map(|netif| netif.addrs())
.map(|ipnet| ipnet.addr())
.collect();
+ // In browsers, we don't have this information. This will do the right thing in the ActiveRelayActor, though.
+ #[cfg(wasm_browser)]
+ let local_ips = Vec::new();
self.send_relay_actor(RelayActorMessage::MaybeCloseRelaysOnRebind(local_ips));
}
diff --git a/pr/3215/docs/src/iroh/magicsock/node_map/node_state.rs.html b/pr/3215/docs/src/iroh/magicsock/node_map/node_state.rs.html
index 9a395a417e..2773712614 100644
--- a/pr/3215/docs/src/iroh/magicsock/node_map/node_state.rs.html
+++ b/pr/3215/docs/src/iroh/magicsock/node_map/node_state.rs.html
@@ -1745,13 +1745,7 @@
1744
1745
1746
-1747
-1748
-1749
-1750
-1751
-1752
-1753
use std::{
+1747
use std::{
collections::{btree_map::Entry, BTreeSet, HashMap},
hash::Hash,
net::{IpAddr, SocketAddr},
@@ -2743,7 +2737,7 @@
for peer_sockaddr in &m.my_numbers {
if let IpAddr::V6(ip) = peer_sockaddr.ip() {
- if is_unicast_link_local(ip) {
+ if netwatch::ip::is_unicast_link_local(ip) {
// We send these out, but ignore them for now.
// TODO: teach the ping code to ping on all interfaces for these.
continue;
@@ -3193,12 +3187,6 @@
None,
}
-/// Returns true if the address is a unicast address with link-local scope, as defined in RFC 4291.
-// Copied from std lib, not stable yet
-pub const fn is_unicast_link_local(addr: std::net::Ipv6Addr) -> bool {
- (addr.segments()[0] & 0xffc0) == 0xfe80
-}
-
#[cfg(test)]
mod tests {
use std::{collections::BTreeMap, net::Ipv4Addr};
diff --git a/pr/3215/docs/type.impl/iroh/struct.PublicKey.js b/pr/3215/docs/type.impl/iroh/struct.PublicKey.js
index 9c9039082f..ed1958aa92 100644
--- a/pr/3215/docs/type.impl/iroh/struct.PublicKey.js
+++ b/pr/3215/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"],["","NodeIdExt","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"],["","NodeIdExt","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":[47657]}
\ No newline at end of file
+//{"start":55,"fragment_lengths":[44405]}
\ 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/3215/docs/iroh/endpoint/struct.Endpoint.html b/pr/3215/docs/iroh/endpoint/struct.Endpoint.html
index 44bed5afc7..2e21adc596 100644
--- a/pr/3215/docs/iroh/endpoint/struct.Endpoint.html
+++ b/pr/3215/docs/iroh/endpoint/struct.Endpoint.html
@@ -26,7 +26,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/3215/docs/iroh/enum.KeyParsingError.html b/pr/3215/docs/iroh/enum.KeyParsingError.html
index ea1d1fc907..ae2385ec9a 100644
--- a/pr/3215/docs/iroh/enum.KeyParsingError.html
+++ b/pr/3215/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/3215/docs/iroh/struct.NodeAddr.html b/pr/3215/docs/iroh/struct.NodeAddr.html
index d7aba73563..55febed3f9 100644
--- a/pr/3215/docs/iroh/struct.NodeAddr.html
+++ b/pr/3215/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/3215/docs/iroh/struct.PublicKey.html b/pr/3215/docs/iroh/struct.PublicKey.html
index 2a306a8932..e20c6288ad 100644
--- a/pr/3215/docs/iroh/struct.PublicKey.html
+++ b/pr/3215/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/3215/docs/iroh/struct.RelayUrl.html b/pr/3215/docs/iroh/struct.RelayUrl.html
index d1f98982e6..d6b1ad8686 100644
--- a/pr/3215/docs/iroh/struct.RelayUrl.html
+++ b/pr/3215/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.
It is cheaply clonable, as the underlying type is wrapped into an Arc.
The main type under the hood though is Url, with a few custom tweaks:
@@ -444,30 +444,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/3215/docs/iroh/struct.RelayUrlParseError.html b/pr/3215/docs/iroh/struct.RelayUrlParseError.html
index aef9f10d8c..e4e07ce0aa 100644
--- a/pr/3215/docs/iroh/struct.RelayUrlParseError.html
+++ b/pr/3215/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/3215/docs/iroh/struct.SecretKey.html b/pr/3215/docs/iroh/struct.SecretKey.html
index 2b1c7d44b2..fbe1b379ea 100644
--- a/pr/3215/docs/iroh/struct.SecretKey.html
+++ b/pr/3215/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/3215/docs/iroh/type.NodeId.html b/pr/3215/docs/iroh/type.NodeId.html
index 6a9e7e4e5d..b03316ea24 100644
--- a/pr/3215/docs/iroh/type.NodeId.html
+++ b/pr/3215/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/3215/docs/src/iroh/discovery/local_swarm_discovery.rs.html b/pr/3215/docs/src/iroh/discovery/local_swarm_discovery.rs.html
index 503c6fbabb..41975662f1 100644
--- a/pr/3215/docs/src/iroh/discovery/local_swarm_discovery.rs.html
+++ b/pr/3215/docs/src/iroh/discovery/local_swarm_discovery.rs.html
@@ -989,8 +989,8 @@
let mut got_ids = BTreeSet::new();
while got_ids.len() != num_nodes {
if let Some(item) = events.next().await {
- if node_ids.contains(&(item.node_id(), item.user_data().cloned())) {
- got_ids.insert((item.node_id(), item.user_data().cloned()));
+ if node_ids.contains(&(item.node_id(), item.user_data())) {
+ got_ids.insert((item.node_id(), item.user_data()));
}
} else {
anyhow::bail!(
diff --git a/pr/3215/docs/src/iroh/magicsock.rs.html b/pr/3215/docs/src/iroh/magicsock.rs.html
index 512ac3e026..555b530a35 100644
--- a/pr/3215/docs/src/iroh/magicsock.rs.html
+++ b/pr/3215/docs/src/iroh/magicsock.rs.html
@@ -4688,17 +4688,7 @@
4687
4688
4689
-4690
-4691
-4692
-4693
-4694
-4695
-4696
-4697
-4698
-4699
-4700//! Implements a socket that can change its communication path while in use, actively searching for the best way to communicate.
+4690
//! 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
//!
@@ -4745,8 +4735,9 @@
use net_report::IpMappedAddresses;
#[cfg(not(wasm_browser))]
use net_report::{IpMappedAddr, QuicConfig};
+use netwatch::{interfaces, netmon};
#[cfg(not(wasm_browser))]
-use netwatch::{interfaces, ip::LocalAddresses, netmon, UdpSocket};
+use netwatch::{ip::LocalAddresses, UdpSocket};
use quinn::{AsyncUdpSocket, ServerConfig};
use rand::{seq::SliceRandom, Rng, SeedableRng};
use relay_actor::RelaySendItem;
@@ -6525,8 +6516,7 @@
}
});
- #[cfg(not(wasm_browser))]
- let network_monitor = netmon::Monitor::new().await?;
+ let network_monitor = netmon::Monitor::new().await?;
let qad_endpoint = endpoint.clone();
// create a client config for the endpoint to use for QUIC address discovery
@@ -6570,8 +6560,7 @@
sockets: actor_sockets,
no_v4_send: false,
net_reporter,
- #[cfg(not(wasm_browser))]
- network_monitor,
+ network_monitor,
net_report_config,
};
@@ -7038,8 +7027,7 @@
/// The prober that discovers local network conditions, including the closest relay relay and NAT mappings.
net_reporter: net_report::Client,
- #[cfg(not(wasm_browser))]
- network_monitor: netmon::Monitor,
+ network_monitor: netmon::Monitor,
}
/// Actor state that relies on sockets being available.
@@ -7125,10 +7113,8 @@
impl Actor {
async fn run(mut self) -> Result<()> {
// Setup network monitoring
- #[cfg(not(wasm_browser))]
let (link_change_s, mut link_change_r) = mpsc::channel(8);
- #[cfg(not(wasm_browser))]
- let _token = self
+ let _token = self
.network_monitor
.subscribe(move |is_major| {
let link_change_s = link_change_s.clone();
@@ -7173,11 +7159,6 @@
#[cfg(wasm_browser)]
let direct_addr_heartbeat_timer_tick = n0_future::future::pending();
- #[cfg(not(wasm_browser))]
- let link_change_r_recv = link_change_r.recv();
- #[cfg(wasm_browser)]
- let link_change_r_recv = n0_future::future::pending();
-
tokio::select! {
msg = self.msg_receiver.recv(), if !receiver_closed => {
let Some(msg) = msg else {
@@ -7242,23 +7223,18 @@
self.refresh_direct_addrs(reason).await;
}
}
- is_major = link_change_r_recv, if !link_change_closed => {
- #[cfg(not(wasm_browser))]
- {
- let Some(is_major) = is_major else {
- trace!("tick: link change receiver closed");
- inc!(Metrics, actor_tick_other);
+ is_major = link_change_r.recv(), if !link_change_closed => {
+ let Some(is_major) = is_major else {
+ trace!("tick: link change receiver closed");
+ inc!(Metrics, actor_tick_other);
- link_change_closed = true;
- continue;
- };
+ link_change_closed = true;
+ continue;
+ };
- trace!("tick: link change {}", is_major);
- inc!(Metrics, actor_link_change);
- self.handle_network_change(is_major).await;
- }
- #[cfg(wasm_browser)]
- let _unused_in_browsers = is_major;
+ trace!("tick: link change {}", is_major);
+ inc!(Metrics, actor_link_change);
+ self.handle_network_change(is_major).await;
}
// Even if `discovery_events` yields `None`, it could begin to yield
// `Some` again in the future, so we don't want to disable this branch
@@ -7282,20 +7258,22 @@
}
}
- #[cfg(not(wasm_browser))]
- async fn handle_network_change(&mut self, is_major: bool) {
+ async fn handle_network_change(&mut self, is_major: bool) {
debug!("link change detected: major? {}", is_major);
if is_major {
- if let Err(err) = self.sockets.v4.rebind() {
- warn!("failed to rebind Udp IPv4 socket: {:?}", err);
- };
- if let Some(ref socket) = self.sockets.v6 {
- if let Err(err) = socket.rebind() {
- warn!("failed to rebind Udp IPv6 socket: {:?}", err);
+ #[cfg(not(wasm_browser))]
+ {
+ if let Err(err) = self.sockets.v4.rebind() {
+ warn!("failed to rebind Udp IPv4 socket: {:?}", err);
};
+ if let Some(ref socket) = self.sockets.v6 {
+ if let Err(err) = socket.rebind() {
+ warn!("failed to rebind Udp IPv6 socket: {:?}", err);
+ };
+ }
+ self.msock.dns_resolver.clear_cache();
}
- self.msock.dns_resolver.clear_cache();
self.msock.re_stun("link-change-major");
self.close_stale_relay_connections().await;
self.reset_endpoint_states();
@@ -7349,8 +7327,7 @@
self.finalize_direct_addrs_update(why);
}
ActorMessage::NetworkChange => {
- #[cfg(not(wasm_browser))]
- self.network_monitor.network_change().await.ok();
+ self.network_monitor.network_change().await.ok();
}
#[cfg(test)]
ActorMessage::ForceNetworkChange(is_major) => {
@@ -7732,15 +7709,18 @@
/// The relay connections who's local endpoints no longer exist after a network change
/// will error out soon enough. Closing them eagerly speeds this up however and allows
/// re-establishing a relay connection faster.
- #[cfg(not(wasm_browser))]
async fn close_stale_relay_connections(&self) {
let ifs = interfaces::State::new().await;
- let local_ips = ifs
+ #[cfg(not(wasm_browser))]
+ let local_ips = ifs
.interfaces
.values()
.flat_map(|netif| netif.addrs())
.map(|ipnet| ipnet.addr())
.collect();
+ // In browsers, we don't have this information. This will do the right thing in the ActiveRelayActor, though.
+ #[cfg(wasm_browser)]
+ let local_ips = Vec::new();
self.send_relay_actor(RelayActorMessage::MaybeCloseRelaysOnRebind(local_ips));
}
diff --git a/pr/3215/docs/src/iroh/magicsock/node_map/node_state.rs.html b/pr/3215/docs/src/iroh/magicsock/node_map/node_state.rs.html
index 9a395a417e..2773712614 100644
--- a/pr/3215/docs/src/iroh/magicsock/node_map/node_state.rs.html
+++ b/pr/3215/docs/src/iroh/magicsock/node_map/node_state.rs.html
@@ -1745,13 +1745,7 @@
1744
1745
1746
-1747
-1748
-1749
-1750
-1751
-1752
-1753
use std::{
+1747
use std::{
collections::{btree_map::Entry, BTreeSet, HashMap},
hash::Hash,
net::{IpAddr, SocketAddr},
@@ -2743,7 +2737,7 @@
for peer_sockaddr in &m.my_numbers {
if let IpAddr::V6(ip) = peer_sockaddr.ip() {
- if is_unicast_link_local(ip) {
+ if netwatch::ip::is_unicast_link_local(ip) {
// We send these out, but ignore them for now.
// TODO: teach the ping code to ping on all interfaces for these.
continue;
@@ -3193,12 +3187,6 @@
None,
}
-/// Returns true if the address is a unicast address with link-local scope, as defined in RFC 4291.
-// Copied from std lib, not stable yet
-pub const fn is_unicast_link_local(addr: std::net::Ipv6Addr) -> bool {
- (addr.segments()[0] & 0xffc0) == 0xfe80
-}
-
#[cfg(test)]
mod tests {
use std::{collections::BTreeMap, net::Ipv4Addr};
diff --git a/pr/3215/docs/type.impl/iroh/struct.PublicKey.js b/pr/3215/docs/type.impl/iroh/struct.PublicKey.js
index 9c9039082f..ed1958aa92 100644
--- a/pr/3215/docs/type.impl/iroh/struct.PublicKey.js
+++ b/pr/3215/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"],["","NodeIdExt","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"],["","NodeIdExt","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":[47657]}
\ No newline at end of file
+//{"start":55,"fragment_lengths":[44405]}
\ No newline at end of file