From 40497b22ea331ba73ed63fc21cbc30b3ea67e7e6 Mon Sep 17 00:00:00 2001 From: flub Date: Thu, 29 Aug 2024 11:29:21 +0000 Subject: [PATCH] deploy: e019b5a6c00cff695b41dc3b4cba0875a35453ce --- .../net/endpoint/enum.DirectAddrType.html | 12 ++--- .../net/endpoint/fn.default_relay_mode.html | 2 +- .../net/endpoint/fn.get_remote_node_id.html | 2 +- .../net/endpoint/fn.make_server_config.html | 2 +- .../docs/iroh/net/endpoint/struct.Accept.html | 6 +-- .../iroh/net/endpoint/struct.Connecting.html | 16 +++---- .../iroh/net/endpoint/struct.DirectAddr.html | 12 ++--- .../iroh/net/endpoint/struct.Endpoint.html | 46 +++++++++---------- .../iroh/net/endpoint/struct.Incoming.html | 20 ++++---- .../net/endpoint/struct.IncomingFuture.html | 6 +-- pr/2678/docs/iroh/net/struct.Endpoint.html | 46 +++++++++---------- .../iroh_blobs/metrics/struct.Metrics.html | 28 +++++------ .../iroh_docs/metrics/struct.Metrics.html | 42 ++++++++--------- .../docs/iroh_gossip/net/enum.Command.html | 4 +- .../iroh_gossip/net/enum.GossipEvent.html | 14 +++--- .../docs/iroh_gossip/net/struct.Gossip.html | 6 +-- .../net/struct.GossipReceiver.html | 2 +- .../iroh_gossip/net/struct.GossipSender.html | 2 +- .../iroh_gossip/net/struct.JoinOptions.html | 6 +-- .../docs/iroh_gossip/net/struct.Message.html | 4 +- .../iroh_gossip/net/type.ProtoCommand.html | 6 +-- .../docs/iroh_gossip/net/type.ProtoEvent.html | 14 +++--- .../iroh_gossip/net/util/fn.read_message.html | 2 +- .../net/util/fn.write_message.html | 2 +- .../iroh_gossip/proto/topic/enum.Event.html | 2 +- .../endpoint/enum.DirectAddrType.html | 12 ++--- .../endpoint/fn.default_relay_mode.html | 2 +- .../endpoint/fn.get_remote_node_id.html | 2 +- .../endpoint/fn.make_server_config.html | 2 +- pr/2678/docs/iroh_net/endpoint/index.html | 2 +- .../docs/iroh_net/endpoint/struct.Accept.html | 6 +-- .../iroh_net/endpoint/struct.AddrInfo.html | 18 ++++---- .../iroh_net/endpoint/struct.Connecting.html | 16 +++---- .../iroh_net/endpoint/struct.DirectAddr.html | 12 ++--- .../iroh_net/endpoint/struct.Endpoint.html | 46 +++++++++---------- .../iroh_net/endpoint/struct.Incoming.html | 20 ++++---- .../endpoint/struct.IncomingFuture.html | 6 +-- .../iroh_net/endpoint/struct.NodeAddr.html | 28 +++++------ .../iroh_net/key/enum.KeyParsingError.html | 8 ++-- pr/2678/docs/iroh_net/key/index.html | 2 +- .../docs/iroh_net/key/struct.PublicKey.html | 30 ++++++------ .../docs/iroh_net/key/struct.SecretKey.html | 26 +++++------ .../iroh_net/key/struct.SharedSecret.html | 8 ++-- pr/2678/docs/iroh_net/key/type.NodeId.html | 2 +- .../docs/iroh_net/relay/struct.RelayUrl.html | 20 ++++---- pr/2678/docs/iroh_net/struct.AddrInfo.html | 18 ++++---- pr/2678/docs/iroh_net/struct.NodeAddr.html | 28 +++++------ .../iroh_net/ticket/struct.NodeTicket.html | 14 +++--- pr/2678/docs/iroh_net/type.NodeId.html | 2 +- .../docs/iroh_net_bench/iroh/fn.client.html | 4 +- .../iroh/fn.connect_client.html | 4 +- .../iroh/fn.server_endpoint.html | 4 +- pr/2678/docs/iroh_relay/struct.Config.html | 4 +- pr/2678/docs/src/iroh_net/endpoint.rs.html | 6 ++- pr/2678/docs/src/iroh_net/magicsock.rs.html | 22 ++++++--- .../trait.impl/core/convert/trait.From.js | 2 +- .../iroh_metrics/core/trait.Metric.js | 4 +- .../iroh_net/key/struct.PublicKey.js | 2 +- 58 files changed, 350 insertions(+), 336 deletions(-) diff --git a/pr/2678/docs/iroh/net/endpoint/enum.DirectAddrType.html b/pr/2678/docs/iroh/net/endpoint/enum.DirectAddrType.html index 26678b99f6..30f2fff678 100644 --- a/pr/2678/docs/iroh/net/endpoint/enum.DirectAddrType.html +++ b/pr/2678/docs/iroh/net/endpoint/enum.DirectAddrType.html @@ -1,4 +1,4 @@ -DirectAddrType in iroh::net::endpoint - Rust

Enum iroh::net::endpoint::DirectAddrType

source ·
pub enum DirectAddrType {
+DirectAddrType in iroh::net::endpoint - Rust

Enum iroh::net::endpoint::DirectAddrType

source ·
pub enum DirectAddrType {
     Unknown,
     Local,
     Stun,
@@ -20,17 +20,17 @@ get a publicly routable direct address.

It is possible to configure iroh-net to bound to a specific port and independently configure the router to forward this port to the iroh-net node. This indicates a situation like this, which still uses STUN to discover the public address.

-

Trait Implementations§

source§

impl Clone for DirectAddrType

source§

fn clone(&self) -> DirectAddrType

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 DirectAddrType

source§

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

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

impl Display for DirectAddrType

source§

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

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

impl Hash for DirectAddrType

source§

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

Trait Implementations§

source§

impl Clone for DirectAddrType

source§

fn clone(&self) -> DirectAddrType

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 DirectAddrType

source§

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

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

impl Display for DirectAddrType

source§

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

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

impl Hash for DirectAddrType

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

impl Ord for DirectAddrType

source§

fn cmp(&self, other: &DirectAddrType) -> 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 DirectAddrType

source§

fn cmp(&self, other: &DirectAddrType) -> 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 DirectAddrType

source§

fn eq(&self, other: &DirectAddrType) -> 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 DirectAddrType

source§

fn eq(&self, other: &DirectAddrType) -> 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.
source§

impl PartialOrd for DirectAddrType

source§

fn partial_cmp(&self, other: &DirectAddrType) -> 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 DirectAddrType

source§

fn partial_cmp(&self, other: &DirectAddrType) -> 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
source§

impl Copy for DirectAddrType

source§

impl Eq for DirectAddrType

source§

impl StructuralPartialEq for DirectAddrType

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +operator. Read more

source§

impl Copy for DirectAddrType

source§

impl Eq for DirectAddrType

source§

impl StructuralPartialEq for DirectAddrType

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/2678/docs/iroh/net/endpoint/fn.default_relay_mode.html b/pr/2678/docs/iroh/net/endpoint/fn.default_relay_mode.html index dfc99b5751..cac79ef477 100644 --- a/pr/2678/docs/iroh/net/endpoint/fn.default_relay_mode.html +++ b/pr/2678/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 set to 1, it will return RelayMode::Staging. Otherwise, it will return RelayMode::Default.

\ No newline at end of file diff --git a/pr/2678/docs/iroh/net/endpoint/fn.get_remote_node_id.html b/pr/2678/docs/iroh/net/endpoint/fn.get_remote_node_id.html index 633721f169..1f8f871a9f 100644 --- a/pr/2678/docs/iroh/net/endpoint/fn.get_remote_node_id.html +++ b/pr/2678/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/2678/docs/iroh/net/endpoint/fn.make_server_config.html b/pr/2678/docs/iroh/net/endpoint/fn.make_server_config.html index 06dcd2f64a..c92b49d606 100644 --- a/pr/2678/docs/iroh/net/endpoint/fn.make_server_config.html +++ b/pr/2678/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/2678/docs/iroh/net/endpoint/struct.Accept.html b/pr/2678/docs/iroh/net/endpoint/struct.Accept.html
index b81fc2fe3b..09110ad2c5 100644
--- a/pr/2678/docs/iroh/net/endpoint/struct.Accept.html
+++ b/pr/2678/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/2678/docs/iroh/net/endpoint/struct.Connecting.html b/pr/2678/docs/iroh/net/endpoint/struct.Connecting.html index 5b28fa14da..cfd715ab04 100644 --- a/pr/2678/docs/iroh/net/endpoint/struct.Connecting.html +++ b/pr/2678/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/2678/docs/iroh/net/endpoint/struct.DirectAddr.html b/pr/2678/docs/iroh/net/endpoint/struct.DirectAddr.html index 796768d662..cf179bcaa0 100644 --- a/pr/2678/docs/iroh/net/endpoint/struct.DirectAddr.html +++ b/pr/2678/docs/iroh/net/endpoint/struct.DirectAddr.html @@ -1,4 +1,4 @@ -DirectAddr in iroh::net::endpoint - Rust

Struct iroh::net::endpoint::DirectAddr

source ·
pub struct DirectAddr {
+DirectAddr in iroh::net::endpoint - Rust

Struct iroh::net::endpoint::DirectAddr

source ·
pub struct DirectAddr {
     pub addr: SocketAddr,
     pub typ: DirectAddrType,
 }
Expand description

A direct address on which an iroh-node might be contactable.

@@ -7,17 +7,17 @@ contacted. These can come from various sources depending on the network topolog iroh-net node, see DirectAddrType for the several kinds of sources.

Fields§

§addr: SocketAddr

The address.

§typ: DirectAddrType

The origin of this direct address.

-

Trait Implementations§

source§

impl Clone for DirectAddr

source§

fn clone(&self) -> DirectAddr

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 DirectAddr

source§

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

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

impl Hash for DirectAddr

source§

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

Trait Implementations§

source§

impl Clone for DirectAddr

source§

fn clone(&self) -> DirectAddr

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 DirectAddr

source§

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

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

impl Hash for DirectAddr

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

impl Ord for DirectAddr

source§

fn cmp(&self, other: &DirectAddr) -> 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 DirectAddr

source§

fn cmp(&self, other: &DirectAddr) -> 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 DirectAddr

source§

fn eq(&self, other: &DirectAddr) -> 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 DirectAddr

source§

fn eq(&self, other: &DirectAddr) -> 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.
source§

impl PartialOrd for DirectAddr

source§

fn partial_cmp(&self, other: &DirectAddr) -> 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 DirectAddr

source§

fn partial_cmp(&self, other: &DirectAddr) -> 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
source§

impl Eq for DirectAddr

source§

impl StructuralPartialEq for DirectAddr

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +operator. Read more

source§

impl Eq for DirectAddr

source§

impl StructuralPartialEq for DirectAddr

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/2678/docs/iroh/net/endpoint/struct.Endpoint.html b/pr/2678/docs/iroh/net/endpoint/struct.Endpoint.html index 676a8f655a..07aa3b2c36 100644 --- a/pr/2678/docs/iroh/net/endpoint/struct.Endpoint.html +++ b/pr/2678/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: NodeAddr, alpn: &[u8] @@ -38,7 +38,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] @@ -47,13 +47,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 @@ -63,7 +63,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 @@ -76,15 +76,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 @@ -93,14 +93,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 @@ -123,10 +123,10 @@ most recently discovered IP endpoints.

let mep = Endpoint::builder().bind(0).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 @@ -135,14 +135,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.

@@ -158,13 +158,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 @@ -172,14 +172,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§

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§

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/2678/docs/iroh/net/endpoint/struct.Incoming.html b/pr/2678/docs/iroh/net/endpoint/struct.Incoming.html index 67a66d8a48..3b9c5e1f48 100644 --- a/pr/2678/docs/iroh/net/endpoint/struct.Incoming.html +++ b/pr/2678/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/2678/docs/iroh/net/endpoint/struct.IncomingFuture.html b/pr/2678/docs/iroh/net/endpoint/struct.IncomingFuture.html index e23556a6db..4152b76af8 100644 --- a/pr/2678/docs/iroh/net/endpoint/struct.IncomingFuture.html +++ b/pr/2678/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/2678/docs/iroh/net/struct.Endpoint.html b/pr/2678/docs/iroh/net/struct.Endpoint.html index 74ab367ba9..8306c5ec2f 100644 --- a/pr/2678/docs/iroh/net/struct.Endpoint.html +++ b/pr/2678/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: NodeAddr, alpn: &[u8] @@ -38,7 +38,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] @@ -47,13 +47,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 @@ -63,7 +63,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 @@ -76,15 +76,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 @@ -93,14 +93,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 @@ -123,10 +123,10 @@ most recently discovered IP endpoints.

let mep = Endpoint::builder().bind(0).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 @@ -135,14 +135,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.

@@ -158,13 +158,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 @@ -172,14 +172,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§

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§

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/2678/docs/iroh_blobs/metrics/struct.Metrics.html b/pr/2678/docs/iroh_blobs/metrics/struct.Metrics.html index 5887529647..8db691fd2c 100644 --- a/pr/2678/docs/iroh_blobs/metrics/struct.Metrics.html +++ b/pr/2678/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.
source§

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

Initializes this metric group.
source§

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

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

Initializes this metric group.
§

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.
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 +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 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/2678/docs/iroh_docs/metrics/struct.Metrics.html b/pr/2678/docs/iroh_docs/metrics/struct.Metrics.html index 14f294057a..09df15e741 100644 --- a/pr/2678/docs/iroh_docs/metrics/struct.Metrics.html +++ b/pr/2678/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.
source§

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

Initializes this metric group.
source§

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

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

Initializes this metric group.
§

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.
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 +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 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/2678/docs/iroh_gossip/net/enum.Command.html b/pr/2678/docs/iroh_gossip/net/enum.Command.html index e20a902bc1..df220a2c80 100644 --- a/pr/2678/docs/iroh_gossip/net/enum.Command.html +++ b/pr/2678/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>),
 }
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/2678/docs/iroh_gossip/net/enum.GossipEvent.html b/pr/2678/docs/iroh_gossip/net/enum.GossipEvent.html index e453221b30..e9feb070dc 100644 --- a/pr/2678/docs/iroh_gossip/net/enum.GossipEvent.html +++ b/pr/2678/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),
 }
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/2678/docs/iroh_gossip/net/struct.Gossip.html b/pr/2678/docs/iroh_gossip/net/struct.Gossip.html index 8dd5570da0..b19472112e 100644 --- a/pr/2678/docs/iroh_gossip/net/struct.Gossip.html +++ b/pr/2678/docs/iroh_gossip/net/struct.Gossip.html @@ -1,7 +1,7 @@ Gossip in iroh_gossip::net - Rust

Struct iroh_gossip::net::Gossip

source ·
pub struct Gossip { /* private fields */ }
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.

@@ -13,7 +13,7 @@ gossip actor through

Implementations§

source§

impl Gossip

source

pub fn from_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/2678/docs/iroh_gossip/net/struct.GossipReceiver.html b/pr/2678/docs/iroh_gossip/net/struct.GossipReceiver.html index cfe7dff279..c79fd81811 100644 --- a/pr/2678/docs/iroh_gossip/net/struct.GossipReceiver.html +++ b/pr/2678/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 */ }
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/2678/docs/iroh_gossip/net/struct.GossipSender.html b/pr/2678/docs/iroh_gossip/net/struct.GossipSender.html index 47ad6e69ff..db05b11bcc 100644 --- a/pr/2678/docs/iroh_gossip/net/struct.GossipSender.html +++ b/pr/2678/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 */);
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/2678/docs/iroh_gossip/net/struct.JoinOptions.html b/pr/2678/docs/iroh_gossip/net/struct.JoinOptions.html index 7f2a9e792c..cf31d4b8ea 100644 --- a/pr/2678/docs/iroh_gossip/net/struct.JoinOptions.html +++ b/pr/2678/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,
 }
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/2678/docs/iroh_gossip/net/struct.Message.html b/pr/2678/docs/iroh_gossip/net/struct.Message.html index 76ae67e0a3..a9e18759c5 100644 --- a/pr/2678/docs/iroh_gossip/net/struct.Message.html +++ b/pr/2678/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,
 }
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/2678/docs/iroh_gossip/net/type.ProtoCommand.html b/pr/2678/docs/iroh_gossip/net/type.ProtoCommand.html index 5c5f3a8956..9b415b3388 100644 --- a/pr/2678/docs/iroh_gossip/net/type.ProtoCommand.html +++ b/pr/2678/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>;
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>;
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/2678/docs/iroh_gossip/net/type.ProtoEvent.html b/pr/2678/docs/iroh_gossip/net/type.ProtoEvent.html index 7bad2777cc..8112783662 100644 --- a/pr/2678/docs/iroh_gossip/net/type.ProtoEvent.html +++ b/pr/2678/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>;
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>;
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/2678/docs/iroh_gossip/net/util/fn.read_message.html b/pr/2678/docs/iroh_gossip/net/util/fn.read_message.html index 84215badfa..3b1865db49 100644 --- a/pr/2678/docs/iroh_gossip/net/util/fn.read_message.html +++ b/pr/2678/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>>>
Expand description

Read a length-prefixed message and decode as ProtoMessage;

+) -> Result<Option<Message<PublicKey>>>
Expand description

Read a length-prefixed message and decode as ProtoMessage;

\ No newline at end of file diff --git a/pr/2678/docs/iroh_gossip/net/util/fn.write_message.html b/pr/2678/docs/iroh_gossip/net/util/fn.write_message.html index 57dfa9468f..68c3f1f252 100644 --- a/pr/2678/docs/iroh_gossip/net/util/fn.write_message.html +++ b/pr/2678/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<()>
Expand description

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

\ No newline at end of file diff --git a/pr/2678/docs/iroh_gossip/proto/topic/enum.Event.html b/pr/2678/docs/iroh_gossip/proto/topic/enum.Event.html index f5cab23ee7..a9d2943067 100644 --- a/pr/2678/docs/iroh_gossip/proto/topic/enum.Event.html +++ b/pr/2678/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

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

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/2678/docs/iroh_net/endpoint/enum.DirectAddrType.html b/pr/2678/docs/iroh_net/endpoint/enum.DirectAddrType.html index 7704ff5191..987d2d74bc 100644 --- a/pr/2678/docs/iroh_net/endpoint/enum.DirectAddrType.html +++ b/pr/2678/docs/iroh_net/endpoint/enum.DirectAddrType.html @@ -1,4 +1,4 @@ -DirectAddrType in iroh_net::endpoint - Rust

Enum iroh_net::endpoint::DirectAddrType

source ·
pub enum DirectAddrType {
+DirectAddrType in iroh_net::endpoint - Rust

Enum iroh_net::endpoint::DirectAddrType

source ·
pub enum DirectAddrType {
     Unknown,
     Local,
     Stun,
@@ -20,16 +20,16 @@ get a publicly routable direct address.

It is possible to configure iroh-net to bound to a specific port and independently configure the router to forward this port to the iroh-net node. This indicates a situation like this, which still uses STUN to discover the public address.

-

Trait Implementations§

source§

impl Clone for DirectAddrType

source§

fn clone(&self) -> DirectAddrType

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 DirectAddrType

source§

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

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

impl Display for DirectAddrType

source§

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

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

impl Hash for DirectAddrType

source§

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

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

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

Trait Implementations§

source§

impl Clone for DirectAddrType

source§

fn clone(&self) -> DirectAddrType

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 DirectAddrType

source§

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

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

impl Display for DirectAddrType

source§

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

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

impl Hash for DirectAddrType

source§

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

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

impl Ord for DirectAddrType

source§

fn cmp(&self, other: &DirectAddrType) -> 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 DirectAddrType

source§

fn cmp(&self, other: &DirectAddrType) -> 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 DirectAddrType

source§

fn eq(&self, other: &DirectAddrType) -> 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 DirectAddrType

source§

fn eq(&self, other: &DirectAddrType) -> 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.
source§

impl PartialOrd for DirectAddrType

source§

fn partial_cmp(&self, other: &DirectAddrType) -> 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 DirectAddrType

source§

fn partial_cmp(&self, other: &DirectAddrType) -> 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
source§

impl Copy for DirectAddrType

source§

impl Eq for DirectAddrType

source§

impl StructuralPartialEq for DirectAddrType

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +operator. Read more

source§

impl Copy for DirectAddrType

source§

impl Eq for DirectAddrType

source§

impl StructuralPartialEq for DirectAddrType

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/2678/docs/iroh_net/endpoint/fn.default_relay_mode.html b/pr/2678/docs/iroh_net/endpoint/fn.default_relay_mode.html index 9f33a57bc7..1a15d63e97 100644 --- a/pr/2678/docs/iroh_net/endpoint/fn.default_relay_mode.html +++ b/pr/2678/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 set to 1, it will return RelayMode::Staging. Otherwise, it will return RelayMode::Default.

\ No newline at end of file diff --git a/pr/2678/docs/iroh_net/endpoint/fn.get_remote_node_id.html b/pr/2678/docs/iroh_net/endpoint/fn.get_remote_node_id.html index 62a83cdbee..8a004ec503 100644 --- a/pr/2678/docs/iroh_net/endpoint/fn.get_remote_node_id.html +++ b/pr/2678/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/2678/docs/iroh_net/endpoint/fn.make_server_config.html b/pr/2678/docs/iroh_net/endpoint/fn.make_server_config.html index aba689515f..899ee361de 100644 --- a/pr/2678/docs/iroh_net/endpoint/fn.make_server_config.html +++ b/pr/2678/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/2678/docs/iroh_net/endpoint/index.html b/pr/2678/docs/iroh_net/endpoint/index.html
index 73ba14b63e..c0195c3477 100644
--- a/pr/2678/docs/iroh_net/endpoint/index.html
+++ b/pr/2678/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/2678/docs/iroh_net/endpoint/struct.Accept.html b/pr/2678/docs/iroh_net/endpoint/struct.Accept.html index 686aaf1866..5d6ca5b40d 100644 --- a/pr/2678/docs/iroh_net/endpoint/struct.Accept.html +++ b/pr/2678/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/2678/docs/iroh_net/endpoint/struct.AddrInfo.html b/pr/2678/docs/iroh_net/endpoint/struct.AddrInfo.html index 99a85d3da3..532732d29b 100644 --- a/pr/2678/docs/iroh_net/endpoint/struct.AddrInfo.html +++ b/pr/2678/docs/iroh_net/endpoint/struct.AddrInfo.html @@ -1,4 +1,4 @@ -AddrInfo in iroh_net::endpoint - Rust

Struct iroh_net::endpoint::AddrInfo

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

Struct iroh_net::endpoint::AddrInfo

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§

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.

+

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.

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§

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

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>( __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.
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 + __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 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 AddrInfo

source§

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

§

impl PartialEq for AddrInfo

§

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

impl Serialize for AddrInfo

source§

fn serialize<__S>( +operator. Read more

§

impl Serialize for AddrInfo

§

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

impl Eq for AddrInfo

source§

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
§

impl Eq for AddrInfo

§

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/2678/docs/iroh_net/endpoint/struct.Connecting.html b/pr/2678/docs/iroh_net/endpoint/struct.Connecting.html index 52f0faeca1..8e90bf70e8 100644 --- a/pr/2678/docs/iroh_net/endpoint/struct.Connecting.html +++ b/pr/2678/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/2678/docs/iroh_net/endpoint/struct.DirectAddr.html b/pr/2678/docs/iroh_net/endpoint/struct.DirectAddr.html index 24bb08a3bc..9528cb8dea 100644 --- a/pr/2678/docs/iroh_net/endpoint/struct.DirectAddr.html +++ b/pr/2678/docs/iroh_net/endpoint/struct.DirectAddr.html @@ -1,4 +1,4 @@ -DirectAddr in iroh_net::endpoint - Rust

Struct iroh_net::endpoint::DirectAddr

source ·
pub struct DirectAddr {
+DirectAddr in iroh_net::endpoint - Rust

Struct iroh_net::endpoint::DirectAddr

source ·
pub struct DirectAddr {
     pub addr: SocketAddr,
     pub typ: DirectAddrType,
 }
Expand description

A direct address on which an iroh-node might be contactable.

@@ -7,16 +7,16 @@ contacted. These can come from various sources depending on the network topolog iroh-net node, see DirectAddrType for the several kinds of sources.

Fields§

§addr: SocketAddr

The address.

§typ: DirectAddrType

The origin of this direct address.

-

Trait Implementations§

source§

impl Clone for DirectAddr

source§

fn clone(&self) -> DirectAddr

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 DirectAddr

source§

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

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

impl Hash for DirectAddr

source§

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

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

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

Trait Implementations§

source§

impl Clone for DirectAddr

source§

fn clone(&self) -> DirectAddr

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

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

Performs copy-assignment from source. Read more
source§

impl Debug for DirectAddr

source§

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

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

impl Hash for DirectAddr

source§

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

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

impl Ord for DirectAddr

source§

fn cmp(&self, other: &DirectAddr) -> 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 DirectAddr

source§

fn cmp(&self, other: &DirectAddr) -> 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 DirectAddr

source§

fn eq(&self, other: &DirectAddr) -> 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 DirectAddr

source§

fn eq(&self, other: &DirectAddr) -> 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.
source§

impl PartialOrd for DirectAddr

source§

fn partial_cmp(&self, other: &DirectAddr) -> 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 DirectAddr

source§

fn partial_cmp(&self, other: &DirectAddr) -> 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
source§

impl Eq for DirectAddr

source§

impl StructuralPartialEq for DirectAddr

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +operator. Read more

source§

impl Eq for DirectAddr

source§

impl StructuralPartialEq for DirectAddr

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/2678/docs/iroh_net/endpoint/struct.Endpoint.html b/pr/2678/docs/iroh_net/endpoint/struct.Endpoint.html index f7dafd401b..b8ecee1ad2 100644 --- a/pr/2678/docs/iroh_net/endpoint/struct.Endpoint.html +++ b/pr/2678/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: NodeAddr, alpn: &[u8] @@ -38,7 +38,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] @@ -47,13 +47,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 @@ -63,7 +63,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 @@ -76,15 +76,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 @@ -93,14 +93,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 @@ -123,10 +123,10 @@ most recently discovered IP endpoints.

let mep = Endpoint::builder().bind(0).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 @@ -135,14 +135,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.

@@ -155,11 +155,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 @@ -167,14 +167,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/2678/docs/iroh_net/endpoint/struct.Incoming.html b/pr/2678/docs/iroh_net/endpoint/struct.Incoming.html index 8da59cec61..5b15d8ade8 100644 --- a/pr/2678/docs/iroh_net/endpoint/struct.Incoming.html +++ b/pr/2678/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/2678/docs/iroh_net/endpoint/struct.IncomingFuture.html b/pr/2678/docs/iroh_net/endpoint/struct.IncomingFuture.html index 552f698280..43b3b83a5f 100644 --- a/pr/2678/docs/iroh_net/endpoint/struct.IncomingFuture.html +++ b/pr/2678/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/2678/docs/iroh_net/endpoint/struct.NodeAddr.html b/pr/2678/docs/iroh_net/endpoint/struct.NodeAddr.html index c64e243b70..d9b9ff6692 100644 --- a/pr/2678/docs/iroh_net/endpoint/struct.NodeAddr.html +++ b/pr/2678/docs/iroh_net/endpoint/struct.NodeAddr.html @@ -1,4 +1,4 @@ -NodeAddr in iroh_net::endpoint - Rust

Struct iroh_net::endpoint::NodeAddr

source ·
pub struct NodeAddr {
+NodeAddr in iroh_net::endpoint - Rust

Struct iroh_net::endpoint::NodeAddr

pub struct NodeAddr {
     pub node_id: PublicKey,
     pub info: AddrInfo,
 }
Expand description

Network-level addressing information for an iroh-net node.

@@ -25,38 +25,38 @@ 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§

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( +

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( self, addresses: impl IntoIterator<Item = SocketAddr> ) -> NodeAddr

Adds the given direct addresses to the peer’s AddrInfo.

-
source

pub fn from_parts( +

pub fn from_parts( node_id: PublicKey, relay_url: Option<RelayUrl>, direct_addresses: Vec<SocketAddr> ) -> NodeAddr

Creates a new NodeAddr from its parts.

-
source

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

Applies the options to self.

+

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.

-
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

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>( __deserializer: __D ) -> Result<NodeAddr, <__D as Deserializer<'de>>::Error>
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<NodeInfo> for NodeAddr

source§

fn from(value: NodeInfo) -> Self

Converts to this type from the input type.
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 + __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.
source§

impl From<NodeInfo> for NodeAddr

source§

fn from(value: NodeInfo) -> Self

Converts to this type from the input type.
§

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 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 NodeAddr

source§

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
§

impl PartialEq for NodeAddr

§

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

impl Serialize for NodeAddr

source§

fn serialize<__S>( +operator. Read more

§

impl Serialize for NodeAddr

§

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

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

impl Eq for NodeAddr

source§

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
§

impl Eq for NodeAddr

§

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/2678/docs/iroh_net/key/enum.KeyParsingError.html b/pr/2678/docs/iroh_net/key/enum.KeyParsingError.html index c12b64b727..5b56f65a1b 100644 --- a/pr/2678/docs/iroh_net/key/enum.KeyParsingError.html +++ b/pr/2678/docs/iroh_net/key/enum.KeyParsingError.html @@ -1,10 +1,10 @@ -KeyParsingError in iroh_net::key - Rust

Enum iroh_net::key::KeyParsingError

source ·
pub enum KeyParsingError {
-    Base32(HexOrBase32ParseError),
+KeyParsingError in iroh_net::key - Rust

Enum iroh_net::key::KeyParsingError

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§

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 +

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 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/2678/docs/iroh_net/key/index.html b/pr/2678/docs/iroh_net/key/index.html index 4ba1abd5b6..8ab602f612 100644 --- a/pr/2678/docs/iroh_net/key/index.html +++ b/pr/2678/docs/iroh_net/key/index.html @@ -1,2 +1,2 @@ -iroh_net::key - Rust

Module iroh_net::key

source ·
Expand description

Cryptographic key handling for iroh-net.

+iroh_net::key - Rust

Module iroh_net::key

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/2678/docs/iroh_net/key/struct.PublicKey.html b/pr/2678/docs/iroh_net/key/struct.PublicKey.html index 9c30e5f859..8f3b13a784 100644 --- a/pr/2678/docs/iroh_net/key/struct.PublicKey.html +++ b/pr/2678/docs/iroh_net/key/struct.PublicKey.html @@ -1,45 +1,45 @@ -PublicKey in iroh_net::key - Rust

Struct iroh_net::key::PublicKey

source ·
pub struct PublicKey(/* private fields */);
Expand description

A public key.

+PublicKey in iroh_net::key - Rust

Struct iroh_net::key::PublicKey

pub struct PublicKey(/* private fields */);
Expand description

A public key.

The key itself is just a 32 byte array, but a key has associated crypto information that is cached for performance reasons.

The cache item will be refreshed every time a crypto operation is performed, or when a key is deserialised or created from a byte array.

Serialisation or creation from a byte array is cheap if the key is already in the cache, but expensive if it is not.

-

Implementations§

source§

impl PublicKey

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.

+

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.

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

-
source

pub fn verify(&self, message: &[u8], signature: &Signature) -> Result<(), Error>

Verify a signature on a message with this secret key’s public key.

+

pub fn verify(&self, message: &[u8], signature: &Signature) -> Result<(), Error>

Verify a signature on a message with this secret key’s public key.

§Return

Returns Ok(()) if the signature is valid, and Err otherwise.

-
source

pub fn fmt_short(&self) -> String

Convert to a base32 string limited to the first 10 bytes for a friendly string +

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§

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

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>( deserializer: D ) -> Result<PublicKey, <D as Deserializer<'de>>::Error>
where - 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.

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

Display is capable of serialising this format.

-
§

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

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 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
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,

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,

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 PublicKey

source§

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

§

impl PartialEq for PublicKey

§

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

impl Serialize for PublicKey

source§

fn serialize<S>( +operator. Read more

§

impl Serialize for PublicKey

§

fn serialize<S>( &self, serializer: S ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where - S: Serializer,

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

impl TryFrom<&[u8]> for PublicKey

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from( + 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( bytes: &[u8] -) -> 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( +) -> 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( bytes: &[u8; 32] -) -> 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§

Blanket Implementations§

source§

impl<T> Any for T
where +) -> 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§

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/2678/docs/iroh_net/key/struct.SecretKey.html b/pr/2678/docs/iroh_net/key/struct.SecretKey.html index e38284a287..c6f3f9a2fc 100644 --- a/pr/2678/docs/iroh_net/key/struct.SecretKey.html +++ b/pr/2678/docs/iroh_net/key/struct.SecretKey.html @@ -1,24 +1,24 @@ -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 +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 R: CryptoRngCore + ?Sized,

Generate a new SecretKey with a randomness generator.

-
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 +

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 T: AsRef<[u8]>,

Deserialise this key from OpenSSH format.

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

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. The public part can always be recovered.

-
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

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>( deserializer: D ) -> Result<SecretKey, <D as Deserializer<'de>>::Error>
where - 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

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

impl TryFrom<&[u8]> for SecretKey

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from( + 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( bytes: &[u8] ) -> Result<SecretKey, <SecretKey as TryFrom<&[u8]>>::Error>

Performs the conversion.

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 diff --git a/pr/2678/docs/iroh_net/key/struct.SharedSecret.html b/pr/2678/docs/iroh_net/key/struct.SharedSecret.html index d93384b5b8..5dc882a827 100644 --- a/pr/2678/docs/iroh_net/key/struct.SharedSecret.html +++ b/pr/2678/docs/iroh_net/key/struct.SharedSecret.html @@ -1,7 +1,7 @@ -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 +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 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/2678/docs/iroh_net/key/type.NodeId.html b/pr/2678/docs/iroh_net/key/type.NodeId.html index ea672bc69d..cec1e5cdea 100644 --- a/pr/2678/docs/iroh_net/key/type.NodeId.html +++ b/pr/2678/docs/iroh_net/key/type.NodeId.html @@ -1,4 +1,4 @@ -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.

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

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/2678/docs/iroh_net/relay/struct.RelayUrl.html b/pr/2678/docs/iroh_net/relay/struct.RelayUrl.html index dfbe9f569d..12f08a4c95 100644 --- a/pr/2678/docs/iroh_net/relay/struct.RelayUrl.html +++ b/pr/2678/docs/iroh_net/relay/struct.RelayUrl.html @@ -1,4 +1,4 @@ -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.

+RelayUrl in iroh_net::relay - Rust

Struct iroh_net::relay::RelayUrl

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§

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.

+

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.

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

fn deref(&self) -> &<RelayUrl as Deref>::Target

Dereferences the value.
source§

impl<'de> Deserialize<'de> for RelayUrl

§

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>( __deserializer: __D ) -> Result<RelayUrl, <__D as Deserializer<'de>>::Error>
where - __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.

+ __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.

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

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 __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
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,

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,

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 RelayUrl

source§

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
§

impl PartialEq for RelayUrl

§

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

impl Serialize for RelayUrl

source§

fn serialize<__S>( +operator. Read more

§

impl Serialize for RelayUrl

§

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

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

impl Eq for RelayUrl

source§

impl StructuralPartialEq for RelayUrl

Auto Trait Implementations§

Blanket Implementations§

source§

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

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

impl Eq for RelayUrl

§

impl StructuralPartialEq for RelayUrl

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/2678/docs/iroh_net/struct.AddrInfo.html b/pr/2678/docs/iroh_net/struct.AddrInfo.html index ee920a2096..b581a91bcb 100644 --- a/pr/2678/docs/iroh_net/struct.AddrInfo.html +++ b/pr/2678/docs/iroh_net/struct.AddrInfo.html @@ -1,4 +1,4 @@ -AddrInfo in iroh_net - Rust

Struct iroh_net::AddrInfo

source ·
pub struct AddrInfo {
+AddrInfo in iroh_net - Rust

Struct iroh_net::AddrInfo

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§

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.

+

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.

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§

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

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>( __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.
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 + __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 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 AddrInfo

source§

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
§

impl PartialEq for AddrInfo

§

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

impl Serialize for AddrInfo

source§

fn serialize<__S>( +operator. Read more

§

impl Serialize for AddrInfo

§

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

impl Eq for AddrInfo

source§

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
§

impl Eq for AddrInfo

§

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/2678/docs/iroh_net/struct.NodeAddr.html b/pr/2678/docs/iroh_net/struct.NodeAddr.html index dcee2cc2b8..e080f94392 100644 --- a/pr/2678/docs/iroh_net/struct.NodeAddr.html +++ b/pr/2678/docs/iroh_net/struct.NodeAddr.html @@ -1,4 +1,4 @@ -NodeAddr in iroh_net - Rust

Struct iroh_net::NodeAddr

source ·
pub struct NodeAddr {
+NodeAddr in iroh_net - Rust

Struct iroh_net::NodeAddr

pub struct NodeAddr {
     pub node_id: PublicKey,
     pub info: AddrInfo,
 }
Expand description

Network-level addressing information for an iroh-net node.

@@ -25,38 +25,38 @@ 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§

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( +

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( self, addresses: impl IntoIterator<Item = SocketAddr> ) -> NodeAddr

Adds the given direct addresses to the peer’s AddrInfo.

-
source

pub fn from_parts( +

pub fn from_parts( node_id: PublicKey, relay_url: Option<RelayUrl>, direct_addresses: Vec<SocketAddr> ) -> NodeAddr

Creates a new NodeAddr from its parts.

-
source

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

Applies the options to self.

+

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.

-
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

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>( __deserializer: __D ) -> Result<NodeAddr, <__D as Deserializer<'de>>::Error>
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<NodeInfo> for NodeAddr

source§

fn from(value: NodeInfo) -> Self

Converts to this type from the input type.
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 + __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.
source§

impl From<NodeInfo> for NodeAddr

source§

fn from(value: NodeInfo) -> Self

Converts to this type from the input type.
§

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 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 NodeAddr

source§

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
§

impl PartialEq for NodeAddr

§

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

impl Serialize for NodeAddr

source§

fn serialize<__S>( +operator. Read more

§

impl Serialize for NodeAddr

§

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

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

impl Eq for NodeAddr

source§

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
§

impl Eq for NodeAddr

§

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/2678/docs/iroh_net/ticket/struct.NodeTicket.html b/pr/2678/docs/iroh_net/ticket/struct.NodeTicket.html index e6598f8f08..7c73c38b4c 100644 --- a/pr/2678/docs/iroh_net/ticket/struct.NodeTicket.html +++ b/pr/2678/docs/iroh_net/ticket/struct.NodeTicket.html @@ -1,17 +1,17 @@ -NodeTicket in iroh_net::ticket - Rust

Struct iroh_net::ticket::NodeTicket

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

A token containing everything to get a file from the provider.

+NodeTicket in iroh_net::ticket - Rust

Struct iroh_net::ticket::NodeTicket

pub struct NodeTicket { /* private fields */ }
Expand description

A token containing everything to get a file from the provider.

It is a single item which can be easily serialized and deserialized.

-

Implementations§

source§

impl NodeTicket

source

pub fn new(node: NodeAddr) -> Result<NodeTicket, Error>

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

Implementations§

§

impl NodeTicket

pub fn new(node: NodeAddr) -> Result<NodeTicket, Error>

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>( deserializer: D ) -> Result<NodeTicket, <D as Deserializer<'de>>::Error>
where - 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 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 + 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 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 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.
source§

impl Serialize for NodeTicket

source§

fn serialize<S>( +sufficient, and should not be overridden without very good reason.

§

impl Serialize for NodeTicket

§

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

Blanket Implementations§

source§

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

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/2678/docs/iroh_net/type.NodeId.html b/pr/2678/docs/iroh_net/type.NodeId.html index 4059de03ac..ad41084168 100644 --- a/pr/2678/docs/iroh_net/type.NodeId.html +++ b/pr/2678/docs/iroh_net/type.NodeId.html @@ -1,4 +1,4 @@ -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.

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

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/2678/docs/iroh_net_bench/iroh/fn.client.html b/pr/2678/docs/iroh_net_bench/iroh/fn.client.html index 73fef012dd..510bc0b785 100644 --- a/pr/2678/docs/iroh_net_bench/iroh/fn.client.html +++ b/pr/2678/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/2678/docs/iroh_net_bench/iroh/fn.connect_client.html b/pr/2678/docs/iroh_net_bench/iroh/fn.connect_client.html index 3051f211a7..9f42e27ef1 100644 --- a/pr/2678/docs/iroh_net_bench/iroh/fn.connect_client.html +++ b/pr/2678/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

\ No newline at end of file diff --git a/pr/2678/docs/iroh_net_bench/iroh/fn.server_endpoint.html b/pr/2678/docs/iroh_net_bench/iroh/fn.server_endpoint.html index eeab3ad968..a838cffc61 100644 --- a/pr/2678/docs/iroh_net_bench/iroh/fn.server_endpoint.html +++ b/pr/2678/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/2678/docs/iroh_relay/struct.Config.html b/pr/2678/docs/iroh_relay/struct.Config.html index 803e8642b5..2cf2a71e36 100644 --- a/pr/2678/docs/iroh_relay/struct.Config.html +++ b/pr/2678/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/2678/docs/src/iroh_net/endpoint.rs.html b/pr/2678/docs/src/iroh_net/endpoint.rs.html index 8bdea7ef7a..0cbd153fed 100644 --- a/pr/2678/docs/src/iroh_net/endpoint.rs.html +++ b/pr/2678/docs/src/iroh_net/endpoint.rs.html @@ -1700,6 +1700,8 @@ 1700 1701 1702 +1703 +1704
//! 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
@@ -1996,7 +1998,9 @@
 }
 
 /// Creates a [`quinn::ServerConfig`] with the given secret key and limits.
-// TODO: this return type can not longer be used anywhere in our public API.  Remove this.
+// This return type can not longer be used anywhere in our public API.  It is however still
+// used by iroh::node::Node (or rather iroh::node::Builder) to create a plain Quinn
+// endpoint.
 pub fn make_server_config(
     secret_key: &SecretKey,
     alpn_protocols: Vec<Vec<u8>>,
diff --git a/pr/2678/docs/src/iroh_net/magicsock.rs.html b/pr/2678/docs/src/iroh_net/magicsock.rs.html
index 1c5d87c18b..159d88173c 100644
--- a/pr/2678/docs/src/iroh_net/magicsock.rs.html
+++ b/pr/2678/docs/src/iroh_net/magicsock.rs.html
@@ -3881,6 +3881,11 @@
 3881
 3882
 3883
+3884
+3885
+3886
+3887
+3888
 
//! Implements a socket that can change its communication path while in use, actively searching for the best way to communicate.
 //!
 //! Based on tailscale/wgengine/magicsock
@@ -5127,7 +5132,7 @@
     }
 
     /// Triggers an address discovery. The provided why string is for debug logging only.
-    #[instrument(skip_all, fields(me = %self.me))]
+    #[instrument(skip_all)]
     fn re_stun(&self, why: &'static str) {
         debug!("re_stun: {}", why);
         inc!(MagicsockMetrics, re_stun_calls);
@@ -5254,8 +5259,8 @@
             );
         }
 
-        Self::with_name(me.clone(), opts)
-            .instrument(error_span!("magicsock", %me))
+        Self::with_name(me, opts)
+            .instrument(error_span!("magicsock"))
             .await
     }
 
@@ -5579,7 +5584,7 @@
 
     fn max_transmit_segments(&self) -> usize {
         if let Some(pconn6) = self.pconn6.as_ref() {
-            std::cmp::max(
+            std::cmp::min(
                 pconn6.max_transmit_segments(),
                 self.pconn4.max_transmit_segments(),
             )
@@ -5590,8 +5595,13 @@
 
     fn max_receive_segments(&self) -> usize {
         if let Some(pconn6) = self.pconn6.as_ref() {
-            // TODO(matheus23): This is somewhat incorrect. Needs updates to `MagicSock::poll_recv` to fix this though.
-            std::cmp::min(
+            // `max_receive_segments` controls the size of the `RecvMeta` buffer
+            // that quinn creates. Having buffers slightly bigger than necessary
+            // isn't terrible, and makes sure a single socket can read the maximum
+            // amount with a single poll. We considered adding these numbers instead,
+            // but we never get data from both sockets at the same time in `poll_recv`
+            // and it's impossible and unnecessary to be refactored that way.
+            std::cmp::max(
                 pconn6.max_receive_segments(),
                 self.pconn4.max_receive_segments(),
             )
diff --git a/pr/2678/docs/trait.impl/core/convert/trait.From.js b/pr/2678/docs/trait.impl/core/convert/trait.From.js
index 5f65523c65..f70ed0fd21 100644
--- a/pr/2678/docs/trait.impl/core/convert/trait.From.js
+++ b/pr/2678/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<RelayUrl> for Url"],["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<&Peer> for DiscoveryItem"],["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<JoinHandle<T>> for AbortingJoinHandle<T>"],["impl<T> From<T> for ConcurrentDiscovery
where\n T: IntoIterator<Item = Box<dyn Discovery>>,
"],["impl<T: Clone + Send + 'static> From<JoinHandle<T>> for SharedAbortingJoinHandle<T>"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/pr/2678/docs/trait.impl/iroh_metrics/core/trait.Metric.js b/pr/2678/docs/trait.impl/iroh_metrics/core/trait.Metric.js index b6339d8222..8902586109 100644 --- a/pr/2678/docs/trait.impl/iroh_metrics/core/trait.Metric.js +++ b/pr/2678/docs/trait.impl/iroh_metrics/core/trait.Metric.js @@ -1,8 +1,8 @@ (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_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"]] diff --git a/pr/2678/docs/type.impl/iroh_net/key/struct.PublicKey.js b/pr/2678/docs/type.impl/iroh_net/key/struct.PublicKey.js index 2fcaac350a..bbff1af8fe 100644 --- a/pr/2678/docs/type.impl/iroh_net/key/struct.PublicKey.js +++ b/pr/2678/docs/type.impl/iroh_net/key/struct.PublicKey.js @@ -1,3 +1,3 @@ (function() {var type_impls = { -"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"]] +"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"]] };if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file