diff --git a/pr/2778/docs/iroh/net/endpoint/fn.default_relay_mode.html b/pr/2778/docs/iroh/net/endpoint/fn.default_relay_mode.html index 22f8a9a872..f8e003f1e9 100644 --- a/pr/2778/docs/iroh/net/endpoint/fn.default_relay_mode.html +++ b/pr/2778/docs/iroh/net/endpoint/fn.default_relay_mode.html @@ -1,4 +1,4 @@ -default_relay_mode in iroh::net::endpoint - Rust

Function iroh::net::endpoint::default_relay_mode

source ·
pub fn default_relay_mode() -> RelayMode
Expand description

Returns the default relay mode.

+default_relay_mode in iroh::net::endpoint - Rust

Function iroh::net::endpoint::default_relay_mode

source ·
pub fn default_relay_mode() -> RelayMode
Expand description

Returns the default relay mode.

If the IROH_FORCE_STAGING_RELAYS environment variable is non empty, it will return RelayMode::Staging. Otherwise, it will return RelayMode::Default.

\ No newline at end of file diff --git a/pr/2778/docs/iroh/net/endpoint/fn.get_remote_node_id.html b/pr/2778/docs/iroh/net/endpoint/fn.get_remote_node_id.html index 29b3751571..1c698cc520 100644 --- a/pr/2778/docs/iroh/net/endpoint/fn.get_remote_node_id.html +++ b/pr/2778/docs/iroh/net/endpoint/fn.get_remote_node_id.html @@ -1,2 +1,2 @@ -get_remote_node_id in iroh::net::endpoint - Rust

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.

+get_remote_node_id in iroh::net::endpoint - Rust

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.

\ No newline at end of file diff --git a/pr/2778/docs/iroh/net/endpoint/fn.make_server_config.html b/pr/2778/docs/iroh/net/endpoint/fn.make_server_config.html index 265f7b878d..6238770fa1 100644 --- a/pr/2778/docs/iroh/net/endpoint/fn.make_server_config.html +++ b/pr/2778/docs/iroh/net/endpoint/fn.make_server_config.html @@ -1,4 +1,4 @@ -make_server_config in iroh::net::endpoint - Rust

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

Struct iroh::net::endpoint::Accept

source ·
pub struct Accept<'a> { /* private fields */ }
Expand description

Future produced by Endpoint::accept.

-

Trait Implementations§

source§

impl<'a> Debug for Accept<'a>

source§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<'a> Future for Accept<'a>

§

type Output = Option<Incoming>

The type of value produced on completion.
source§

fn poll( +Accept in iroh::net::endpoint - Rust

Struct iroh::net::endpoint::Accept

source ·
pub struct Accept<'a> { /* private fields */ }
Expand description

Future produced by Endpoint::accept.

+

Trait Implementations§

source§

impl<'a> Debug for Accept<'a>

source§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<'a> Future for Accept<'a>

§

type Output = Option<Incoming>

The type of value produced on completion.
source§

fn poll( self: Pin<&mut Accept<'a>>, cx: &mut Context<'_> ) -> Poll<<Accept<'a> as Future>::Output>

Attempt to resolve the future to a final value, registering -the current task for wakeup if the value is not yet available. Read more
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§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where 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

Struct iroh::net::endpoint::Builder

source ·
pub struct Builder { /* private fields */ }
Expand description

Builder for Endpoint.

+Builder in iroh::net::endpoint - Rust

Struct iroh::net::endpoint::Builder

source ·
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

source

pub async fn bind(self) -> Result<Endpoint, Error>

Binds the magic endpoint.

-
source

pub fn bind_addr_v4(self, addr: SocketAddrV4) -> Builder

Sets the IPv4 bind address.

+

Implementations§

source§

impl Builder

source

pub async fn bind(self) -> Result<Endpoint, Error>

Binds the magic endpoint.

+
source

pub 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.

-
source

pub fn bind_addr_v6(self, addr: SocketAddrV6) -> Builder

Sets the IPv6 bind address.

+
source

pub 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.

-
source

pub fn secret_key(self, secret_key: SecretKey) -> Builder

Sets a secret key to authenticate with other peers.

+
source

pub fn secret_key(self, secret_key: SecretKey) -> Builder

Sets a secret key to authenticate with other peers.

This secret key’s public key will be the PublicKey of this endpoint and thus also its NodeId

If not set, a new secret key will be generated.

-
source

pub fn alpns(self, alpn_protocols: Vec<Vec<u8>>) -> Builder

Sets the ALPN protocols that this endpoint will accept on incoming connections.

+
source

pub fn alpns(self, alpn_protocols: Vec<Vec<u8>>) -> Builder

Sets the ALPN protocols that this endpoint will accept on incoming connections.

Not setting this will still allow creating connections, but to accept incoming connections the ALPN must be set.

-
source

pub fn relay_mode(self, relay_mode: RelayMode) -> Builder

Sets the relay servers to assist in establishing connectivity.

+
source

pub 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.

-
source

pub fn clear_discovery(self) -> Builder

Removes all discovery services from the builder.

-
source

pub fn discovery(self, discovery: Box<dyn Discovery>) -> Builder

Optionally sets a discovery mechanism for this endpoint.

+
source

pub fn clear_discovery(self) -> Builder

Removes all discovery services from the builder.

+
source

pub 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.

-
source

pub fn add_discovery<F, D>(self, discovery: F) -> Builder
where +

source

pub fn add_discovery<F, D>(self, discovery: F) -> Builder
where F: FnOnce(&SecretKey) -> Option<D> + Send + Sync + 'static, D: Discovery + 'static,

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.

-
source

pub fn discovery_n0(self) -> Builder

Configures the endpoint to use the default n0 DNS discovery service.

+
source

pub 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.

-
source

pub fn discovery_dht(self) -> Builder

Configures the endpoint to also use the mainline DHT with default settings.

+
source

pub 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.

-
source

pub fn discovery_local_network(self) -> Builder

Configures the endpoint to also use local network discovery.

+
source

pub 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.

-
source

pub fn known_nodes(self, nodes: Vec<NodeAddr>) -> Builder

Optionally set a list of known nodes.

-
source

pub fn transport_config(self, transport_config: TransportConfig) -> Builder

Sets a custom quinn::TransportConfig for this endpoint.

+
source

pub fn known_nodes(self, nodes: Vec<NodeAddr>) -> Builder

Optionally set a list of known nodes.

+
source

pub 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.

-
source

pub fn dns_resolver( +

source

pub 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.

-
source

pub fn proxy_url(self, url: Url) -> Builder

Sets an explicit proxy url to proxy all HTTP(S) traffic through.

-
source

pub fn proxy_from_env(self) -> Builder

Sets the proxy url from the environment, in this order:

+
source

pub fn proxy_url(self, url: Url) -> Builder

Sets an explicit proxy url to proxy all HTTP(S) traffic through.

+
source

pub fn proxy_from_env(self) -> Builder

Sets the proxy url from the environment, in this order:

  • HTTP_PROXY
  • http_proxy
  • HTTPS_PROXY
  • https_proxy
-
source

pub fn keylog(self, keylog: bool) -> Builder

Enables saving the TLS pre-master key for connections.

+
source

pub 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.

-
source

pub fn insecure_skip_relay_cert_verify(self, skip_verify: bool) -> Builder

Skip verification of SSL certificates from relay servers

+
source

pub 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§

source§

impl Debug for Builder

source§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Default for Builder

source§

fn default() -> Builder

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +

Trait Implementations§

source§

impl Debug for Builder

source§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Default for Builder

source§

fn default() -> Builder

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where 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

source

pub fn into_0rtt(self) -> Result<(Connection, ZeroRttAccepted), Connecting>

Convert into a 0-RTT or 0.5-RTT connection at the cost of weakened security.

-
source

pub async fn handshake_data(&mut self) -> Result<Box<dyn Any>, ConnectionError>

Parameters negotiated during the handshake

-
source

pub fn local_ip(&self) -> Option<IpAddr>

The local IP address which was used when the peer established the connection.

-
source

pub fn remote_address(&self) -> SocketAddr

The peer’s UDP address.

-
source

pub async fn alpn(&mut self) -> Result<Vec<u8>, Error>

Extracts the ALPN protocol from the peer’s handshake data.

-

Trait Implementations§

source§

impl Debug for Connecting

source§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
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

source

pub fn into_0rtt(self) -> Result<(Connection, ZeroRttAccepted), Connecting>

Convert into a 0-RTT or 0.5-RTT connection at the cost of weakened security.

+
source

pub async fn handshake_data(&mut self) -> Result<Box<dyn Any>, ConnectionError>

Parameters negotiated during the handshake

+
source

pub fn local_ip(&self) -> Option<IpAddr>

The local IP address which was used when the peer established the connection.

+
source

pub fn remote_address(&self) -> SocketAddr

The peer’s UDP address.

+
source

pub async fn alpn(&mut self) -> Result<Vec<u8>, Error>

Extracts the ALPN protocol from the peer’s handshake data.

+

Trait Implementations§

source§

impl Debug for Connecting

source§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Future for Connecting

§

type Output = Result<Connection, ConnectionError>

The type of value produced on completion.
source§

fn poll( self: Pin<&mut Connecting>, cx: &mut Context<'_> ) -> Poll<<Connecting as Future>::Output>

Attempt to resolve the future to a final value, registering -the current task for wakeup if the value is not yet available. Read more
source§

impl<'pin> Unpin for Connecting
where +the current task for wakeup if the value is not yet available. Read more

source§

impl<'pin> Unpin for Connecting
where __Connecting<'pin>: Unpin,

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where 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

Struct iroh::net::endpoint::Endpoint

source ·
pub struct Endpoint { /* private fields */ }
Expand description

Controls an iroh-net node, establishing connections with other nodes.

+Endpoint in iroh::net::endpoint - Rust

Struct iroh::net::endpoint::Endpoint

source ·
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

source

pub fn builder() -> Builder

Returns the builder for an Endpoint, with a production configuration.

-
source

pub fn set_alpns(&self, alpns: Vec<Vec<u8>>) -> Result<(), Error>

Sets the list of accepted ALPN protocols.

+

Implementations§

source§

impl Endpoint

source

pub fn builder() -> Builder

Returns the builder for an Endpoint, with a production configuration.

+
source

pub fn set_alpns(&self, alpns: Vec<Vec<u8>>) -> Result<(), Error>

Sets the list of accepted ALPN protocols.

This will only affect new incoming connections. Note that this overrides the current list of ALPNs.

-
source

pub async fn connect( +

source

pub 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.

-

source

pub async fn connect_by_node_id( +

source

pub 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.

-

source

pub fn accept(&self) -> Accept<'_> ⓘ

Accepts an incoming connection on the endpoint.

+
source

pub 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.

-
source

pub fn add_node_addr(&self, node_addr: NodeAddr) -> Result<(), Error>

Informs this Endpoint about addresses of the iroh-net node.

+
source

pub 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.

-
source

pub fn add_node_addr_with_source( +

source

pub fn add_node_addr_with_source( &self, node_addr: NodeAddr, source: &'static str @@ -77,15 +77,15 @@ used for logging exclusively and will not be stored.

§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.

-

source

pub fn secret_key(&self) -> &SecretKey

Returns the secret_key of this endpoint.

-
source

pub fn node_id(&self) -> PublicKey

Returns the node id of this endpoint.

+
source

pub fn secret_key(&self) -> &SecretKey

Returns the secret_key of this endpoint.

+
source

pub 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.

-
source

pub async fn node_addr(&self) -> Result<NodeAddr, Error>

Returns the current NodeAddr for this endpoint.

+
source

pub 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.

-
source

pub fn home_relay(&self) -> Option<RelayUrl>

Returns the RelayUrl of the Relay server used as home relay.

+
source

pub 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.

-
source

pub fn watch_home_relay(&self) -> impl Stream<Item = RelayUrl>

Watches for changes to the home relay.

+
source

pub 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.

-
source

pub fn direct_addresses(&self) -> DirectAddrsStream

Returns the direct addresses of this Endpoint.

+
source

pub 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;
-
source

pub fn bound_sockets(&self) -> (SocketAddr, Option<SocketAddr>)

Returns the local socket addresses on which the underlying sockets are bound.

+
source

pub 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.

-
source

pub fn remote_info(&self, node_id: PublicKey) -> Option<RemoteInfo>

Returns information about the remote node identified by a NodeId.

+
source

pub 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.

-
source

pub fn remote_info_iter(&self) -> impl Iterator<Item = RemoteInfo>

Returns information about all the remote nodes this Endpoint knows about.

+
source

pub 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.

-
source

pub fn conn_type_stream( +

source

pub 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.

-
source

pub fn dns_resolver( +

source

pub fn dns_resolver( &self ) -> &AsyncResolver<GenericConnector<TokioRuntimeProvider>>

Returns the DNS resolver used in this Endpoint.

See Builder::discovery.

-
source

pub fn discovery(&self) -> Option<&dyn Discovery>

Returns the discovery mechanism, if configured.

+
source

pub fn discovery(&self) -> Option<&dyn Discovery>

Returns the discovery mechanism, if configured.

See Builder::dns_resolver.

-
source

pub async fn network_change(&self)

Notifies the system of potential network changes.

+
source

pub 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.

-
source

pub async fn close(self, error_code: VarInt, reason: &[u8]) -> Result<(), Error>

Closes the QUIC endpoint and the magic socket.

+
source

pub 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§

source§

impl Clone for Endpoint

source§

fn clone(&self) -> Endpoint

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Endpoint

source§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

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§

source§

impl<T> Any for T
where +

Trait Implementations§

source§

impl Clone for Endpoint

source§

fn clone(&self) -> Endpoint

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Endpoint

source§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

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§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where 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

Struct iroh::net::endpoint::Incoming

source ·
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

Struct iroh::net::endpoint::Incoming

source ·
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

source

pub fn accept(self) -> Result<Connecting, ConnectionError>

Attempts to accept this incoming connection (an error may still occur).

+

Implementations§

source§

impl Incoming

source

pub 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.

-
source

pub fn accept_with( +

source

pub fn accept_with( self, server_config: Arc<ServerConfig> ) -> Result<Connecting, ConnectionError>

Accepts this incoming connection using a custom configuration.

See accept() for more details.

-
source

pub fn refuse(self)

Rejects this incoming connection attempt.

-
source

pub fn retry(self) -> Result<(), RetryError>

Responds with a retry packet.

+
source

pub fn refuse(self)

Rejects this incoming connection attempt.

+
source

pub 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.

-
source

pub fn ignore(self)

Ignores this incoming connection attempt, not sending any packet in response.

-
source

pub fn local_ip(&self) -> Option<IpAddr>

Returns the local IP address which was used when the peer established the +

source

pub fn ignore(self)

Ignores this incoming connection attempt, not sending any packet in response.

+
source

pub fn local_ip(&self) -> Option<IpAddr>

Returns the local IP address which was used when the peer established the connection.

-
source

pub fn remote_address(&self) -> SocketAddr

Returns the peer’s UDP address.

-
source

pub fn remote_address_validated(&self) -> bool

Whether the socket address that is initiating this connection has been validated.

+
source

pub fn remote_address(&self) -> SocketAddr

Returns the peer’s UDP address.

+
source

pub 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 Debug for Incoming

source§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
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 more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +

Trait Implementations§

source§

impl Debug for Incoming

source§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
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 more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where 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§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
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§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Future for IncomingFuture

§

type Output = Result<Connection, ConnectionError>

The type of value produced on completion.
source§

fn poll( self: Pin<&mut IncomingFuture>, cx: &mut Context<'_> ) -> Poll<<IncomingFuture as Future>::Output>

Attempt to resolve the future to a final value, registering -the current task for wakeup if the value is not yet available. Read more
source§

impl<'pin> Unpin for IncomingFuture
where +the current task for wakeup if the value is not yet available. Read more

source§

impl<'pin> Unpin for IncomingFuture
where __IncomingFuture<'pin>: Unpin,

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where 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

Struct iroh::net::Endpoint

source ·
pub struct Endpoint { /* private fields */ }
Expand description

Controls an iroh-net node, establishing connections with other nodes.

+Endpoint in iroh::net - Rust

Struct iroh::net::Endpoint

source ·
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

source

pub fn builder() -> Builder

Returns the builder for an Endpoint, with a production configuration.

-
source

pub fn set_alpns(&self, alpns: Vec<Vec<u8>>) -> Result<(), Error>

Sets the list of accepted ALPN protocols.

+

Implementations§

source§

impl Endpoint

source

pub fn builder() -> Builder

Returns the builder for an Endpoint, with a production configuration.

+
source

pub fn set_alpns(&self, alpns: Vec<Vec<u8>>) -> Result<(), Error>

Sets the list of accepted ALPN protocols.

This will only affect new incoming connections. Note that this overrides the current list of ALPNs.

-
source

pub async fn connect( +

source

pub 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.

-

source

pub async fn connect_by_node_id( +

source

pub 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.

-

source

pub fn accept(&self) -> Accept<'_> ⓘ

Accepts an incoming connection on the endpoint.

+
source

pub 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.

-
source

pub fn add_node_addr(&self, node_addr: NodeAddr) -> Result<(), Error>

Informs this Endpoint about addresses of the iroh-net node.

+
source

pub 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.

-
source

pub fn add_node_addr_with_source( +

source

pub fn add_node_addr_with_source( &self, node_addr: NodeAddr, source: &'static str @@ -77,15 +77,15 @@ used for logging exclusively and will not be stored.

§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.

-

source

pub fn secret_key(&self) -> &SecretKey

Returns the secret_key of this endpoint.

-
source

pub fn node_id(&self) -> PublicKey

Returns the node id of this endpoint.

+
source

pub fn secret_key(&self) -> &SecretKey

Returns the secret_key of this endpoint.

+
source

pub 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.

-
source

pub async fn node_addr(&self) -> Result<NodeAddr, Error>

Returns the current NodeAddr for this endpoint.

+
source

pub 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.

-
source

pub fn home_relay(&self) -> Option<RelayUrl>

Returns the RelayUrl of the Relay server used as home relay.

+
source

pub 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.

-
source

pub fn watch_home_relay(&self) -> impl Stream<Item = RelayUrl>

Watches for changes to the home relay.

+
source

pub 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.

-
source

pub fn direct_addresses(&self) -> DirectAddrsStream

Returns the direct addresses of this Endpoint.

+
source

pub 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;
-
source

pub fn bound_sockets(&self) -> (SocketAddr, Option<SocketAddr>)

Returns the local socket addresses on which the underlying sockets are bound.

+
source

pub 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.

-
source

pub fn remote_info(&self, node_id: PublicKey) -> Option<RemoteInfo>

Returns information about the remote node identified by a NodeId.

+
source

pub 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.

-
source

pub fn remote_info_iter(&self) -> impl Iterator<Item = RemoteInfo>

Returns information about all the remote nodes this Endpoint knows about.

+
source

pub 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.

-
source

pub fn conn_type_stream( +

source

pub 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.

-
source

pub fn dns_resolver( +

source

pub fn dns_resolver( &self ) -> &AsyncResolver<GenericConnector<TokioRuntimeProvider>>

Returns the DNS resolver used in this Endpoint.

See Builder::discovery.

-
source

pub fn discovery(&self) -> Option<&dyn Discovery>

Returns the discovery mechanism, if configured.

+
source

pub fn discovery(&self) -> Option<&dyn Discovery>

Returns the discovery mechanism, if configured.

See Builder::dns_resolver.

-
source

pub async fn network_change(&self)

Notifies the system of potential network changes.

+
source

pub 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.

-
source

pub async fn close(self, error_code: VarInt, reason: &[u8]) -> Result<(), Error>

Closes the QUIC endpoint and the magic socket.

+
source

pub 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§

source§

impl Clone for Endpoint

source§

fn clone(&self) -> Endpoint

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Endpoint

source§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

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§

source§

impl<T> Any for T
where +

Trait Implementations§

source§

impl Clone for Endpoint

source§

fn clone(&self) -> Endpoint

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Endpoint

source§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

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§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where 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

source

pub 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.

source

pub async fn queue(&self, request: DownloadRequest) -> DownloadHandle ⓘ

Queue a download.

source

pub async fn cancel(&self, handle: DownloadHandle)

Cancel a download.

-
source

pub async fn nodes_have(&mut self, hash: Hash, nodes: Vec<NodeId>)

Declare that certain nodes can be used to download a hash.

+
source

pub 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 more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Downloader

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto 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 T
where 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§

source

type Connection: Clone + 'static

Type of connections returned by the Dialer.

-

Required Methods§

source

fn queue_dial(&mut self, node_id: NodeId)

Dial a node.

+

Required Methods§

source

fn queue_dial(&mut self, node_id: NodeId)

Dial a node.

source

fn pending_count(&self) -> usize

Get the number of dialing nodes.

-
source

fn is_pending(&self, node: NodeId) -> bool

Check if a node is being dialed.

-
source

fn node_id(&self) -> NodeId

Get the node id of our node.

-

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 +

source

fn is_pending(&self, node: NodeId) -> bool

Check if a node is being dialed.

+
source

fn node_id(&self) -> NodeId

Get the node id of our node.

+

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§

§

Raw

Raw blob

§

HashSeq

A sequence of BLAKE3 hashes

-

Implementations§

§

impl BlobFormat

pub const fn is_raw(&self) -> bool

Is raw format

-

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 more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for BlobFormat

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

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

source

pub const fn is_raw(&self) -> bool

Is raw format

+
source

pub const fn is_hash_seq(&self) -> bool

Is hash seq format

+

Trait Implementations§

source§

impl Clone for BlobFormat

source§

fn clone(&self) -> BlobFormat

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for BlobFormat

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Default for BlobFormat

source§

fn default() -> BlobFormat

Returns the “default value” for a type. Read more
source§

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

§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Hash for BlobFormat

§

fn hash<__H>(&self, state: &mut __H)
where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for BlobFormat

source§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Hash for BlobFormat

source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, - Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

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

§

fn cmp(&self, other: &BlobFormat) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
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

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where - Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
§

impl PartialEq for BlobFormat

§

fn eq(&self, other: &BlobFormat) -> bool

This method tests for self and other values to be equal, and is used + Self: Sized + PartialOrd,
Restrict a value to a certain interval. Read more
source§

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 ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
§

impl PartialOrd for BlobFormat

§

fn partial_cmp(&self, other: &BlobFormat) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
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 <= +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for BlobFormat

source§

fn partial_cmp(&self, other: &BlobFormat) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
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 more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
§

impl Serialize for BlobFormat

§

fn serialize<__S>( +operator. Read more

source§

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§

Blanket Implementations§

source§

impl<T> Any for T
where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Copy for BlobFormat

source§

impl Eq for BlobFormat

source§

impl StructuralPartialEq for BlobFormat

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where 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

Fields

§id: u64

Unique id of the entry that is being exported.

§

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 more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ExportProgress

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
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 more
source§

impl Serialize for ExportProgress

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where 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.

Fields

§id: u64

The unique id of the entry.

§

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 more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for DownloadProgress

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
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 more
source§

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: Counter

Trait Implementations§

source§

impl Clone for Metrics

source§

fn clone(&self) -> Metrics

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Metrics

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Metrics

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Iterable for Metrics

source§

fn iter<'a>(&'a self) -> IntoIter<(&'static str, &'a dyn Any)>

Returns an iterator over the struct’s fields as tuples. Read more
source§

impl Metric for Metrics

source§

fn name() -> &'static str

The name of this metric group.
§

fn new(registry: &mut Registry) -> Self

Initializes this metric group.
§

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: Counter

Trait Implementations§

source§

impl Clone for Metrics

source§

fn clone(&self) -> Metrics

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Metrics

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Metrics

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Iterable for Metrics

source§

fn iter<'a>(&'a self) -> IntoIter<(&'static str, &'a dyn Any)>

Returns an iterator over the struct’s fields as tuples. Read more
source§

impl Metric for Metrics

source§

fn name() -> &'static str

The name of this metric group.
source§

fn new(registry: &mut Registry) -> Self

Initializes this metric group.
source§

fn with_metric<T, F>(f: F)
where F: FnOnce(&Self) -> T,

Access to this metrics group to record a metric. -Only records if this metric is registered in the global registry.
§

fn try_get() -> Option<&'static Self>

Attempts to get the current metric from the global registry.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +Only records if this metric is registered in the global registry.

source§

fn try_get() -> Option<&'static Self>

Attempts to get the current metric from the global registry.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where 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

§id: u64

A new unique id for this entry.

@@ -33,7 +33,7 @@

Fields

§hash: Hash

The hash of the created data.

§format: BlobFormat

The format of the added data.

§tag: Tag

The tag of the added data.

-
§

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 Debug for AddProgress

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
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 more
source§

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

§size: u64

The size of the entry in bytes.

@@ -16,7 +16,7 @@

Fields

§offset: u64

The offset of the progress, in bytes.

§

Done

We are done, and the hash is hash.

Fields

§hash: Hash

The hash of the entry.

-
§

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 Debug for BatchAddPathProgress

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
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 more
source§

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§

§

Start

Consistency check started

§

Update

Consistency check update

@@ -14,7 +14,7 @@
§entry: Option<Hash>

The entry this message is about, if any

§level: ReportLevel

The 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§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
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 more
source§

impl Serialize for ConsistencyCheckProgress

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where 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: u64

The total number of entries to validate

@@ -62,7 +62,7 @@ Otherwise it might be an url or something else to uniquely identify the entry.

Fields

§id: u64

The unique id of the entry.

§ranges: RangeSpec

Available ranges.

§

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§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
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 more
source§

impl Serialize for ValidateProgress

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where 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 EMPTY: Hash = _

The hash for the empty byte range (b"").

-

pub fn new(buf: impl AsRef<[u8]>) -> Hash

Calculate the hash of the provided bytes.

-

pub fn as_bytes(&self) -> &[u8; 32]

Bytes of the hash.

-

pub const fn from_bytes(bytes: [u8; 32]) -> Hash

Create a Hash from its raw bytes representation.

-

pub fn to_hex(&self) -> String

Convert the hash to a hex string.

-

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§

source§

impl Hash

source

pub const EMPTY: Hash = _

The hash for the empty byte range (b"").

+
source

pub fn new(buf: impl AsRef<[u8]>) -> Hash

Calculate the hash of the provided bytes.

+
source

pub fn as_bytes(&self) -> &[u8; 32]

Bytes of the hash.

+
source

pub const fn from_bytes(bytes: [u8; 32]) -> Hash

Create a Hash from its raw bytes representation.

+
source

pub fn to_hex(&self) -> String

Convert the hash to a hex string.

+
source

pub fn fmt_short(&self) -> String

Convert to a base32 string limited to the first 10 bytes for a friendly string representation of the hash.

-

Trait Implementations§

§

impl AsRef<[u8]> for Hash

§

fn as_ref(&self) -> &[u8] ⓘ

Converts this type into a shared reference of the (usually inferred) input type.
§

impl Borrow<[u8]> for Hash

§

fn borrow(&self) -> &[u8] ⓘ

Immutably borrows from an owned value. Read more
§

impl Borrow<[u8; 32]> for Hash

§

fn borrow(&self) -> &[u8; 32]

Immutably borrows from an owned value. Read more
§

impl Clone for Hash

§

fn clone(&self) -> Hash

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for Hash

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<'de> Deserialize<'de> for Hash

§

fn deserialize<D>( +

Trait Implementations§

source§

impl AsRef<[u8]> for Hash

source§

fn as_ref(&self) -> &[u8] ⓘ

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Borrow<[u8]> for Hash

source§

fn borrow(&self) -> &[u8] ⓘ

Immutably borrows from an owned value. Read more
source§

impl Borrow<[u8; 32]> for Hash

source§

fn borrow(&self) -> &[u8; 32]

Immutably borrows from an owned value. Read more
source§

impl Clone for Hash

source§

fn clone(&self) -> Hash

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Hash

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
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 more
§

impl Display for Hash

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl From<&[u8; 32]> for Hash

§

fn from(value: &[u8; 32]) -> Hash

Converts to this type from the input type.
§

impl From<[u8; 32]> for Hash

§

fn from(value: [u8; 32]) -> Hash

Converts to this type from the input type.
§

impl From<Hash> for [u8; 32]

§

fn from(value: Hash) -> [u8; 32]

Converts to this type from the input type.
§

impl From<Hash> for Hash

§

fn from(value: Hash) -> Hash

Converts to this type from the input type.
source§

impl FromIterator<Hash> for HashSeq

source§

fn from_iter<T: IntoIterator<Item = Hash>>(iter: T) -> Self

Creates a value from an iterator. Read more
§

impl FromStr for Hash

§

type Err = HexOrBase32ParseError

The associated error which can be returned from parsing.
§

fn from_str(s: &str) -> Result<Hash, <Hash as FromStr>::Err>

Parses a string s to return a value of this type. Read more
§

impl Hash for Hash

§

fn hash<__H>(&self, state: &mut __H)
where + D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for Hash

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl From<&[u8; 32]> for Hash

source§

fn from(value: &[u8; 32]) -> Hash

Converts to this type from the input type.
source§

impl From<[u8; 32]> for Hash

source§

fn from(value: [u8; 32]) -> Hash

Converts to this type from the input type.
source§

impl From<Hash> for [u8; 32]

source§

fn from(value: Hash) -> [u8; 32]

Converts to this type from the input type.
source§

impl From<Hash> for Hash

source§

fn from(value: Hash) -> Hash

Converts to this type from the input type.
source§

impl FromIterator<Hash> for HashSeq

source§

fn from_iter<T: IntoIterator<Item = Hash>>(iter: T) -> Self

Creates a value from an iterator. Read more
source§

impl FromStr for Hash

§

type Err = HexOrBase32ParseError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Hash, <Hash as FromStr>::Err>

Parses a string s to return a value of this type. Read more
source§

impl Hash for Hash

source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, - Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl Key for Hash

§

fn compare(data1: &[u8], data2: &[u8]) -> Ordering

Compare data1 with data2
§

impl MaxSize for Hash

§

const POSTCARD_MAX_SIZE: usize = 32usize

The maximum possible size that the serialization of this -type can have, in bytes.
§

impl Ord for Hash

§

fn cmp(&self, other: &Hash) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Key for Hash

source§

fn compare(data1: &[u8], data2: &[u8]) -> Ordering

Compare data1 with data2
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§

fn cmp(&self, other: &Hash) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where - Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
§

impl PartialEq for Hash

§

fn eq(&self, other: &Hash) -> bool

This method tests for self and other values to be equal, and is used + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more

source§

impl PartialEq for Hash

source§

fn eq(&self, other: &Hash) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
§

impl PartialOrd for Hash

§

fn partial_cmp(&self, other: &Hash) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
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 <= +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Hash

source§

fn partial_cmp(&self, other: &Hash) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
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 more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
§

impl Serialize for Hash

§

fn serialize<S>( +operator. Read more

source§

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 more
source§

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
source§

fn from_bytes<'a>(data: &'a [u8]) -> <Hash as Value>::SelfType<'a>
where Hash: 'a,

Deserializes data -Implementations may return a view over data, or an owned type
§

fn as_bytes<'a, 'b>( +Implementations may return a view over data, or an owned type

source§

fn as_bytes<'a, 'b>( value: &'a <Hash as Value>::SelfType<'b> ) -> <Hash as Value>::AsBytes<'a>
where 'b: 'a, - Hash: 'a + 'b,

Serialize the value to a slice
§

fn type_name() -> TypeName

Globally unique identifier for this type

§

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<T> Any for T
where + Hash: 'a + 'b,

Serialize the value to a slice
source§

fn type_name() -> TypeName

Globally unique identifier for this type
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§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<A, T> AsBits<T> for A
where A: AsRef<[T]>, T: BitStore,

§

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: Hash

The hash

§format: BlobFormat

The 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 more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for HashAndFormat

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<'de> Deserialize<'de> for HashAndFormat

§

fn deserialize<D>( +

Implementations§

source§

impl HashAndFormat

source

pub fn new(hash: Hash, format: BlobFormat) -> HashAndFormat

Create a new hash and format pair.

+
source

pub fn raw(hash: Hash) -> HashAndFormat

Create a new hash and format pair, using the default (raw) format.

+
source

pub 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 more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for HashAndFormat

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
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

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
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

§

type Err = Error

The associated error which can be returned from parsing.
§

fn from_str(s: &str) -> Result<HashAndFormat, <HashAndFormat as FromStr>::Err>

Parses a string s to return a value of this type. Read more
§

impl Hash for HashAndFormat

§

fn hash<__H>(&self, state: &mut __H)
where + D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for HashAndFormat

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
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

§

type Err = Error

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<HashAndFormat, <HashAndFormat as FromStr>::Err>

Parses a string s to return a value of this type. Read more
source§

impl Hash for HashAndFormat

source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, - Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

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

§

fn cmp(&self, other: &HashAndFormat) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
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

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where - Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
§

impl PartialEq for HashAndFormat

§

fn eq(&self, other: &HashAndFormat) -> bool

This method tests for self and other values to be equal, and is used + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

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 ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
§

impl PartialOrd for HashAndFormat

§

fn partial_cmp(&self, other: &HashAndFormat) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
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 <= +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for HashAndFormat

source§

fn partial_cmp(&self, other: &HashAndFormat) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
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 more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
§

impl Serialize for HashAndFormat

§

fn serialize<S>( +operator. Read more

source§

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 more
source§

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 width
source§

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 type
§

fn as_bytes<'a, 'b>( +Implementations may return a view over data, or an owned type

source§

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
§

fn type_name() -> TypeName

Globally unique identifier for this type

§

impl Copy for HashAndFormat

§

impl Eq for HashAndFormat

§

impl StructuralPartialEq for HashAndFormat

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + HashAndFormat: 'a + 'b,

Serialize the value to a slice
source§

fn type_name() -> TypeName

Globally unique identifier for this type
source§

impl Copy for HashAndFormat

source§

impl Eq for HashAndFormat

source§

impl StructuralPartialEq for HashAndFormat

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where 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

Struct iroh_docs::metrics::Metrics

source ·
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: Counter

Trait Implementations§

source§

impl Clone for Metrics

source§

fn clone(&self) -> Metrics

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Metrics

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Metrics

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Iterable for Metrics

source§

fn iter<'a>(&'a self) -> IntoIter<(&'static str, &'a dyn Any)> ⓘ

Returns an iterator over the struct’s fields as tuples. Read more
source§

impl Metric for Metrics

source§

fn name() -> &'static str

The name of this metric group.
§

fn new(registry: &mut Registry) -> Self

Initializes this metric group.
§

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: Counter

Trait Implementations§

source§

impl Clone for Metrics

source§

fn clone(&self) -> Metrics

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Metrics

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Metrics

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Iterable for Metrics

source§

fn iter<'a>(&'a self) -> IntoIter<(&'static str, &'a dyn Any)> ⓘ

Returns an iterator over the struct’s fields as tuples. Read more
source§

impl Metric for Metrics

source§

fn name() -> &'static str

The name of this metric group.
source§

fn new(registry: &mut Registry) -> Self

Initializes this metric group.
source§

fn with_metric<T, F>(f: F)
where F: FnOnce(&Self) -> T,

Access to this metrics group to record a metric. -Only records if this metric is registered in the global registry.
§

fn try_get() -> Option<&'static Self>

Attempts to get the current metric from the global registry.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +Only records if this metric is registered in the global registry.

source§

fn try_get() -> Option<&'static Self>

Attempts to get the current metric from the global registry.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where 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: Counter

Trait Implementations§

source§

impl Clone for Metrics

source§

fn clone(&self) -> Metrics

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Metrics

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Metrics

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Iterable for Metrics

source§

fn iter<'a>(&'a self) -> IntoIter<(&'static str, &'a dyn Any)>

Returns an iterator over the struct’s fields as tuples. Read more
source§

impl Metric for Metrics

source§

fn name() -> &'static str

The name of this metric group.
§

fn new(registry: &mut Registry) -> Self

Initializes this metric group.
§

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: Counter

Trait Implementations§

source§

impl Clone for Metrics

source§

fn clone(&self) -> Metrics

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Metrics

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Metrics

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Iterable for Metrics

source§

fn iter<'a>(&'a self) -> IntoIter<(&'static str, &'a dyn Any)>

Returns an iterator over the struct’s fields as tuples. Read more
source§

impl Metric for Metrics

source§

fn name() -> &'static str

The name of this metric group.
source§

fn new(registry: &mut Registry) -> Self

Initializes this metric group.
source§

fn with_metric<T, F>(f: F)
where F: FnOnce(&Self) -> T,

Access to this metrics group to record a metric. -Only records if this metric is registered in the global registry.
§

fn try_get() -> Option<&'static Self>

Attempts to get the current metric from the global registry.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +Only records if this metric is registered in the global registry.

source§

fn try_get() -> Option<&'static Self>

Attempts to get the current metric from the global registry.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where 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 Debug for Command

source§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
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 more
source§

impl Serialize for Command

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where 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 more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for GossipEvent

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
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 more
source§

impl From<Event<PublicKey>> for GossipEvent

source§

fn from(event: Event<NodeId>) -> Self

Converts to this type from the input type.
source§

impl Ord for GossipEvent

source§

fn cmp(&self, other: &GossipEvent) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<Event<PublicKey>> for GossipEvent

source§

fn from(event: Event<NodeId>) -> Self

Converts to this type from the input type.
source§

impl Ord for GossipEvent

source§

fn cmp(&self, other: &GossipEvent) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

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

source

pub 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

source

pub fn max_message_size(&self) -> usize

Get the maximum message size configured for this gossip actor.

source

pub async fn handle_connection(&self, conn: Connection) -> Result<()>

Handle an incoming [Connection].

@@ -21,7 +21,7 @@ gossip actor through
source

pub 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.

source

pub 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

source

pub fn neighbors(&self) -> impl Iterator<Item = NodeId> + '_

Lists our current direct neighbors.

+

Implementations§

source§

impl GossipReceiver

source

pub fn neighbors(&self) -> impl Iterator<Item = NodeId> + '_

Lists our current direct neighbors.

source

pub 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

source

pub async fn broadcast(&self, message: Bytes) -> Result<()>

Broadcast a message to all nodes.

source

pub async fn broadcast_neighbors(&self, message: Bytes) -> Result<()>

Broadcast a message to our direct neighbors.

-
source

pub async fn join_peers(&self, peers: Vec<NodeId>) -> Result<()>

Join a set of peers.

+
source

pub async fn join_peers(&self, peers: Vec<NodeId>) -> Result<()>

Join a set of peers.

Trait Implementations§

source§

impl Debug for GossipSender

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where 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: usize

The 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

source

pub fn with_bootstrap(nodes: impl IntoIterator<Item = NodeId>) -> Self

Creates JoinOptions with the provided bootstrap nodes and the default subscription +

Implementations§

source§

impl JoinOptions

source

pub 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§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
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 more
source§

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: Bytes

The content of the message

§scope: DeliveryScope

The scope of the message. This tells us if the message is from a direct neighbor or actual gossip.

-
§delivered_from: NodeId

The node that delivered the message. This is not the same as the original author.

+
§delivered_from: NodeId

The node that delivered the message. This is not the same as the original author.

Trait Implementations§

source§

impl Clone for Message

source§

fn clone(&self) -> Message

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Message

source§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
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 more
source§

impl Ord for Message

source§

fn cmp(&self, other: &Message) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where 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

Type Alias iroh_gossip::net::ProtoEvent

source ·
pub type ProtoEvent = Event<PublicKey>;
Available on crate feature net only.
Expand description

Events emitted from the gossip protocol

+ProtoEvent in iroh_gossip::net - Rust

Type Alias iroh_gossip::net::ProtoEvent

source ·
pub type ProtoEvent = Event<PublicKey>;
Available on crate feature net only.
Expand description

Events emitted from the gossip protocol

Aliased Type§

enum ProtoEvent {
-    NeighborUp(PublicKey),
-    NeighborDown(PublicKey),
-    Received(GossipEvent<PublicKey>),
-}

Variants§

§

NeighborUp(PublicKey)

We have a new, direct neighbor in the swarm membership layer for this topic

-
§

NeighborDown(PublicKey)

We dropped direct neighbor in the swarm membership layer for this topic

-
§

Received(GossipEvent<PublicKey>)

A gossip message was received for this topic

+ NeighborUp(PublicKey), + NeighborDown(PublicKey), + Received(GossipEvent<PublicKey>), +}

Variants§

§

NeighborUp(PublicKey)

We have a new, direct neighbor in the swarm membership layer for this topic

+
§

NeighborDown(PublicKey)

We dropped direct neighbor in the swarm membership layer for this topic

+
§

Received(GossipEvent<PublicKey>)

A gossip message was received for this topic

\ No newline at end of file diff --git a/pr/2778/docs/iroh_gossip/net/util/fn.read_message.html b/pr/2778/docs/iroh_gossip/net/util/fn.read_message.html index af93364bd0..78d19d74ef 100644 --- a/pr/2778/docs/iroh_gossip/net/util/fn.read_message.html +++ b/pr/2778/docs/iroh_gossip/net/util/fn.read_message.html @@ -2,5 +2,5 @@ reader: impl AsyncRead + Unpin, buffer: &mut BytesMut, max_message_size: usize -) -> Result<Option<Message<PublicKey>>>
Available on crate feature net only.
Expand description

Read a length-prefixed message and decode as ProtoMessage;

+) -> Result<Option<Message<PublicKey>>>
Available on crate feature net only.
Expand description

Read a length-prefixed message and decode as ProtoMessage;

\ No newline at end of file diff --git a/pr/2778/docs/iroh_gossip/net/util/fn.write_message.html b/pr/2778/docs/iroh_gossip/net/util/fn.write_message.html index 8604a776cf..19d9f2fdf5 100644 --- a/pr/2778/docs/iroh_gossip/net/util/fn.write_message.html +++ b/pr/2778/docs/iroh_gossip/net/util/fn.write_message.html @@ -1,7 +1,7 @@ write_message in iroh_gossip::net::util - Rust

Function iroh_gossip::net::util::write_message

source ·
pub async fn write_message<W: AsyncWrite + Unpin>(
     writer: &mut W,
     buffer: &mut BytesMut,
-    frame: &Message<PublicKey>,
+    frame: &Message<PublicKey>,
     max_message_size: usize
 ) -> Result<()>
Available on crate feature net only.
Expand description

Write a ProtoMessage as a length-prefixed, postcard-encoded message.

\ No newline at end of file diff --git a/pr/2778/docs/iroh_gossip/proto/topic/enum.Event.html b/pr/2778/docs/iroh_gossip/proto/topic/enum.Event.html index f9d9618f05..fc6762475d 100644 --- a/pr/2778/docs/iroh_gossip/proto/topic/enum.Event.html +++ b/pr/2778/docs/iroh_gossip/proto/topic/enum.Event.html @@ -8,7 +8,7 @@
§

Received(GossipEvent<PI>)

A gossip message was received for this topic

Trait Implementations§

source§

impl<PI: Clone> Clone for Event<PI>

source§

fn clone(&self) -> Event<PI>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<PI: Debug> Debug for Event<PI>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de, PI> Deserialize<'de> for Event<PI>
where PI: Deserialize<'de>,

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where - __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<Event<PublicKey>> for GossipEvent

Available on crate feature net only.
source§

fn from(event: Event<NodeId>) -> Self

Converts to this type from the input type.
source§

impl<PI: Ord> Ord for Event<PI>

source§

fn cmp(&self, other: &Event<PI>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<Event<PublicKey>> for GossipEvent

Available on crate feature net only.
source§

fn from(event: Event<NodeId>) -> Self

Converts to this type from the input type.
source§

impl<PI: Ord> Ord for Event<PI>

source§

fn cmp(&self, other: &Event<PI>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl<PI: PartialEq> PartialEq for Event<PI>

source§

fn eq(&self, other: &Event<PI>) -> bool

This method tests for self and other values to be equal, and is used diff --git a/pr/2778/docs/iroh_net/endpoint/fn.default_relay_mode.html b/pr/2778/docs/iroh_net/endpoint/fn.default_relay_mode.html index 0f6905c348..729004e4a4 100644 --- a/pr/2778/docs/iroh_net/endpoint/fn.default_relay_mode.html +++ b/pr/2778/docs/iroh_net/endpoint/fn.default_relay_mode.html @@ -1,4 +1,4 @@ -default_relay_mode in iroh_net::endpoint - Rust

Function iroh_net::endpoint::default_relay_mode

source ·
pub fn default_relay_mode() -> RelayMode
Expand description

Returns the default relay mode.

+default_relay_mode in iroh_net::endpoint - Rust

Function iroh_net::endpoint::default_relay_mode

source ·
pub fn default_relay_mode() -> RelayMode
Expand description

Returns the default relay mode.

If the IROH_FORCE_STAGING_RELAYS environment variable is non empty, it will return RelayMode::Staging. Otherwise, it will return RelayMode::Default.

\ No newline at end of file diff --git a/pr/2778/docs/iroh_net/endpoint/fn.get_remote_node_id.html b/pr/2778/docs/iroh_net/endpoint/fn.get_remote_node_id.html index 2c95fb2feb..5d412a5d47 100644 --- a/pr/2778/docs/iroh_net/endpoint/fn.get_remote_node_id.html +++ b/pr/2778/docs/iroh_net/endpoint/fn.get_remote_node_id.html @@ -1,2 +1,2 @@ -get_remote_node_id in iroh_net::endpoint - Rust

Function iroh_net::endpoint::get_remote_node_id

source ·
pub fn get_remote_node_id(connection: &Connection) -> Result<PublicKey>
Expand description

Extract the PublicKey from the peer’s TLS certificate.

+get_remote_node_id in iroh_net::endpoint - Rust

Function iroh_net::endpoint::get_remote_node_id

source ·
pub fn get_remote_node_id(connection: &Connection) -> Result<PublicKey>
Expand description

Extract the PublicKey from the peer’s TLS certificate.

\ No newline at end of file diff --git a/pr/2778/docs/iroh_net/endpoint/fn.make_server_config.html b/pr/2778/docs/iroh_net/endpoint/fn.make_server_config.html index 25947fe29a..85e72b01bd 100644 --- a/pr/2778/docs/iroh_net/endpoint/fn.make_server_config.html +++ b/pr/2778/docs/iroh_net/endpoint/fn.make_server_config.html @@ -1,4 +1,4 @@ -make_server_config in iroh_net::endpoint - Rust

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/index.html b/pr/2778/docs/iroh_net/endpoint/index.html
index 6b36ff7bfc..bfbf3956c7 100644
--- a/pr/2778/docs/iroh_net/endpoint/index.html
+++ b/pr/2778/docs/iroh_net/endpoint/index.html
@@ -1,4 +1,4 @@
-iroh_net::endpoint - Rust

Module iroh_net::endpoint

source ·
Expand description

The Endpoint allows establishing connections to other iroh-net nodes.

+iroh_net::endpoint - Rust

Module iroh_net::endpoint

source ·
Expand description

The Endpoint allows establishing connections to other iroh-net nodes.

The Endpoint is the main API interface to manage a local iroh-net node. It allows connecting to and accepting connections from other nodes. See the module docs for more details on how iroh-net connections work.

diff --git a/pr/2778/docs/iroh_net/endpoint/struct.Accept.html b/pr/2778/docs/iroh_net/endpoint/struct.Accept.html index 22ac1982fe..a8c21e2615 100644 --- a/pr/2778/docs/iroh_net/endpoint/struct.Accept.html +++ b/pr/2778/docs/iroh_net/endpoint/struct.Accept.html @@ -1,6 +1,6 @@ -Accept in iroh_net::endpoint - Rust

Struct iroh_net::endpoint::Accept

source ·
pub struct Accept<'a> { /* private fields */ }
Expand description

Future produced by Endpoint::accept.

-

Trait Implementations§

source§

impl<'a> Debug for Accept<'a>

source§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> Future for Accept<'a>

§

type Output = Option<Incoming>

The type of value produced on completion.
source§

fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>

Attempt to resolve the future to a final value, registering -the current task for wakeup if the value is not yet available. Read more
source§

impl<'pin, 'a> Unpin for Accept<'a>
where +Accept in iroh_net::endpoint - Rust

Struct iroh_net::endpoint::Accept

source ·
pub struct Accept<'a> { /* private fields */ }
Expand description

Future produced by Endpoint::accept.

+

Trait Implementations§

source§

impl<'a> Debug for Accept<'a>

source§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> Future for Accept<'a>

§

type Output = Option<Incoming>

The type of value produced on completion.
source§

fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>

Attempt to resolve the future to a final value, registering +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§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where diff --git a/pr/2778/docs/iroh_net/endpoint/struct.AddrInfo.html b/pr/2778/docs/iroh_net/endpoint/struct.AddrInfo.html index 2e05a33802..b2150c2a65 100644 --- a/pr/2778/docs/iroh_net/endpoint/struct.AddrInfo.html +++ b/pr/2778/docs/iroh_net/endpoint/struct.AddrInfo.html @@ -1,4 +1,4 @@ -AddrInfo in iroh_net::endpoint - Rust

Struct iroh_net::endpoint::AddrInfo

pub struct AddrInfo {
+AddrInfo in iroh_net::endpoint - Rust

Struct iroh_net::endpoint::AddrInfo

source ·
pub struct AddrInfo {
     pub relay_url: Option<RelayUrl>,
     pub direct_addresses: BTreeSet<SocketAddr>,
 }
Expand description

Network paths to contact an iroh-net node.

@@ -7,26 +7,26 @@ Unless a [discovery service] is used at least one path is required to connect to other node, see NodeAddr for details.

Fields§

§relay_url: Option<RelayUrl>

The node’s home relay url.

§direct_addresses: BTreeSet<SocketAddr>

Socket addresses where the peer might be reached directly.

-

Implementations§

§

impl AddrInfo

pub fn is_empty(&self) -> bool

Returns whether this addressing information is empty.

-

pub fn apply_options(&mut self, opts: AddrInfoOptions)

Applies the options to self.

+

Implementations§

source§

impl AddrInfo

source

pub fn is_empty(&self) -> bool

Returns whether this addressing information is empty.

+
source

pub fn apply_options(&mut self, opts: AddrInfoOptions)

Applies the options to self.

This is used to more tightly control the information stored in ab AddrInfo received from another API. E.g. to ensure a discovery service is used the AddrInfoOptions::Id] option could be used to remove all other addressing details.

-

Trait Implementations§

§

impl Clone for AddrInfo

§

fn clone(&self) -> AddrInfo

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for AddrInfo

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Default for AddrInfo

§

fn default() -> AddrInfo

Returns the “default value” for a type. Read more
§

impl<'de> Deserialize<'de> for AddrInfo

§

fn deserialize<__D>( +

Trait Implementations§

source§

impl Clone for AddrInfo

source§

fn clone(&self) -> AddrInfo

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AddrInfo

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Default for AddrInfo

source§

fn default() -> AddrInfo

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for AddrInfo

source§

fn deserialize<__D>( __deserializer: __D ) -> Result<AddrInfo, <__D as Deserializer<'de>>::Error>
where - __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<NodeInfo> for AddrInfo

source§

fn from(value: NodeInfo) -> Self

Converts to this type from the input type.
§

impl Ord for AddrInfo

§

fn cmp(&self, other: &AddrInfo) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<NodeInfo> for AddrInfo

source§

fn from(value: NodeInfo) -> Self

Converts to this type from the input type.
source§

impl Ord for AddrInfo

source§

fn cmp(&self, other: &AddrInfo) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where - Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
§

impl PartialEq for AddrInfo

§

fn eq(&self, other: &AddrInfo) -> bool

This method tests for self and other values to be equal, and is used + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more

source§

impl PartialEq for AddrInfo

source§

fn eq(&self, other: &AddrInfo) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
§

impl PartialOrd for AddrInfo

§

fn partial_cmp(&self, other: &AddrInfo) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
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 <= +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for AddrInfo

source§

fn partial_cmp(&self, other: &AddrInfo) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
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 more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
§

impl Serialize for AddrInfo

§

fn serialize<__S>( +operator. Read more

source§

impl Serialize for AddrInfo

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 Eq for AddrInfo

§

impl StructuralPartialEq for AddrInfo

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for AddrInfo

source§

impl StructuralPartialEq for AddrInfo

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( diff --git a/pr/2778/docs/iroh_net/endpoint/struct.Builder.html b/pr/2778/docs/iroh_net/endpoint/struct.Builder.html index 09fbed6c51..82d1dfb506 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

Struct iroh_net::endpoint::Builder

source ·
pub struct Builder { /* private fields */ }
Expand description

Builder for Endpoint.

+Builder in iroh_net::endpoint - Rust

Struct iroh_net::endpoint::Builder

source ·
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

source

pub async fn bind(self) -> Result<Endpoint>

Binds the magic endpoint.

-
source

pub fn bind_addr_v4(self, addr: SocketAddrV4) -> Self

Sets the IPv4 bind address.

+

Implementations§

source§

impl Builder

source

pub async fn bind(self) -> Result<Endpoint>

Binds the magic endpoint.

+
source

pub fn bind_addr_v4(self, addr: SocketAddrV4) -> Self

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.

-
source

pub fn bind_addr_v6(self, addr: SocketAddrV6) -> Self

Sets the IPv6 bind address.

+
source

pub fn bind_addr_v6(self, addr: SocketAddrV6) -> Self

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.

-
source

pub fn secret_key(self, secret_key: SecretKey) -> Self

Sets a secret key to authenticate with other peers.

+
source

pub fn secret_key(self, secret_key: SecretKey) -> Self

Sets a secret key to authenticate with other peers.

This secret key’s public key will be the PublicKey of this endpoint and thus also its NodeId

If not set, a new secret key will be generated.

-
source

pub fn alpns(self, alpn_protocols: Vec<Vec<u8>>) -> Self

Sets the ALPN protocols that this endpoint will accept on incoming connections.

+
source

pub fn alpns(self, alpn_protocols: Vec<Vec<u8>>) -> Self

Sets the ALPN protocols that this endpoint will accept on incoming connections.

Not setting this will still allow creating connections, but to accept incoming connections the ALPN must be set.

-
source

pub fn relay_mode(self, relay_mode: RelayMode) -> Self

Sets the relay servers to assist in establishing connectivity.

+
source

pub fn relay_mode(self, relay_mode: RelayMode) -> Self

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.

-
source

pub fn clear_discovery(self) -> Self

Removes all discovery services from the builder.

-
source

pub fn discovery(self, discovery: Box<dyn Discovery>) -> Self

Optionally sets a discovery mechanism for this endpoint.

+
source

pub fn clear_discovery(self) -> Self

Removes all discovery services from the builder.

+
source

pub fn discovery(self, discovery: Box<dyn Discovery>) -> Self

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.

-
source

pub fn add_discovery<F, D>(self, discovery: F) -> Self
where +

source

pub fn add_discovery<F, D>(self, discovery: F) -> Self
where F: FnOnce(&SecretKey) -> Option<D> + Send + Sync + 'static, D: Discovery + 'static,

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.

-
source

pub fn discovery_n0(self) -> Self

Configures the endpoint to use the default n0 DNS discovery service.

+
source

pub fn discovery_n0(self) -> Self

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,45 +56,45 @@ 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.

-
source

pub fn discovery_dht(self) -> Self

Configures the endpoint to also use the mainline DHT with default settings.

+
source

pub fn discovery_dht(self) -> Self

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.

-
source

pub fn discovery_local_network(self) -> Self

Configures the endpoint to also use local network discovery.

+
source

pub fn discovery_local_network(self) -> Self

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.

-
source

pub fn known_nodes(self, nodes: Vec<NodeAddr>) -> Self

Optionally set a list of known nodes.

-
source

pub fn transport_config(self, transport_config: TransportConfig) -> Self

Sets a custom quinn::TransportConfig for this endpoint.

+
source

pub fn known_nodes(self, nodes: Vec<NodeAddr>) -> Self

Optionally set a list of known nodes.

+
source

pub fn transport_config(self, transport_config: TransportConfig) -> Self

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.

-
source

pub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self

Optionally sets a custom DNS resolver to use for this endpoint.

+
source

pub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self

Optionally sets a custom DNS resolver to use for this endpoint.

The DNS resolver is used to resolve relay hostnames, and node addresses if crate::discovery::dns::DnsDiscovery is configured.

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.

-
source

pub fn proxy_url(self, url: Url) -> Self

Sets an explicit proxy url to proxy all HTTP(S) traffic through.

-
source

pub fn proxy_from_env(self) -> Self

Sets the proxy url from the environment, in this order:

+
source

pub fn proxy_url(self, url: Url) -> Self

Sets an explicit proxy url to proxy all HTTP(S) traffic through.

+
source

pub fn proxy_from_env(self) -> Self

Sets the proxy url from the environment, in this order:

  • HTTP_PROXY
  • http_proxy
  • HTTPS_PROXY
  • https_proxy
-
source

pub fn keylog(self, keylog: bool) -> Self

Enables saving the TLS pre-master key for connections.

+
source

pub fn keylog(self, keylog: bool) -> Self

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.

-
source

pub fn insecure_skip_relay_cert_verify(self, skip_verify: bool) -> Self

Available on test or crate feature test-utils only.

Skip verification of SSL certificates from relay servers

+
source

pub fn insecure_skip_relay_cert_verify(self, skip_verify: bool) -> Self

Available on test or crate feature test-utils only.

Skip verification of SSL certificates from relay servers

May only be used in tests.

-

Trait Implementations§

source§

impl Debug for Builder

source§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Builder

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +

Trait Implementations§

source§

impl Debug for Builder

source§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Builder

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where 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 cca07c4cff..2a1637f0b6 100644 --- a/pr/2778/docs/iroh_net/endpoint/struct.Connecting.html +++ b/pr/2778/docs/iroh_net/endpoint/struct.Connecting.html @@ -1,11 +1,11 @@ -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

source

pub fn into_0rtt(self) -> Result<(Connection, ZeroRttAccepted), Self>

Convert into a 0-RTT or 0.5-RTT connection at the cost of weakened security.

-
source

pub async fn handshake_data(&mut self) -> Result<Box<dyn Any>, ConnectionError>

Parameters negotiated during the handshake

-
source

pub fn local_ip(&self) -> Option<IpAddr>

The local IP address which was used when the peer established the connection.

-
source

pub fn remote_address(&self) -> SocketAddr

The peer’s UDP address.

-
source

pub async fn alpn(&mut self) -> Result<Vec<u8>>

Extracts the ALPN protocol from the peer’s handshake data.

-

Trait Implementations§

source§

impl Debug for Connecting

source§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Future for Connecting

§

type Output = Result<Connection, ConnectionError>

The type of value produced on completion.
source§

fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>

Attempt to resolve the future to a final value, registering -the current task for wakeup if the value is not yet available. Read more
source§

impl<'pin> Unpin for Connecting
where +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

source

pub fn into_0rtt(self) -> Result<(Connection, ZeroRttAccepted), Self>

Convert into a 0-RTT or 0.5-RTT connection at the cost of weakened security.

+
source

pub async fn handshake_data(&mut self) -> Result<Box<dyn Any>, ConnectionError>

Parameters negotiated during the handshake

+
source

pub fn local_ip(&self) -> Option<IpAddr>

The local IP address which was used when the peer established the connection.

+
source

pub fn remote_address(&self) -> SocketAddr

The peer’s UDP address.

+
source

pub async fn alpn(&mut self) -> Result<Vec<u8>>

Extracts the ALPN protocol from the peer’s handshake data.

+

Trait Implementations§

source§

impl Debug for Connecting

source§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Future for Connecting

§

type Output = Result<Connection, ConnectionError>

The type of value produced on completion.
source§

fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>

Attempt to resolve the future to a final value, registering +the current task for wakeup if the value is not yet available. Read more
source§

impl<'pin> Unpin for Connecting
where __Connecting<'pin>: Unpin,

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where diff --git a/pr/2778/docs/iroh_net/endpoint/struct.Endpoint.html b/pr/2778/docs/iroh_net/endpoint/struct.Endpoint.html index 723a057183..5314d3c0b6 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

Struct iroh_net::endpoint::Endpoint

source ·
pub struct Endpoint { /* private fields */ }
Expand description

Controls an iroh-net node, establishing connections with other nodes.

+Endpoint in iroh_net::endpoint - Rust

Struct iroh_net::endpoint::Endpoint

source ·
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

source

pub fn builder() -> Builder

Returns the builder for an Endpoint, with a production configuration.

-
source

pub fn set_alpns(&self, alpns: Vec<Vec<u8>>) -> Result<()>

Sets the list of accepted ALPN protocols.

+

Implementations§

source§

impl Endpoint

source

pub fn builder() -> Builder

Returns the builder for an Endpoint, with a production configuration.

+
source

pub fn set_alpns(&self, alpns: Vec<Vec<u8>>) -> Result<()>

Sets the list of accepted ALPN protocols.

This will only affect new incoming connections. Note that this overrides the current list of ALPNs.

-
source

pub async fn connect( +

source

pub 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.

-

source

pub async fn connect_by_node_id( +

source

pub async fn connect_by_node_id( &self, node_id: NodeId, 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.

-

source

pub fn accept(&self) -> Accept<'_> ⓘ

Accepts an incoming connection on the endpoint.

+
source

pub 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.

-
source

pub fn add_node_addr(&self, node_addr: NodeAddr) -> Result<()>

Informs this Endpoint about addresses of the iroh-net node.

+
source

pub fn add_node_addr(&self, node_addr: NodeAddr) -> Result<()>

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.

-
source

pub fn add_node_addr_with_source( +

source

pub fn add_node_addr_with_source( &self, node_addr: NodeAddr, source: &'static str @@ -77,15 +77,15 @@ used for logging exclusively and will not be stored.

§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.

-
source

pub fn secret_key(&self) -> &SecretKey

Returns the secret_key of this endpoint.

-
source

pub fn node_id(&self) -> NodeId

Returns the node id of this endpoint.

+
source

pub fn secret_key(&self) -> &SecretKey

Returns the secret_key of this endpoint.

+
source

pub fn node_id(&self) -> NodeId

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.

-
source

pub async fn node_addr(&self) -> Result<NodeAddr>

Returns the current NodeAddr for this endpoint.

+
source

pub async fn node_addr(&self) -> Result<NodeAddr>

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.

-
source

pub fn home_relay(&self) -> Option<RelayUrl>

Returns the RelayUrl of the Relay server used as home relay.

+
source

pub 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.

-
source

pub fn watch_home_relay(&self) -> impl Stream<Item = RelayUrl>

Watches for changes to the home relay.

+
source

pub 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.

-
source

pub fn direct_addresses(&self) -> DirectAddrsStream

Returns the direct addresses of this Endpoint.

+
source

pub 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;
-

source

pub fn bound_sockets(&self) -> (SocketAddr, Option<SocketAddr>)

Returns the local socket addresses on which the underlying sockets are bound.

+
source

pub 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.

-
source

pub fn remote_info(&self, node_id: NodeId) -> Option<RemoteInfo>

Returns information about the remote node identified by a NodeId.

+
source

pub fn remote_info(&self, node_id: NodeId) -> 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.

-
source

pub fn remote_info_iter(&self) -> impl Iterator<Item = RemoteInfo>

Returns information about all the remote nodes this Endpoint knows about.

+
source

pub 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.

-
source

pub fn conn_type_stream(&self, node_id: NodeId) -> Result<ConnectionTypeStream>

Returns a stream that reports connection type changes for the remote node.

+
source

pub fn conn_type_stream(&self, node_id: NodeId) -> Result<ConnectionTypeStream>

Returns a stream that reports connection type changes for the remote node.

This returns a stream of ConnectionType items, each time the underlying connection to a remote node changes it yields an item. These connection changes are when the connection switches between using the Relay server and a direct connection.

@@ -156,11 +156,11 @@ 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.

-
source

pub fn dns_resolver(&self) -> &DnsResolver

Returns the DNS resolver used in this Endpoint.

+
source

pub fn dns_resolver(&self) -> &DnsResolver

Returns the DNS resolver used in this Endpoint.

See Builder::discovery.

-
source

pub fn discovery(&self) -> Option<&dyn Discovery>

Returns the discovery mechanism, if configured.

+
source

pub fn discovery(&self) -> Option<&dyn Discovery>

Returns the discovery mechanism, if configured.

See Builder::dns_resolver.

-
source

pub async fn network_change(&self)

Notifies the system of potential network changes.

+
source

pub 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 @@ -168,14 +168,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.

-
source

pub async fn close(self, error_code: VarInt, reason: &[u8]) -> Result<()>

Closes the QUIC endpoint and the magic socket.

+
source

pub async fn close(self, error_code: VarInt, reason: &[u8]) -> Result<()>

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§

source§

impl Clone for Endpoint

source§

fn clone(&self) -> Endpoint

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Endpoint

source§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +

Trait Implementations§

source§

impl Clone for Endpoint

source§

fn clone(&self) -> Endpoint

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Endpoint

source§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where 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 149b0ade71..e7b7bc0894 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

Struct iroh_net::endpoint::Incoming

source ·
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

Struct iroh_net::endpoint::Incoming

source ·
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

source

pub fn accept(self) -> Result<Connecting, ConnectionError>

Attempts to accept this incoming connection (an error may still occur).

+

Implementations§

source§

impl Incoming

source

pub 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.

-
source

pub fn accept_with( +

source

pub fn accept_with( self, server_config: Arc<ServerConfig> ) -> Result<Connecting, ConnectionError>

Accepts this incoming connection using a custom configuration.

See accept() for more details.

-
source

pub fn refuse(self)

Rejects this incoming connection attempt.

-
source

pub fn retry(self) -> Result<(), RetryError>

Responds with a retry packet.

+
source

pub fn refuse(self)

Rejects this incoming connection attempt.

+
source

pub 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.

-
source

pub fn ignore(self)

Ignores this incoming connection attempt, not sending any packet in response.

-
source

pub fn local_ip(&self) -> Option<IpAddr>

Returns the local IP address which was used when the peer established the +

source

pub fn ignore(self)

Ignores this incoming connection attempt, not sending any packet in response.

+
source

pub fn local_ip(&self) -> Option<IpAddr>

Returns the local IP address which was used when the peer established the connection.

-
source

pub fn remote_address(&self) -> SocketAddr

Returns the peer’s UDP address.

-
source

pub fn remote_address_validated(&self) -> bool

Whether the socket address that is initiating this connection has been validated.

+
source

pub fn remote_address(&self) -> SocketAddr

Returns the peer’s UDP address.

+
source

pub 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 Debug for Incoming

source§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
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) -> Self::IntoFuture

Creates a future from a value. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +

Trait Implementations§

source§

impl Debug for Incoming

source§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
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) -> Self::IntoFuture

Creates a future from a value. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where 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 c11e8b082d..1e65f83ffd 100644 --- a/pr/2778/docs/iroh_net/endpoint/struct.IncomingFuture.html +++ b/pr/2778/docs/iroh_net/endpoint/struct.IncomingFuture.html @@ -1,6 +1,6 @@ -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§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Future for IncomingFuture

§

type Output = Result<Connection, ConnectionError>

The type of value produced on completion.
source§

fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>

Attempt to resolve the future to a final value, registering -the current task for wakeup if the value is not yet available. Read more
source§

impl<'pin> Unpin for IncomingFuture
where +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§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Future for IncomingFuture

§

type Output = Result<Connection, ConnectionError>

The type of value produced on completion.
source§

fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>

Attempt to resolve the future to a final value, registering +the current task for wakeup if the value is not yet available. Read more
source§

impl<'pin> Unpin for IncomingFuture
where __IncomingFuture<'pin>: Unpin,

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where diff --git a/pr/2778/docs/iroh_net/endpoint/struct.NodeAddr.html b/pr/2778/docs/iroh_net/endpoint/struct.NodeAddr.html index 5c9ec7e41e..ca366ed1f3 100644 --- a/pr/2778/docs/iroh_net/endpoint/struct.NodeAddr.html +++ b/pr/2778/docs/iroh_net/endpoint/struct.NodeAddr.html @@ -1,4 +1,4 @@ -NodeAddr in iroh_net::endpoint - Rust

Struct iroh_net::endpoint::NodeAddr

pub struct NodeAddr {
+NodeAddr in iroh_net::endpoint - Rust

Struct iroh_net::endpoint::NodeAddr

source ·
pub struct NodeAddr {
     pub node_id: PublicKey,
     pub info: AddrInfo,
 }
Expand description

Network-level addressing information for an iroh-net node.

@@ -25,40 +25,40 @@ number of network-level addressing information. It is a generic addressing type whenever a connection to other nodes needs to be established.

Fields§

§node_id: PublicKey

The node’s identifier.

§info: AddrInfo

Addressing information to connect to Self::node_id.

-

Implementations§

§

impl NodeAddr

pub fn new(node_id: PublicKey) -> NodeAddr

Creates a new NodeAddr with empty AddrInfo.

-

pub fn with_relay_url(self, relay_url: RelayUrl) -> NodeAddr

Adds a relay url to the node’s AddrInfo.

-

pub fn with_direct_addresses( +

Implementations§

source§

impl NodeAddr

source

pub fn new(node_id: PublicKey) -> NodeAddr

Creates a new NodeAddr with empty AddrInfo.

+
source

pub fn with_relay_url(self, relay_url: RelayUrl) -> NodeAddr

Adds a relay url to the node’s AddrInfo.

+
source

pub fn with_direct_addresses( self, addresses: impl IntoIterator<Item = SocketAddr> ) -> NodeAddr

Adds the given direct addresses to the peer’s AddrInfo.

-

pub fn from_parts( +

source

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.

-

pub fn apply_options(&mut self, opts: AddrInfoOptions)

Applies the options to self.

+
source

pub fn apply_options(&mut self, opts: AddrInfoOptions)

Applies the options to self.

This is used to more tightly control the information stored in a NodeAddr received from another API. E.g. to ensure a discovery service is used the AddrInfoOptions::Id] option could be used to remove all other addressing details.

-

pub fn direct_addresses(&self) -> impl Iterator<Item = &SocketAddr>

Returns the direct addresses of this peer.

-

pub fn relay_url(&self) -> Option<&RelayUrl>

Returns the relay url of this peer.

-

Trait Implementations§

§

impl Clone for NodeAddr

§

fn clone(&self) -> NodeAddr

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for NodeAddr

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<'de> Deserialize<'de> for NodeAddr

§

fn deserialize<__D>( +

source

pub fn direct_addresses(&self) -> impl Iterator<Item = &SocketAddr>

Returns the direct addresses of this peer.

+
source

pub fn relay_url(&self) -> Option<&RelayUrl>

Returns the relay url of this peer.

+

Trait Implementations§

source§

impl Clone for NodeAddr

source§

fn clone(&self) -> NodeAddr

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for NodeAddr

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for NodeAddr

source§

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 more
§

impl From<(PublicKey, Option<RelayUrl>, &[SocketAddr])> for NodeAddr

§

fn from(value: (PublicKey, Option<RelayUrl>, &[SocketAddr])) -> NodeAddr

Converts to this type from the input type.
§

impl From<NodeAddr> for NodeTicket

§

fn from(addr: NodeAddr) -> NodeTicket

Creates a ticket from given addressing info.

-
source§

impl From<NodeInfo> for NodeAddr

source§

fn from(value: NodeInfo) -> Self

Converts to this type from the input type.
§

impl From<NodeTicket> for NodeAddr

§

fn from(ticket: NodeTicket) -> NodeAddr

Returns the addressing info from given ticket.

-
§

impl From<PublicKey> for NodeAddr

§

fn from(node_id: PublicKey) -> NodeAddr

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

§

fn cmp(&self, other: &NodeAddr) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<(PublicKey, Option<RelayUrl>, &[SocketAddr])> for NodeAddr

source§

fn from(value: (PublicKey, Option<RelayUrl>, &[SocketAddr])) -> NodeAddr

Converts to this type from the input type.
source§

impl From<NodeAddr> for NodeTicket

source§

fn from(addr: NodeAddr) -> NodeTicket

Creates a ticket from given addressing info.

+
source§

impl From<NodeInfo> for NodeAddr

source§

fn from(value: NodeInfo) -> Self

Converts to this type from the input type.
source§

impl From<NodeTicket> for NodeAddr

source§

fn from(ticket: NodeTicket) -> NodeAddr

Returns the addressing info from given ticket.

+
source§

impl From<PublicKey> for NodeAddr

source§

fn from(node_id: PublicKey) -> NodeAddr

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.
source§

impl Ord for NodeAddr

source§

fn cmp(&self, other: &NodeAddr) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where - Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
§

impl PartialEq for NodeAddr

§

fn eq(&self, other: &NodeAddr) -> bool

This method tests for self and other values to be equal, and is used + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for NodeAddr

source§

fn eq(&self, other: &NodeAddr) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
§

impl PartialOrd for NodeAddr

§

fn partial_cmp(&self, other: &NodeAddr) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
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 <= +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for NodeAddr

source§

fn partial_cmp(&self, other: &NodeAddr) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
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 more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
§

impl Serialize for NodeAddr

§

fn serialize<__S>( +operator. Read more

source§

impl Serialize for NodeAddr

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 Eq for NodeAddr

§

impl StructuralPartialEq for NodeAddr

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for NodeAddr

source§

impl StructuralPartialEq for NodeAddr

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( diff --git a/pr/2778/docs/iroh_net/key/enum.KeyParsingError.html b/pr/2778/docs/iroh_net/key/enum.KeyParsingError.html index 97deead166..f5ffec4461 100644 --- a/pr/2778/docs/iroh_net/key/enum.KeyParsingError.html +++ b/pr/2778/docs/iroh_net/key/enum.KeyParsingError.html @@ -1,10 +1,10 @@ -KeyParsingError in iroh_net::key - Rust

Enum iroh_net::key::KeyParsingError

pub enum KeyParsingError {
-    Base32(HexOrBase32ParseError),
+KeyParsingError in iroh_net::key - Rust

Enum iroh_net::key::KeyParsingError

source ·
pub enum KeyParsingError {
+    Base32(HexOrBase32ParseError),
     Key(Error),
 }
Expand description

Error when deserialising a PublicKey or a SecretKey.

-

Variants§

§

Base32(HexOrBase32ParseError)

Error when decoding the base32.

+

Variants§

§

Base32(HexOrBase32ParseError)

Error when decoding the base32.

§

Key(Error)

Error when decoding the public key.

-

Trait Implementations§

§

impl Debug for KeyParsingError

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Display for KeyParsingError

§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Error for KeyParsingError

§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
§

impl From<Error> for KeyParsingError

§

fn from(source: Error) -> KeyParsingError

Converts to this type from the input type.
§

impl From<HexOrBase32ParseError> for KeyParsingError

§

fn from(source: HexOrBase32ParseError) -> KeyParsingError

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +

Trait Implementations§

source§

impl Debug for KeyParsingError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Display for KeyParsingError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Error for KeyParsingError

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<Error> for KeyParsingError

source§

fn from(source: Error) -> KeyParsingError

Converts to this type from the input type.
source§

impl From<HexOrBase32ParseError> for KeyParsingError

source§

fn from(source: HexOrBase32ParseError) -> KeyParsingError

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( diff --git a/pr/2778/docs/iroh_net/key/index.html b/pr/2778/docs/iroh_net/key/index.html index 769dda60ac..2513dce214 100644 --- a/pr/2778/docs/iroh_net/key/index.html +++ b/pr/2778/docs/iroh_net/key/index.html @@ -1,2 +1,2 @@ -iroh_net::key - Rust

Module iroh_net::key

Expand description

Cryptographic key handling for iroh-net.

+iroh_net::key - Rust

Module iroh_net::key

source ·
Expand description

Cryptographic key handling for iroh-net.

Structs§

Enums§

Constants§

Type Aliases§

  • The identifier for a node in the (iroh) network.
\ No newline at end of file diff --git a/pr/2778/docs/iroh_net/key/struct.PublicKey.html b/pr/2778/docs/iroh_net/key/struct.PublicKey.html index 5cdc283501..4b87e45788 100644 --- a/pr/2778/docs/iroh_net/key/struct.PublicKey.html +++ b/pr/2778/docs/iroh_net/key/struct.PublicKey.html @@ -1,45 +1,45 @@ -PublicKey in iroh_net::key - Rust

Struct iroh_net::key::PublicKey

pub struct PublicKey(/* private fields */);
Expand description

A public key.

+PublicKey in iroh_net::key - Rust

Struct iroh_net::key::PublicKey

source ·
pub struct PublicKey(/* private fields */);
Expand description

A public key.

The key itself is just a 32 byte array, but a key has associated crypto information that is cached for performance reasons.

The cache item will be refreshed every time a crypto operation is performed, or when a key is deserialised or created from a byte array.

Serialisation or creation from a byte array is cheap if the key is already in the cache, but expensive if it is not.

-

Implementations§

§

impl PublicKey

pub fn as_bytes(&self) -> &[u8; 32]

Get this public key as a byte array.

-

pub fn from_bytes(bytes: &[u8; 32]) -> Result<PublicKey, Error>

Construct a PublicKey from a slice of bytes.

+

Implementations§

source§

impl PublicKey

source

pub fn as_bytes(&self) -> &[u8; 32]

Get this public key as a byte array.

+
source

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.

-

pub fn verify(&self, message: &[u8], signature: &Signature) -> Result<(), Error>

Verify a signature on a message with this secret key’s public key.

+
source

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.

-

pub fn fmt_short(&self) -> String

Convert to a base32 string limited to the first 10 bytes for a friendly string +

source

pub fn fmt_short(&self) -> String

Convert to a base32 string limited to the first 10 bytes for a friendly string representation of the key.

-

Trait Implementations§

§

impl AsRef<[u8]> for PublicKey

§

fn as_ref(&self) -> &[u8] ⓘ

Converts this type into a shared reference of the (usually inferred) input type.
§

impl Clone for PublicKey

§

fn clone(&self) -> PublicKey

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for PublicKey

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<'de> Deserialize<'de> for PublicKey

§

fn deserialize<D>( +

Trait Implementations§

source§

impl AsRef<[u8]> for PublicKey

source§

fn as_ref(&self) -> &[u8] ⓘ

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for PublicKey

source§

fn clone(&self) -> PublicKey

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PublicKey

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for PublicKey

source§

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 Display for PublicKey

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl From<PublicKey> for NodeAddr

§

fn from(node_id: PublicKey) -> NodeAddr

Converts to this type from the input type.
§

impl From<VerifyingKey> for PublicKey

§

fn from(verifying_key: VerifyingKey) -> PublicKey

Converts to this type from the input type.
§

impl FromStr for PublicKey

Deserialises the PublicKey from it’s base32 encoding.

+ D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for PublicKey

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl From<PublicKey> for NodeAddr

source§

fn from(node_id: PublicKey) -> NodeAddr

Converts to this type from the input type.
source§

impl From<VerifyingKey> for PublicKey

source§

fn from(verifying_key: VerifyingKey) -> PublicKey

Converts to this type from the input type.
source§

impl FromStr for PublicKey

Deserialises the PublicKey from it’s base32 encoding.

Display is capable of serialising this format.

-
§

type Err = KeyParsingError

The associated error which can be returned from parsing.
§

fn from_str(s: &str) -> Result<PublicKey, <PublicKey as FromStr>::Err>

Parses a string s to return a value of this type. Read more
§

impl Hash for PublicKey

§

fn hash<H>(&self, state: &mut H)
where +
§

type Err = KeyParsingError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<PublicKey, <PublicKey as FromStr>::Err>

Parses a string s to return a value of this type. Read more

source§

impl Hash for PublicKey

source§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, - Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl Ord for PublicKey

§

fn cmp(&self, other: &PublicKey) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for PublicKey

source§

fn cmp(&self, other: &PublicKey) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where - Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
§

impl PartialEq for PublicKey

§

fn eq(&self, other: &PublicKey) -> bool

This method tests for self and other values to be equal, and is used + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for PublicKey

source§

fn eq(&self, other: &PublicKey) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
§

impl PartialOrd for PublicKey

§

fn partial_cmp(&self, other: &PublicKey) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
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 <= +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for PublicKey

source§

fn partial_cmp(&self, other: &PublicKey) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
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 more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
§

impl Serialize for PublicKey

§

fn serialize<S>( +operator. Read more

source§

impl Serialize for PublicKey

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 TryFrom<&[u8]> for PublicKey

§

type Error = Error

The type returned in the event of a conversion error.
§

fn try_from( + S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl TryFrom<&[u8]> for PublicKey

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from( bytes: &[u8] -) -> Result<PublicKey, <PublicKey as TryFrom<&[u8]>>::Error>

Performs the conversion.
§

impl TryFrom<&[u8; 32]> for PublicKey

§

type Error = Error

The type returned in the event of a conversion error.
§

fn try_from( +) -> Result<PublicKey, <PublicKey as TryFrom<&[u8]>>::Error>

Performs the conversion.
source§

impl TryFrom<&[u8; 32]> for PublicKey

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from( bytes: &[u8; 32] -) -> Result<PublicKey, <PublicKey as TryFrom<&[u8; 32]>>::Error>

Performs the conversion.
§

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§

source§

impl<T> Any for T
where +) -> Result<PublicKey, <PublicKey as TryFrom<&[u8; 32]>>::Error>

Performs the conversion.
source§

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§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<A, T> AsBits<T> for A
where A: AsRef<[T]>, T: BitStore,

§

fn as_bits<O>(&self) -> &BitSlice<T, O>
where diff --git a/pr/2778/docs/iroh_net/key/struct.SecretKey.html b/pr/2778/docs/iroh_net/key/struct.SecretKey.html index f3776b47dc..14ac9f12d0 100644 --- a/pr/2778/docs/iroh_net/key/struct.SecretKey.html +++ b/pr/2778/docs/iroh_net/key/struct.SecretKey.html @@ -1,24 +1,24 @@ -SecretKey in iroh_net::key - Rust

Struct iroh_net::key::SecretKey

pub struct SecretKey { /* private fields */ }
Expand description

A secret key.

-

Implementations§

§

impl SecretKey

pub fn shared(&self, other: &PublicKey) -> SharedSecret

Returns the shared key for communication between this key and other.

-
§

impl SecretKey

pub fn public(&self) -> PublicKey

The public key of this SecretKey.

-

pub fn generate() -> SecretKey

Generate a new SecretKey with the default randomness generator.

-

pub fn generate_with_rng<R>(csprng: &mut R) -> SecretKey
where +SecretKey in iroh_net::key - Rust

Struct iroh_net::key::SecretKey

source ·
pub struct SecretKey { /* private fields */ }
Expand description

A secret key.

+

Implementations§

source§

impl SecretKey

source

pub fn shared(&self, other: &PublicKey) -> SharedSecret

Returns the shared key for communication between this key and other.

+
source§

impl SecretKey

source

pub fn public(&self) -> PublicKey

The public key of this SecretKey.

+
source

pub fn generate() -> SecretKey

Generate a new SecretKey with the default randomness generator.

+
source

pub fn generate_with_rng<R>(csprng: &mut R) -> SecretKey
where R: CryptoRngCore + ?Sized,

Generate a new SecretKey with a randomness generator.

-

pub fn to_openssh(&self) -> Result<Zeroizing<String>, Error>

Serialise this key to OpenSSH format.

-

pub fn try_from_openssh<T>(data: T) -> Result<SecretKey, Error>
where +

source

pub fn to_openssh(&self) -> Result<Zeroizing<String>, Error>

Serialise this key to OpenSSH format.

+
source

pub fn try_from_openssh<T>(data: T) -> Result<SecretKey, Error>
where T: AsRef<[u8]>,

Deserialise this key from OpenSSH format.

-

pub 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. +

source

pub fn sign(&self, msg: &[u8]) -> Signature

Sign the given message and return a digital signature

+
source

pub fn to_bytes(&self) -> [u8; 32]

Convert this to the bytes representing the secret part. The public part can always be recovered.

-

pub fn from_bytes(bytes: &[u8; 32]) -> SecretKey

Create a secret key from its byte representation.

-

Trait Implementations§

§

impl Clone for SecretKey

§

fn clone(&self) -> SecretKey

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for SecretKey

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<'de> Deserialize<'de> for SecretKey

§

fn deserialize<D>( +

source

pub fn from_bytes(bytes: &[u8; 32]) -> SecretKey

Create a secret key from its byte representation.

+

Trait Implementations§

source§

impl Clone for SecretKey

source§

fn clone(&self) -> SecretKey

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SecretKey

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for SecretKey

source§

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 Display for SecretKey

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl From<[u8; 32]> for SecretKey

§

fn from(value: [u8; 32]) -> SecretKey

Converts to this type from the input type.
§

impl From<SigningKey> for SecretKey

§

fn from(secret: SigningKey) -> SecretKey

Converts to this type from the input type.
§

impl FromStr for SecretKey

§

type Err = KeyParsingError

The associated error which can be returned from parsing.
§

fn from_str(s: &str) -> Result<SecretKey, <SecretKey as FromStr>::Err>

Parses a string s to return a value of this type. Read more
§

impl Serialize for SecretKey

§

fn serialize<S>( + D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for SecretKey

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl From<[u8; 32]> for SecretKey

source§

fn from(value: [u8; 32]) -> SecretKey

Converts to this type from the input type.
source§

impl From<SigningKey> for SecretKey

source§

fn from(secret: SigningKey) -> SecretKey

Converts to this type from the input type.
source§

impl FromStr for SecretKey

§

type Err = KeyParsingError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<SecretKey, <SecretKey as FromStr>::Err>

Parses a string s to return a value of this type. Read more
source§

impl Serialize for SecretKey

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 TryFrom<&[u8]> for SecretKey

§

type Error = Error

The type returned in the event of a conversion error.
§

fn try_from( + S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl TryFrom<&[u8]> for SecretKey

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from( bytes: &[u8] ) -> Result<SecretKey, <SecretKey as TryFrom<&[u8]>>::Error>

Performs the conversion.

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§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where diff --git a/pr/2778/docs/iroh_net/key/struct.SharedSecret.html b/pr/2778/docs/iroh_net/key/struct.SharedSecret.html index cd47cc4503..486363bd7b 100644 --- a/pr/2778/docs/iroh_net/key/struct.SharedSecret.html +++ b/pr/2778/docs/iroh_net/key/struct.SharedSecret.html @@ -1,7 +1,7 @@ -SharedSecret in iroh_net::key - Rust

Struct iroh_net::key::SharedSecret

pub struct SharedSecret(/* private fields */);
Expand description

Shared Secret.

-

Implementations§

§

impl SharedSecret

pub fn seal(&self, buffer: &mut dyn Buffer)

Seals the provided cleartext.

-

pub fn open(&self, buffer: &mut dyn Buffer) -> Result<(), Error>

Opens the ciphertext, which must have been created using Self::seal, and places the clear text into the provided buffer.

-

Trait Implementations§

§

impl Debug for SharedSecret

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +SharedSecret in iroh_net::key - Rust

Struct iroh_net::key::SharedSecret

source ·
pub struct SharedSecret(/* private fields */);
Expand description

Shared Secret.

+

Implementations§

source§

impl SharedSecret

source

pub fn seal(&self, buffer: &mut dyn Buffer)

Seals the provided cleartext.

+
source

pub fn open(&self, buffer: &mut dyn Buffer) -> Result<(), Error>

Opens the ciphertext, which must have been created using Self::seal, and places the clear text into the provided buffer.

+

Trait Implementations§

source§

impl Debug for SharedSecret

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( diff --git a/pr/2778/docs/iroh_net/key/type.NodeId.html b/pr/2778/docs/iroh_net/key/type.NodeId.html index 2fcb472645..38aed1617e 100644 --- a/pr/2778/docs/iroh_net/key/type.NodeId.html +++ b/pr/2778/docs/iroh_net/key/type.NodeId.html @@ -1,4 +1,4 @@ -NodeId in iroh_net::key - Rust

Type Alias iroh_net::key::NodeId

pub type NodeId = PublicKey;
Expand description

The identifier for a node in the (iroh) network.

+NodeId in iroh_net::key - Rust

Type Alias iroh_net::key::NodeId

source ·
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/2778/docs/iroh_net/metrics/struct.MagicsockMetrics.html b/pr/2778/docs/iroh_net/metrics/struct.MagicsockMetrics.html index 0b0945ca43..6528a80c7c 100644 --- a/pr/2778/docs/iroh_net/metrics/struct.MagicsockMetrics.html +++ b/pr/2778/docs/iroh_net/metrics/struct.MagicsockMetrics.html @@ -1,55 +1,55 @@ MagicsockMetrics in iroh_net::metrics - Rust

Struct iroh_net::metrics::MagicsockMetrics

source ·
pub struct MagicsockMetrics {
Show 41 fields - pub re_stun_calls: Counter, - pub update_direct_addrs: Counter, - pub send_ipv4: Counter, - pub send_ipv6: Counter, - pub send_relay: Counter, - pub send_relay_error: Counter, - pub send_data: Counter, - pub send_data_network_down: Counter, - pub recv_data_relay: Counter, - pub recv_data_ipv4: Counter, - pub recv_data_ipv6: Counter, - pub recv_datagrams: Counter, - pub recv_gro_datagrams: Counter, - pub send_disco_udp: Counter, - pub send_disco_relay: Counter, - pub sent_disco_udp: Counter, - pub sent_disco_relay: Counter, - pub sent_disco_ping: Counter, - pub sent_disco_pong: Counter, - pub sent_disco_call_me_maybe: Counter, - pub recv_disco_bad_key: Counter, - pub recv_disco_bad_parse: Counter, - pub recv_disco_udp: Counter, - pub recv_disco_relay: Counter, - pub recv_disco_ping: Counter, - pub recv_disco_pong: Counter, - pub recv_disco_call_me_maybe: Counter, - pub recv_disco_call_me_maybe_bad_disco: Counter, - pub relay_home_change: Counter, - pub num_direct_conns_added: Counter, - pub num_direct_conns_removed: Counter, - pub num_relay_conns_added: Counter, - pub num_relay_conns_removed: Counter, - pub actor_tick_main: Counter, - pub actor_tick_msg: Counter, - pub actor_tick_re_stun: Counter, - pub actor_tick_portmap_changed: Counter, - pub actor_tick_direct_addr_heartbeat: Counter, - pub actor_tick_direct_addr_update_receiver: Counter, - pub actor_link_change: Counter, - pub actor_tick_other: Counter, + pub re_stun_calls: Counter, + pub update_direct_addrs: Counter, + pub send_ipv4: Counter, + pub send_ipv6: Counter, + pub send_relay: Counter, + pub send_relay_error: Counter, + pub send_data: Counter, + pub send_data_network_down: Counter, + pub recv_data_relay: Counter, + pub recv_data_ipv4: Counter, + pub recv_data_ipv6: Counter, + pub recv_datagrams: Counter, + pub recv_gro_datagrams: Counter, + pub send_disco_udp: Counter, + pub send_disco_relay: Counter, + pub sent_disco_udp: Counter, + pub sent_disco_relay: Counter, + pub sent_disco_ping: Counter, + pub sent_disco_pong: Counter, + pub sent_disco_call_me_maybe: Counter, + pub recv_disco_bad_key: Counter, + pub recv_disco_bad_parse: Counter, + pub recv_disco_udp: Counter, + pub recv_disco_relay: Counter, + pub recv_disco_ping: Counter, + pub recv_disco_pong: Counter, + pub recv_disco_call_me_maybe: Counter, + pub recv_disco_call_me_maybe_bad_disco: Counter, + pub relay_home_change: Counter, + pub num_direct_conns_added: Counter, + pub num_direct_conns_removed: Counter, + pub num_relay_conns_added: Counter, + pub num_relay_conns_removed: Counter, + pub actor_tick_main: Counter, + pub actor_tick_msg: Counter, + pub actor_tick_re_stun: Counter, + pub actor_tick_portmap_changed: Counter, + pub actor_tick_direct_addr_heartbeat: Counter, + pub actor_tick_direct_addr_update_receiver: Counter, + pub actor_link_change: Counter, + pub actor_tick_other: Counter,
}
Expand description

Enum of metrics for the module

-

Fields§

§re_stun_calls: Counter§update_direct_addrs: Counter§send_ipv4: Counter§send_ipv6: Counter§send_relay: Counter§send_relay_error: Counter§send_data: Counter§send_data_network_down: Counter§recv_data_relay: Counter§recv_data_ipv4: Counter§recv_data_ipv6: Counter§recv_datagrams: Counter

Number of QUIC datagrams received.

-
§recv_gro_datagrams: Counter

Number of datagrams received using GRO

-
§send_disco_udp: Counter§send_disco_relay: Counter§sent_disco_udp: Counter§sent_disco_relay: Counter§sent_disco_ping: Counter§sent_disco_pong: Counter§sent_disco_call_me_maybe: Counter§recv_disco_bad_key: Counter§recv_disco_bad_parse: Counter§recv_disco_udp: Counter§recv_disco_relay: Counter§recv_disco_ping: Counter§recv_disco_pong: Counter§recv_disco_call_me_maybe: Counter§recv_disco_call_me_maybe_bad_disco: Counter§relay_home_change: Counter§num_direct_conns_added: Counter

The number of direct connections we have made to peers.

-
§num_direct_conns_removed: Counter

The number of direct connections we have lost to peers.

-
§num_relay_conns_added: Counter

The number of connections to peers we have added over relay.

-
§num_relay_conns_removed: Counter

The number of connections to peers we have removed over relay.

-
§actor_tick_main: Counter§actor_tick_msg: Counter§actor_tick_re_stun: Counter§actor_tick_portmap_changed: Counter§actor_tick_direct_addr_heartbeat: Counter§actor_tick_direct_addr_update_receiver: Counter§actor_link_change: Counter§actor_tick_other: Counter

Trait Implementations§

source§

impl Clone for Metrics

source§

fn clone(&self) -> Metrics

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Metrics

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Metrics

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Iterable for Metrics

source§

fn iter<'a>(&'a self) -> IntoIter<(&'static str, &'a dyn Any)>

Returns an iterator over the struct’s fields as tuples. Read more
source§

impl Metric for Metrics

source§

fn name() -> &'static str

The name of this metric group.
§

fn new(registry: &mut Registry) -> Self

Initializes this metric group.
§

fn with_metric<T, F>(f: F)
where +

Fields§

§re_stun_calls: Counter§update_direct_addrs: Counter§send_ipv4: Counter§send_ipv6: Counter§send_relay: Counter§send_relay_error: Counter§send_data: Counter§send_data_network_down: Counter§recv_data_relay: Counter§recv_data_ipv4: Counter§recv_data_ipv6: Counter§recv_datagrams: Counter

Number of QUIC datagrams received.

+
§recv_gro_datagrams: Counter

Number of datagrams received using GRO

+
§send_disco_udp: Counter§send_disco_relay: Counter§sent_disco_udp: Counter§sent_disco_relay: Counter§sent_disco_ping: Counter§sent_disco_pong: Counter§sent_disco_call_me_maybe: Counter§recv_disco_bad_key: Counter§recv_disco_bad_parse: Counter§recv_disco_udp: Counter§recv_disco_relay: Counter§recv_disco_ping: Counter§recv_disco_pong: Counter§recv_disco_call_me_maybe: Counter§recv_disco_call_me_maybe_bad_disco: Counter§relay_home_change: Counter§num_direct_conns_added: Counter

The number of direct connections we have made to peers.

+
§num_direct_conns_removed: Counter

The number of direct connections we have lost to peers.

+
§num_relay_conns_added: Counter

The number of connections to peers we have added over relay.

+
§num_relay_conns_removed: Counter

The number of connections to peers we have removed over relay.

+
§actor_tick_main: Counter§actor_tick_msg: Counter§actor_tick_re_stun: Counter§actor_tick_portmap_changed: Counter§actor_tick_direct_addr_heartbeat: Counter§actor_tick_direct_addr_update_receiver: Counter§actor_link_change: Counter§actor_tick_other: Counter

Trait Implementations§

source§

impl Clone for Metrics

source§

fn clone(&self) -> Metrics

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Metrics

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Metrics

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Iterable for Metrics

source§

fn iter<'a>(&'a self) -> IntoIter<(&'static str, &'a dyn Any)>

Returns an iterator over the struct’s fields as tuples. Read more
source§

impl Metric for Metrics

source§

fn name() -> &'static str

The name of this metric group.
source§

fn new(registry: &mut Registry) -> Self

Initializes this metric group.
source§

fn with_metric<T, F>(f: F)
where F: FnOnce(&Self) -> T,

Access to this metrics group to record a metric. -Only records if this metric is registered in the global registry.
§

fn try_get() -> Option<&'static Self>

Attempts to get the current metric from the global registry.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +Only records if this metric is registered in the global registry.

source§

fn try_get() -> Option<&'static Self>

Attempts to get the current metric from the global registry.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( diff --git a/pr/2778/docs/iroh_net/netcheck/struct.Metrics.html b/pr/2778/docs/iroh_net/netcheck/struct.Metrics.html index 2eed106346..fb9f58dfd6 100644 --- a/pr/2778/docs/iroh_net/netcheck/struct.Metrics.html +++ b/pr/2778/docs/iroh_net/netcheck/struct.Metrics.html @@ -1,15 +1,15 @@ Metrics in iroh_net::netcheck - Rust

Struct iroh_net::netcheck::Metrics

source ·
pub struct Metrics {
-    pub stun_packets_dropped: Counter,
-    pub stun_packets_sent_ipv4: Counter,
-    pub stun_packets_sent_ipv6: Counter,
-    pub stun_packets_recv_ipv4: Counter,
-    pub stun_packets_recv_ipv6: Counter,
-    pub reports: Counter,
-    pub reports_full: Counter,
+    pub stun_packets_dropped: Counter,
+    pub stun_packets_sent_ipv4: Counter,
+    pub stun_packets_sent_ipv6: Counter,
+    pub stun_packets_recv_ipv4: Counter,
+    pub stun_packets_recv_ipv6: Counter,
+    pub reports: Counter,
+    pub reports_full: Counter,
 }
Expand description

Enum of metrics for the module

-

Fields§

§stun_packets_dropped: Counter§stun_packets_sent_ipv4: Counter§stun_packets_sent_ipv6: Counter§stun_packets_recv_ipv4: Counter§stun_packets_recv_ipv6: Counter§reports: Counter§reports_full: Counter

Trait Implementations§

source§

impl Clone for Metrics

source§

fn clone(&self) -> Metrics

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Metrics

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Metrics

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Iterable for Metrics

source§

fn iter<'a>(&'a self) -> IntoIter<(&'static str, &'a dyn Any)>

Returns an iterator over the struct’s fields as tuples. Read more
source§

impl Metric for Metrics

source§

fn name() -> &'static str

The name of this metric group.
§

fn new(registry: &mut Registry) -> Self

Initializes this metric group.
§

fn with_metric<T, F>(f: F)
where +

Fields§

§stun_packets_dropped: Counter§stun_packets_sent_ipv4: Counter§stun_packets_sent_ipv6: Counter§stun_packets_recv_ipv4: Counter§stun_packets_recv_ipv6: Counter§reports: Counter§reports_full: Counter

Trait Implementations§

source§

impl Clone for Metrics

source§

fn clone(&self) -> Metrics

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Metrics

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Metrics

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Iterable for Metrics

source§

fn iter<'a>(&'a self) -> IntoIter<(&'static str, &'a dyn Any)>

Returns an iterator over the struct’s fields as tuples. Read more
source§

impl Metric for Metrics

source§

fn name() -> &'static str

The name of this metric group.
source§

fn new(registry: &mut Registry) -> Self

Initializes this metric group.
source§

fn with_metric<T, F>(f: F)
where F: FnOnce(&Self) -> T,

Access to this metrics group to record a metric. -Only records if this metric is registered in the global registry.
§

fn try_get() -> Option<&'static Self>

Attempts to get the current metric from the global registry.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +Only records if this metric is registered in the global registry.

source§

fn try_get() -> Option<&'static Self>

Attempts to get the current metric from the global registry.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( diff --git a/pr/2778/docs/iroh_net/portmapper/struct.Metrics.html b/pr/2778/docs/iroh_net/portmapper/struct.Metrics.html index 4b81f3aa22..edd4f04110 100644 --- a/pr/2778/docs/iroh_net/portmapper/struct.Metrics.html +++ b/pr/2778/docs/iroh_net/portmapper/struct.Metrics.html @@ -1,19 +1,19 @@ Metrics in iroh_net::portmapper - Rust

Struct iroh_net::portmapper::Metrics

source ·
pub struct Metrics {
-    pub probes_started: Counter,
-    pub local_port_updates: Counter,
-    pub mapping_attempts: Counter,
-    pub mapping_failures: Counter,
-    pub external_address_updated: Counter,
-    pub upnp_probes: Counter,
-    pub upnp_probes_failed: Counter,
-    pub upnp_available: Counter,
-    pub upnp_gateway_updated: Counter,
-    pub pcp_probes: Counter,
-    pub pcp_available: Counter,
+    pub probes_started: Counter,
+    pub local_port_updates: Counter,
+    pub mapping_attempts: Counter,
+    pub mapping_failures: Counter,
+    pub external_address_updated: Counter,
+    pub upnp_probes: Counter,
+    pub upnp_probes_failed: Counter,
+    pub upnp_available: Counter,
+    pub upnp_gateway_updated: Counter,
+    pub pcp_probes: Counter,
+    pub pcp_available: Counter,
 }
Expand description

Enum of metrics for the module

-

Fields§

§probes_started: Counter§local_port_updates: Counter§mapping_attempts: Counter§mapping_failures: Counter§external_address_updated: Counter§upnp_probes: Counter§upnp_probes_failed: Counter§upnp_available: Counter§upnp_gateway_updated: Counter§pcp_probes: Counter§pcp_available: Counter

Trait Implementations§

source§

impl Clone for Metrics

source§

fn clone(&self) -> Metrics

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Metrics

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Metrics

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Iterable for Metrics

source§

fn iter<'a>(&'a self) -> IntoIter<(&'static str, &'a dyn Any)>

Returns an iterator over the struct’s fields as tuples. Read more
source§

impl Metric for Metrics

source§

fn name() -> &'static str

The name of this metric group.
§

fn new(registry: &mut Registry) -> Self

Initializes this metric group.
§

fn with_metric<T, F>(f: F)
where +

Fields§

§probes_started: Counter§local_port_updates: Counter§mapping_attempts: Counter§mapping_failures: Counter§external_address_updated: Counter§upnp_probes: Counter§upnp_probes_failed: Counter§upnp_available: Counter§upnp_gateway_updated: Counter§pcp_probes: Counter§pcp_available: Counter

Trait Implementations§

source§

impl Clone for Metrics

source§

fn clone(&self) -> Metrics

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Metrics

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Metrics

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Iterable for Metrics

source§

fn iter<'a>(&'a self) -> IntoIter<(&'static str, &'a dyn Any)>

Returns an iterator over the struct’s fields as tuples. Read more
source§

impl Metric for Metrics

source§

fn name() -> &'static str

The name of this metric group.
source§

fn new(registry: &mut Registry) -> Self

Initializes this metric group.
source§

fn with_metric<T, F>(f: F)
where F: FnOnce(&Self) -> T,

Access to this metrics group to record a metric. -Only records if this metric is registered in the global registry.
§

fn try_get() -> Option<&'static Self>

Attempts to get the current metric from the global registry.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +Only records if this metric is registered in the global registry.

source§

fn try_get() -> Option<&'static Self>

Attempts to get the current metric from the global registry.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( diff --git a/pr/2778/docs/iroh_net/relay/server/struct.Metrics.html b/pr/2778/docs/iroh_net/relay/server/struct.Metrics.html index 0a807f9331..09b73f86ee 100644 --- a/pr/2778/docs/iroh_net/relay/server/struct.Metrics.html +++ b/pr/2778/docs/iroh_net/relay/server/struct.Metrics.html @@ -1,46 +1,46 @@ Metrics in iroh_net::relay::server - Rust

Struct iroh_net::relay::server::Metrics

source ·
pub struct Metrics {
Show 19 fields - pub bytes_sent: Counter, - pub bytes_recv: Counter, - pub send_packets_sent: Counter, - pub send_packets_recv: Counter, - pub send_packets_dropped: Counter, - pub disco_packets_sent: Counter, - pub disco_packets_recv: Counter, - pub disco_packets_dropped: Counter, - pub other_packets_sent: Counter, - pub other_packets_recv: Counter, - pub other_packets_dropped: Counter, - pub got_ping: Counter, - pub sent_pong: Counter, - pub unknown_frames: Counter, - pub accepts: Counter, - pub disconnects: Counter, - pub unique_client_keys: Counter, - pub websocket_accepts: Counter, - pub derp_accepts: Counter, + pub bytes_sent: Counter, + pub bytes_recv: Counter, + pub send_packets_sent: Counter, + pub send_packets_recv: Counter, + pub send_packets_dropped: Counter, + pub disco_packets_sent: Counter, + pub disco_packets_recv: Counter, + pub disco_packets_dropped: Counter, + pub other_packets_sent: Counter, + pub other_packets_recv: Counter, + pub other_packets_dropped: Counter, + pub got_ping: Counter, + pub sent_pong: Counter, + pub unknown_frames: Counter, + pub accepts: Counter, + pub disconnects: Counter, + pub unique_client_keys: Counter, + pub websocket_accepts: Counter, + pub derp_accepts: Counter,
}
Available on crate feature iroh-relay only.
Expand description

Metrics tracked for the relay server

-

Fields§

§bytes_sent: Counter

Bytes sent from a FrameType::SendPacket

-
§bytes_recv: Counter

Bytes received from a FrameType::SendPacket

-
§send_packets_sent: Counter

FrameType::SendPacket sent, that are not disco messages

-
§send_packets_recv: Counter

FrameType::SendPacket received, that are not disco messages

-
§send_packets_dropped: Counter

FrameType::SendPacket dropped, that are not disco messages

-
§disco_packets_sent: Counter

FrameType::SendPacket sent that are disco messages

-
§disco_packets_recv: Counter

FrameType::SendPacket received that are disco messages

-
§disco_packets_dropped: Counter

FrameType::SendPacket dropped that are disco messages

-
§other_packets_sent: Counter

Packets of other FrameTypes sent

-
§other_packets_recv: Counter

Packets of other FrameTypes received

-
§other_packets_dropped: Counter

Packets of other FrameTypes dropped

-
§got_ping: Counter

Number of FrameType::Pings received

-
§sent_pong: Counter

Number of FrameType::Pongs sent

-
§unknown_frames: Counter

Number of FrameType::Unknown received

-
§accepts: Counter

Number of connections we have accepted

-
§disconnects: Counter

Number of connections we have removed because of an error

-
§unique_client_keys: Counter

Number of unique client keys per day

-
§websocket_accepts: Counter

Number of accepted websocket connections

-
§derp_accepts: Counter

Number of accepted ‘iroh derp http’ connection upgrades

-

Trait Implementations§

source§

impl Clone for Metrics

source§

fn clone(&self) -> Metrics

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Metrics

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Metrics

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Iterable for Metrics

source§

fn iter<'a>(&'a self) -> IntoIter<(&'static str, &'a dyn Any)>

Returns an iterator over the struct’s fields as tuples. Read more
source§

impl Metric for Metrics

source§

fn name() -> &'static str

The name of this metric group.
§

fn new(registry: &mut Registry) -> Self

Initializes this metric group.
§

fn with_metric<T, F>(f: F)
where +

Fields§

§bytes_sent: Counter

Bytes sent from a FrameType::SendPacket

+
§bytes_recv: Counter

Bytes received from a FrameType::SendPacket

+
§send_packets_sent: Counter

FrameType::SendPacket sent, that are not disco messages

+
§send_packets_recv: Counter

FrameType::SendPacket received, that are not disco messages

+
§send_packets_dropped: Counter

FrameType::SendPacket dropped, that are not disco messages

+
§disco_packets_sent: Counter

FrameType::SendPacket sent that are disco messages

+
§disco_packets_recv: Counter

FrameType::SendPacket received that are disco messages

+
§disco_packets_dropped: Counter

FrameType::SendPacket dropped that are disco messages

+
§other_packets_sent: Counter

Packets of other FrameTypes sent

+
§other_packets_recv: Counter

Packets of other FrameTypes received

+
§other_packets_dropped: Counter

Packets of other FrameTypes dropped

+
§got_ping: Counter

Number of FrameType::Pings received

+
§sent_pong: Counter

Number of FrameType::Pongs sent

+
§unknown_frames: Counter

Number of FrameType::Unknown received

+
§accepts: Counter

Number of connections we have accepted

+
§disconnects: Counter

Number of connections we have removed because of an error

+
§unique_client_keys: Counter

Number of unique client keys per day

+
§websocket_accepts: Counter

Number of accepted websocket connections

+
§derp_accepts: Counter

Number of accepted ‘iroh derp http’ connection upgrades

+

Trait Implementations§

source§

impl Clone for Metrics

source§

fn clone(&self) -> Metrics

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Metrics

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Metrics

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Iterable for Metrics

source§

fn iter<'a>(&'a self) -> IntoIter<(&'static str, &'a dyn Any)>

Returns an iterator over the struct’s fields as tuples. Read more
source§

impl Metric for Metrics

source§

fn name() -> &'static str

The name of this metric group.
source§

fn new(registry: &mut Registry) -> Self

Initializes this metric group.
source§

fn with_metric<T, F>(f: F)
where F: FnOnce(&Self) -> T,

Access to this metrics group to record a metric. -Only records if this metric is registered in the global registry.
§

fn try_get() -> Option<&'static Self>

Attempts to get the current metric from the global registry.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +Only records if this metric is registered in the global registry.

source§

fn try_get() -> Option<&'static Self>

Attempts to get the current metric from the global registry.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( diff --git a/pr/2778/docs/iroh_net/relay/struct.RelayUrl.html b/pr/2778/docs/iroh_net/relay/struct.RelayUrl.html index 9226e2fb21..f2241c8133 100644 --- a/pr/2778/docs/iroh_net/relay/struct.RelayUrl.html +++ b/pr/2778/docs/iroh_net/relay/struct.RelayUrl.html @@ -1,4 +1,4 @@ -RelayUrl in iroh_net::relay - Rust

Struct iroh_net::relay::RelayUrl

pub struct RelayUrl(/* private fields */);
Expand description

A URL identifying a relay server.

+RelayUrl in iroh_net::relay - Rust

Struct iroh_net::relay::RelayUrl

source ·
pub struct RelayUrl(/* private fields */);
Expand description

A URL identifying a relay server.

This is but a wrapper around Url, with a few custom tweaks:

  • @@ -441,30 +441,30 @@ It is the user’s responsibility to check the URL’s scheme before calling thi 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.)

    -

Trait Implementations§

§

impl Clone for RelayUrl

§

fn clone(&self) -> RelayUrl

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for RelayUrl

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Deref for RelayUrl

Dereferences to the wrapped Url.

+

Trait Implementations§

source§

impl Clone for RelayUrl

source§

fn clone(&self) -> RelayUrl

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RelayUrl

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Deref for RelayUrl

Dereferences to the wrapped Url.

Note that DerefMut is not implemented on purpose, so this type has more flexibility to change the inner later.

-
§

type Target = Url

The resulting type after dereferencing.
§

fn deref(&self) -> &<RelayUrl as Deref>::Target

Dereferences the value.
§

impl<'de> Deserialize<'de> for RelayUrl

§

fn deserialize<__D>( +

§

type Target = Url

The resulting type after dereferencing.
source§

fn deref(&self) -> &<RelayUrl as Deref>::Target

Dereferences the value.
source§

impl<'de> Deserialize<'de> for RelayUrl

source§

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 Display for RelayUrl

§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl From<RelayUrl> for Url

§

fn from(value: RelayUrl) -> Url

Converts to this type from the input type.
§

impl From<Url> for RelayUrl

§

fn from(url: Url) -> RelayUrl

Converts to this type from the input type.
§

impl FromStr for RelayUrl

Support for parsing strings directly.

+ __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more

source§

impl Display for RelayUrl

source§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl From<RelayUrl> for Url

source§

fn from(value: RelayUrl) -> Url

Converts to this type from the input type.
source§

impl From<Url> for RelayUrl

source§

fn from(url: Url) -> RelayUrl

Converts to this type from the input type.
source§

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.

-
§

type Err = Error

The associated error which can be returned from parsing.
§

fn from_str(s: &str) -> Result<RelayUrl, <RelayUrl as FromStr>::Err>

Parses a string s to return a value of this type. Read more
§

impl Hash for RelayUrl

§

fn hash<__H>(&self, state: &mut __H)
where +
§

type Err = Error

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<RelayUrl, <RelayUrl as FromStr>::Err>

Parses a string s to return a value of this type. Read more

source§

impl Hash for RelayUrl

source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, - Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl Ord for RelayUrl

§

fn cmp(&self, other: &RelayUrl) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for RelayUrl

source§

fn cmp(&self, other: &RelayUrl) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where - Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
§

impl PartialEq for RelayUrl

§

fn eq(&self, other: &RelayUrl) -> bool

This method tests for self and other values to be equal, and is used + Self: Sized + PartialOrd,
Restrict a value to a certain interval. Read more
source§

impl PartialEq for RelayUrl

source§

fn eq(&self, other: &RelayUrl) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
§

impl PartialOrd for RelayUrl

§

fn partial_cmp(&self, other: &RelayUrl) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
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 <= +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for RelayUrl

source§

fn partial_cmp(&self, other: &RelayUrl) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
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 more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
§

impl Serialize for RelayUrl

§

fn serialize<__S>( +operator. Read more

source§

impl Serialize for RelayUrl

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 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§

source§

impl<T> Any for T
where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

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 T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( diff --git a/pr/2778/docs/iroh_net/struct.AddrInfo.html b/pr/2778/docs/iroh_net/struct.AddrInfo.html index bf49ca4a7e..a5f222850f 100644 --- a/pr/2778/docs/iroh_net/struct.AddrInfo.html +++ b/pr/2778/docs/iroh_net/struct.AddrInfo.html @@ -1,4 +1,4 @@ -AddrInfo in iroh_net - Rust

Struct iroh_net::AddrInfo

pub struct AddrInfo {
+AddrInfo in iroh_net - Rust

Struct iroh_net::AddrInfo

source ·
pub struct AddrInfo {
     pub relay_url: Option<RelayUrl>,
     pub direct_addresses: BTreeSet<SocketAddr>,
 }
Expand description

Network paths to contact an iroh-net node.

@@ -7,26 +7,26 @@ Unless a [discovery service] is used at least one path is required to connect to other node, see NodeAddr for details.

Fields§

§relay_url: Option<RelayUrl>

The node’s home relay url.

§direct_addresses: BTreeSet<SocketAddr>

Socket addresses where the peer might be reached directly.

-

Implementations§

§

impl AddrInfo

pub fn is_empty(&self) -> bool

Returns whether this addressing information is empty.

-

pub fn apply_options(&mut self, opts: AddrInfoOptions)

Applies the options to self.

+

Implementations§

source§

impl AddrInfo

source

pub fn is_empty(&self) -> bool

Returns whether this addressing information is empty.

+
source

pub fn apply_options(&mut self, opts: AddrInfoOptions)

Applies the options to self.

This is used to more tightly control the information stored in ab AddrInfo received from another API. E.g. to ensure a discovery service is used the AddrInfoOptions::Id] option could be used to remove all other addressing details.

-

Trait Implementations§

§

impl Clone for AddrInfo

§

fn clone(&self) -> AddrInfo

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for AddrInfo

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Default for AddrInfo

§

fn default() -> AddrInfo

Returns the “default value” for a type. Read more
§

impl<'de> Deserialize<'de> for AddrInfo

§

fn deserialize<__D>( +

Trait Implementations§

source§

impl Clone for AddrInfo

source§

fn clone(&self) -> AddrInfo

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AddrInfo

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Default for AddrInfo

source§

fn default() -> AddrInfo

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for AddrInfo

source§

fn deserialize<__D>( __deserializer: __D ) -> Result<AddrInfo, <__D as Deserializer<'de>>::Error>
where - __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<NodeInfo> for AddrInfo

source§

fn from(value: NodeInfo) -> Self

Converts to this type from the input type.
§

impl Ord for AddrInfo

§

fn cmp(&self, other: &AddrInfo) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<NodeInfo> for AddrInfo

source§

fn from(value: NodeInfo) -> Self

Converts to this type from the input type.
source§

impl Ord for AddrInfo

source§

fn cmp(&self, other: &AddrInfo) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where - Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
§

impl PartialEq for AddrInfo

§

fn eq(&self, other: &AddrInfo) -> bool

This method tests for self and other values to be equal, and is used + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for AddrInfo

source§

fn eq(&self, other: &AddrInfo) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
§

impl PartialOrd for AddrInfo

§

fn partial_cmp(&self, other: &AddrInfo) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
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 <= +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for AddrInfo

source§

fn partial_cmp(&self, other: &AddrInfo) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
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 more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
§

impl Serialize for AddrInfo

§

fn serialize<__S>( +operator. Read more

source§

impl Serialize for AddrInfo

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 Eq for AddrInfo

§

impl StructuralPartialEq for AddrInfo

Auto Trait Implementations§

§

impl Freeze for AddrInfo

§

impl RefUnwindSafe for AddrInfo

§

impl Send for AddrInfo

§

impl Sync for AddrInfo

§

impl Unpin for AddrInfo

§

impl UnwindSafe for AddrInfo

Blanket Implementations§

source§

impl<T> Any for T
where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for AddrInfo

source§

impl StructuralPartialEq for AddrInfo

Auto Trait Implementations§

§

impl Freeze for AddrInfo

§

impl RefUnwindSafe for AddrInfo

§

impl Send for AddrInfo

§

impl Sync for AddrInfo

§

impl Unpin for AddrInfo

§

impl UnwindSafe for AddrInfo

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( diff --git a/pr/2778/docs/iroh_net/struct.NodeAddr.html b/pr/2778/docs/iroh_net/struct.NodeAddr.html index 67cd5fcebf..476c960399 100644 --- a/pr/2778/docs/iroh_net/struct.NodeAddr.html +++ b/pr/2778/docs/iroh_net/struct.NodeAddr.html @@ -1,4 +1,4 @@ -NodeAddr in iroh_net - Rust

Struct iroh_net::NodeAddr

pub struct NodeAddr {
+NodeAddr in iroh_net - Rust

Struct iroh_net::NodeAddr

source ·
pub struct NodeAddr {
     pub node_id: PublicKey,
     pub info: AddrInfo,
 }
Expand description

Network-level addressing information for an iroh-net node.

@@ -25,40 +25,40 @@ number of network-level addressing information. It is a generic addressing type whenever a connection to other nodes needs to be established.

Fields§

§node_id: PublicKey

The node’s identifier.

§info: AddrInfo

Addressing information to connect to Self::node_id.

-

Implementations§

§

impl NodeAddr

pub fn new(node_id: PublicKey) -> NodeAddr

Creates a new NodeAddr with empty AddrInfo.

-

pub fn with_relay_url(self, relay_url: RelayUrl) -> NodeAddr

Adds a relay url to the node’s AddrInfo.

-

pub fn with_direct_addresses( +

Implementations§

source§

impl NodeAddr

source

pub fn new(node_id: PublicKey) -> NodeAddr

Creates a new NodeAddr with empty AddrInfo.

+
source

pub fn with_relay_url(self, relay_url: RelayUrl) -> NodeAddr

Adds a relay url to the node’s AddrInfo.

+
source

pub fn with_direct_addresses( self, addresses: impl IntoIterator<Item = SocketAddr> ) -> NodeAddr

Adds the given direct addresses to the peer’s AddrInfo.

-

pub fn from_parts( +

source

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.

-

pub fn apply_options(&mut self, opts: AddrInfoOptions)

Applies the options to self.

+
source

pub fn apply_options(&mut self, opts: AddrInfoOptions)

Applies the options to self.

This is used to more tightly control the information stored in a NodeAddr received from another API. E.g. to ensure a discovery service is used the AddrInfoOptions::Id] option could be used to remove all other addressing details.

-

pub fn direct_addresses(&self) -> impl Iterator<Item = &SocketAddr>

Returns the direct addresses of this peer.

-

pub fn relay_url(&self) -> Option<&RelayUrl>

Returns the relay url of this peer.

-

Trait Implementations§

§

impl Clone for NodeAddr

§

fn clone(&self) -> NodeAddr

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for NodeAddr

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<'de> Deserialize<'de> for NodeAddr

§

fn deserialize<__D>( +

source

pub fn direct_addresses(&self) -> impl Iterator<Item = &SocketAddr>

Returns the direct addresses of this peer.

+
source

pub fn relay_url(&self) -> Option<&RelayUrl>

Returns the relay url of this peer.

+

Trait Implementations§

source§

impl Clone for NodeAddr

source§

fn clone(&self) -> NodeAddr

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for NodeAddr

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for NodeAddr

source§

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 more
§

impl From<(PublicKey, Option<RelayUrl>, &[SocketAddr])> for NodeAddr

§

fn from(value: (PublicKey, Option<RelayUrl>, &[SocketAddr])) -> NodeAddr

Converts to this type from the input type.
§

impl From<NodeAddr> for NodeTicket

§

fn from(addr: NodeAddr) -> NodeTicket

Creates a ticket from given addressing info.

-
source§

impl From<NodeInfo> for NodeAddr

source§

fn from(value: NodeInfo) -> Self

Converts to this type from the input type.
§

impl From<NodeTicket> for NodeAddr

§

fn from(ticket: NodeTicket) -> NodeAddr

Returns the addressing info from given ticket.

-
§

impl From<PublicKey> for NodeAddr

§

fn from(node_id: PublicKey) -> NodeAddr

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

§

fn cmp(&self, other: &NodeAddr) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<(PublicKey, Option<RelayUrl>, &[SocketAddr])> for NodeAddr

source§

fn from(value: (PublicKey, Option<RelayUrl>, &[SocketAddr])) -> NodeAddr

Converts to this type from the input type.
source§

impl From<NodeAddr> for NodeTicket

source§

fn from(addr: NodeAddr) -> NodeTicket

Creates a ticket from given addressing info.

+
source§

impl From<NodeInfo> for NodeAddr

source§

fn from(value: NodeInfo) -> Self

Converts to this type from the input type.
source§

impl From<NodeTicket> for NodeAddr

source§

fn from(ticket: NodeTicket) -> NodeAddr

Returns the addressing info from given ticket.

+
source§

impl From<PublicKey> for NodeAddr

source§

fn from(node_id: PublicKey) -> NodeAddr

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.
source§

impl Ord for NodeAddr

source§

fn cmp(&self, other: &NodeAddr) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where - Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
§

impl PartialEq for NodeAddr

§

fn eq(&self, other: &NodeAddr) -> bool

This method tests for self and other values to be equal, and is used + Self: Sized + PartialOrd,
Restrict a value to a certain interval. Read more
source§

impl PartialEq for NodeAddr

source§

fn eq(&self, other: &NodeAddr) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
§

impl PartialOrd for NodeAddr

§

fn partial_cmp(&self, other: &NodeAddr) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
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 <= +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for NodeAddr

source§

fn partial_cmp(&self, other: &NodeAddr) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
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 more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
§

impl Serialize for NodeAddr

§

fn serialize<__S>( +operator. Read more

source§

impl Serialize for NodeAddr

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 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§

source§

impl<T> Any for T
where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

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 T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( diff --git a/pr/2778/docs/iroh_net/ticket/struct.NodeTicket.html b/pr/2778/docs/iroh_net/ticket/struct.NodeTicket.html index 180a57cd37..0d21e42eb7 100644 --- a/pr/2778/docs/iroh_net/ticket/struct.NodeTicket.html +++ b/pr/2778/docs/iroh_net/ticket/struct.NodeTicket.html @@ -1,4 +1,4 @@ -NodeTicket in iroh_net::ticket - Rust

Struct iroh_net::ticket::NodeTicket

pub struct NodeTicket { /* private fields */ }
Expand description

A token containing information for establishing a connection to a node.

+NodeTicket in iroh_net::ticket - Rust

Struct iroh_net::ticket::NodeTicket

source ·
pub struct NodeTicket { /* private fields */ }
Expand description

A token containing information for establishing a connection to a node.

Contains

  • The NodeId of the node to connect to (a 32-byte ed25519 public key).
  • @@ -10,20 +10,20 @@ possible to do so.

    This NodeTicket is a single item which can be easily serialized and deserialized and implements the Ticket trait. The Display and FromStr traits can also be used to round-trip the ticket to string.

    -

Implementations§

§

impl NodeTicket

pub fn new(node: NodeAddr) -> NodeTicket

Creates a new ticket.

-

pub fn node_addr(&self) -> &NodeAddr

The NodeAddr of the provider for this ticket.

-

Trait Implementations§

§

impl Clone for NodeTicket

§

fn clone(&self) -> NodeTicket

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for NodeTicket

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<'de> Deserialize<'de> for NodeTicket

§

fn deserialize<D>( +

Implementations§

source§

impl NodeTicket

source

pub fn new(node: NodeAddr) -> NodeTicket

Creates a new ticket.

+
source

pub fn node_addr(&self) -> &NodeAddr

The NodeAddr of the provider for this ticket.

+

Trait Implementations§

source§

impl Clone for NodeTicket

source§

fn clone(&self) -> NodeTicket

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for NodeTicket

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for NodeTicket

source§

fn deserialize<D>( deserializer: D ) -> Result<NodeTicket, <D as Deserializer<'de>>::Error>
where - D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl Display for NodeTicket

§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl From<NodeAddr> for NodeTicket

§

fn from(addr: NodeAddr) -> NodeTicket

Creates a ticket from given addressing info.

-
§

impl From<NodeTicket> for NodeAddr

§

fn from(ticket: NodeTicket) -> NodeAddr

Returns the addressing info from given ticket.

-
§

impl FromStr for NodeTicket

§

type Err = Error

The associated error which can be returned from parsing.
§

fn from_str(s: &str) -> Result<NodeTicket, <NodeTicket as FromStr>::Err>

Parses a string s to return a value of this type. Read more
§

impl PartialEq for NodeTicket

§

fn eq(&self, other: &NodeTicket) -> bool

This method tests for self and other values to be equal, and is used + D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for NodeTicket

source§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl From<NodeAddr> for NodeTicket

source§

fn from(addr: NodeAddr) -> NodeTicket

Creates a ticket from given addressing info.

+
source§

impl From<NodeTicket> for NodeAddr

source§

fn from(ticket: NodeTicket) -> NodeAddr

Returns the addressing info from given ticket.

+
source§

impl FromStr for NodeTicket

§

type Err = Error

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<NodeTicket, <NodeTicket as FromStr>::Err>

Parses a string s to return a value of this type. Read more
source§

impl PartialEq for NodeTicket

source§

fn eq(&self, other: &NodeTicket) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
§

impl Serialize for NodeTicket

§

fn serialize<S>( +sufficient, and should not be overridden without very good reason.

source§

impl Serialize for NodeTicket

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 Ticket for NodeTicket

§

const KIND: &'static str = "node"

String prefix describing the kind of iroh ticket. Read more
§

fn to_bytes(&self) -> Vec<u8> ⓘ

Serialize to bytes used in the base32 string representation.
§

fn from_bytes(bytes: &[u8]) -> Result<NodeTicket, Error>

Deserialize from the base32 string representation bytes.
§

fn serialize(&self) -> String

Serialize to string.
§

fn deserialize(str: &str) -> Result<Self, Error>

Deserialize from a string.
§

impl Eq for NodeTicket

§

impl StructuralPartialEq for NodeTicket

Auto Trait Implementations§

§

impl Freeze for NodeTicket

§

impl RefUnwindSafe for NodeTicket

§

impl Send for NodeTicket

§

impl Sync for NodeTicket

§

impl Unpin for NodeTicket

§

impl UnwindSafe for NodeTicket

Blanket Implementations§

source§

impl<T> Any for T
where + S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Ticket for NodeTicket

source§

const KIND: &'static str = "node"

String prefix describing the kind of iroh ticket. Read more
source§

fn to_bytes(&self) -> Vec<u8> ⓘ

Serialize to bytes used in the base32 string representation.
source§

fn from_bytes(bytes: &[u8]) -> Result<NodeTicket, Error>

Deserialize from the base32 string representation bytes.
source§

fn serialize(&self) -> String

Serialize to string.
source§

fn deserialize(str: &str) -> Result<Self, Error>

Deserialize from a string.
source§

impl Eq for NodeTicket

source§

impl StructuralPartialEq for NodeTicket

Auto Trait Implementations§

§

impl Freeze for NodeTicket

§

impl RefUnwindSafe for NodeTicket

§

impl Send for NodeTicket

§

impl Sync for NodeTicket

§

impl Unpin for NodeTicket

§

impl UnwindSafe for NodeTicket

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( diff --git a/pr/2778/docs/iroh_net/ticket/trait.Ticket.html b/pr/2778/docs/iroh_net/ticket/trait.Ticket.html index 2975e85cad..02dbb4a9cb 100644 --- a/pr/2778/docs/iroh_net/ticket/trait.Ticket.html +++ b/pr/2778/docs/iroh_net/ticket/trait.Ticket.html @@ -1,13 +1,13 @@ -Ticket in iroh_net::ticket - Rust

Trait iroh_net::ticket::Ticket

pub trait Ticket: Sized {
+Ticket in iroh_net::ticket - Rust

Trait iroh_net::ticket::Ticket

source ·
pub trait Ticket: Sized {
     const KIND: &'static str;
 
     // Required methods
     fn to_bytes(&self) -> Vec<u8> ⓘ;
-    fn from_bytes(bytes: &[u8]) -> Result<Self, Error>;
+    fn from_bytes(bytes: &[u8]) -> Result<Self, Error>;
 
     // Provided methods
     fn serialize(&self) -> String { ... }
-    fn deserialize(str: &str) -> Result<Self, Error> { ... }
+    fn deserialize(str: &str) -> Result<Self, Error> { ... }
 }
Expand description

A ticket is a serializable object combining information required for an operation.

Typically tickets contain all information required for an operation, e.g. an iroh blob ticket would contain the hash of the data as well as information about how to reach the @@ -18,10 +18,10 @@ ticket will be prepended to the string to make it somewhat self describing.

versioning, others might not.

The serialization format for converting the ticket from and to bytes is left to the implementer. We recommend using postcard for serialization.

-

Required Associated Constants§

const KIND: &'static str

String prefix describing the kind of iroh ticket.

+

Required Associated Constants§

source

const KIND: &'static str

String prefix describing the kind of iroh ticket.

This should be lower case ascii characters.

-

Required Methods§

fn to_bytes(&self) -> Vec<u8> ⓘ

Serialize to bytes used in the base32 string representation.

-

fn from_bytes(bytes: &[u8]) -> Result<Self, Error>

Deserialize from the base32 string representation bytes.

-

Provided Methods§

fn serialize(&self) -> String

Serialize to string.

-

fn deserialize(str: &str) -> Result<Self, Error>

Deserialize from a string.

-

Object Safety§

This trait is not object safe.

Implementors§

§

impl Ticket for NodeTicket

§

const KIND: &'static str = "node"

§

impl Ticket for BlobTicket

§

const KIND: &'static str = "blob"

\ No newline at end of file +

Required Methods§

source

fn to_bytes(&self) -> Vec<u8> ⓘ

Serialize to bytes used in the base32 string representation.

+
source

fn from_bytes(bytes: &[u8]) -> Result<Self, Error>

Deserialize from the base32 string representation bytes.

+

Provided Methods§

source

fn serialize(&self) -> String

Serialize to string.

+
source

fn deserialize(str: &str) -> Result<Self, Error>

Deserialize from a string.

+

Object Safety§

This trait is not object safe.

Implementors§

source§

impl Ticket for BlobTicket

source§

const KIND: &'static str = "blob"

source§

impl Ticket for NodeTicket

source§

const KIND: &'static str = "node"

\ No newline at end of file diff --git a/pr/2778/docs/iroh_net/type.NodeId.html b/pr/2778/docs/iroh_net/type.NodeId.html index 574790c8ee..4740be351a 100644 --- a/pr/2778/docs/iroh_net/type.NodeId.html +++ b/pr/2778/docs/iroh_net/type.NodeId.html @@ -1,4 +1,4 @@ -NodeId in iroh_net - Rust

Type Alias iroh_net::NodeId

pub type NodeId = PublicKey;
Expand description

The identifier for a node in the (iroh) network.

+NodeId in iroh_net - Rust

Type Alias iroh_net::NodeId

source ·
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/2778/docs/iroh_net_bench/enum.EndpointSelector.html b/pr/2778/docs/iroh_net_bench/enum.EndpointSelector.html index f8477e755c..67415a086e 100644 --- a/pr/2778/docs/iroh_net_bench/enum.EndpointSelector.html +++ b/pr/2778/docs/iroh_net_bench/enum.EndpointSelector.html @@ -1,7 +1,7 @@ EndpointSelector in iroh_net_bench - Rust

Enum iroh_net_bench::EndpointSelector

source ·
pub enum EndpointSelector {
-    Iroh(Endpoint),
+    Iroh(Endpoint),
     Quinn(Endpoint),
-}

Variants§

§

Iroh(Endpoint)

§

Quinn(Endpoint)

Implementations§

source§

impl EndpointSelector

source

pub async fn close(self) -> Result<()>

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +}

Variants§

§

Iroh(Endpoint)

§

Quinn(Endpoint)

Implementations§

source§

impl EndpointSelector

source

pub async fn close(self) -> Result<()>

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( diff --git a/pr/2778/docs/iroh_net_bench/iroh/fn.client.html b/pr/2778/docs/iroh_net_bench/iroh/fn.client.html index 0e03029f98..9b299854f4 100644 --- a/pr/2778/docs/iroh_net_bench/iroh/fn.client.html +++ b/pr/2778/docs/iroh_net_bench/iroh/fn.client.html @@ -1,6 +1,6 @@ client in iroh_net_bench::iroh - Rust

Function iroh_net_bench::iroh::client

source ·
pub async fn client(
-    server_addr: NodeAddr,
-    relay_url: Option<RelayUrl>,
+    server_addr: NodeAddr,
+    relay_url: Option<RelayUrl>,
     opt: Opt
 ) -> Result<ClientStats>
Expand description

Create and run a client

\ No newline at end of file diff --git a/pr/2778/docs/iroh_net_bench/iroh/fn.connect_client.html b/pr/2778/docs/iroh_net_bench/iroh/fn.connect_client.html index 2667ff9a69..5443cdc7e2 100644 --- a/pr/2778/docs/iroh_net_bench/iroh/fn.connect_client.html +++ b/pr/2778/docs/iroh_net_bench/iroh/fn.connect_client.html @@ -1,6 +1,6 @@ connect_client in iroh_net_bench::iroh - Rust

Function iroh_net_bench::iroh::connect_client

source ·
pub async fn connect_client(
-    server_addr: NodeAddr,
-    relay_url: Option<RelayUrl>,
+    server_addr: NodeAddr,
+    relay_url: Option<RelayUrl>,
     opt: Opt
-) -> Result<(Endpoint, Connection)>
Expand description

Create a client endpoint and client connection

+) -> Result<(Endpoint, Connection)>
Expand description

Create a client endpoint and client connection

\ No newline at end of file diff --git a/pr/2778/docs/iroh_net_bench/iroh/fn.server.html b/pr/2778/docs/iroh_net_bench/iroh/fn.server.html index 7c6a1ce43b..215ad95505 100644 --- a/pr/2778/docs/iroh_net_bench/iroh/fn.server.html +++ b/pr/2778/docs/iroh_net_bench/iroh/fn.server.html @@ -1,2 +1,2 @@ -server in iroh_net_bench::iroh - Rust

Function iroh_net_bench::iroh::server

source ·
pub async fn server(endpoint: Endpoint, opt: Opt) -> Result<()>
Expand description

Take the provided endpoint and run the server

+server in iroh_net_bench::iroh - Rust

Function iroh_net_bench::iroh::server

source ·
pub async fn server(endpoint: Endpoint, opt: Opt) -> Result<()>
Expand description

Take the provided endpoint and run the server

\ No newline at end of file diff --git a/pr/2778/docs/iroh_net_bench/iroh/fn.server_endpoint.html b/pr/2778/docs/iroh_net_bench/iroh/fn.server_endpoint.html index d33aefb4c9..303015b81e 100644 --- a/pr/2778/docs/iroh_net_bench/iroh/fn.server_endpoint.html +++ b/pr/2778/docs/iroh_net_bench/iroh/fn.server_endpoint.html @@ -1,6 +1,6 @@ server_endpoint in iroh_net_bench::iroh - Rust

Function iroh_net_bench::iroh::server_endpoint

source ·
pub fn server_endpoint(
     rt: &Runtime,
-    relay_url: &Option<RelayUrl>,
+    relay_url: &Option<RelayUrl>,
     opt: &Opt
-) -> (NodeAddr, Endpoint)
Expand description

Creates a server endpoint which runs on the given runtime

+) -> (NodeAddr, Endpoint)
Expand description

Creates a server endpoint which runs on the given runtime

\ No newline at end of file diff --git a/pr/2778/docs/iroh_relay/metrics/struct.StunMetrics.html b/pr/2778/docs/iroh_relay/metrics/struct.StunMetrics.html index 09b25d078c..8b68424f20 100644 --- a/pr/2778/docs/iroh_relay/metrics/struct.StunMetrics.html +++ b/pr/2778/docs/iroh_relay/metrics/struct.StunMetrics.html @@ -1,18 +1,18 @@ StunMetrics in iroh_relay::metrics - Rust

Struct iroh_relay::metrics::StunMetrics

source ·
pub struct StunMetrics {
-    pub requests: Counter,
-    pub ipv4_success: Counter,
-    pub ipv6_success: Counter,
-    pub bad_requests: Counter,
-    pub failures: Counter,
+    pub requests: Counter,
+    pub ipv4_success: Counter,
+    pub ipv6_success: Counter,
+    pub bad_requests: Counter,
+    pub failures: Counter,
 }
Expand description

StunMetrics tracked for the relay server

-

Fields§

§requests: Counter

Number of stun requests made

-
§ipv4_success: Counter

Number of successful requests over ipv4

-
§ipv6_success: Counter

Number of successful requests over ipv6

-
§bad_requests: Counter

Number of bad requests, either non-stun packets or incorrect binding request

-
§failures: Counter

Number of failures

-

Trait Implementations§

source§

impl Clone for StunMetrics

source§

fn clone(&self) -> StunMetrics

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for StunMetrics

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for StunMetrics

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Iterable for StunMetrics

source§

fn iter<'a>(&'a self) -> IntoIter<(&'static str, &'a dyn Any)>

Returns an iterator over the struct’s fields as tuples. Read more
source§

impl Metric for StunMetrics

source§

fn name() -> &'static str

The name of this metric group.
§

fn new(registry: &mut Registry) -> Self

Initializes this metric group.
§

fn with_metric<T, F>(f: F)
where +

Fields§

§requests: Counter

Number of stun requests made

+
§ipv4_success: Counter

Number of successful requests over ipv4

+
§ipv6_success: Counter

Number of successful requests over ipv6

+
§bad_requests: Counter

Number of bad requests, either non-stun packets or incorrect binding request

+
§failures: Counter

Number of failures

+

Trait Implementations§

source§

impl Clone for StunMetrics

source§

fn clone(&self) -> StunMetrics

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for StunMetrics

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for StunMetrics

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Iterable for StunMetrics

source§

fn iter<'a>(&'a self) -> IntoIter<(&'static str, &'a dyn Any)>

Returns an iterator over the struct’s fields as tuples. Read more
source§

impl Metric for StunMetrics

source§

fn name() -> &'static str

The name of this metric group.
source§

fn new(registry: &mut Registry) -> Self

Initializes this metric group.
source§

fn with_metric<T, F>(f: F)
where F: FnOnce(&Self) -> T,

Access to this metrics group to record a metric. -Only records if this metric is registered in the global registry.
§

fn try_get() -> Option<&'static Self>

Attempts to get the current metric from the global registry.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +Only records if this metric is registered in the global registry.

source§

fn try_get() -> Option<&'static Self>

Attempts to get the current metric from the global registry.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( diff --git a/pr/2778/docs/iroh_relay/struct.Config.html b/pr/2778/docs/iroh_relay/struct.Config.html index 482c992bba..0b7bfa9786 100644 --- a/pr/2778/docs/iroh_relay/struct.Config.html +++ b/pr/2778/docs/iroh_relay/struct.Config.html @@ -1,5 +1,5 @@ Config in iroh_relay - Rust

Struct iroh_relay::Config

source ·
pub(crate) struct Config {
-    pub(crate) secret_key: SecretKey,
+    pub(crate) secret_key: SecretKey,
     pub(crate) enable_relay: bool,
     pub(crate) http_bind_addr: Option<SocketAddr>,
     pub(crate) tls: Option<TlsConfig>,
@@ -10,7 +10,7 @@
     pub(crate) metrics_bind_addr: Option<SocketAddr>,
 }
Expand description

Configuration for the relay-server.

This is (de)serialised to/from a TOML config file.

-

Fields§

§secret_key: SecretKey

The iroh [SecretKey] for this relay server.

+

Fields§

§secret_key: SecretKey

The iroh SecretKey for this relay server.

If not specified a new key will be generated and the config file will be re-written using it.

§enable_relay: bool

Whether to enable the Relay server.

diff --git a/pr/2778/docs/src/iroh_net/endpoint.rs.html b/pr/2778/docs/src/iroh_net/endpoint.rs.html index 067cc04a00..0753ba5bf3 100644 --- a/pr/2778/docs/src/iroh_net/endpoint.rs.html +++ b/pr/2778/docs/src/iroh_net/endpoint.rs.html @@ -1850,7 +1850,6 @@ 1850 1851 1852 -1853
//! The [`Endpoint`] allows establishing connections to other iroh-net nodes.
 //!
 //! The [`Endpoint`] is the main API interface to manage a local iroh-net node.  It allows
@@ -1914,7 +1913,6 @@
 /// is still no connection the configured [`Discovery`] will be used however.
 const DISCOVERY_WAIT_PERIOD: Duration = Duration::from_millis(500);
 
-
 type DiscoveryBuilder = Box<dyn FnOnce(&SecretKey) -> Option<Box<dyn Discovery>> + Send + Sync>;
 
 /// Builder for [`Endpoint`].
diff --git a/pr/2778/docs/trait.impl/core/convert/trait.From.js b/pr/2778/docs/trait.impl/core/convert/trait.From.js
index 2ed57da99e..22218fc445 100644
--- a/pr/2778/docs/trait.impl/core/convert/trait.From.js
+++ b/pr/2778/docs/trait.impl/core/convert/trait.From.js
@@ -3,6 +3,6 @@
 "iroh_base":[["impl From<&[u8; 32]> for Hash"],["impl From<(PublicKey, Option<RelayUrl>, &[SocketAddr])> for NodeAddr"],["impl From<FromHexError> for HexOrBase32ParseError"],["impl From<HexOrBase32ParseError> for KeyParsingError"],["impl From<BlobFormat> for u64"],["impl From<Error> for RpcError"],["impl From<Error> for RpcError"],["impl From<Url> for RelayUrl"],["impl From<DecodeError> for HexOrBase32ParseError"],["impl From<DecodeError> for Error"],["impl From<Hash> for Hash"],["impl From<Hash> for [u8; 32]"],["impl From<PublicKey> for NodeAddr"],["impl From<NodeAddr> for NodeTicket"],["impl From<RelayUrl> for Url"],["impl From<NodeTicket> for NodeAddr"],["impl From<Error> for KeyParsingError"],["impl From<Error> for Error"],["impl From<Hash> for Hash"],["impl From<SigningKey> for SecretKey"],["impl From<VerifyingKey> for PublicKey"],["impl From<[u8; 32]> for Hash"],["impl From<[u8; 32]> for SecretKey"]],
 "iroh_blobs":[["impl From<&str> for Tag"],["impl From<(AtBlobContent, Result<BaoContentItem, DecodeError>)> for BlobContentNext"],["impl From<BlobId> for u64"],["impl From<GetResponseError> for Error"],["impl From<GetError> for FailureAction"],["impl From<AtBlobHeaderNextError> for GetError"],["impl From<AtBlobHeaderNextError> for DecodeError"],["impl From<AtBlobHeaderNextError> for Error"],["impl From<ConnectedNextError> for GetError"],["impl From<ConnectedNextError> for Error"],["impl From<DecodeError> for GetError"],["impl From<DecodeError> for Error"],["impl From<Closed> for VarInt"],["impl From<SpawnError> for Error"],["impl From<ProgressSendError> for GetError"],["impl From<ProgressSendError> for Error"],["impl From<String> for Tag"],["impl From<Vec<u8>> for SparseMemFile"],["impl From<Error> for GetError"],["impl From<Error> for DecodeError"],["impl From<Error> for GetResponseError"],["impl From<DownloadKind> for HashAndFormat"],["impl From<AtClosing> for ConnectedNext"],["impl From<AtClosing> for EndBlobNext"],["impl From<AtEndBlob> for BlobContentNext"],["impl From<AtStartChild> for ConnectedNext"],["impl From<AtStartChild> for EndBlobNext"],["impl From<AtStartRoot> for ConnectedNext"],["impl From<HashSeq> for Bytes"],["impl From<GetRequest> for Request"],["impl From<HashAndFormat> for DownloadKind"],["impl From<Tag> for Bytes"],["impl From<Bytes> for Tag"],["impl From<ClosedStream> for GetError"],["impl From<ClosedStream> for ConnectedNextError"],["impl From<ConnectionError> for GetResponseError"],["impl From<ConnectionError> for GetError"],["impl From<DecodeError> for GetResponseError"],["impl From<DecodeError> for DecodeError"],["impl From<Error> for GetResponseError"],["impl From<ReadError> for GetResponseError"],["impl From<ReadError> for GetError"],["impl From<WriteError> for GetResponseError"],["impl From<WriteError> for GetError"],["impl From<WriteError> for ConnectedNextError"],["impl<T: CustomEventSender> From<T> for EventSender"]],
 "iroh_docs":[["impl From<&Author> for AuthorPublicKey"],["impl From<&AuthorPublicKey> for AuthorId"],["impl From<&NamespacePublicKey> for NamespaceId"],["impl From<&NamespaceSecret> for NamespacePublicKey"],["impl From<&[u8; 32]> for AuthorId"],["impl From<&[u8; 32]> for NamespaceId"],["impl From<CapabilityKind> for u8"],["impl From<ValidationFailure> for InsertError"],["impl From<Error> for OpenError"],["impl From<QueryBuilder<FlatQuery>> for Query"],["impl From<QueryBuilder<SingleLatestPerKeyQuery>> for Query"],["impl From<Author> for AuthorId"],["impl From<Author> for AuthorPublicKey"],["impl From<AuthorId> for AuthorFilter"],["impl From<AuthorId> for [u8; 32]"],["impl From<AuthorPublicKey> for AuthorId"],["impl From<NamespaceId> for Capability"],["impl From<NamespaceId> for [u8; 32]"],["impl From<NamespacePublicKey> for NamespaceId"],["impl From<NamespaceSecret> for Capability"],["impl From<NamespaceSecret> for NamespaceId"],["impl From<NamespaceSecret> for NamespacePublicKey"],["impl From<ReadOnly> for InsertError"],["impl From<SignedEntry> for Entry"],["impl From<SigningKey> for Author"],["impl From<SigningKey> for NamespaceSecret"],["impl From<VerifyingKey> for AuthorPublicKey"],["impl From<VerifyingKey> for NamespacePublicKey"],["impl From<[u8; 32]> for AuthorId"],["impl From<[u8; 32]> for NamespaceId"],["impl<T: AsRef<[u8]>> From<T> for KeyFilter"]],
-"iroh_gossip":[["impl From<Event<PublicKey>> for GossipEvent"],["impl<T: Into<[u8; 32]>> From<T> for TopicId"]],
+"iroh_gossip":[["impl From<Event<PublicKey>> for GossipEvent"],["impl<T: Into<[u8; 32]>> From<T> for TopicId"]],
 "iroh_net":[["impl From<&NodeInfo> for TxtAttrs<IrohAttr>"],["impl From<&TxtAttrs<IrohAttr>> for NodeInfo"],["impl From<IpAddr> for IpFamily"],["impl From<IpFamily> for Domain"],["impl From<Error> for ClientError"],["impl From<Error> for PingError"],["impl From<NodeInfo> for AddrInfo"],["impl From<NodeInfo> for NodeAddr"],["impl From<TxtAttrs<IrohAttr>> for NodeInfo"],["impl From<RemoteInfo> for NodeAddr"],["impl From<GenError> for CreateConfigError"],["impl From<ParseError> for Error"],["impl From<VerificationError> for Error"],["impl From<Error> for ClientError"],["impl From<Error> for ClientError"],["impl From<Error> for ClientError"],["impl From<Error> for GenError"],["impl From<Error> for ParseError"],["impl From<Error> for VerificationError"],["impl From<JoinError> for ClientError"],["impl From<NoInitialCipherSuite> for CreateConfigError"],["impl From<SurgeError> for PingError"],["impl From<UdpSocket> for UdpSocket"],["impl<T> From<T> for ConcurrentDiscovery
where\n T: IntoIterator<Item = Box<dyn Discovery>>,
"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/pr/2778/docs/trait.impl/iroh_metrics/core/trait.Metric.js b/pr/2778/docs/trait.impl/iroh_metrics/core/trait.Metric.js index 8902586109..d96d2ad190 100644 --- a/pr/2778/docs/trait.impl/iroh_metrics/core/trait.Metric.js +++ b/pr/2778/docs/trait.impl/iroh_metrics/core/trait.Metric.js @@ -1,9 +1,9 @@ (function() {var implementors = { "iroh":[["impl Metric for Metrics"]], -"iroh_blobs":[["impl Metric for Metrics"]], +"iroh_blobs":[["impl Metric for Metrics"]], "iroh_dns_server":[["impl Metric for Metrics"]], -"iroh_docs":[["impl Metric for Metrics"]], -"iroh_gossip":[["impl Metric for Metrics"]], -"iroh_net":[["impl Metric for Metrics"],["impl Metric for Metrics"],["impl Metric for Metrics"],["impl Metric for Metrics"]], -"iroh_relay":[["impl Metric for StunMetrics"]] +"iroh_docs":[["impl Metric for Metrics"]], +"iroh_gossip":[["impl Metric for Metrics"]], +"iroh_net":[["impl Metric for Metrics"],["impl Metric for Metrics"],["impl Metric for Metrics"],["impl Metric for Metrics"]], +"iroh_relay":[["impl Metric for StunMetrics"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/pr/2778/docs/type.impl/iroh_net/key/struct.PublicKey.js b/pr/2778/docs/type.impl/iroh_net/key/struct.PublicKey.js index bbff1af8fe..2fcaac350a 100644 --- a/pr/2778/docs/type.impl/iroh_net/key/struct.PublicKey.js +++ b/pr/2778/docs/type.impl/iroh_net/key/struct.PublicKey.js @@ -1,3 +1,3 @@ (function() {var type_impls = { -"iroh_net":[["
§

impl AsRef<[u8]> for PublicKey

§

fn as_ref(&self) -> &[u8] ⓘ

Converts this type into a shared reference of the (usually inferred) input type.
","AsRef<[u8]>","iroh_net::NodeId"],["
§

impl Clone for PublicKey

§

fn clone(&self) -> PublicKey

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
","Clone","iroh_net::NodeId"],["
§

impl Debug for PublicKey

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Debug","iroh_net::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_net::NodeId"],["
§

impl Display for PublicKey

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Display","iroh_net::NodeId"],["
§

impl From<VerifyingKey> for PublicKey

§

fn from(verifying_key: VerifyingKey) -> PublicKey

Converts to this type from the input type.
","From","iroh_net::NodeId"],["
§

impl FromStr for PublicKey

Deserialises the PublicKey from it’s base32 encoding.

\n

Display is capable of serialising this format.

\n
§

type Err = KeyParsingError

The associated error which can be returned from parsing.
§

fn from_str(s: &str) -> Result<PublicKey, <PublicKey as FromStr>::Err>

Parses a string s to return a value of this type. Read more
","FromStr","iroh_net::NodeId"],["
§

impl Hash for PublicKey

§

fn hash<H>(&self, state: &mut H)
where\n H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where\n H: Hasher,\n Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
","Hash","iroh_net::NodeId"],["
§

impl Ord for PublicKey

§

fn cmp(&self, other: &PublicKey) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where\n Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where\n Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where\n Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
","Ord","iroh_net::NodeId"],["
§

impl PartialEq for PublicKey

§

fn eq(&self, other: &PublicKey) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq","iroh_net::NodeId"],["
§

impl PartialOrd for PublicKey

§

fn partial_cmp(&self, other: &PublicKey) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
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 <=\noperator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >=\noperator. Read more
","PartialOrd","iroh_net::NodeId"],["
§

impl PublicKey

pub fn as_bytes(&self) -> &[u8; 32]

Get this public key as a byte array.

\n

pub fn from_bytes(bytes: &[u8; 32]) -> Result<PublicKey, Error>

Construct a PublicKey from a slice of bytes.

\n
§Warning
\n

This 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

pub fn verify(&self, message: &[u8], signature: &Signature) -> Result<(), Error>

Verify a signature on a message with this secret key’s public key.

\n
§Return
\n

Returns Ok(()) if the signature is valid, and Err otherwise.

\n

pub fn fmt_short(&self) -> String

Convert to a base32 string limited to the first 10 bytes for a friendly string\nrepresentation of the key.

\n
",0,"iroh_net::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_net::NodeId"],["
§

impl TryFrom<&[u8]> for PublicKey

§

type Error = Error

The type returned in the event of a conversion error.
§

fn try_from(\n bytes: &[u8]\n) -> Result<PublicKey, <PublicKey as TryFrom<&[u8]>>::Error>

Performs the conversion.
","TryFrom<&[u8]>","iroh_net::NodeId"],["
§

impl TryFrom<&[u8; 32]> for PublicKey

§

type Error = Error

The type returned in the event of a conversion error.
§

fn try_from(\n bytes: &[u8; 32]\n) -> Result<PublicKey, <PublicKey as TryFrom<&[u8; 32]>>::Error>

Performs the conversion.
","TryFrom<&[u8; 32]>","iroh_net::NodeId"],["
§

impl Copy for PublicKey

","Copy","iroh_net::NodeId"],["
§

impl Eq for PublicKey

","Eq","iroh_net::NodeId"],["
§

impl StructuralPartialEq for PublicKey

","StructuralPartialEq","iroh_net::NodeId"]] +"iroh_net":[["
source§

impl AsRef<[u8]> for PublicKey

source§

fn as_ref(&self) -> &[u8] ⓘ

Converts this type into a shared reference of the (usually inferred) input type.
","AsRef<[u8]>","iroh_net::NodeId"],["
source§

impl Clone for PublicKey

source§

fn clone(&self) -> PublicKey

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
","Clone","iroh_net::NodeId"],["
source§

impl Debug for PublicKey

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Debug","iroh_net::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_net::NodeId"],["
source§

impl Display for PublicKey

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Display","iroh_net::NodeId"],["
source§

impl From<VerifyingKey> for PublicKey

source§

fn from(verifying_key: VerifyingKey) -> PublicKey

Converts to this type from the input type.
","From","iroh_net::NodeId"],["
source§

impl FromStr for PublicKey

Deserialises the PublicKey from it’s base32 encoding.

\n

Display is capable of serialising this format.

\n
§

type Err = KeyParsingError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<PublicKey, <PublicKey as FromStr>::Err>

Parses a string s to return a value of this type. Read more
","FromStr","iroh_net::NodeId"],["
source§

impl Hash for PublicKey

source§

fn hash<H>(&self, state: &mut H)
where\n H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where\n H: Hasher,\n Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
","Hash","iroh_net::NodeId"],["
source§

impl Ord for PublicKey

source§

fn cmp(&self, other: &PublicKey) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where\n Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where\n Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where\n Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
","Ord","iroh_net::NodeId"],["
source§

impl PartialEq for PublicKey

source§

fn eq(&self, other: &PublicKey) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq","iroh_net::NodeId"],["
source§

impl PartialOrd for PublicKey

source§

fn partial_cmp(&self, other: &PublicKey) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
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 <=\noperator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >=\noperator. Read more
","PartialOrd","iroh_net::NodeId"],["
source§

impl PublicKey

source

pub fn as_bytes(&self) -> &[u8; 32]

Get this public key as a byte array.

\n
source

pub fn from_bytes(bytes: &[u8; 32]) -> Result<PublicKey, Error>

Construct a PublicKey from a slice of bytes.

\n
§Warning
\n

This 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
source

pub fn verify(&self, message: &[u8], signature: &Signature) -> Result<(), Error>

Verify a signature on a message with this secret key’s public key.

\n
§Return
\n

Returns Ok(()) if the signature is valid, and Err otherwise.

\n
source

pub fn fmt_short(&self) -> String

Convert to a base32 string limited to the first 10 bytes for a friendly string\nrepresentation of the key.

\n
",0,"iroh_net::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_net::NodeId"],["
source§

impl TryFrom<&[u8]> for PublicKey

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(\n bytes: &[u8]\n) -> Result<PublicKey, <PublicKey as TryFrom<&[u8]>>::Error>

Performs the conversion.
","TryFrom<&[u8]>","iroh_net::NodeId"],["
source§

impl TryFrom<&[u8; 32]> for PublicKey

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(\n bytes: &[u8; 32]\n) -> Result<PublicKey, <PublicKey as TryFrom<&[u8; 32]>>::Error>

Performs the conversion.
","TryFrom<&[u8; 32]>","iroh_net::NodeId"],["
source§

impl Copy for PublicKey

","Copy","iroh_net::NodeId"],["
source§

impl Eq for PublicKey

","Eq","iroh_net::NodeId"],["
source§

impl StructuralPartialEq for PublicKey

","StructuralPartialEq","iroh_net::NodeId"]] };if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file