Function iroh::net::endpoint::default_relay_mode
source · pub fn default_relay_mode() -> RelayModeExpand description
Returns the default relay mode.
+Function iroh::net::endpoint::get_remote_node_id
source · pub fn get_remote_node_id(connection: &Connection) -> Result<PublicKey, Error>Expand description
Extract the PublicKey from the peer’s TLS certificate.
Function iroh::net::endpoint::get_remote_node_id
source · pub fn get_remote_node_id(connection: &Connection) -> Result<PublicKey, Error>Expand description
Extract the PublicKey from the peer’s TLS certificate.
Function iroh::net::endpoint::make_server_config
source · pub fn make_server_config(
+make_server_config in iroh::net::endpoint - Rust Function iroh::net::endpoint::make_server_config
source · pub fn make_server_config(
secret_key: &SecretKey,
alpn_protocols: Vec<Vec<u8>>,
transport_config: Arc<TransportConfig>,
diff --git a/pr/2778/docs/iroh/net/endpoint/struct.Accept.html b/pr/2778/docs/iroh/net/endpoint/struct.Accept.html
index 46c5d92bba..746a5527ee 100644
--- a/pr/2778/docs/iroh/net/endpoint/struct.Accept.html
+++ b/pr/2778/docs/iroh/net/endpoint/struct.Accept.html
@@ -1,9 +1,9 @@
-Accept in iroh::net::endpoint - Rust pub struct Accept<'a> { /* private fields */ }
Expand description
Future produced by Endpoint::accept.
-Trait Implementations§
source§impl<'a> Future for Accept<'a>
source§fn poll(
+Accept in iroh::net::endpoint - Rust pub struct Accept<'a> { /* private fields */ }
Expand description
Future produced by Endpoint::accept.
+Trait Implementations§
source§impl<'pin, 'a> Unpin for Accept<'a>where
+the current task for wakeup if the value is not yet available. Read more
source§impl<'pin, 'a> Unpin for Accept<'a>where
__Accept<'pin, 'a>: Unpin,
Auto Trait Implementations§
§impl<'a> !Freeze for Accept<'a>
§impl<'a> !RefUnwindSafe for Accept<'a>
§impl<'a> Send for Accept<'a>
§impl<'a> Sync for Accept<'a>
§impl<'a> !UnwindSafe for Accept<'a>
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/2778/docs/iroh/net/endpoint/struct.Builder.html b/pr/2778/docs/iroh/net/endpoint/struct.Builder.html
index 02fcd23ef4..d9c6a29fdf 100644
--- a/pr/2778/docs/iroh/net/endpoint/struct.Builder.html
+++ b/pr/2778/docs/iroh/net/endpoint/struct.Builder.html
@@ -1,24 +1,24 @@
-Builder in iroh::net::endpoint - Rust pub struct Builder { /* private fields */ }
Expand description
Builder for Endpoint.
+Builder in iroh::net::endpoint - Rust pub struct Builder { /* private fields */ }
Expand description
Builder for Endpoint.
By default the endpoint will generate a new random SecretKey, which will result in a
new NodeId.
To create the Endpoint call Builder::bind.
-Implementations§
source§impl Builder
sourcepub fn bind_addr_v4(self, addr: SocketAddrV4) -> Builder
Sets the IPv4 bind address.
+Implementations§
source§impl Builder
sourcepub fn bind_addr_v4(self, addr: SocketAddrV4) -> Builder
Sets the IPv4 bind address.
Setting the port to 0 will use a random port.
If the port specified is already in use, it will fallback to choosing a random port.
By default will use 0.0.0.0:0 to bind to.
-sourcepub fn bind_addr_v6(self, addr: SocketAddrV6) -> Builder
Sets the IPv6 bind address.
+sourcepub fn bind_addr_v6(self, addr: SocketAddrV6) -> Builder
Sets the IPv6 bind address.
Setting the port to 0 will use a random port.
If the port specified is already in use, it will fallback to choosing a random port.
By default will use [::]:0 to bind to.
-sourcepub fn secret_key(self, secret_key: SecretKey) -> Builder
Sets a secret key to authenticate with other peers.
+sourcepub fn secret_key(self, secret_key: SecretKey) -> Builder
sourcepub fn alpns(self, alpn_protocols: Vec<Vec<u8>>) -> Builder
Sets the ALPN protocols that this endpoint will accept on incoming connections.
+sourcepub fn relay_mode(self, relay_mode: RelayMode) -> Builder
Sets the relay servers to assist in establishing connectivity.
+sourcepub fn relay_mode(self, relay_mode: RelayMode) -> Builder
Sets the relay servers to assist in establishing connectivity.
Relay servers are used to establish initial connection with another iroh-net node.
They also perform various functions related to hole punching, see the crate docs
for more details.
@@ -26,15 +26,15 @@ for more details.
When using RelayMode::Custom, the provided relay_map must contain at least one
configured relay node. If an invalid RelayMap is provided bind
will result in an error.
-sourcepub fn clear_discovery(self) -> Builder
Removes all discovery services from the builder.
-sourcepub fn discovery(self, discovery: Box<dyn Discovery>) -> Builder
Optionally sets a discovery mechanism for this endpoint.
+sourcepub fn clear_discovery(self) -> Builder
Removes all discovery services from the builder.
+sourcepub fn discovery(self, discovery: Box<dyn Discovery>) -> Builder
Optionally sets a discovery mechanism for this endpoint.
If you want to combine multiple discovery services, you can use
Builder::add_discovery instead. This will internally create a
crate::discovery::ConcurrentDiscovery.
If no discovery service is set, connecting to a node without providing its
direct addresses or relay URLs will fail.
See the documentation of the Discovery trait for details.
-sourcepub fn add_discovery<F, D>(self, discovery: F) -> Builderwhere
+
sourcepub fn add_discovery<F, D>(self, discovery: F) -> Builder
Adds a discovery mechanism for this endpoint.
The function discovery
@@ -47,7 +47,7 @@ to use this secret key to sign the information.
direct addresses or relay URLs will fail.
To clear all discovery services, use Builder::clear_discovery.
See the documentation of the Discovery trait for details.
-sourcepub fn discovery_n0(self) -> Builder
Configures the endpoint to use the default n0 DNS discovery service.
+sourcepub fn discovery_n0(self) -> Builder
Configures the endpoint to use the default n0 DNS discovery service.
The default discovery service publishes to and resolves from the
n0.computer dns server iroh.link.
This is equivalent to adding both a crate::discovery::pkarr::PkarrPublisher
@@ -56,24 +56,24 @@ n0.computer dns server.
This will by default use N0_DNS_PKARR_RELAY_PROD.
When in tests, or when the test-utils feature is enabled, this will use the
N0_DNS_PKARR_RELAY_STAGING.
-sourcepub fn discovery_dht(self) -> Builder
Configures the endpoint to also use the mainline DHT with default settings.
+sourcepub fn discovery_dht(self) -> Builder
Configures the endpoint to also use the mainline DHT with default settings.
This is equivalent to adding a crate::discovery::pkarr::dht::DhtDiscovery
with default settings. Note that DhtDiscovery has various more advanced
configuration options. If you need any of those, you should manually
create a DhtDiscovery and add it with Builder::add_discovery.
-sourcepub fn discovery_local_network(self) -> Builder
Configures the endpoint to also use local network discovery.
+sourcepub fn discovery_local_network(self) -> Builder
Configures the endpoint to also use local network discovery.
This is equivalent to adding a crate::discovery::local_swarm_discovery::LocalSwarmDiscovery
with default settings. Note that LocalSwarmDiscovery has various more advanced
configuration options. If you need any of those, you should manually
create a LocalSwarmDiscovery and add it with Builder::add_discovery.
-sourcepub fn known_nodes(self, nodes: Vec<NodeAddr>) -> Builder
Optionally set a list of known nodes.
-sourcepub fn transport_config(self, transport_config: TransportConfig) -> Builder
Sets a custom quinn::TransportConfig for this endpoint.
+sourcepub fn known_nodes(self, nodes: Vec<NodeAddr>) -> Builder
Optionally set a list of known nodes.
+sourcepub fn transport_config(self, transport_config: TransportConfig) -> Builder
Sets a custom quinn::TransportConfig for this endpoint.
The transport config contains parameters governing the QUIC state machine.
If unset, the default config is used. Default values should be suitable for most
internet applications. Applications protocols which forbid remotely-initiated
streams should set max_concurrent_bidi_streams and max_concurrent_uni_streams to
zero.
-sourcepub fn dns_resolver(
+
sourcepub fn dns_resolver(
self,
dns_resolver: AsyncResolver<GenericConnector<TokioRuntimeProvider>>
) -> Builder
Optionally sets a custom DNS resolver to use for this endpoint.
@@ -82,22 +82,22 @@ zero.
By default, all endpoints share a DNS resolver, which is configured to use the
host system’s DNS configuration. You can pass a custom instance of DnsResolver
here to use a differently configured DNS resolver for this endpoint.
-sourcepub fn proxy_url(self, url: Url) -> Builder
Sets an explicit proxy url to proxy all HTTP(S) traffic through.
-sourcepub fn proxy_from_env(self) -> Builder
Sets the proxy url from the environment, in this order:
+sourcepub fn proxy_url(self, url: Url) -> Builder
Sets an explicit proxy url to proxy all HTTP(S) traffic through.
+sourcepub fn proxy_from_env(self) -> Builder
Sets the proxy url from the environment, in this order:
HTTP_PROXY
http_proxy
HTTPS_PROXY
https_proxy
-sourcepub fn keylog(self, keylog: bool) -> Builder
Enables saving the TLS pre-master key for connections.
+sourcepub fn keylog(self, keylog: bool) -> Builder
Enables saving the TLS pre-master key for connections.
This key should normally remain secret but can be useful to debug networking issues
by decrypting captured traffic.
If keylog is true then setting the SSLKEYLOGFILE environment variable to a
filename will result in this file being used to log the TLS pre-master keys.
-sourcepub fn insecure_skip_relay_cert_verify(self, skip_verify: bool) -> Builder
Skip verification of SSL certificates from relay servers
+sourcepub fn insecure_skip_relay_cert_verify(self, skip_verify: bool) -> Builder
Skip verification of SSL certificates from relay servers
May only be used in tests.
-Trait Implementations§
Auto Trait Implementations§
§impl !Freeze for Builder
§impl !RefUnwindSafe for Builder
§impl Send for Builder
§impl Sync for Builder
§impl Unpin for Builder
§impl !UnwindSafe for Builder
Blanket Implementations§
Trait Implementations§
Auto Trait Implementations§
§impl !Freeze for Builder
§impl !RefUnwindSafe for Builder
§impl Send for Builder
§impl Sync for Builder
§impl Unpin for Builder
§impl !UnwindSafe for Builder
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/2778/docs/iroh/net/endpoint/struct.Connecting.html b/pr/2778/docs/iroh/net/endpoint/struct.Connecting.html
index 6358133ea1..38ed9da7c3 100644
--- a/pr/2778/docs/iroh/net/endpoint/struct.Connecting.html
+++ b/pr/2778/docs/iroh/net/endpoint/struct.Connecting.html
@@ -1,14 +1,14 @@
-Connecting in iroh::net::endpoint - Rust Struct iroh::net::endpoint::Connecting
source · pub struct Connecting { /* private fields */ }
Expand description
In-progress connection attempt future
-Implementations§
source§impl Connecting
sourcepub fn into_0rtt(self) -> Result<(Connection, ZeroRttAccepted), Connecting>
Convert into a 0-RTT or 0.5-RTT connection at the cost of weakened security.
-sourcepub async fn handshake_data(&mut self) -> Result<Box<dyn Any>, ConnectionError>
Parameters negotiated during the handshake
-sourcepub fn local_ip(&self) -> Option<IpAddr>
The local IP address which was used when the peer established the connection.
-sourcepub fn remote_address(&self) -> SocketAddr
The peer’s UDP address.
-Trait Implementations§
source§impl Debug for Connecting
source§impl Future for Connecting
§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.source§fn poll(
+Connecting in iroh::net::endpoint - Rust Struct iroh::net::endpoint::Connecting
source · pub struct Connecting { /* private fields */ }
Expand description
In-progress connection attempt future
+Implementations§
source§impl Connecting
sourcepub fn into_0rtt(self) -> Result<(Connection, ZeroRttAccepted), Connecting>
Convert into a 0-RTT or 0.5-RTT connection at the cost of weakened security.
+sourcepub async fn handshake_data(&mut self) -> Result<Box<dyn Any>, ConnectionError>
Parameters negotiated during the handshake
+sourcepub fn local_ip(&self) -> Option<IpAddr>
The local IP address which was used when the peer established the connection.
+sourcepub fn remote_address(&self) -> SocketAddr
The peer’s UDP address.
+Trait Implementations§
source§impl Debug for Connecting
source§impl Future for Connecting
§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.source§impl<'pin> Unpin for Connectingwhere
+the current task for wakeup if the value is not yet available. Read more
source§impl<'pin> Unpin for Connectingwhere
__Connecting<'pin>: Unpin,
Auto Trait Implementations§
§impl Freeze for Connecting
§impl !RefUnwindSafe for Connecting
§impl Send for Connecting
§impl Sync for Connecting
§impl !UnwindSafe for Connecting
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/2778/docs/iroh/net/endpoint/struct.Endpoint.html b/pr/2778/docs/iroh/net/endpoint/struct.Endpoint.html
index f799795ecd..031d73098f 100644
--- a/pr/2778/docs/iroh/net/endpoint/struct.Endpoint.html
+++ b/pr/2778/docs/iroh/net/endpoint/struct.Endpoint.html
@@ -1,4 +1,4 @@
-Endpoint in iroh::net::endpoint - Rust pub struct Endpoint { /* private fields */ }
Expand description
Controls an iroh-net node, establishing connections with other nodes.
+Endpoint in iroh::net::endpoint - Rust pub struct Endpoint { /* private fields */ }
Expand description
Controls an iroh-net node, establishing connections with other nodes.
This is the main API interface to create connections to, and accept connections from
other iroh-net nodes. The connections are peer-to-peer and encrypted, a Relay server is
used to make the connections reliable. See the [crate docs] for a more detailed
@@ -14,11 +14,11 @@ behaviour.
Connection::open_bi functions.
Note that due to the light-weight properties of streams a stream will only be accepted
once the initiating peer has sent some data on it.
-Implementations§
source§impl Endpoint
sourcepub fn builder() -> Builder
Returns the builder for an Endpoint, with a production configuration.
-sourcepub fn set_alpns(&self, alpns: Vec<Vec<u8>>) -> Result<(), Error>
Sets the list of accepted ALPN protocols.
+Implementations§
source§impl Endpoint
sourcepub fn builder() -> Builder
Returns the builder for an Endpoint, with a production configuration.
+sourcepub async fn connect(
&self,
node_addr: impl Into<NodeAddr>,
alpn: &[u8]
@@ -39,7 +39,7 @@ connection attempt will fail with an error.
The alpn, or application-level protocol identifier, is also required. The remote
endpoint must support this alpn, otherwise the connection attempt will fail with
an error.
-
sourcepub async fn connect_by_node_id(
+
sourcepub async fn connect_by_node_id(
&self,
node_id: PublicKey,
alpn: &[u8]
@@ -48,13 +48,13 @@ an error.
information being provided by either the discovery service or using
Endpoint::add_node_addr. See Endpoint::connect for the details of how it
uses the discovery service to establish a connection to a remote node.
-
sourcepub fn accept(&self) -> Accept<'_> ⓘ
Accepts an incoming connection on the endpoint.
Only connections with the ALPNs configured in Builder::alpns will be accepted.
If multiple ALPNs have been configured the ALPN can be inspected before accepting
the connection using Connecting::alpn.
The returned future will yield None if the endpoint is closed by calling
Endpoint::close.
-sourcepub fn add_node_addr(&self, node_addr: NodeAddr) -> Result<(), Error>
Informs this Endpoint about addresses of the iroh-net node.
+sourcepub fn add_node_addr(&self, node_addr: NodeAddr) -> Result<(), Error>
Informs this Endpoint about addresses of the iroh-net node.
This updates the local state for the remote node. If the provided NodeAddr
contains a RelayUrl this will be used as the new relay server for this node. If
it contains any new IP endpoints they will also be stored and tried when next
@@ -64,7 +64,7 @@ silently ignored.
§Errors
Will return an error if we attempt to add our own PublicKey to the node map or if the
direct addresses are a subset of ours.
-sourcepub fn add_node_addr_with_source(
+
sourcepub fn secret_key(&self) -> &SecretKey
Returns the secret_key of this endpoint.
-sourcepub fn secret_key(&self) -> &SecretKey
Returns the secret_key of this endpoint.
+sourcepub fn node_id(&self) -> PublicKey
Returns the node id of this endpoint.
This ID is the unique addressing information of this node and other peers must know
it to be able to connect to this node.
-sourcepub async fn node_addr(&self) -> Result<NodeAddr, Error>
Returns the current NodeAddr for this endpoint.
+sourcepub async fn node_addr(&self) -> Result<NodeAddr, Error>
Returns the current NodeAddr for this endpoint.
The returned NodeAddr will have the current RelayUrl and local IP endpoints
as they would be returned by Endpoint::home_relay and
Endpoint::direct_addresses.
-sourcepub fn home_relay(&self) -> Option<RelayUrl>
Returns the RelayUrl of the Relay server used as home relay.
+sourcepub fn home_relay(&self) -> Option<RelayUrl>
Returns the RelayUrl of the Relay server used as home relay.
Every endpoint has a home Relay server which it chooses as the server with the
lowest latency out of the configured servers provided by Builder::relay_mode.
This is the server other iroh-net nodes can use to reliably establish a connection
@@ -94,14 +94,14 @@ to this node.
Note that this will be None right after the Endpoint is created since it takes
some time to connect to find and connect to the home relay server. Use
Endpoint::watch_home_relay to wait until the home relay server is available.
-sourcepub fn watch_home_relay(&self) -> impl Stream<Item = RelayUrl>
Watches for changes to the home relay.
+sourcepub fn watch_home_relay(&self) -> impl Stream<Item = RelayUrl>
Watches for changes to the home relay.
If there is currently a home relay it will be yielded immediately as the first item
in the stream. This makes it possible to use this function to wait for the initial
home relay to be known.
Note that it is not guaranteed that a home relay will ever become available. If no
servers are configured with Builder::relay_mode this stream will never yield an
item.
-sourcepub fn direct_addresses(&self) -> DirectAddrsStream
Returns the direct addresses of this Endpoint.
+sourcepub fn direct_addresses(&self) -> DirectAddrsStream
Returns the direct addresses of this Endpoint.
The direct addresses of the Endpoint are those that could be used by other
iroh-net nodes to establish direct connectivity, depending on the network
situation. The yielded lists of direct addresses contain both the locally-bound
@@ -124,10 +124,10 @@ most recently discovered IP endpoints.
let mep = Endpoint::builder().bind().await.unwrap();
let _addrs = mep.direct_addresses().next().await;
-sourcepub fn bound_sockets(&self) -> (SocketAddr, Option<SocketAddr>)
Returns the local socket addresses on which the underlying sockets are bound.
+sourcepub fn bound_sockets(&self) -> (SocketAddr, Option<SocketAddr>)
Returns the local socket addresses on which the underlying sockets are bound.
The Endpoint always binds on an IPv4 address and also tries to bind on an IPv6
address if available.
-sourcepub fn remote_info(&self, node_id: PublicKey) -> Option<RemoteInfo>
Returns information about the remote node identified by a NodeId.
+sourcepub fn remote_info(&self, node_id: PublicKey) -> Option<RemoteInfo>
Returns information about the remote node identified by a NodeId.
The Endpoint keeps some information about remote iroh-net nodes, which it uses to find
the best path to a node. Having information on a remote node, however, does not mean we have
ever connected to it to or even whether a connection is even possible. The information about a
@@ -136,14 +136,14 @@ calls may return different information. Furthermore, node information may even b
completely evicted as it becomes stale.
See also Endpoint::remote_info_iter which returns information on all nodes known
by this Endpoint.
-sourcepub fn remote_info_iter(&self) -> impl Iterator<Item = RemoteInfo>
Returns information about all the remote nodes this Endpoint knows about.
+sourcepub fn remote_info_iter(&self) -> impl Iterator<Item = RemoteInfo>
Returns information about all the remote nodes this Endpoint knows about.
This returns the same information as Endpoint::remote_info for each node known to this
Endpoint.
The Endpoint keeps some information about remote iroh-net nodes, which it uses to find
the best path to a node. This returns all the nodes it knows about, regardless of whether a
connection was ever made or is even possible.
See also Endpoint::remote_info to only retrieve information about a single node.
-sourcepub fn conn_type_stream(
+
sourcepub fn conn_type_stream(
&self,
node_id: PublicKey
) -> Result<ConnectionTypeStream, Error>
Returns a stream that reports connection type changes for the remote node.
@@ -159,13 +159,13 @@ connection when the switch from a relayed to a direct connection can be so fast
the relayed state is never exposed.
§Errors
Will error if we do not have any address information for the given node_id.
-sourcepub fn dns_resolver(
+
sourcepub fn dns_resolver(
&self
) -> &AsyncResolver<GenericConnector<TokioRuntimeProvider>>
Returns the DNS resolver used in this Endpoint.
See Builder::discovery.
-sourcepub fn discovery(&self) -> Option<&dyn Discovery>
Returns the discovery mechanism, if configured.
+sourcepub fn discovery(&self) -> Option<&dyn Discovery>
Returns the discovery mechanism, if configured.
-sourcepub async fn network_change(&self)
Notifies the system of potential network changes.
+sourcepub async fn network_change(&self)
Notifies the system of potential network changes.
On many systems iroh is able to detect network changes by itself, however
some systems like android do not expose this functionality to native code.
Android does however provide this functionality to Java code. This
@@ -173,14 +173,14 @@ function allows for notifying iroh of any potential network changes like
this.
Even when the network did not change, or iroh was already able to detect
the network change itself, there is no harm in calling this function.
-sourcepub async fn close(self, error_code: VarInt, reason: &[u8]) -> Result<(), Error>
Closes the QUIC endpoint and the magic socket.
+sourcepub async fn close(self, error_code: VarInt, reason: &[u8]) -> Result<(), Error>
Closes the QUIC endpoint and the magic socket.
This will close all open QUIC connections with the provided error_code and
reason. See quinn::Connection for details on how these are interpreted.
It will then wait for all connections to actually be shutdown, and afterwards
close the magic socket.
Returns an error if closing the magic socket failed.
TODO: Document error cases.
-Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Endpoint
§impl !RefUnwindSafe for Endpoint
§impl Send for Endpoint
§impl Sync for Endpoint
§impl Unpin for Endpoint
§impl !UnwindSafe for Endpoint
Blanket Implementations§
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Endpoint
§impl !RefUnwindSafe for Endpoint
§impl Send for Endpoint
§impl Sync for Endpoint
§impl Unpin for Endpoint
§impl !UnwindSafe for Endpoint
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/2778/docs/iroh/net/endpoint/struct.Incoming.html b/pr/2778/docs/iroh/net/endpoint/struct.Incoming.html
index 8abcc82b6c..525bee9106 100644
--- a/pr/2778/docs/iroh/net/endpoint/struct.Incoming.html
+++ b/pr/2778/docs/iroh/net/endpoint/struct.Incoming.html
@@ -1,29 +1,29 @@
-Incoming in iroh::net::endpoint - Rust pub struct Incoming { /* private fields */ }
Expand description
An incoming connection for which the server has not yet begun its parts of the
+
Incoming in iroh::net::endpoint - Rust pub struct Incoming { /* private fields */ }
Expand description
An incoming connection for which the server has not yet begun its parts of the
handshake.
-Implementations§
source§impl Incoming
sourcepub fn accept(self) -> Result<Connecting, ConnectionError>
Attempts to accept this incoming connection (an error may still occur).
+Implementations§
source§impl Incoming
sourcepub fn accept(self) -> Result<Connecting, ConnectionError>
Attempts to accept this incoming connection (an error may still occur).
Errors occurring here are likely not caused by the application or remote. The QUIC
connection listens on a normal UDP socket and any reachable network endpoint can
send datagrams to it, solicited or not. Even if the first few bytes look like a
QUIC packet, it might not even be a QUIC packet that is being received.
Thus it is common to simply log the errors here and accept them as something which
can happen.
-sourcepub fn accept_with(
+
sourcepub fn accept_with(
self,
server_config: Arc<ServerConfig>
) -> Result<Connecting, ConnectionError>
Accepts this incoming connection using a custom configuration.
See accept() for more details.
-sourcepub fn retry(self) -> Result<(), RetryError>
Responds with a retry packet.
+sourcepub fn retry(self) -> Result<(), RetryError>
Responds with a retry packet.
This requires the client to retry with address validation.
Errors if remote_address_validated() is true.
-sourcepub fn ignore(self)
Ignores this incoming connection attempt, not sending any packet in response.
-sourcepub fn local_ip(&self) -> Option<IpAddr>
Returns the local IP address which was used when the peer established the
+
sourcepub fn ignore(self)
Ignores this incoming connection attempt, not sending any packet in response.
+sourcepub fn local_ip(&self) -> Option<IpAddr>
Returns the local IP address which was used when the peer established the
connection.
-sourcepub fn remote_address(&self) -> SocketAddr
Returns the peer’s UDP address.
-sourcepub fn remote_address_validated(&self) -> bool
Whether the socket address that is initiating this connection has been validated.
+sourcepub fn remote_address(&self) -> SocketAddr
Returns the peer’s UDP address.
+sourcepub fn remote_address_validated(&self) -> bool
Whether the socket address that is initiating this connection has been validated.
This means that the sender of the initial packet has proved that they can receive
traffic sent to self.remote_address().
-Trait Implementations§
source§impl IntoFuture for Incoming
§type Output = Result<Connection, ConnectionError>
The output that the future will produce on completion.§type IntoFuture = IncomingFuture
Which kind of future are we turning this into?source§fn into_future(self) -> <Incoming as IntoFuture>::IntoFuture
Creates a future from a value. Read moreAuto Trait Implementations§
§impl !Freeze for Incoming
§impl !RefUnwindSafe for Incoming
§impl Send for Incoming
§impl Sync for Incoming
§impl Unpin for Incoming
§impl !UnwindSafe for Incoming
Blanket Implementations§
Trait Implementations§
source§impl IntoFuture for Incoming
§type Output = Result<Connection, ConnectionError>
The output that the future will produce on completion.§type IntoFuture = IncomingFuture
Which kind of future are we turning this into?source§fn into_future(self) -> <Incoming as IntoFuture>::IntoFuture
Creates a future from a value. Read moreAuto Trait Implementations§
§impl !Freeze for Incoming
§impl !RefUnwindSafe for Incoming
§impl Send for Incoming
§impl Sync for Incoming
§impl Unpin for Incoming
§impl !UnwindSafe for Incoming
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/2778/docs/iroh/net/endpoint/struct.IncomingFuture.html b/pr/2778/docs/iroh/net/endpoint/struct.IncomingFuture.html
index 9b37879a58..f195c0f1fc 100644
--- a/pr/2778/docs/iroh/net/endpoint/struct.IncomingFuture.html
+++ b/pr/2778/docs/iroh/net/endpoint/struct.IncomingFuture.html
@@ -1,9 +1,9 @@
-IncomingFuture in iroh::net::endpoint - Rust Struct iroh::net::endpoint::IncomingFuture
source · pub struct IncomingFuture { /* private fields */ }
Expand description
Adaptor to let Incoming be awaited like a Connecting.
-Trait Implementations§
source§impl Debug for IncomingFuture
source§impl Future for IncomingFuture
§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.source§fn poll(
+IncomingFuture in iroh::net::endpoint - Rust Struct iroh::net::endpoint::IncomingFuture
source · pub struct IncomingFuture { /* private fields */ }
Expand description
Adaptor to let Incoming be awaited like a Connecting.
+Trait Implementations§
source§impl Debug for IncomingFuture
source§impl Future for IncomingFuture
§type Output = Result<Connection, ConnectionError>
The type of value produced on completion.source§impl<'pin> Unpin for IncomingFuturewhere
+the current task for wakeup if the value is not yet available. Read more
source§impl<'pin> Unpin for IncomingFuturewhere
__IncomingFuture<'pin>: Unpin,
Auto Trait Implementations§
§impl !Freeze for IncomingFuture
§impl !RefUnwindSafe for IncomingFuture
§impl Send for IncomingFuture
§impl Sync for IncomingFuture
§impl !UnwindSafe for IncomingFuture
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/2778/docs/iroh/net/struct.Endpoint.html b/pr/2778/docs/iroh/net/struct.Endpoint.html
index 824b486d80..249c398dd6 100644
--- a/pr/2778/docs/iroh/net/struct.Endpoint.html
+++ b/pr/2778/docs/iroh/net/struct.Endpoint.html
@@ -1,4 +1,4 @@
-Endpoint in iroh::net - Rust pub struct Endpoint { /* private fields */ }
Expand description
Controls an iroh-net node, establishing connections with other nodes.
+Endpoint in iroh::net - Rust pub struct Endpoint { /* private fields */ }
Expand description
Controls an iroh-net node, establishing connections with other nodes.
This is the main API interface to create connections to, and accept connections from
other iroh-net nodes. The connections are peer-to-peer and encrypted, a Relay server is
used to make the connections reliable. See the [crate docs] for a more detailed
@@ -14,11 +14,11 @@ behaviour.
Connection::open_bi functions.
Note that due to the light-weight properties of streams a stream will only be accepted
once the initiating peer has sent some data on it.
-Implementations§
source§impl Endpoint
sourcepub fn builder() -> Builder
Returns the builder for an Endpoint, with a production configuration.
-sourcepub fn set_alpns(&self, alpns: Vec<Vec<u8>>) -> Result<(), Error>
Sets the list of accepted ALPN protocols.
+Implementations§
source§impl Endpoint
sourcepub fn builder() -> Builder
Returns the builder for an Endpoint, with a production configuration.
+sourcepub async fn connect(
&self,
node_addr: impl Into<NodeAddr>,
alpn: &[u8]
@@ -39,7 +39,7 @@ connection attempt will fail with an error.
The alpn, or application-level protocol identifier, is also required. The remote
endpoint must support this alpn, otherwise the connection attempt will fail with
an error.
-
sourcepub async fn connect_by_node_id(
+
sourcepub async fn connect_by_node_id(
&self,
node_id: PublicKey,
alpn: &[u8]
@@ -48,13 +48,13 @@ an error.
information being provided by either the discovery service or using
Endpoint::add_node_addr. See Endpoint::connect for the details of how it
uses the discovery service to establish a connection to a remote node.
-
sourcepub fn accept(&self) -> Accept<'_> ⓘ
Accepts an incoming connection on the endpoint.
Only connections with the ALPNs configured in Builder::alpns will be accepted.
If multiple ALPNs have been configured the ALPN can be inspected before accepting
the connection using Connecting::alpn.
The returned future will yield None if the endpoint is closed by calling
Endpoint::close.
-sourcepub fn add_node_addr(&self, node_addr: NodeAddr) -> Result<(), Error>
Informs this Endpoint about addresses of the iroh-net node.
+sourcepub fn add_node_addr(&self, node_addr: NodeAddr) -> Result<(), Error>
Informs this Endpoint about addresses of the iroh-net node.
This updates the local state for the remote node. If the provided NodeAddr
contains a RelayUrl this will be used as the new relay server for this node. If
it contains any new IP endpoints they will also be stored and tried when next
@@ -64,7 +64,7 @@ silently ignored.
§Errors
Will return an error if we attempt to add our own PublicKey to the node map or if the
direct addresses are a subset of ours.
-sourcepub fn add_node_addr_with_source(
+
sourcepub fn secret_key(&self) -> &SecretKey
Returns the secret_key of this endpoint.
-sourcepub fn secret_key(&self) -> &SecretKey
Returns the secret_key of this endpoint.
+sourcepub fn node_id(&self) -> PublicKey
Returns the node id of this endpoint.
This ID is the unique addressing information of this node and other peers must know
it to be able to connect to this node.
-sourcepub async fn node_addr(&self) -> Result<NodeAddr, Error>
Returns the current NodeAddr for this endpoint.
+sourcepub async fn node_addr(&self) -> Result<NodeAddr, Error>
Returns the current NodeAddr for this endpoint.
The returned NodeAddr will have the current RelayUrl and local IP endpoints
as they would be returned by Endpoint::home_relay and
Endpoint::direct_addresses.
-sourcepub fn home_relay(&self) -> Option<RelayUrl>
Returns the RelayUrl of the Relay server used as home relay.
+sourcepub fn home_relay(&self) -> Option<RelayUrl>
Returns the RelayUrl of the Relay server used as home relay.
Every endpoint has a home Relay server which it chooses as the server with the
lowest latency out of the configured servers provided by Builder::relay_mode.
This is the server other iroh-net nodes can use to reliably establish a connection
@@ -94,14 +94,14 @@ to this node.
Note that this will be None right after the Endpoint is created since it takes
some time to connect to find and connect to the home relay server. Use
Endpoint::watch_home_relay to wait until the home relay server is available.
-sourcepub fn watch_home_relay(&self) -> impl Stream<Item = RelayUrl>
Watches for changes to the home relay.
+sourcepub fn watch_home_relay(&self) -> impl Stream<Item = RelayUrl>
Watches for changes to the home relay.
If there is currently a home relay it will be yielded immediately as the first item
in the stream. This makes it possible to use this function to wait for the initial
home relay to be known.
Note that it is not guaranteed that a home relay will ever become available. If no
servers are configured with Builder::relay_mode this stream will never yield an
item.
-sourcepub fn direct_addresses(&self) -> DirectAddrsStream
Returns the direct addresses of this Endpoint.
+sourcepub fn direct_addresses(&self) -> DirectAddrsStream
Returns the direct addresses of this Endpoint.
The direct addresses of the Endpoint are those that could be used by other
iroh-net nodes to establish direct connectivity, depending on the network
situation. The yielded lists of direct addresses contain both the locally-bound
@@ -124,10 +124,10 @@ most recently discovered IP endpoints.
let mep = Endpoint::builder().bind().await.unwrap();
let _addrs = mep.direct_addresses().next().await;
-sourcepub fn bound_sockets(&self) -> (SocketAddr, Option<SocketAddr>)
Returns the local socket addresses on which the underlying sockets are bound.
+sourcepub fn bound_sockets(&self) -> (SocketAddr, Option<SocketAddr>)
Returns the local socket addresses on which the underlying sockets are bound.
The Endpoint always binds on an IPv4 address and also tries to bind on an IPv6
address if available.
-sourcepub fn remote_info(&self, node_id: PublicKey) -> Option<RemoteInfo>
Returns information about the remote node identified by a NodeId.
+sourcepub fn remote_info(&self, node_id: PublicKey) -> Option<RemoteInfo>
Returns information about the remote node identified by a NodeId.
The Endpoint keeps some information about remote iroh-net nodes, which it uses to find
the best path to a node. Having information on a remote node, however, does not mean we have
ever connected to it to or even whether a connection is even possible. The information about a
@@ -136,14 +136,14 @@ calls may return different information. Furthermore, node information may even b
completely evicted as it becomes stale.
See also Endpoint::remote_info_iter which returns information on all nodes known
by this Endpoint.
-sourcepub fn remote_info_iter(&self) -> impl Iterator<Item = RemoteInfo>
Returns information about all the remote nodes this Endpoint knows about.
+sourcepub fn remote_info_iter(&self) -> impl Iterator<Item = RemoteInfo>
Returns information about all the remote nodes this Endpoint knows about.
This returns the same information as Endpoint::remote_info for each node known to this
Endpoint.
The Endpoint keeps some information about remote iroh-net nodes, which it uses to find
the best path to a node. This returns all the nodes it knows about, regardless of whether a
connection was ever made or is even possible.
See also Endpoint::remote_info to only retrieve information about a single node.
-sourcepub fn conn_type_stream(
+
sourcepub fn conn_type_stream(
&self,
node_id: PublicKey
) -> Result<ConnectionTypeStream, Error>
Returns a stream that reports connection type changes for the remote node.
@@ -159,13 +159,13 @@ connection when the switch from a relayed to a direct connection can be so fast
the relayed state is never exposed.
§Errors
Will error if we do not have any address information for the given node_id.
-sourcepub fn dns_resolver(
+
sourcepub fn dns_resolver(
&self
) -> &AsyncResolver<GenericConnector<TokioRuntimeProvider>>
Returns the DNS resolver used in this Endpoint.
See Builder::discovery.
-sourcepub fn discovery(&self) -> Option<&dyn Discovery>
Returns the discovery mechanism, if configured.
+sourcepub fn discovery(&self) -> Option<&dyn Discovery>
Returns the discovery mechanism, if configured.
-sourcepub async fn network_change(&self)
Notifies the system of potential network changes.
+sourcepub async fn network_change(&self)
Notifies the system of potential network changes.
On many systems iroh is able to detect network changes by itself, however
some systems like android do not expose this functionality to native code.
Android does however provide this functionality to Java code. This
@@ -173,14 +173,14 @@ function allows for notifying iroh of any potential network changes like
this.
Even when the network did not change, or iroh was already able to detect
the network change itself, there is no harm in calling this function.
-sourcepub async fn close(self, error_code: VarInt, reason: &[u8]) -> Result<(), Error>
Closes the QUIC endpoint and the magic socket.
+sourcepub async fn close(self, error_code: VarInt, reason: &[u8]) -> Result<(), Error>
Closes the QUIC endpoint and the magic socket.
This will close all open QUIC connections with the provided error_code and
reason. See quinn::Connection for details on how these are interpreted.
It will then wait for all connections to actually be shutdown, and afterwards
close the magic socket.
Returns an error if closing the magic socket failed.
TODO: Document error cases.
-Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Endpoint
§impl !RefUnwindSafe for Endpoint
§impl Send for Endpoint
§impl Sync for Endpoint
§impl Unpin for Endpoint
§impl !UnwindSafe for Endpoint
Blanket Implementations§
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for Endpoint
§impl !RefUnwindSafe for Endpoint
§impl Send for Endpoint
§impl Sync for Endpoint
§impl Unpin for Endpoint
§impl !UnwindSafe for Endpoint
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/2778/docs/iroh_blobs/downloader/struct.DownloadRequest.html b/pr/2778/docs/iroh_blobs/downloader/struct.DownloadRequest.html
index cb5b6d8543..6006ab22f7 100644
--- a/pr/2778/docs/iroh_blobs/downloader/struct.DownloadRequest.html
+++ b/pr/2778/docs/iroh_blobs/downloader/struct.DownloadRequest.html
@@ -1,7 +1,7 @@
DownloadRequest in iroh_blobs::downloader - Rust Struct iroh_blobs::downloader::DownloadRequest
source · pub struct DownloadRequest { /* private fields */ }
Available on crate feature downloader only.Expand description
A download request.
Implementations§
source§impl DownloadRequest
sourcepub fn new(
resource: impl Into<DownloadKind>,
- nodes: impl IntoIterator<Item = impl Into<NodeAddr>>
+ nodes: impl IntoIterator<Item = impl Into<NodeAddr>>
) -> Self
Create a new download request.
It is the responsibility of the caller to ensure that the data is tagged either with a
temp tag or with a persistent tag to make sure the data is not garbage collected during
diff --git a/pr/2778/docs/iroh_blobs/downloader/struct.Downloader.html b/pr/2778/docs/iroh_blobs/downloader/struct.Downloader.html
index df20b5efe0..9a418e1322 100644
--- a/pr/2778/docs/iroh_blobs/downloader/struct.Downloader.html
+++ b/pr/2778/docs/iroh_blobs/downloader/struct.Downloader.html
@@ -11,7 +11,7 @@
S: Store,
Create a new Downloader with custom ConcurrencyLimits and RetryConfig.
sourcepub async fn queue(&self, request: DownloadRequest) -> DownloadHandle ⓘ
Queue a download.
sourcepub async fn cancel(&self, handle: DownloadHandle)
Cancel a download.
-sourcepub async fn nodes_have(&mut self, hash: Hash, nodes: Vec<NodeId>)
Declare that certain nodes can be used to download a hash.
+sourcepub async fn nodes_have(&mut self, hash: Hash, nodes: Vec<NodeId>)
Declare that certain nodes can be used to download a hash.
Note that this does not start a download, but only provides new nodes to already queued
downloads. Use Self::queue to queue a download.
Trait Implementations§
source§impl Clone for Downloader
source§fn clone(&self) -> Downloader
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 Downloader
§impl !RefUnwindSafe for Downloader
§impl Send for Downloader
§impl Sync for Downloader
§impl Unpin for Downloader
§impl !UnwindSafe for Downloader
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/pr/2778/docs/iroh_blobs/downloader/trait.Dialer.html b/pr/2778/docs/iroh_blobs/downloader/trait.Dialer.html
index 21615d171a..c6308c48e2 100644
--- a/pr/2778/docs/iroh_blobs/downloader/trait.Dialer.html
+++ b/pr/2778/docs/iroh_blobs/downloader/trait.Dialer.html
@@ -1,15 +1,15 @@
-Dialer in iroh_blobs::downloader - Rust Trait iroh_blobs::downloader::Dialer
source · pub trait Dialer: Stream<Item = (NodeId, Result<Self::Connection>)> + Unpin {
+Dialer in iroh_blobs::downloader - Rust Trait iroh_blobs::downloader::Dialer
source · pub trait Dialer: Stream<Item = (NodeId, Result<Self::Connection>)> + Unpin {
type Connection: Clone + 'static;
// Required methods
- fn queue_dial(&mut self, node_id: NodeId);
+ fn queue_dial(&mut self, node_id: NodeId);
fn pending_count(&self) -> usize;
- fn is_pending(&self, node: NodeId) -> bool;
- fn node_id(&self) -> NodeId;
+ fn is_pending(&self, node: NodeId) -> bool;
+ fn node_id(&self) -> NodeId;
}
Available on crate feature downloader only.Expand description
Trait modeling a dialer. This allows for IO-less testing.
Required Associated Types§
sourcetype Connection: Clone + 'static
Type of connections returned by the Dialer.
-Required Methods§
sourcefn queue_dial(&mut self, node_id: NodeId)
Dial a node.
+Required Methods§
sourcefn queue_dial(&mut self, node_id: NodeId)
Dial a node.
sourcefn pending_count(&self) -> usize
Get the number of dialing nodes.
-sourcefn is_pending(&self, node: NodeId) -> bool
Check if a node is being dialed.
-Implementations on Foreign Types§
source§impl Dialer for Dialer
§type Connection = Connection
source§fn queue_dial(&mut self, node_id: NodeId)
source§fn pending_count(&self) -> usize
source§fn is_pending(&self, node: NodeId) -> bool
source§fn node_id(&self) -> NodeId
Implementors§
\ No newline at end of file
+
sourcefn is_pending(&self, node: NodeId) -> bool
Check if a node is being dialed.
+Implementations on Foreign Types§
source§impl Dialer for Dialer
§type Connection = Connection
source§fn queue_dial(&mut self, node_id: NodeId)
source§fn pending_count(&self) -> usize
source§fn is_pending(&self, node: NodeId) -> bool
source§fn node_id(&self) -> NodeId
Implementors§
\ No newline at end of file
diff --git a/pr/2778/docs/iroh_blobs/enum.BlobFormat.html b/pr/2778/docs/iroh_blobs/enum.BlobFormat.html
index 6e37e0f457..f310055b00 100644
--- a/pr/2778/docs/iroh_blobs/enum.BlobFormat.html
+++ b/pr/2778/docs/iroh_blobs/enum.BlobFormat.html
@@ -1,30 +1,30 @@
-BlobFormat in iroh_blobs - Rust Enum iroh_blobs::BlobFormat
pub enum BlobFormat {
+BlobFormat in iroh_blobs - Rust Enum iroh_blobs::BlobFormat
source · pub enum BlobFormat {
Raw,
HashSeq,
}
Expand description
A format identifier
Variants§
Implementations§
§impl BlobFormat
pub const fn is_hash_seq(&self) -> bool
Is hash seq format
-Trait Implementations§
§impl Clone for BlobFormat
§fn clone(&self) -> BlobFormat
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more§impl Debug for BlobFormat
§impl Default for BlobFormat
§fn default() -> BlobFormat
Returns the “default value” for a type. Read more§impl<'de> Deserialize<'de> for BlobFormat
§fn deserialize<__D>(
+
Implementations§
source§impl BlobFormat
Trait Implementations§
source§impl Clone for BlobFormat
source§fn clone(&self) -> BlobFormat
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 BlobFormat
source§impl Default for BlobFormat
source§fn default() -> BlobFormat
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for BlobFormat
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<BlobFormat, <__D as Deserializer<'de>>::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more§impl Display for BlobFormat
§impl Hash for BlobFormat
§fn hash<__H>(&self, state: &mut __H)where
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Display for BlobFormat
source§impl Hash for BlobFormat
§impl MaxSize for BlobFormat
§const POSTCARD_MAX_SIZE: usize = 1usize
The maximum possible size that the serialization of this
-type can have, in bytes.§impl Ord for BlobFormat
source§impl MaxSize for BlobFormat
source§const POSTCARD_MAX_SIZE: usize = 1usize
The maximum possible size that the serialization of this
+type can have, in bytes.source§impl Ord for BlobFormat
source§fn cmp(&self, other: &BlobFormat) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more§impl PartialEq for BlobFormat
§fn eq(&self, other: &BlobFormat) -> bool
Restrict a value to a certain interval. Read moresource§impl PartialEq for BlobFormat
source§fn eq(&self, other: &BlobFormat) -> bool
This method tests for self and other values to be equal, and is used
by ==.§impl PartialOrd for BlobFormat
§fn partial_cmp(&self, other: &BlobFormat) -> Option<Ordering>
source§impl PartialOrd for BlobFormat
source§fn partial_cmp(&self, other: &BlobFormat) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read moresource§impl Serialize for BlobFormat
source§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§impl Copy for BlobFormat
§impl Eq for BlobFormat
§impl StructuralPartialEq for BlobFormat
Auto Trait Implementations§
§impl Freeze for BlobFormat
§impl RefUnwindSafe for BlobFormat
§impl Send for BlobFormat
§impl Sync for BlobFormat
§impl Unpin for BlobFormat
§impl UnwindSafe for BlobFormat
Blanket Implementations§
source§impl<T> Any for Twhere
+ __S: Serializer,
Serialize this value into the given Serde serializer. Read moresource§impl Copy for BlobFormat
source§impl Eq for BlobFormat
source§impl StructuralPartialEq for BlobFormat
Auto Trait Implementations§
§impl Freeze for BlobFormat
§impl RefUnwindSafe for BlobFormat
§impl Send for BlobFormat
§impl Sync for BlobFormat
§impl Unpin for BlobFormat
§impl UnwindSafe for BlobFormat
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/2778/docs/iroh_blobs/export/enum.ExportProgress.html b/pr/2778/docs/iroh_blobs/export/enum.ExportProgress.html
index ec9e7b9479..c1afde02ca 100644
--- a/pr/2778/docs/iroh_blobs/export/enum.ExportProgress.html
+++ b/pr/2778/docs/iroh_blobs/export/enum.ExportProgress.html
@@ -14,7 +14,7 @@
id: u64,
},
AllDone,
- Abort(RpcError),
+ Abort(RpcError),
}Expand description
Progress events for an export operation
Variants§
§Found
The download part is done for this id, we are now exporting the data
to the specified out path.
@@ -30,7 +30,7 @@ to the specified out path.
§Done
We finished exporting a blob
§AllDone
We are done with the whole operation.
-§Abort(RpcError)
We got an error and need to abort.
+§Abort(RpcError)
We got an error and need to abort.
Trait Implementations§
source§impl Clone for ExportProgress
source§fn clone(&self) -> ExportProgress
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 ExportProgress
source§impl<'de> Deserialize<'de> for ExportProgress
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl !Freeze for ExportProgress
§impl RefUnwindSafe for ExportProgress
§impl Send for ExportProgress
§impl Sync for ExportProgress
§impl Unpin for ExportProgress
§impl UnwindSafe for ExportProgress
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/pr/2778/docs/iroh_blobs/get/db/enum.DownloadProgress.html b/pr/2778/docs/iroh_blobs/get/db/enum.DownloadProgress.html
index 53922f7c40..219fa5610f 100644
--- a/pr/2778/docs/iroh_blobs/get/db/enum.DownloadProgress.html
+++ b/pr/2778/docs/iroh_blobs/get/db/enum.DownloadProgress.html
@@ -25,7 +25,7 @@
id: u64,
},
AllDone(Stats),
- Abort(RpcError),
+ Abort(RpcError),
}Expand description
Progress updates for the get operation.
Variants§
§InitialState(TransferState)
Initial state if subscribing to a running or queued transfer.
§FoundLocal
Data was found locally.
@@ -51,7 +51,7 @@ allows to identify the children by their offset in the hashseq.
§AllDone(Stats)
All operations finished.
This will be the last message in the stream.
-§Abort(RpcError)
We got an error and need to abort.
+§Abort(RpcError)
We got an error and need to abort.
This will be the last message in the stream.
Trait Implementations§
source§impl Clone for DownloadProgress
source§fn clone(&self) -> DownloadProgress
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 DownloadProgress
source§impl<'de> Deserialize<'de> for DownloadProgress
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Serialize for DownloadProgress
source§fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where
diff --git a/pr/2778/docs/iroh_blobs/metrics/struct.Metrics.html b/pr/2778/docs/iroh_blobs/metrics/struct.Metrics.html
index cbcf7da0a8..9095ac1eae 100644
--- a/pr/2778/docs/iroh_blobs/metrics/struct.Metrics.html
+++ b/pr/2778/docs/iroh_blobs/metrics/struct.Metrics.html
@@ -1,20 +1,20 @@
Metrics in iroh_blobs::metrics - Rust Struct iroh_blobs::metrics::Metrics
source · pub struct Metrics {
- pub download_bytes_total: Counter,
- pub download_time_total: Counter,
- pub downloads_success: Counter,
- pub downloads_error: Counter,
- pub downloads_notfound: Counter,
- pub downloader_tick_main: Counter,
- pub downloader_tick_connection_ready: Counter,
- pub downloader_tick_message_received: Counter,
- pub downloader_tick_transfer_completed: Counter,
- pub downloader_tick_transfer_failed: Counter,
- pub downloader_tick_retry_node: Counter,
- pub downloader_tick_goodbye_node: Counter,
+ pub download_bytes_total: Counter,
+ pub download_time_total: Counter,
+ pub downloads_success: Counter,
+ pub downloads_error: Counter,
+ pub downloads_notfound: Counter,
+ pub downloader_tick_main: Counter,
+ pub downloader_tick_connection_ready: Counter,
+ pub downloader_tick_message_received: Counter,
+ pub downloader_tick_transfer_completed: Counter,
+ pub downloader_tick_transfer_failed: Counter,
+ pub downloader_tick_retry_node: Counter,
+ pub downloader_tick_goodbye_node: Counter,
}
Expand description
Enum of metrics for the module
-Fields§
§download_bytes_total: Counter§download_time_total: Counter§downloads_success: Counter§downloads_error: Counter§downloads_notfound: Counter§downloader_tick_main: Counter§downloader_tick_connection_ready: Counter§downloader_tick_message_received: Counter§downloader_tick_transfer_completed: Counter§downloader_tick_transfer_failed: Counter§downloader_tick_retry_node: Counter§downloader_tick_goodbye_node: CounterTrait Implementations§
source§impl Metric for Metrics
§fn with_metric<T, F>(f: F)where
+
Fields§
§download_bytes_total: Counter§download_time_total: Counter§downloads_success: Counter§downloads_error: Counter§downloads_notfound: Counter§downloader_tick_main: Counter§downloader_tick_connection_ready: Counter§downloader_tick_message_received: Counter§downloader_tick_transfer_completed: Counter§downloader_tick_transfer_failed: Counter§downloader_tick_retry_node: Counter§downloader_tick_goodbye_node: CounterTrait Implementations§
Auto Trait Implementations§
§impl Freeze for Metrics
§impl RefUnwindSafe for Metrics
§impl Send for Metrics
§impl Sync for Metrics
§impl Unpin for Metrics
§impl UnwindSafe for Metrics
Blanket Implementations§
Auto Trait Implementations§
§impl Freeze for Metrics
§impl RefUnwindSafe for Metrics
§impl Send for Metrics
§impl Sync for Metrics
§impl Unpin for Metrics
§impl UnwindSafe for Metrics
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/2778/docs/iroh_blobs/provider/enum.AddProgress.html b/pr/2778/docs/iroh_blobs/provider/enum.AddProgress.html
index 7f293542df..48bdbeb3aa 100644
--- a/pr/2778/docs/iroh_blobs/provider/enum.AddProgress.html
+++ b/pr/2778/docs/iroh_blobs/provider/enum.AddProgress.html
@@ -17,7 +17,7 @@
format: BlobFormat,
tag: Tag,
},
- Abort(RpcError),
+ Abort(RpcError),
}Expand description
Progress updates for the add operation.
Variants§
§Found
An item was found with name name, from now on referred to via id
Fields
§Abort(RpcError)
We got an error and need to abort.
This will be the last message in the stream.
Trait Implementations§
source§impl Debug for AddProgress
source§impl<'de> Deserialize<'de> for AddProgress
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Serialize for AddProgress
source§fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where
diff --git a/pr/2778/docs/iroh_blobs/provider/enum.BatchAddPathProgress.html b/pr/2778/docs/iroh_blobs/provider/enum.BatchAddPathProgress.html
index 1cf9d2bcb9..897f90ff71 100644
--- a/pr/2778/docs/iroh_blobs/provider/enum.BatchAddPathProgress.html
+++ b/pr/2778/docs/iroh_blobs/provider/enum.BatchAddPathProgress.html
@@ -8,7 +8,7 @@
Done {
hash: Hash,
},
- Abort(RpcError),
+ Abort(RpcError),
}Expand description
Progress updates for the batch add operation.
Variants§
§Found
An item was found with the given size
Fields
§Abort(RpcError)
We got an error and need to abort.
This will be the last message in the stream.
Trait Implementations§
source§impl Debug for BatchAddPathProgress
source§impl<'de> Deserialize<'de> for BatchAddPathProgress
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Serialize for BatchAddPathProgress
source§fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where
diff --git a/pr/2778/docs/iroh_blobs/store/enum.ConsistencyCheckProgress.html b/pr/2778/docs/iroh_blobs/store/enum.ConsistencyCheckProgress.html
index a4f93f4530..247034c641 100644
--- a/pr/2778/docs/iroh_blobs/store/enum.ConsistencyCheckProgress.html
+++ b/pr/2778/docs/iroh_blobs/store/enum.ConsistencyCheckProgress.html
@@ -6,7 +6,7 @@
level: ReportLevel,
},
Done,
- Abort(RpcError),
+ Abort(RpcError),
}Expand description
Progress updates for the validate operation
Variants§
§level: ReportLevelThe level of the message
§Done
Consistency check ended
-§Abort(RpcError)
We got an error and need to abort.
+§Abort(RpcError)
We got an error and need to abort.
Trait Implementations§
source§impl Debug for ConsistencyCheckProgress
source§impl<'de> Deserialize<'de> for ConsistencyCheckProgress
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for ConsistencyCheckProgress
§impl RefUnwindSafe for ConsistencyCheckProgress
§impl Send for ConsistencyCheckProgress
§impl Sync for ConsistencyCheckProgress
§impl Unpin for ConsistencyCheckProgress
§impl UnwindSafe for ConsistencyCheckProgress
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/pr/2778/docs/iroh_blobs/store/enum.ValidateProgress.html b/pr/2778/docs/iroh_blobs/store/enum.ValidateProgress.html
index 4eb15f03bf..a02b614ce4 100644
--- a/pr/2778/docs/iroh_blobs/store/enum.ValidateProgress.html
+++ b/pr/2778/docs/iroh_blobs/store/enum.ValidateProgress.html
@@ -31,7 +31,7 @@
ranges: RangeSpec,
},
AllDone,
- Abort(RpcError),
+ Abort(RpcError),
}Expand description
Progress updates for the validate operation
Variants§
§Starting
started validating
Fields
§total: u64The total number of entries to validate
@@ -62,7 +62,7 @@ Otherwise it might be an url or something else to uniquely identify the entry.
§AllDone
We are done with the whole operation.
-§Abort(RpcError)
We got an error and need to abort.
+§Abort(RpcError)
We got an error and need to abort.
Trait Implementations§
source§impl Debug for ValidateProgress
source§impl<'de> Deserialize<'de> for ValidateProgress
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for ValidateProgress
§impl RefUnwindSafe for ValidateProgress
§impl Send for ValidateProgress
§impl Sync for ValidateProgress
§impl Unpin for ValidateProgress
§impl UnwindSafe for ValidateProgress
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/pr/2778/docs/iroh_blobs/struct.Hash.html b/pr/2778/docs/iroh_blobs/struct.Hash.html
index e6826db92b..9534292b28 100644
--- a/pr/2778/docs/iroh_blobs/struct.Hash.html
+++ b/pr/2778/docs/iroh_blobs/struct.Hash.html
@@ -1,36 +1,36 @@
-Hash in iroh_blobs - Rust Struct iroh_blobs::Hash
pub struct Hash(/* private fields */);
Expand description
Hash type used throughout.
-Implementations§
§impl Hash
pub const fn from_bytes(bytes: [u8; 32]) -> Hash
Create a Hash from its raw bytes representation.
-pub fn fmt_short(&self) -> String
Convert to a base32 string limited to the first 10 bytes for a friendly string
+
Hash in iroh_blobs - Rust Struct iroh_blobs::Hash
source · pub struct Hash(/* private fields */);
Expand description
Hash type used throughout.
+Implementations§
Trait Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for Hash
source§fn deserialize<D>(
deserializer: D
) -> Result<Hash, <D as Deserializer<'de>>::Error>where
- D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl FromIterator<Hash> for HashSeq
§impl Hash for Hash
§fn hash<__H>(&self, state: &mut __H)where
+ D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl FromIterator<Hash> for HashSeq
§impl MaxSize for Hash
§const POSTCARD_MAX_SIZE: usize = 32usize
The maximum possible size that the serialization of this
-type can have, in bytes.source§impl MaxSize for Hash
source§const POSTCARD_MAX_SIZE: usize = 32usize
The maximum possible size that the serialization of this
+type can have, in bytes.source§impl Ord for Hash
source§impl PartialEq for Hash
§impl PartialOrd for Hash
source§impl PartialOrd for Hash
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read moresource§impl Serialize for Hash
source§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§impl Value for Hash
§type SelfType<'a> = Hash
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = &'a [u8; 32]
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> <Hash as Value>::SelfType<'a>where
+ S: Serializer,
Serialize this value into the given Serde serializer. Read moresource§impl Value for Hash
§type SelfType<'a> = Hash
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = &'a [u8; 32]
source§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§impl Copy for Hash
§impl Eq for Hash
§impl StructuralPartialEq for Hash
Auto Trait Implementations§
§impl Freeze for Hash
§impl RefUnwindSafe for Hash
§impl Send for Hash
§impl Sync for Hash
§impl Unpin for Hash
§impl UnwindSafe for Hash
Blanket Implementations§
source§impl Copy for Hash
source§impl Eq for Hash
source§impl StructuralPartialEq for Hash
Auto Trait Implementations§
§impl Freeze for Hash
§impl RefUnwindSafe for Hash
§impl Send for Hash
§impl Sync for Hash
§impl Unpin for Hash
§impl UnwindSafe for Hash
Blanket Implementations§
§impl<A, T> AsBits<T> for A
§fn as_bits<O>(&self) -> &BitSlice<T, O>where
diff --git a/pr/2778/docs/iroh_blobs/struct.HashAndFormat.html b/pr/2778/docs/iroh_blobs/struct.HashAndFormat.html
index 08a8bb8f3f..7039e7b230 100644
--- a/pr/2778/docs/iroh_blobs/struct.HashAndFormat.html
+++ b/pr/2778/docs/iroh_blobs/struct.HashAndFormat.html
@@ -1,37 +1,37 @@
-HashAndFormat in iroh_blobs - Rust Struct iroh_blobs::HashAndFormat
pub struct HashAndFormat {
+HashAndFormat in iroh_blobs - Rust Struct iroh_blobs::HashAndFormat
source · pub struct HashAndFormat {
pub hash: Hash,
pub format: BlobFormat,
}
Expand description
A hash and format pair
Fields§
§hash: HashThe hash
§format: BlobFormatThe format
-Implementations§
§impl HashAndFormat
pub fn new(hash: Hash, format: BlobFormat) -> HashAndFormat
Create a new hash and format pair.
-pub fn raw(hash: Hash) -> HashAndFormat
Create a new hash and format pair, using the default (raw) format.
-pub fn hash_seq(hash: Hash) -> HashAndFormat
Create a new hash and format pair, using the collection format.
-Trait Implementations§
§impl Clone for HashAndFormat
§fn clone(&self) -> HashAndFormat
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more§impl Debug for HashAndFormat
§impl<'de> Deserialize<'de> for HashAndFormat
§fn deserialize<D>(
+
Implementations§
source§impl HashAndFormat
sourcepub fn new(hash: Hash, format: BlobFormat) -> HashAndFormat
Create a new hash and format pair.
+sourcepub fn raw(hash: Hash) -> HashAndFormat
Create a new hash and format pair, using the default (raw) format.
+sourcepub fn hash_seq(hash: Hash) -> HashAndFormat
Create a new hash and format pair, using the collection format.
+Trait Implementations§
source§impl Clone for HashAndFormat
source§fn clone(&self) -> HashAndFormat
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 HashAndFormat
source§impl<'de> Deserialize<'de> for HashAndFormat
source§fn deserialize<D>(
deserializer: D
) -> Result<HashAndFormat, <D as Deserializer<'de>>::Error>where
- D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more§impl Display for HashAndFormat
source§impl From<DownloadKind> for HashAndFormat
Available on crate feature downloader only.
source§fn from(value: DownloadKind) -> Self
Converts to this type from the input type.source§impl From<HashAndFormat> for DownloadKind
Available on crate feature downloader only.
source§fn from(value: HashAndFormat) -> Self
Converts to this type from the input type.§impl FromStr for HashAndFormat
§impl Hash for HashAndFormat
§fn hash<__H>(&self, state: &mut __H)where
+ D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Display for HashAndFormat
source§impl From<DownloadKind> for HashAndFormat
Available on crate feature downloader only.
source§fn from(value: DownloadKind) -> Self
Converts to this type from the input type.source§impl From<HashAndFormat> for DownloadKind
Available on crate feature downloader only.
source§fn from(value: HashAndFormat) -> Self
Converts to this type from the input type.source§impl FromStr for HashAndFormat
source§impl Hash for HashAndFormat
§impl MaxSize for HashAndFormat
§const POSTCARD_MAX_SIZE: usize = 33usize
The maximum possible size that the serialization of this
-type can have, in bytes.§impl Ord for HashAndFormat
source§impl MaxSize for HashAndFormat
source§const POSTCARD_MAX_SIZE: usize = 33usize
The maximum possible size that the serialization of this
+type can have, in bytes.source§impl Ord for HashAndFormat
source§fn cmp(&self, other: &HashAndFormat) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more§impl PartialEq for HashAndFormat
§fn eq(&self, other: &HashAndFormat) -> bool
Restrict a value to a certain interval. Read moresource§impl PartialEq for HashAndFormat
source§fn eq(&self, other: &HashAndFormat) -> bool
This method tests for self and other values to be equal, and is used
by ==.§impl PartialOrd for HashAndFormat
§fn partial_cmp(&self, other: &HashAndFormat) -> Option<Ordering>
source§impl PartialOrd for HashAndFormat
source§fn partial_cmp(&self, other: &HashAndFormat) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read moresource§impl Serialize for HashAndFormat
source§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§impl Value for HashAndFormat
§type SelfType<'a> = HashAndFormat
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = [u8; 33]
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> <HashAndFormat as Value>::SelfType<'a>where
+ S: Serializer,
Serialize this value into the given Serde serializer. Read moresource§impl Value for HashAndFormat
§type SelfType<'a> = HashAndFormat
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = [u8; 33]
source§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable widthsource§fn from_bytes<'a>(data: &'a [u8]) -> <HashAndFormat as Value>::SelfType<'a>where
HashAndFormat: 'a,
Deserializes data
-Implementations may return a view over data, or an owned typesource§fn as_bytes<'a, 'b>(
value: &'a <HashAndFormat as Value>::SelfType<'b>
) -> <HashAndFormat as Value>::AsBytes<'a>where
'b: 'a,
- HashAndFormat: 'a + 'b,
Serialize the value to a slice§impl Copy for HashAndFormat
§impl Eq for HashAndFormat
§impl StructuralPartialEq for HashAndFormat
Auto Trait Implementations§
§impl Freeze for HashAndFormat
§impl RefUnwindSafe for HashAndFormat
§impl Send for HashAndFormat
§impl Sync for HashAndFormat
§impl Unpin for HashAndFormat
§impl UnwindSafe for HashAndFormat
Blanket Implementations§
source§impl<T> Any for Twhere
+ HashAndFormat: 'a + 'b,
Serialize the value to a slicesource§impl Copy for HashAndFormat
source§impl Eq for HashAndFormat
source§impl StructuralPartialEq for HashAndFormat
Auto Trait Implementations§
§impl Freeze for HashAndFormat
§impl RefUnwindSafe for HashAndFormat
§impl Send for HashAndFormat
§impl Sync for HashAndFormat
§impl Unpin for HashAndFormat
§impl UnwindSafe for HashAndFormat
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/2778/docs/iroh_docs/metrics/struct.Metrics.html b/pr/2778/docs/iroh_docs/metrics/struct.Metrics.html
index b07c4845ba..1bcdeca94b 100644
--- a/pr/2778/docs/iroh_docs/metrics/struct.Metrics.html
+++ b/pr/2778/docs/iroh_docs/metrics/struct.Metrics.html
@@ -1,27 +1,27 @@
Metrics in iroh_docs::metrics - Rust pub struct Metrics {Show 19 fields
- pub new_entries_local: Counter,
- pub new_entries_remote: Counter,
- pub new_entries_local_size: Counter,
- pub new_entries_remote_size: Counter,
- pub sync_via_connect_success: Counter,
- pub sync_via_connect_failure: Counter,
- pub sync_via_accept_success: Counter,
- pub sync_via_accept_failure: Counter,
- pub actor_tick_main: Counter,
- pub doc_gossip_tick_main: Counter,
- pub doc_gossip_tick_event: Counter,
- pub doc_gossip_tick_actor: Counter,
- pub doc_gossip_tick_pending_join: Counter,
- pub doc_live_tick_main: Counter,
- pub doc_live_tick_actor: Counter,
- pub doc_live_tick_replica_event: Counter,
- pub doc_live_tick_running_sync_connect: Counter,
- pub doc_live_tick_running_sync_accept: Counter,
- pub doc_live_tick_pending_downloads: Counter,
+ pub new_entries_local: Counter,
+ pub new_entries_remote: Counter,
+ pub new_entries_local_size: Counter,
+ pub new_entries_remote_size: Counter,
+ pub sync_via_connect_success: Counter,
+ pub sync_via_connect_failure: Counter,
+ pub sync_via_accept_success: Counter,
+ pub sync_via_accept_failure: Counter,
+ pub actor_tick_main: Counter,
+ pub doc_gossip_tick_main: Counter,
+ pub doc_gossip_tick_event: Counter,
+ pub doc_gossip_tick_actor: Counter,
+ pub doc_gossip_tick_pending_join: Counter,
+ pub doc_live_tick_main: Counter,
+ pub doc_live_tick_actor: Counter,
+ pub doc_live_tick_replica_event: Counter,
+ pub doc_live_tick_running_sync_connect: Counter,
+ pub doc_live_tick_running_sync_accept: Counter,
+ pub doc_live_tick_pending_downloads: Counter,
}
Expand description
Metrics for iroh-docs
-Fields§
§new_entries_local: Counter§new_entries_remote: Counter§new_entries_local_size: Counter§new_entries_remote_size: Counter§sync_via_connect_success: Counter§sync_via_connect_failure: Counter§sync_via_accept_success: Counter§sync_via_accept_failure: Counter§actor_tick_main: Counter§doc_gossip_tick_main: Counter§doc_gossip_tick_event: Counter§doc_gossip_tick_actor: Counter§doc_gossip_tick_pending_join: Counter§doc_live_tick_main: Counter§doc_live_tick_actor: Counter§doc_live_tick_replica_event: Counter§doc_live_tick_running_sync_connect: Counter§doc_live_tick_running_sync_accept: Counter§doc_live_tick_pending_downloads: CounterTrait Implementations§
source§impl Metric for Metrics
§fn with_metric<T, F>(f: F)where
+
Fields§
§new_entries_local: Counter§new_entries_remote: Counter§new_entries_local_size: Counter§new_entries_remote_size: Counter§sync_via_connect_success: Counter§sync_via_connect_failure: Counter§sync_via_accept_success: Counter§sync_via_accept_failure: Counter§actor_tick_main: Counter§doc_gossip_tick_main: Counter§doc_gossip_tick_event: Counter§doc_gossip_tick_actor: Counter§doc_gossip_tick_pending_join: Counter§doc_live_tick_main: Counter§doc_live_tick_actor: Counter§doc_live_tick_replica_event: Counter§doc_live_tick_running_sync_connect: Counter§doc_live_tick_running_sync_accept: Counter§doc_live_tick_pending_downloads: CounterTrait Implementations§
Auto Trait Implementations§
§impl Freeze for Metrics
§impl RefUnwindSafe for Metrics
§impl Send for Metrics
§impl Sync for Metrics
§impl Unpin for Metrics
§impl UnwindSafe for Metrics
Blanket Implementations§
Auto Trait Implementations§
§impl Freeze for Metrics
§impl RefUnwindSafe for Metrics
§impl Send for Metrics
§impl Sync for Metrics
§impl Unpin for Metrics
§impl UnwindSafe for Metrics
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/2778/docs/iroh_gossip/metrics/struct.Metrics.html b/pr/2778/docs/iroh_gossip/metrics/struct.Metrics.html
index c1fbb79c81..4739fe4f84 100644
--- a/pr/2778/docs/iroh_gossip/metrics/struct.Metrics.html
+++ b/pr/2778/docs/iroh_gossip/metrics/struct.Metrics.html
@@ -1,26 +1,26 @@
Metrics in iroh_gossip::metrics - Rust Struct iroh_gossip::metrics::Metrics
source · pub struct Metrics {Show 18 fields
- pub msgs_ctrl_sent: Counter,
- pub msgs_ctrl_recv: Counter,
- pub msgs_data_sent: Counter,
- pub msgs_data_recv: Counter,
- pub msgs_data_sent_size: Counter,
- pub msgs_data_recv_size: Counter,
- pub msgs_ctrl_sent_size: Counter,
- pub msgs_ctrl_recv_size: Counter,
- pub neighbor_up: Counter,
- pub neighbor_down: Counter,
- pub actor_tick_main: Counter,
- pub actor_tick_rx: Counter,
- pub actor_tick_endpoint: Counter,
- pub actor_tick_dialer: Counter,
- pub actor_tick_dialer_success: Counter,
- pub actor_tick_dialer_failure: Counter,
- pub actor_tick_in_event_rx: Counter,
- pub actor_tick_timers: Counter,
+ pub msgs_ctrl_sent: Counter,
+ pub msgs_ctrl_recv: Counter,
+ pub msgs_data_sent: Counter,
+ pub msgs_data_recv: Counter,
+ pub msgs_data_sent_size: Counter,
+ pub msgs_data_recv_size: Counter,
+ pub msgs_ctrl_sent_size: Counter,
+ pub msgs_ctrl_recv_size: Counter,
+ pub neighbor_up: Counter,
+ pub neighbor_down: Counter,
+ pub actor_tick_main: Counter,
+ pub actor_tick_rx: Counter,
+ pub actor_tick_endpoint: Counter,
+ pub actor_tick_dialer: Counter,
+ pub actor_tick_dialer_success: Counter,
+ pub actor_tick_dialer_failure: Counter,
+ pub actor_tick_in_event_rx: Counter,
+ pub actor_tick_timers: Counter,
}
Expand description
Enum of metrics for the module
-Fields§
§msgs_ctrl_sent: Counter§msgs_ctrl_recv: Counter§msgs_data_sent: Counter§msgs_data_recv: Counter§msgs_data_sent_size: Counter§msgs_data_recv_size: Counter§msgs_ctrl_sent_size: Counter§msgs_ctrl_recv_size: Counter§neighbor_up: Counter§neighbor_down: Counter§actor_tick_main: Counter§actor_tick_rx: Counter§actor_tick_endpoint: Counter§actor_tick_dialer: Counter§actor_tick_dialer_success: Counter§actor_tick_dialer_failure: Counter§actor_tick_in_event_rx: Counter§actor_tick_timers: CounterTrait Implementations§
source§impl Metric for Metrics
§fn with_metric<T, F>(f: F)where
+
Fields§
§msgs_ctrl_sent: Counter§msgs_ctrl_recv: Counter§msgs_data_sent: Counter§msgs_data_recv: Counter§msgs_data_sent_size: Counter§msgs_data_recv_size: Counter§msgs_ctrl_sent_size: Counter§msgs_ctrl_recv_size: Counter§neighbor_up: Counter§neighbor_down: Counter§actor_tick_main: Counter§actor_tick_rx: Counter§actor_tick_endpoint: Counter§actor_tick_dialer: Counter§actor_tick_dialer_success: Counter§actor_tick_dialer_failure: Counter§actor_tick_in_event_rx: Counter§actor_tick_timers: CounterTrait Implementations§
Auto Trait Implementations§
§impl Freeze for Metrics
§impl RefUnwindSafe for Metrics
§impl Send for Metrics
§impl Sync for Metrics
§impl Unpin for Metrics
§impl UnwindSafe for Metrics
Blanket Implementations§
Auto Trait Implementations§
§impl Freeze for Metrics
§impl RefUnwindSafe for Metrics
§impl Send for Metrics
§impl Sync for Metrics
§impl Unpin for Metrics
§impl UnwindSafe for Metrics
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/pr/2778/docs/iroh_gossip/net/enum.Command.html b/pr/2778/docs/iroh_gossip/net/enum.Command.html
index 0b1a67d465..7a8129bc62 100644
--- a/pr/2778/docs/iroh_gossip/net/enum.Command.html
+++ b/pr/2778/docs/iroh_gossip/net/enum.Command.html
@@ -1,11 +1,11 @@
Command in iroh_gossip::net - Rust Enum iroh_gossip::net::Command
source · pub enum Command {
Broadcast(Bytes),
BroadcastNeighbors(Bytes),
- JoinPeers(Vec<NodeId>),
+ JoinPeers(Vec<NodeId>),
}
Available on crate feature net only.Expand description
Send a gossip message
Variants§
§Broadcast(Bytes)
Broadcast a message to all nodes in the swarm
§BroadcastNeighbors(Bytes)
Broadcast a message to all direct neighbors
-§JoinPeers(Vec<NodeId>)
Connect to a set of peers
+§JoinPeers(Vec<NodeId>)
Connect to a set of peers
Trait Implementations§
source§impl<'de> Deserialize<'de> for Command
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl !Freeze for Command
§impl RefUnwindSafe for Command
§impl Send for Command
§impl Sync for Command
§impl Unpin for Command
§impl UnwindSafe for Command
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/pr/2778/docs/iroh_gossip/net/enum.GossipEvent.html b/pr/2778/docs/iroh_gossip/net/enum.GossipEvent.html
index 36005a18ec..e76cca003b 100644
--- a/pr/2778/docs/iroh_gossip/net/enum.GossipEvent.html
+++ b/pr/2778/docs/iroh_gossip/net/enum.GossipEvent.html
@@ -1,17 +1,17 @@
GossipEvent in iroh_gossip::net - Rust Enum iroh_gossip::net::GossipEvent
source · pub enum GossipEvent {
- Joined(Vec<NodeId>),
- NeighborUp(NodeId),
- NeighborDown(NodeId),
+ Joined(Vec<NodeId>),
+ NeighborUp(NodeId),
+ NeighborDown(NodeId),
Received(Message),
}
Available on crate feature net only.Expand description
Events emitted from a gossip topic.
These are the events emitted from a GossipReceiver, wrapped in Event::Gossip.
-Variants§
§Joined(Vec<NodeId>)
We joined the topic with at least one peer.
+Variants§
§Joined(Vec<NodeId>)
We joined the topic with at least one peer.
This is the first event on a GossipReceiver and will only be emitted once.
-§NeighborUp(NodeId)
We have a new, direct neighbor in the swarm membership layer for this topic.
-§NeighborDown(NodeId)
We dropped direct neighbor in the swarm membership layer for this topic.
+§NeighborUp(NodeId)
We have a new, direct neighbor in the swarm membership layer for this topic.
+§NeighborDown(NodeId)
We dropped direct neighbor in the swarm membership layer for this topic.
§Received(Message)
We received a gossip message for this topic.
Trait Implementations§
source§impl Clone for GossipEvent
source§fn clone(&self) -> GossipEvent
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 GossipEvent
source§impl<'de> Deserialize<'de> for GossipEvent
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl From<Event<PublicKey>> for GossipEvent
source§impl Ord for GossipEvent
source§impl Ord for GossipEvent
source§fn cmp(&self, other: &GossipEvent) -> 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 GossipEvent
source§fn eq(&self, other: &GossipEvent) -> bool
This method tests for self and other values to be equal, and is used
diff --git a/pr/2778/docs/iroh_gossip/net/struct.Gossip.html b/pr/2778/docs/iroh_gossip/net/struct.Gossip.html
index 31b306fc7c..dc471b01be 100644
--- a/pr/2778/docs/iroh_gossip/net/struct.Gossip.html
+++ b/pr/2778/docs/iroh_gossip/net/struct.Gossip.html
@@ -1,19 +1,19 @@
Gossip in iroh_gossip::net - Rust Struct iroh_gossip::net::Gossip
source · pub struct Gossip { /* private fields */ }
Available on crate feature net only.Expand description
Publish and subscribe on gossiping topics.
Each topic is a separate broadcast tree with separate memberships.
A topic has to be joined before you can publish or subscribe on the topic.
-To join the swarm for a topic, you have to know the [PublicKey] of at least one peer that also joined the topic.
+To join the swarm for a topic, you have to know the PublicKey of at least one peer that also joined the topic.
Messages published on the swarm will be delivered to all peers that joined the swarm for that
topic. You will also be relaying (gossiping) messages published by other peers.
With the default settings, the protocol will maintain up to 5 peer connections per topic.
-Even though the Gossip is created from a [Endpoint], it does not accept connections
-itself. You should run an accept loop on the [Endpoint] yourself, check the ALPN protocol of incoming
+
Even though the Gossip is created from a Endpoint, it does not accept connections
+itself. You should run an accept loop on the Endpoint yourself, check the ALPN protocol of incoming
connections, and if the ALPN protocol equals GOSSIP_ALPN, forward the connection to the
gossip actor through Self::handle_connection.
The gossip actor will, however, initiate new connections to other peers by itself.
Implementations§
source§impl Gossip
sourcepub fn from_endpoint(
- endpoint: Endpoint,
+ endpoint: Endpoint,
config: Config,
- my_addr: &AddrInfo
+ my_addr: &AddrInfo
) -> Self
Spawn a gossip actor and get a handle for it
sourcepub fn max_message_size(&self) -> usize
Get the maximum message size configured for this gossip actor.
sourcepub async fn handle_connection(&self, conn: Connection) -> Result<()>
Handle an incoming [Connection].
@@ -21,7 +21,7 @@ gossip actor through sourcepub async fn join(
&self,
topic_id: TopicId,
- bootstrap: Vec<NodeId>
+ bootstrap: Vec<NodeId>
) -> Result<GossipTopic>
Join a gossip topic with the default options and wait for at least one active connection.
sourcepub fn join_with_opts(
&self,
diff --git a/pr/2778/docs/iroh_gossip/net/struct.GossipReceiver.html b/pr/2778/docs/iroh_gossip/net/struct.GossipReceiver.html
index 63849337b2..21af1a3c93 100644
--- a/pr/2778/docs/iroh_gossip/net/struct.GossipReceiver.html
+++ b/pr/2778/docs/iroh_gossip/net/struct.GossipReceiver.html
@@ -1,6 +1,6 @@
GossipReceiver in iroh_gossip::net - Rust Struct iroh_gossip::net::GossipReceiver
source · pub struct GossipReceiver { /* private fields */ }
Available on crate feature net only.Expand description
Receiver for gossip events on a topic.
This is a [Stream] of Events emitted from the topic.
-Implementations§
source§impl GossipReceiver
sourcepub fn neighbors(&self) -> impl Iterator<Item = NodeId> + '_
Lists our current direct neighbors.
+Implementations§
source§impl GossipReceiver
sourcepub fn neighbors(&self) -> impl Iterator<Item = NodeId> + '_
Lists our current direct neighbors.
sourcepub async fn joined(&mut self) -> Result<()>
Waits until we are connected to at least one node.
This progresses the stream until we received GossipEvent::Joined, which is the first
item emitted on the stream.
diff --git a/pr/2778/docs/iroh_gossip/net/struct.GossipSender.html b/pr/2778/docs/iroh_gossip/net/struct.GossipSender.html
index ce6485469e..bce789e2c9 100644
--- a/pr/2778/docs/iroh_gossip/net/struct.GossipSender.html
+++ b/pr/2778/docs/iroh_gossip/net/struct.GossipSender.html
@@ -1,7 +1,7 @@
GossipSender in iroh_gossip::net - Rust Struct iroh_gossip::net::GossipSender
source · pub struct GossipSender(/* private fields */);
Available on crate feature net only.Expand description
Sender for a gossip topic.
Implementations§
source§impl GossipSender
sourcepub async fn broadcast_neighbors(&self, message: Bytes) -> Result<()>
Broadcast a message to our direct neighbors.
-sourcepub async fn join_peers(&self, peers: Vec<NodeId>) -> Result<()>
Join a set of peers.
+Trait Implementations§
Auto Trait Implementations§
§impl Freeze for GossipSender
§impl RefUnwindSafe for GossipSender
§impl Send for GossipSender
§impl Sync for GossipSender
§impl Unpin for GossipSender
§impl UnwindSafe for GossipSender
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/2778/docs/iroh_gossip/net/struct.JoinOptions.html b/pr/2778/docs/iroh_gossip/net/struct.JoinOptions.html
index fb09dd3f72..4eb114b80c 100644
--- a/pr/2778/docs/iroh_gossip/net/struct.JoinOptions.html
+++ b/pr/2778/docs/iroh_gossip/net/struct.JoinOptions.html
@@ -1,14 +1,14 @@
JoinOptions in iroh_gossip::net - Rust Struct iroh_gossip::net::JoinOptions
source · pub struct JoinOptions {
- pub bootstrap: BTreeSet<NodeId>,
+ pub bootstrap: BTreeSet<NodeId>,
pub subscription_capacity: usize,
}
Available on crate feature net only.Expand description
Options for joining a gossip topic.
-Fields§
§bootstrap: BTreeSet<NodeId>The initial bootstrap nodes
+Fields§
§bootstrap: BTreeSet<NodeId>The initial bootstrap nodes
§subscription_capacity: usizeThe maximum number of messages that can be buffered in a subscription.
If this limit is reached, the subscriber will receive a Lagged response,
the message will be dropped, and the subscriber will be closed.
This is to prevent a single slow subscriber from blocking the dispatch loop.
If a subscriber is lagging, it should be closed and re-opened.
-Implementations§
source§impl JoinOptions
sourcepub fn with_bootstrap(nodes: impl IntoIterator<Item = NodeId>) -> Self
Creates JoinOptions with the provided bootstrap nodes and the default subscription
+
Implementations§
source§impl JoinOptions
sourcepub fn with_bootstrap(nodes: impl IntoIterator<Item = NodeId>) -> Self
Creates JoinOptions with the provided bootstrap nodes and the default subscription
capacity.
Trait Implementations§
source§impl Debug for JoinOptions
source§impl<'de> Deserialize<'de> for JoinOptions
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Serialize for JoinOptions
source§fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where
diff --git a/pr/2778/docs/iroh_gossip/net/struct.Message.html b/pr/2778/docs/iroh_gossip/net/struct.Message.html
index c27802f52f..b7d59ad951 100644
--- a/pr/2778/docs/iroh_gossip/net/struct.Message.html
+++ b/pr/2778/docs/iroh_gossip/net/struct.Message.html
@@ -1,12 +1,12 @@
Message in iroh_gossip::net - Rust Struct iroh_gossip::net::Message
source · pub struct Message {
pub content: Bytes,
pub scope: DeliveryScope,
- pub delivered_from: NodeId,
+ pub delivered_from: NodeId,
}
Available on crate feature net only.Expand description
A gossip message
Fields§
§content: BytesThe content of the message
§scope: DeliveryScopeThe scope of the message.
This tells us if the message is from a direct neighbor or actual gossip.
-§delivered_from: NodeIdThe node that delivered the message. This is not the same as the original author.
+§delivered_from: NodeIdThe node that delivered the message. This is not the same as the original author.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Message
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Ord for Message
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more1.21.0 · source§fn min(self, other: Self) -> Selfwhere
diff --git a/pr/2778/docs/iroh_gossip/net/type.ProtoCommand.html b/pr/2778/docs/iroh_gossip/net/type.ProtoCommand.html
index 4f7a36979e..c25682446d 100644
--- a/pr/2778/docs/iroh_gossip/net/type.ProtoCommand.html
+++ b/pr/2778/docs/iroh_gossip/net/type.ProtoCommand.html
@@ -1,9 +1,9 @@
-ProtoCommand in iroh_gossip::net - Rust Type Alias iroh_gossip::net::ProtoCommand
source · pub type ProtoCommand = Command<PublicKey>;
Available on crate feature net only.Expand description
Commands for the gossip protocol
+ProtoCommand in iroh_gossip::net - Rust Type Alias iroh_gossip::net::ProtoCommand
source · pub type ProtoCommand = Command<PublicKey>;
Available on crate feature net only.Expand description
Commands for the gossip protocol
Aliased Type§
enum ProtoCommand {
- Join(Vec<PublicKey>),
+ Join(Vec<PublicKey>),
Broadcast(Bytes, Scope),
Quit,
-}
Variants§
§Join(Vec<PublicKey>)
Join this topic and connect to peers.
+}Variants§
§Join(Vec<PublicKey>)
Join this topic and connect to peers.
If the list of peers is empty, will prepare the state and accept incoming join requests,
but only become operational after the first join request by another peer.
§Broadcast(Bytes, Scope)
Broadcast a message for this topic.
diff --git a/pr/2778/docs/iroh_gossip/net/type.ProtoEvent.html b/pr/2778/docs/iroh_gossip/net/type.ProtoEvent.html
index a21ccbe9c0..4c304da7e9 100644
--- a/pr/2778/docs/iroh_gossip/net/type.ProtoEvent.html
+++ b/pr/2778/docs/iroh_gossip/net/type.ProtoEvent.html
@@ -1,9 +1,9 @@
-ProtoEvent in iroh_gossip::net - Rust