pub const ENV_FORCE_STAGING_RELAYS: &str = "IROH_FORCE_STAGING_RELAYS";Expand description
Environment variable to force the use of staging relays.
+pub enum RelayMode {
+RelayMode in iroh::endpoint - Rust pub enum RelayMode {
Disabled,
Default,
Staging,
@@ -9,9 +9,9 @@
See crate::defaults::prod for the severs used.
§Staging
Use the staging relay servers from n0.
§Custom(RelayMap)
Use a custom relay map.
-Implementations§
Trait Implementations§
impl Eq for RelayMode
impl StructuralPartialEq for RelayMode
Auto Trait Implementations§
impl Freeze for RelayMode
impl RefUnwindSafe for RelayMode
impl Send for RelayMode
impl Sync for RelayMode
impl Unpin for RelayMode
impl UnwindSafe for RelayMode
Blanket Implementations§
Implementations§
Trait Implementations§
impl Eq for RelayMode
impl StructuralPartialEq for RelayMode
Auto Trait Implementations§
impl Freeze for RelayMode
impl RefUnwindSafe for RelayMode
impl Send for RelayMode
impl Sync for RelayMode
impl Unpin for RelayMode
impl UnwindSafe for RelayMode
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/2937/docs/iroh/endpoint/fn.default_relay_mode.html b/pr/2937/docs/iroh/endpoint/fn.default_relay_mode.html
index 1f6f8d7417..ff7fb19a95 100644
--- a/pr/2937/docs/iroh/endpoint/fn.default_relay_mode.html
+++ b/pr/2937/docs/iroh/endpoint/fn.default_relay_mode.html
@@ -1,4 +1,4 @@
-default_relay_mode in iroh::endpoint - Rust pub fn default_relay_mode() -> RelayMode
Expand description
Returns the default relay mode.
+default_relay_mode in iroh::endpoint - Rust
\ No newline at end of file
diff --git a/pr/2937/docs/iroh/endpoint/fn.force_staging_infra.html b/pr/2937/docs/iroh/endpoint/fn.force_staging_infra.html
index 7d9ddd549c..8027e375f8 100644
--- a/pr/2937/docs/iroh/endpoint/fn.force_staging_infra.html
+++ b/pr/2937/docs/iroh/endpoint/fn.force_staging_infra.html
@@ -1,2 +1,2 @@
-force_staging_infra in iroh::endpoint - Rust pub fn force_staging_infra() -> bool
Expand description
Returns true if the use of staging relays is forced.
+force_staging_infra in iroh::endpoint - Rust
\ No newline at end of file
diff --git a/pr/2937/docs/iroh/endpoint/index.html b/pr/2937/docs/iroh/endpoint/index.html
index 6d2cbbd2b4..b1a666b8bf 100644
--- a/pr/2937/docs/iroh/endpoint/index.html
+++ b/pr/2937/docs/iroh/endpoint/index.html
@@ -1,4 +1,4 @@
-iroh::endpoint - Rust Expand description
The Endpoint allows establishing connections to other iroh nodes.
+iroh::endpoint - Rust Expand description
The Endpoint allows establishing connections to other iroh nodes.
The Endpoint is the main API interface to manage a local iroh node. It allows
connecting to and accepting connections from other nodes. See the module docs for
more details on how iroh connections work.
diff --git a/pr/2937/docs/iroh/endpoint/struct.Connection.html b/pr/2937/docs/iroh/endpoint/struct.Connection.html
index e67409dba0..bf3365e8ac 100644
--- a/pr/2937/docs/iroh/endpoint/struct.Connection.html
+++ b/pr/2937/docs/iroh/endpoint/struct.Connection.html
@@ -1,4 +1,4 @@
-Connection in iroh::endpoint - Rust pub struct Connection { /* private fields */ }
Expand description
A QUIC connection.
+Connection in iroh::endpoint - Rust pub struct Connection { /* private fields */ }
Expand description
A QUIC connection.
If all references to a connection (including every clone of the Connection handle,
streams of incoming streams, and the various stream types) have been dropped, then the
connection will be automatically closed with an error_code of 0 and an empty reason. You
@@ -8,29 +8,29 @@ receiving CONNECTION_CLOSE the peer may drop any stream data not yet delivered t
application. Connection::close describes in more detail how to gracefully close a
connection without losing application data.
May be cloned to obtain another handle to the same connection.
-Implementations§
Source§impl Connection
Implementations§
Source§impl Connection
Sourcepub fn open_uni(&self) -> OpenUni<'_> ⓘ
Initiates a new outgoing unidirectional stream.
Streams are cheap and instantaneous to open unless blocked by flow control. As a
consequence, the peer won’t be notified that a stream has been opened until the
stream is actually used.
-Sourcepub fn open_bi(&self) -> OpenBi<'_> ⓘ
Initiates a new outgoing bidirectional stream.
Streams are cheap and instantaneous to open unless blocked by flow control. As a
consequence, the peer won’t be notified that a stream has been opened until the
stream is actually used. Calling open_bi then waiting on the RecvStream
without writing anything to SendStream will never succeed.
-Sourcepub fn accept_uni(&self) -> AcceptUni<'_> ⓘ
Accepts the next incoming uni-directional stream.
-Sourcepub fn accept_uni(&self) -> AcceptUni<'_> ⓘ
Accepts the next incoming uni-directional stream.
+Sourcepub fn accept_bi(&self) -> AcceptBi<'_> ⓘ
Accept the next incoming bidirectional stream.
Important Note: The peer that calls open_bi must write to its SendStream
before the peer Connection is able to accept the stream using
accept_bi(). Calling open_bi then waiting on the RecvStream without
writing anything to the connected SendStream will never succeed.
-Sourcepub fn read_datagram(&self) -> ReadDatagram<'_> ⓘ
Receives an application datagram.
-Sourcepub async fn closed(&self) -> ConnectionError
Wait for the connection to be closed for any reason.
+Sourcepub fn read_datagram(&self) -> ReadDatagram<'_> ⓘ
Receives an application datagram.
+Sourcepub async fn closed(&self) -> ConnectionError
Wait for the connection to be closed for any reason.
Despite the return type’s name, closed connections are often not an error condition
at the application layer. Cases that might be routine include
ConnectionError::LocallyClosed and ConnectionError::ApplicationClosed.
-Sourcepub fn close_reason(&self) -> Option<ConnectionError>
If the connection is closed, the reason why.
+Sourcepub fn close_reason(&self) -> Option<ConnectionError>
If the connection is closed, the reason why.
Returns None if the connection is still open.
-Sourcepub fn close(&self, error_code: VarInt, reason: &[u8])
Closes the connection immediately.
Pending operations will fail immediately with ConnectionError::LocallyClosed. No
more data is sent to the peer and the peer may drop buffered data upon receiving the
CONNECTION_CLOSE frame.
@@ -48,41 +48,41 @@ delivered.
The sender checks that the error_code is the expected error code.
If the close/closed dance is not done, or is interrupted at any point, the connection will eventually time out, provided that the idle timeout is not disabled.
-Sourcepub fn send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError>
Transmits data as an unreliable, unordered application datagram.
+Sourcepub fn send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError>
Transmits data as an unreliable, unordered application datagram.
Application datagrams are a low-level primitive. They may be lost or delivered out
of order, and data must both fit inside a single QUIC packet and be smaller than
the maximum dictated by the peer.
-Sourcepub fn max_datagram_size(&self) -> Option<usize>
Computes the maximum size of datagrams that may be passed to send_datagram.
+Sourcepub fn max_datagram_size(&self) -> Option<usize>
Computes the maximum size of datagrams that may be passed to send_datagram.
Returns None if datagrams are unsupported by the peer or disabled locally.
This may change over the lifetime of a connection according to variation in the path
MTU estimate. The peer can also enforce an arbitrarily small fixed limit, but if the
peer’s limit is large this is guaranteed to be a little over a kilobyte at minimum.
Not necessarily the maximum size of received datagrams.
-Sourcepub fn datagram_send_buffer_space(&self) -> usize
Bytes available in the outgoing datagram buffer.
+Sourcepub fn datagram_send_buffer_space(&self) -> usize
Bytes available in the outgoing datagram buffer.
When greater than zero, calling send_datagram with a
datagram of at most this size is guaranteed not to cause older datagrams to be
dropped.
-Sourcepub fn rtt(&self) -> Duration
Current best estimate of this connection’s latency (round-trip-time).
-Sourcepub fn stats(&self) -> ConnectionStats
Returns connection statistics.
-Sourcepub fn congestion_state(&self) -> Box<dyn Controller>
Current state of the congestion control algorithm, for debugging purposes.
-Sourcepub fn handshake_data(&self) -> Option<Box<dyn Any>>
Parameters negotiated during the handshake.
+Sourcepub fn rtt(&self) -> Duration
Current best estimate of this connection’s latency (round-trip-time).
+Sourcepub fn stats(&self) -> ConnectionStats
Returns connection statistics.
+Sourcepub fn congestion_state(&self) -> Box<dyn Controller>
Current state of the congestion control algorithm, for debugging purposes.
+Sourcepub fn handshake_data(&self) -> Option<Box<dyn Any>>
Parameters negotiated during the handshake.
Guaranteed to return Some on fully established connections or after
Connecting::handshake_data() succeeds. See that method’s documentations for
details on the returned value.
-Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
-Sourcepub fn peer_identity(&self) -> Option<Box<dyn Any>>
Cryptographic identity of the peer.
+Sourcepub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
+Sourcepub fn peer_identity(&self) -> Option<Box<dyn Any>>
Sourcepub fn remote_node_id(&self) -> Result<NodeId>
Returns the NodeId from the peer’s TLS certificate.
+Sourcepub fn remote_node_id(&self) -> Result<NodeId>
Sourcepub fn stable_id(&self) -> usize
A stable identifier for this connection.
Peer addresses and connection IDs can change, but this value will remain fixed for
the lifetime of the connection.
-Sourcepub fn export_keying_material(
+
Sourcepub fn export_keying_material(
&self,
output: &mut [u8],
label: &[u8],
@@ -93,14 +93,14 @@ arguments and output buffers of equal length, they will get the
same sequence of bytes in output. These bytes are cryptographically
strong and pseudorandom, and are suitable for use as keying material.
See RFC5705 for more information.
-
Sourcepub fn set_max_concurrent_uni_streams(&self, count: VarInt)
Modifies the number of unidirectional streams that may be concurrently opened.
+Sourcepub fn set_max_concurrent_uni_streams(&self, count: VarInt)
Modifies the number of unidirectional streams that may be concurrently opened.
No streams may be opened by the peer unless fewer than count are already
open. Large counts increase both minimum and worst-case memory consumption.
-Sourcepub fn set_receive_window(&self, receive_window: VarInt)
Sourcepub fn set_max_concurrent_bi_streams(&self, count: VarInt)
Modifies the number of bidirectional streams that may be concurrently opened.
+Sourcepub fn set_receive_window(&self, receive_window: VarInt)
Sourcepub fn set_max_concurrent_bi_streams(&self, count: VarInt)
Modifies the number of bidirectional streams that may be concurrently opened.
No streams may be opened by the peer unless fewer than count are already
open. Large counts increase both minimum and worst-case memory consumption.
-Trait Implementations§
Source§impl Clone for Connection
Source§fn clone(&self) -> Connection
Returns a copy of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreAuto Trait Implementations§
§impl Freeze for Connection
§impl RefUnwindSafe for Connection
§impl Send for Connection
§impl Sync for Connection
§impl Unpin for Connection
§impl UnwindSafe for Connection
Blanket Implementations§
Trait Implementations§
Source§impl Clone for Connection
Source§fn clone(&self) -> Connection
Returns a copy of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreAuto Trait Implementations§
§impl Freeze for Connection
§impl RefUnwindSafe for Connection
§impl Send for Connection
§impl Sync for Connection
§impl Unpin for Connection
§impl UnwindSafe for Connection
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/2937/docs/iroh/endpoint/struct.Endpoint.html b/pr/2937/docs/iroh/endpoint/struct.Endpoint.html
index 309aaf1dda..dc12bc3d68 100644
--- a/pr/2937/docs/iroh/endpoint/struct.Endpoint.html
+++ b/pr/2937/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/2937/docs/iroh/enum.KeyParsingError.html b/pr/2937/docs/iroh/enum.KeyParsingError.html
index 31d4e510a4..c76cd6ce94 100644
--- a/pr/2937/docs/iroh/enum.KeyParsingError.html
+++ b/pr/2937/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/2937/docs/iroh/struct.NodeAddr.html b/pr/2937/docs/iroh/struct.NodeAddr.html
index b852299fae..4c632de3cb 100644
--- a/pr/2937/docs/iroh/struct.NodeAddr.html
+++ b/pr/2937/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/2937/docs/iroh/struct.PublicKey.html b/pr/2937/docs/iroh/struct.PublicKey.html
index 57c0475554..130fc28fda 100644
--- a/pr/2937/docs/iroh/struct.PublicKey.html
+++ b/pr/2937/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 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 serialize_public_pem(&self) -> String
Serializes the public key as PEM
-Sourcepub fn from_public_der(der: &[u8]) -> Result<PublicKey, Error>
Deserialize the pem bytes
-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 serialize_public_pem(&self) -> String
Serializes the public key as PEM
+pub fn from_public_der(der: &[u8]) -> Result<PublicKey, Error>
Deserialize the pem bytes
+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/2937/docs/iroh/struct.RelayUrl.html b/pr/2937/docs/iroh/struct.RelayUrl.html
index a28dcb6ef6..2b27f10da6 100644
--- a/pr/2937/docs/iroh/struct.RelayUrl.html
+++ b/pr/2937/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/2937/docs/iroh/struct.RelayUrlParseError.html b/pr/2937/docs/iroh/struct.RelayUrlParseError.html
index 695516a7e8..32dc646313 100644
--- a/pr/2937/docs/iroh/struct.RelayUrlParseError.html
+++ b/pr/2937/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/2937/docs/iroh/struct.SecretKey.html b/pr/2937/docs/iroh/struct.SecretKey.html
index 02605435a1..4ab117bc40 100644
--- a/pr/2937/docs/iroh/struct.SecretKey.html
+++ b/pr/2937/docs/iroh/struct.SecretKey.html
@@ -1,25 +1,25 @@
-SecretKey in iroh - Rust pub struct SecretKey { /* private fields */ }
Expand description
A secret key.
-Implementations§
Source§impl SecretKey
Sourcepub fn serialize_secret_pem(&self) -> Zeroizing<String>
Serializes the secret key as PEM
-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 serialize_secret_pem(&self) -> Zeroizing<String>
Serializes the secret key as PEM
+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/2937/docs/iroh/type.NodeId.html b/pr/2937/docs/iroh/type.NodeId.html
index b72028ebf3..ab9edbf3b6 100644
--- a/pr/2937/docs/iroh/type.NodeId.html
+++ b/pr/2937/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/2937/docs/src/iroh/endpoint.rs.html b/pr/2937/docs/src/iroh/endpoint.rs.html
index c99cc25671..dea0bcaa62 100644
--- a/pr/2937/docs/src/iroh/endpoint.rs.html
+++ b/pr/2937/docs/src/iroh/endpoint.rs.html
@@ -2546,9 +2546,7 @@
2545
2546
2547
-2548
-2549
-2550//! The [`Endpoint`] allows establishing connections to other iroh nodes.
+2548
//! The [`Endpoint`] allows establishing connections to other iroh nodes.
//!
//! The [`Endpoint`] is the main API interface to manage a local iroh node. It allows
//! connecting to and accepting connections from other nodes. See the [module docs] for
@@ -4011,8 +4009,6 @@
/// connection without losing application data.
///
/// May be cloned to obtain another handle to the same connection.
-// This has repr(transparent) as it opens the door to potentially allow casting it to a
-// quinn::Connection in the future. Right now however that'd be iroh_quinn::Connection.
#[derive(Debug, Clone)]
pub struct Connection {
inner: quinn::Connection,
diff --git a/pr/2937/docs/src/iroh/tls.rs.html b/pr/2937/docs/src/iroh/tls.rs.html
index a10e517856..bf16e35b72 100644
--- a/pr/2937/docs/src/iroh/tls.rs.html
+++ b/pr/2937/docs/src/iroh/tls.rs.html
@@ -136,7 +136,7 @@
use self::resolver::AlwaysResolvesCert;
-pub mod certificate;
+pub(crate) mod certificate;
mod resolver;
mod verifier;
@@ -156,7 +156,7 @@
/// If *keylog* is `true` this will enable logging of the pre-master key to the file in the
/// `SSLKEYLOGFILE` environment variable. This can be used to inspect the traffic for
/// debugging purposes.
- pub fn make_client_config(
+ pub(crate) fn make_client_config(
self,
secret_key: &SecretKey,
remote_peer_id: PublicKey,
@@ -197,7 +197,7 @@
/// If *keylog* is `true` this will enable logging of the pre-master key to the file in the
/// `SSLKEYLOGFILE` environment variable. This can be used to inspect the traffic for
/// debugging purposes.
- pub fn make_server_config(
+ pub(crate) fn make_server_config(
self,
secret_key: &SecretKey,
alpn_protocols: Vec<Vec<u8>>,
@@ -231,7 +231,7 @@
/// Error for generating TLS configs.
#[derive(Debug, thiserror::Error)]
-pub enum CreateConfigError {
+pub(crate) enum CreateConfigError {
/// Error generating the certificate.
#[error("Error generating the certificate")]
CertError(#[from] certificate::GenError),
diff --git a/pr/2937/docs/src/iroh/tls/certificate.rs.html b/pr/2937/docs/src/iroh/tls/certificate.rs.html
index b671a3c4df..0ba036100c 100644
--- a/pr/2937/docs/src/iroh/tls/certificate.rs.html
+++ b/pr/2937/docs/src/iroh/tls/certificate.rs.html
@@ -438,7 +438,7 @@
/// Generates a self-signed TLS certificate that includes a libp2p-specific
/// certificate extension containing the public key of the given secret key.
-pub fn generate(
+pub(crate) fn generate(
identity_secret_key: &SecretKey,
) -> Result<
(
@@ -475,7 +475,7 @@
///
/// For this to succeed, the certificate must contain the specified extension and the signature must
/// match the embedded public key.
-pub fn parse<'a>(
+pub(crate) fn parse<'a>(
certificate: &'a rustls::pki_types::CertificateDer<'_>,
) -> Result<P2pCertificate<'a>, ParseError> {
let certificate = parse_unverified(certificate.as_ref())?;
@@ -488,7 +488,7 @@
/// An X.509 certificate with a libp2p-specific extension
/// is used to secure libp2p connections.
#[derive(Debug)]
-pub struct P2pCertificate<'a> {
+pub(crate) struct P2pCertificate<'a> {
certificate: X509Certificate<'a>,
/// This is a specific libp2p Public Key Extension with two values:
/// * the public host key
@@ -499,7 +499,7 @@
/// The contents of the specific libp2p extension, containing the public host key
/// and a signature performed using the private host key.
#[derive(Debug)]
-pub struct P2pExtension {
+pub(crate) struct P2pExtension {
public_key: PublicKey,
/// This signature provides cryptographic proof that the peer was
/// in possession of the private host key at the time the certificate was signed.
@@ -509,17 +509,17 @@
/// An error that occurs during certificate generation.
#[derive(Debug, thiserror::Error)]
#[error(transparent)]
-pub struct GenError(#[from] rcgen::Error);
+pub(crate) struct GenError(#[from] rcgen::Error);
/// An error that occurs during certificate parsing.
#[derive(Debug, thiserror::Error)]
#[error(transparent)]
-pub struct ParseError(#[from] pub(crate) webpki::Error);
+pub(crate) struct ParseError(#[from] pub(crate) webpki::Error);
/// An error that occurs during signature verification.
#[derive(Debug, thiserror::Error)]
#[error(transparent)]
-pub struct VerificationError(#[from] pub(crate) webpki::Error);
+pub(crate) struct VerificationError(#[from] pub(crate) webpki::Error);
/// Internal function that only parses but does not verify the certificate.
///
@@ -617,13 +617,13 @@
impl P2pCertificate<'_> {
/// The [`PublicKey`] of the remote peer.
- pub fn peer_id(&self) -> PublicKey {
+ pub(crate) fn peer_id(&self) -> PublicKey {
self.extension.public_key
}
/// Verify the `signature` of the `message` signed by the secret key corresponding to the public key stored
/// in the certificate.
- pub fn verify_signature(
+ pub(crate) fn verify_signature(
&self,
signature_scheme: rustls::SignatureScheme,
message: &[u8],
diff --git a/pr/2937/docs/src/iroh/tls/resolver.rs.html b/pr/2937/docs/src/iroh/tls/resolver.rs.html
index c925ba4a46..bf5dfae962 100644
--- a/pr/2937/docs/src/iroh/tls/resolver.rs.html
+++ b/pr/2937/docs/src/iroh/tls/resolver.rs.html
@@ -94,13 +94,13 @@
use crate::tls::Authentication;
#[derive(Debug)]
-pub(crate) struct AlwaysResolvesCert {
+pub(super) struct AlwaysResolvesCert {
key: Arc<rustls::sign::CertifiedKey>,
auth: Authentication,
}
impl AlwaysResolvesCert {
- pub(crate) fn new(
+ pub(super) fn new(
auth: Authentication,
secret_key: &SecretKey,
) -> Result<Self, CreateConfigError> {
diff --git a/pr/2937/docs/src/iroh/tls/verifier.rs.html b/pr/2937/docs/src/iroh/tls/verifier.rs.html
index 7e66750ed9..a7e0234334 100644
--- a/pr/2937/docs/src/iroh/tls/verifier.rs.html
+++ b/pr/2937/docs/src/iroh/tls/verifier.rs.html
@@ -334,7 +334,8 @@
333
334
335
-336
//! TLS 1.3 certificates and handshakes handling.
+336
+337
//! TLS 1.3 certificates and handshakes handling.
//!
//! This module handles a verification of a client/server certificate chain
//! and signatures allegedly by the given certificates, or using raw public keys.
@@ -359,7 +360,7 @@
use super::{certificate, Authentication};
/// The only TLS version we support is 1.3
-pub static PROTOCOL_VERSIONS: &[&SupportedProtocolVersion] = &[&rustls::version::TLS13];
+pub(super) static PROTOCOL_VERSIONS: &[&SupportedProtocolVersion] = &[&rustls::version::TLS13];
static SUPPORTED_SIG_ALGS: WebPkiSupportedAlgorithms = WebPkiSupportedAlgorithms {
all: &[
@@ -393,7 +394,7 @@
///
/// Only TLS 1.3 is supported. TLS 1.2 should be disabled in the configuration of `rustls`.
#[derive(Debug)]
-pub struct ServerCertificateVerifier {
+pub(super) struct ServerCertificateVerifier {
/// The peer we intend to connect to.
remote_peer_id: PublicKey,
/// Which TLS authentication mode to operate in.
@@ -410,7 +411,7 @@
///
/// or a raw public key.
impl ServerCertificateVerifier {
- pub fn with_remote_peer_id(auth: Authentication, remote_peer_id: PublicKey) -> Self {
+ pub(super) fn with_remote_peer_id(auth: Authentication, remote_peer_id: PublicKey) -> Self {
let mut trusted_spki = Vec::new();
let pem_key = remote_peer_id.serialize_public_pem();
let remote_key = SubjectPublicKeyInfoDer::from_pem_slice(pem_key.as_bytes())
@@ -459,12 +460,13 @@
let end_entity_as_spki = SubjectPublicKeyInfoDer::from(end_entity.as_ref());
- match self.trusted_spki.contains(&end_entity_as_spki) {
- false => Err(rustls::Error::InvalidCertificate(
+ if !self.trusted_spki.contains(&end_entity_as_spki) {
+ return Err(rustls::Error::InvalidCertificate(
CertificateError::UnknownIssuer,
- )),
- true => Ok(ServerCertVerified::assertion()),
+ ));
}
+
+ Ok(ServerCertVerified::assertion())
}
}
}
@@ -512,7 +514,7 @@
///
/// Only TLS 1.3 is supported. TLS 1.2 should be disabled in the configuration of `rustls`.
#[derive(Debug)]
-pub struct ClientCertificateVerifier {
+pub(super) struct ClientCertificateVerifier {
/// Which TLS authentication mode to operate in.
auth: Authentication,
}
@@ -526,7 +528,7 @@
///
/// or a raw public key.
impl ClientCertificateVerifier {
- pub fn new(auth: Authentication) -> Self {
+ pub(super) fn new(auth: Authentication) -> Self {
Self { auth }
}
}
diff --git a/pr/2937/docs/type.impl/iroh/struct.PublicKey.js b/pr/2937/docs/type.impl/iroh/struct.PublicKey.js
index 10549224f6..ee96ec88e4 100644
--- a/pr/2937/docs/type.impl/iroh/struct.PublicKey.js
+++ b/pr/2937/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 serialize_public_pem(&self) -> String
Serializes the public key as PEM
\nSourcepub fn from_public_der(der: &[u8]) -> Result<PublicKey, Error>
Deserialize the pem bytes
\nSourcepub 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 serialize_public_pem(&self) -> String
Serializes the public key as PEM
\npub fn from_public_der(der: &[u8]) -> Result<PublicKey, Error>
Deserialize the pem bytes
\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":[49055]}
\ No newline at end of file
+//{"start":55,"fragment_lengths":[45650]}
\ No newline at end of file
pub fn default_relay_mode() -> RelayModeExpand description
Returns the default relay mode.
+pub fn force_staging_infra() -> boolExpand description
Returns true if the use of staging relays is forced.
Expand description
The Endpoint allows establishing connections to other iroh nodes.
Expand description
The Endpoint allows establishing connections to other iroh nodes.
The Endpoint is the main API interface to manage a local iroh node. It allows
connecting to and accepting connections from other nodes. See the module docs for
more details on how iroh connections work.
pub struct Connection { /* private fields */ }Expand description
A QUIC connection.
+pub struct Connection { /* private fields */ }Expand description
A QUIC connection.
If all references to a connection (including every clone of the Connection handle,
streams of incoming streams, and the various stream types) have been dropped, then the
connection will be automatically closed with an error_code of 0 and an empty reason. You
@@ -8,29 +8,29 @@ receiving CONNECTION_CLOSE the peer may drop any stream data not yet delivered t
application. Connection::close describes in more detail how to gracefully close a
connection without losing application data.
May be cloned to obtain another handle to the same connection.
-Implementations§
Source§impl Connection
impl Connection
Implementations§
Source§impl Connection
impl Connection
Sourcepub fn open_uni(&self) -> OpenUni<'_> ⓘ
pub fn open_uni(&self) -> OpenUni<'_> ⓘ
Initiates a new outgoing unidirectional stream.
Streams are cheap and instantaneous to open unless blocked by flow control. As a consequence, the peer won’t be notified that a stream has been opened until the stream is actually used.
-Sourcepub fn open_bi(&self) -> OpenBi<'_> ⓘ
pub fn open_bi(&self) -> OpenBi<'_> ⓘ
Initiates a new outgoing bidirectional stream.
Streams are cheap and instantaneous to open unless blocked by flow control. As a
consequence, the peer won’t be notified that a stream has been opened until the
stream is actually used. Calling open_bi then waiting on the RecvStream
without writing anything to SendStream will never succeed.
Sourcepub fn accept_uni(&self) -> AcceptUni<'_> ⓘ
pub fn accept_uni(&self) -> AcceptUni<'_> ⓘ
Accepts the next incoming uni-directional stream.
-Sourcepub fn accept_uni(&self) -> AcceptUni<'_> ⓘ
pub fn accept_uni(&self) -> AcceptUni<'_> ⓘ
Accepts the next incoming uni-directional stream.
+Sourcepub fn accept_bi(&self) -> AcceptBi<'_> ⓘ
pub fn accept_bi(&self) -> AcceptBi<'_> ⓘ
Accept the next incoming bidirectional stream.
Important Note: The peer that calls open_bi must write to its SendStream
before the peer Connection is able to accept the stream using
accept_bi(). Calling open_bi then waiting on the RecvStream without
writing anything to the connected SendStream will never succeed.
Sourcepub fn read_datagram(&self) -> ReadDatagram<'_> ⓘ
pub fn read_datagram(&self) -> ReadDatagram<'_> ⓘ
Receives an application datagram.
-Sourcepub async fn closed(&self) -> ConnectionError
pub async fn closed(&self) -> ConnectionError
Wait for the connection to be closed for any reason.
+Sourcepub fn read_datagram(&self) -> ReadDatagram<'_> ⓘ
pub fn read_datagram(&self) -> ReadDatagram<'_> ⓘ
Receives an application datagram.
+Sourcepub async fn closed(&self) -> ConnectionError
pub async fn closed(&self) -> ConnectionError
Wait for the connection to be closed for any reason.
Despite the return type’s name, closed connections are often not an error condition
at the application layer. Cases that might be routine include
ConnectionError::LocallyClosed and ConnectionError::ApplicationClosed.
Sourcepub fn close_reason(&self) -> Option<ConnectionError>
pub fn close_reason(&self) -> Option<ConnectionError>
If the connection is closed, the reason why.
+Sourcepub fn close_reason(&self) -> Option<ConnectionError>
pub fn close_reason(&self) -> Option<ConnectionError>
If the connection is closed, the reason why.
Returns None if the connection is still open.
Sourcepub fn close(&self, error_code: VarInt, reason: &[u8])
pub fn close(&self, error_code: VarInt, reason: &[u8])
Closes the connection immediately.
Pending operations will fail immediately with ConnectionError::LocallyClosed. No
more data is sent to the peer and the peer may drop buffered data upon receiving the
CONNECTION_CLOSE frame.
If the close/closed dance is not done, or is interrupted at any point, the connection will eventually time out, provided that the idle timeout is not disabled.
Sourcepub fn send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError>
pub fn send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError>
Transmits data as an unreliable, unordered application datagram.
Sourcepub fn send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError>
pub fn send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError>
Transmits data as an unreliable, unordered application datagram.
Application datagrams are a low-level primitive. They may be lost or delivered out
of order, and data must both fit inside a single QUIC packet and be smaller than
the maximum dictated by the peer.
Sourcepub fn max_datagram_size(&self) -> Option<usize>
pub fn max_datagram_size(&self) -> Option<usize>
Computes the maximum size of datagrams that may be passed to send_datagram.
Sourcepub fn max_datagram_size(&self) -> Option<usize>
pub fn max_datagram_size(&self) -> Option<usize>
Computes the maximum size of datagrams that may be passed to send_datagram.
Returns None if datagrams are unsupported by the peer or disabled locally.
This may change over the lifetime of a connection according to variation in the path MTU estimate. The peer can also enforce an arbitrarily small fixed limit, but if the peer’s limit is large this is guaranteed to be a little over a kilobyte at minimum.
Not necessarily the maximum size of received datagrams.
-Sourcepub fn datagram_send_buffer_space(&self) -> usize
pub fn datagram_send_buffer_space(&self) -> usize
Bytes available in the outgoing datagram buffer.
+Sourcepub fn datagram_send_buffer_space(&self) -> usize
pub fn datagram_send_buffer_space(&self) -> usize
Bytes available in the outgoing datagram buffer.
When greater than zero, calling send_datagram with a
datagram of at most this size is guaranteed not to cause older datagrams to be
dropped.
Sourcepub fn rtt(&self) -> Duration
pub fn rtt(&self) -> Duration
Current best estimate of this connection’s latency (round-trip-time).
-Sourcepub fn stats(&self) -> ConnectionStats
pub fn stats(&self) -> ConnectionStats
Returns connection statistics.
-Sourcepub fn congestion_state(&self) -> Box<dyn Controller>
pub fn congestion_state(&self) -> Box<dyn Controller>
Current state of the congestion control algorithm, for debugging purposes.
-Sourcepub fn handshake_data(&self) -> Option<Box<dyn Any>>
pub fn handshake_data(&self) -> Option<Box<dyn Any>>
Parameters negotiated during the handshake.
+Sourcepub fn rtt(&self) -> Duration
pub fn rtt(&self) -> Duration
Current best estimate of this connection’s latency (round-trip-time).
+Sourcepub fn stats(&self) -> ConnectionStats
pub fn stats(&self) -> ConnectionStats
Returns connection statistics.
+Sourcepub fn congestion_state(&self) -> Box<dyn Controller>
pub fn congestion_state(&self) -> Box<dyn Controller>
Current state of the congestion control algorithm, for debugging purposes.
+Sourcepub fn handshake_data(&self) -> Option<Box<dyn Any>>
pub fn handshake_data(&self) -> Option<Box<dyn Any>>
Parameters negotiated during the handshake.
Guaranteed to return Some on fully established connections or after
Connecting::handshake_data() succeeds. See that method’s documentations for
details on the returned value.
Sourcepub fn alpn(&self) -> Option<Vec<u8>>
pub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
-Sourcepub fn peer_identity(&self) -> Option<Box<dyn Any>>
pub fn peer_identity(&self) -> Option<Box<dyn Any>>
Cryptographic identity of the peer.
+Sourcepub fn alpn(&self) -> Option<Vec<u8>>
pub fn alpn(&self) -> Option<Vec<u8>>
Extracts the ALPN protocol from the peer’s handshake data.
+Sourcepub fn peer_identity(&self) -> Option<Box<dyn Any>>
pub fn peer_identity(&self) -> Option<Box<dyn Any>>
Sourcepub fn remote_node_id(&self) -> Result<NodeId>
pub fn remote_node_id(&self) -> Result<NodeId>
Returns the NodeId from the peer’s TLS certificate.
Sourcepub fn remote_node_id(&self) -> Result<NodeId>
pub fn remote_node_id(&self) -> Result<NodeId>
Sourcepub fn stable_id(&self) -> usize
pub fn stable_id(&self) -> usize
A stable identifier for this connection.
Peer addresses and connection IDs can change, but this value will remain fixed for the lifetime of the connection.
-Sourcepub fn export_keying_material(
+
pub fn export_keying_material( +
Sourcepub fn export_keying_material(
&self,
output: &mut [u8],
label: &[u8],
@@ -93,14 +93,14 @@ arguments and output buffers of equal length, they will get the
same sequence of bytes in output. These bytes are cryptographically
strong and pseudorandom, and are suitable for use as keying material.
See RFC5705 for more information.
-
pub fn export_keying_material(
&self,
output: &mut [u8],
label: &[u8],
@@ -93,14 +93,14 @@ arguments and output buffers of equal length, they will get the
same sequence of bytes in output. These bytes are cryptographically
strong and pseudorandom, and are suitable for use as keying material.
See RFC5705 for more information.
-Sourcepub fn set_max_concurrent_uni_streams(&self, count: VarInt)
pub fn set_max_concurrent_uni_streams(&self, count: VarInt)
Modifies the number of unidirectional streams that may be concurrently opened.
+Sourcepub fn set_max_concurrent_uni_streams(&self, count: VarInt)
pub fn set_max_concurrent_uni_streams(&self, count: VarInt)
Modifies the number of unidirectional streams that may be concurrently opened.
No streams may be opened by the peer unless fewer than count are already
open. Large counts increase both minimum and worst-case memory consumption.
Sourcepub fn set_receive_window(&self, receive_window: VarInt)
pub fn set_receive_window(&self, receive_window: VarInt)
Sourcepub fn set_max_concurrent_bi_streams(&self, count: VarInt)
pub fn set_max_concurrent_bi_streams(&self, count: VarInt)
Modifies the number of bidirectional streams that may be concurrently opened.
+Sourcepub fn set_receive_window(&self, receive_window: VarInt)
pub fn set_receive_window(&self, receive_window: VarInt)
Sourcepub fn set_max_concurrent_bi_streams(&self, count: VarInt)
pub fn set_max_concurrent_bi_streams(&self, count: VarInt)
Modifies the number of bidirectional streams that may be concurrently opened.
No streams may be opened by the peer unless fewer than count are already
open. Large counts increase both minimum and worst-case memory consumption.
Trait Implementations§
Source§impl Clone for Connection
impl Clone for Connection
Source§fn clone(&self) -> Connection
fn clone(&self) -> Connection
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for Connection
impl RefUnwindSafe for Connection
impl Send for Connection
impl Sync for Connection
impl Unpin for Connection
impl UnwindSafe for Connection
Blanket Implementations§
Trait Implementations§
Source§impl Clone for Connection
impl Clone for Connection
Source§fn clone(&self) -> Connection
fn clone(&self) -> Connection
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for Connection
impl RefUnwindSafe for Connection
impl Send for Connection
impl Sync for Connection
impl Unpin for Connection
impl UnwindSafe for Connection
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/2937/docs/iroh/endpoint/struct.Endpoint.html b/pr/2937/docs/iroh/endpoint/struct.Endpoint.html index 309aaf1dda..dc12bc3d68 100644 --- a/pr/2937/docs/iroh/endpoint/struct.Endpoint.html +++ b/pr/2937/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.
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/2937/docs/iroh/struct.NodeAddr.html b/pr/2937/docs/iroh/struct.NodeAddr.html
index b852299fae..4c632de3cb 100644
--- a/pr/2937/docs/iroh/struct.NodeAddr.html
+++ b/pr/2937/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/2937/docs/iroh/struct.PublicKey.html b/pr/2937/docs/iroh/struct.PublicKey.html
index 57c0475554..130fc28fda 100644
--- a/pr/2937/docs/iroh/struct.PublicKey.html
+++ b/pr/2937/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 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 serialize_public_pem(&self) -> String
Serializes the public key as PEM
-Sourcepub fn from_public_der(der: &[u8]) -> Result<PublicKey, Error>
Deserialize the pem bytes
-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 serialize_public_pem(&self) -> String
Serializes the public key as PEM
+pub fn from_public_der(der: &[u8]) -> Result<PublicKey, Error>
Deserialize the pem bytes
+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/2937/docs/iroh/struct.RelayUrl.html b/pr/2937/docs/iroh/struct.RelayUrl.html
index a28dcb6ef6..2b27f10da6 100644
--- a/pr/2937/docs/iroh/struct.RelayUrl.html
+++ b/pr/2937/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/2937/docs/iroh/struct.RelayUrlParseError.html b/pr/2937/docs/iroh/struct.RelayUrlParseError.html
index 695516a7e8..32dc646313 100644
--- a/pr/2937/docs/iroh/struct.RelayUrlParseError.html
+++ b/pr/2937/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/2937/docs/iroh/struct.SecretKey.html b/pr/2937/docs/iroh/struct.SecretKey.html
index 02605435a1..4ab117bc40 100644
--- a/pr/2937/docs/iroh/struct.SecretKey.html
+++ b/pr/2937/docs/iroh/struct.SecretKey.html
@@ -1,25 +1,25 @@
-SecretKey in iroh - Rust pub struct SecretKey { /* private fields */ }
Expand description
A secret key.
-Implementations§
Source§impl SecretKey
Sourcepub fn serialize_secret_pem(&self) -> Zeroizing<String>
Serializes the secret key as PEM
-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 serialize_secret_pem(&self) -> Zeroizing<String>
Serializes the secret key as PEM
+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/2937/docs/iroh/type.NodeId.html b/pr/2937/docs/iroh/type.NodeId.html
index b72028ebf3..ab9edbf3b6 100644
--- a/pr/2937/docs/iroh/type.NodeId.html
+++ b/pr/2937/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/2937/docs/src/iroh/endpoint.rs.html b/pr/2937/docs/src/iroh/endpoint.rs.html
index c99cc25671..dea0bcaa62 100644
--- a/pr/2937/docs/src/iroh/endpoint.rs.html
+++ b/pr/2937/docs/src/iroh/endpoint.rs.html
@@ -2546,9 +2546,7 @@
2545
2546
2547
-2548
-2549
-2550//! The [`Endpoint`] allows establishing connections to other iroh nodes.
+2548
//! The [`Endpoint`] allows establishing connections to other iroh nodes.
//!
//! The [`Endpoint`] is the main API interface to manage a local iroh node. It allows
//! connecting to and accepting connections from other nodes. See the [module docs] for
@@ -4011,8 +4009,6 @@
/// connection without losing application data.
///
/// May be cloned to obtain another handle to the same connection.
-// This has repr(transparent) as it opens the door to potentially allow casting it to a
-// quinn::Connection in the future. Right now however that'd be iroh_quinn::Connection.
#[derive(Debug, Clone)]
pub struct Connection {
inner: quinn::Connection,
diff --git a/pr/2937/docs/src/iroh/tls.rs.html b/pr/2937/docs/src/iroh/tls.rs.html
index a10e517856..bf16e35b72 100644
--- a/pr/2937/docs/src/iroh/tls.rs.html
+++ b/pr/2937/docs/src/iroh/tls.rs.html
@@ -136,7 +136,7 @@
use self::resolver::AlwaysResolvesCert;
-pub mod certificate;
+pub(crate) mod certificate;
mod resolver;
mod verifier;
@@ -156,7 +156,7 @@
/// If *keylog* is `true` this will enable logging of the pre-master key to the file in the
/// `SSLKEYLOGFILE` environment variable. This can be used to inspect the traffic for
/// debugging purposes.
- pub fn make_client_config(
+ pub(crate) fn make_client_config(
self,
secret_key: &SecretKey,
remote_peer_id: PublicKey,
@@ -197,7 +197,7 @@
/// If *keylog* is `true` this will enable logging of the pre-master key to the file in the
/// `SSLKEYLOGFILE` environment variable. This can be used to inspect the traffic for
/// debugging purposes.
- pub fn make_server_config(
+ pub(crate) fn make_server_config(
self,
secret_key: &SecretKey,
alpn_protocols: Vec<Vec<u8>>,
@@ -231,7 +231,7 @@
/// Error for generating TLS configs.
#[derive(Debug, thiserror::Error)]
-pub enum CreateConfigError {
+pub(crate) enum CreateConfigError {
/// Error generating the certificate.
#[error("Error generating the certificate")]
CertError(#[from] certificate::GenError),
diff --git a/pr/2937/docs/src/iroh/tls/certificate.rs.html b/pr/2937/docs/src/iroh/tls/certificate.rs.html
index b671a3c4df..0ba036100c 100644
--- a/pr/2937/docs/src/iroh/tls/certificate.rs.html
+++ b/pr/2937/docs/src/iroh/tls/certificate.rs.html
@@ -438,7 +438,7 @@
/// Generates a self-signed TLS certificate that includes a libp2p-specific
/// certificate extension containing the public key of the given secret key.
-pub fn generate(
+pub(crate) fn generate(
identity_secret_key: &SecretKey,
) -> Result<
(
@@ -475,7 +475,7 @@
///
/// For this to succeed, the certificate must contain the specified extension and the signature must
/// match the embedded public key.
-pub fn parse<'a>(
+pub(crate) fn parse<'a>(
certificate: &'a rustls::pki_types::CertificateDer<'_>,
) -> Result<P2pCertificate<'a>, ParseError> {
let certificate = parse_unverified(certificate.as_ref())?;
@@ -488,7 +488,7 @@
/// An X.509 certificate with a libp2p-specific extension
/// is used to secure libp2p connections.
#[derive(Debug)]
-pub struct P2pCertificate<'a> {
+pub(crate) struct P2pCertificate<'a> {
certificate: X509Certificate<'a>,
/// This is a specific libp2p Public Key Extension with two values:
/// * the public host key
@@ -499,7 +499,7 @@
/// The contents of the specific libp2p extension, containing the public host key
/// and a signature performed using the private host key.
#[derive(Debug)]
-pub struct P2pExtension {
+pub(crate) struct P2pExtension {
public_key: PublicKey,
/// This signature provides cryptographic proof that the peer was
/// in possession of the private host key at the time the certificate was signed.
@@ -509,17 +509,17 @@
/// An error that occurs during certificate generation.
#[derive(Debug, thiserror::Error)]
#[error(transparent)]
-pub struct GenError(#[from] rcgen::Error);
+pub(crate) struct GenError(#[from] rcgen::Error);
/// An error that occurs during certificate parsing.
#[derive(Debug, thiserror::Error)]
#[error(transparent)]
-pub struct ParseError(#[from] pub(crate) webpki::Error);
+pub(crate) struct ParseError(#[from] pub(crate) webpki::Error);
/// An error that occurs during signature verification.
#[derive(Debug, thiserror::Error)]
#[error(transparent)]
-pub struct VerificationError(#[from] pub(crate) webpki::Error);
+pub(crate) struct VerificationError(#[from] pub(crate) webpki::Error);
/// Internal function that only parses but does not verify the certificate.
///
@@ -617,13 +617,13 @@
impl P2pCertificate<'_> {
/// The [`PublicKey`] of the remote peer.
- pub fn peer_id(&self) -> PublicKey {
+ pub(crate) fn peer_id(&self) -> PublicKey {
self.extension.public_key
}
/// Verify the `signature` of the `message` signed by the secret key corresponding to the public key stored
/// in the certificate.
- pub fn verify_signature(
+ pub(crate) fn verify_signature(
&self,
signature_scheme: rustls::SignatureScheme,
message: &[u8],
diff --git a/pr/2937/docs/src/iroh/tls/resolver.rs.html b/pr/2937/docs/src/iroh/tls/resolver.rs.html
index c925ba4a46..bf5dfae962 100644
--- a/pr/2937/docs/src/iroh/tls/resolver.rs.html
+++ b/pr/2937/docs/src/iroh/tls/resolver.rs.html
@@ -94,13 +94,13 @@
use crate::tls::Authentication;
#[derive(Debug)]
-pub(crate) struct AlwaysResolvesCert {
+pub(super) struct AlwaysResolvesCert {
key: Arc<rustls::sign::CertifiedKey>,
auth: Authentication,
}
impl AlwaysResolvesCert {
- pub(crate) fn new(
+ pub(super) fn new(
auth: Authentication,
secret_key: &SecretKey,
) -> Result<Self, CreateConfigError> {
diff --git a/pr/2937/docs/src/iroh/tls/verifier.rs.html b/pr/2937/docs/src/iroh/tls/verifier.rs.html
index 7e66750ed9..a7e0234334 100644
--- a/pr/2937/docs/src/iroh/tls/verifier.rs.html
+++ b/pr/2937/docs/src/iroh/tls/verifier.rs.html
@@ -334,7 +334,8 @@
333
334
335
-336
//! TLS 1.3 certificates and handshakes handling.
+336
+337
//! TLS 1.3 certificates and handshakes handling.
//!
//! This module handles a verification of a client/server certificate chain
//! and signatures allegedly by the given certificates, or using raw public keys.
@@ -359,7 +360,7 @@
use super::{certificate, Authentication};
/// The only TLS version we support is 1.3
-pub static PROTOCOL_VERSIONS: &[&SupportedProtocolVersion] = &[&rustls::version::TLS13];
+pub(super) static PROTOCOL_VERSIONS: &[&SupportedProtocolVersion] = &[&rustls::version::TLS13];
static SUPPORTED_SIG_ALGS: WebPkiSupportedAlgorithms = WebPkiSupportedAlgorithms {
all: &[
@@ -393,7 +394,7 @@
///
/// Only TLS 1.3 is supported. TLS 1.2 should be disabled in the configuration of `rustls`.
#[derive(Debug)]
-pub struct ServerCertificateVerifier {
+pub(super) struct ServerCertificateVerifier {
/// The peer we intend to connect to.
remote_peer_id: PublicKey,
/// Which TLS authentication mode to operate in.
@@ -410,7 +411,7 @@
///
/// or a raw public key.
impl ServerCertificateVerifier {
- pub fn with_remote_peer_id(auth: Authentication, remote_peer_id: PublicKey) -> Self {
+ pub(super) fn with_remote_peer_id(auth: Authentication, remote_peer_id: PublicKey) -> Self {
let mut trusted_spki = Vec::new();
let pem_key = remote_peer_id.serialize_public_pem();
let remote_key = SubjectPublicKeyInfoDer::from_pem_slice(pem_key.as_bytes())
@@ -459,12 +460,13 @@
let end_entity_as_spki = SubjectPublicKeyInfoDer::from(end_entity.as_ref());
- match self.trusted_spki.contains(&end_entity_as_spki) {
- false => Err(rustls::Error::InvalidCertificate(
+ if !self.trusted_spki.contains(&end_entity_as_spki) {
+ return Err(rustls::Error::InvalidCertificate(
CertificateError::UnknownIssuer,
- )),
- true => Ok(ServerCertVerified::assertion()),
+ ));
}
+
+ Ok(ServerCertVerified::assertion())
}
}
}
@@ -512,7 +514,7 @@
///
/// Only TLS 1.3 is supported. TLS 1.2 should be disabled in the configuration of `rustls`.
#[derive(Debug)]
-pub struct ClientCertificateVerifier {
+pub(super) struct ClientCertificateVerifier {
/// Which TLS authentication mode to operate in.
auth: Authentication,
}
@@ -526,7 +528,7 @@
///
/// or a raw public key.
impl ClientCertificateVerifier {
- pub fn new(auth: Authentication) -> Self {
+ pub(super) fn new(auth: Authentication) -> Self {
Self { auth }
}
}
diff --git a/pr/2937/docs/type.impl/iroh/struct.PublicKey.js b/pr/2937/docs/type.impl/iroh/struct.PublicKey.js
index 10549224f6..ee96ec88e4 100644
--- a/pr/2937/docs/type.impl/iroh/struct.PublicKey.js
+++ b/pr/2937/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 serialize_public_pem(&self) -> String
Serializes the public key as PEM
\nSourcepub fn from_public_der(der: &[u8]) -> Result<PublicKey, Error>
Deserialize the pem bytes
\nSourcepub 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 serialize_public_pem(&self) -> String
Serializes the public key as PEM
\npub fn from_public_der(der: &[u8]) -> Result<PublicKey, Error>
Deserialize the pem bytes
\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":[49055]}
\ No newline at end of file
+//{"start":55,"fragment_lengths":[45650]}
\ No newline at end of file