diff --git a/pr/2937/docs/iroh/defaults/constant.DEFAULT_RELAY_QUIC_PORT.html b/pr/2937/docs/iroh/defaults/constant.DEFAULT_RELAY_QUIC_PORT.html index b827a37ef8..edd0208cb1 100644 --- a/pr/2937/docs/iroh/defaults/constant.DEFAULT_RELAY_QUIC_PORT.html +++ b/pr/2937/docs/iroh/defaults/constant.DEFAULT_RELAY_QUIC_PORT.html @@ -1,4 +1,4 @@ -DEFAULT_RELAY_QUIC_PORT in iroh::defaults - Rust
iroh::defaults

Constant DEFAULT_RELAY_QUIC_PORT

pub const DEFAULT_RELAY_QUIC_PORT: u16 = 7842; // 7_842u16
Expand description

The default QUIC port used by the Relay server to accept QUIC connections +DEFAULT_RELAY_QUIC_PORT in iroh::defaults - Rust

iroh::defaults

Constant DEFAULT_RELAY_QUIC_PORT

Source
pub const DEFAULT_RELAY_QUIC_PORT: u16 = 7842; // 7_842u16
Expand description

The default QUIC port used by the Relay server to accept QUIC connections for QUIC address discovery

The port is “QUIC” typed on a phone keypad. The default QUIC port used by the Relay server to accept QUIC connections diff --git a/pr/2937/docs/iroh/defaults/constant.DEFAULT_STUN_PORT.html b/pr/2937/docs/iroh/defaults/constant.DEFAULT_STUN_PORT.html index 3bedd1bc8d..2a08a424e1 100644 --- a/pr/2937/docs/iroh/defaults/constant.DEFAULT_STUN_PORT.html +++ b/pr/2937/docs/iroh/defaults/constant.DEFAULT_STUN_PORT.html @@ -1,4 +1,4 @@ -DEFAULT_STUN_PORT in iroh::defaults - Rust

iroh::defaults

Constant DEFAULT_STUN_PORT

pub const DEFAULT_STUN_PORT: u16 = 3478; // 3_478u16
Expand description

The default STUN port used by the Relay server.

+DEFAULT_STUN_PORT in iroh::defaults - Rust
iroh::defaults

Constant DEFAULT_STUN_PORT

Source
pub const DEFAULT_STUN_PORT: u16 = 3478; // 3_478u16
Expand description

The default STUN port used by the Relay server.

The STUN port as defined by RFC 8489 The default STUN port used by the Relay server.

diff --git a/pr/2937/docs/iroh/discovery/dns/constant.N0_DNS_NODE_ORIGIN_PROD.html b/pr/2937/docs/iroh/discovery/dns/constant.N0_DNS_NODE_ORIGIN_PROD.html index d500a90037..c89d2fc37e 100644 --- a/pr/2937/docs/iroh/discovery/dns/constant.N0_DNS_NODE_ORIGIN_PROD.html +++ b/pr/2937/docs/iroh/discovery/dns/constant.N0_DNS_NODE_ORIGIN_PROD.html @@ -1,2 +1,2 @@ -N0_DNS_NODE_ORIGIN_PROD in iroh::discovery::dns - Rust
iroh::discovery::dns

Constant N0_DNS_NODE_ORIGIN_PROD

pub const N0_DNS_NODE_ORIGIN_PROD: &'static str;
Available on non-wasm_browser only.
Expand description

The n0 testing DNS node origin, for production.

+N0_DNS_NODE_ORIGIN_PROD in iroh::discovery::dns - Rust
iroh::discovery::dns

Constant N0_DNS_NODE_ORIGIN_PROD

Source
pub const N0_DNS_NODE_ORIGIN_PROD: &'static str;
Available on non-wasm_browser only.
Expand description

The n0 testing DNS node origin, for production.

\ No newline at end of file diff --git a/pr/2937/docs/iroh/discovery/dns/constant.N0_DNS_NODE_ORIGIN_STAGING.html b/pr/2937/docs/iroh/discovery/dns/constant.N0_DNS_NODE_ORIGIN_STAGING.html index 63544895a3..12b232383b 100644 --- a/pr/2937/docs/iroh/discovery/dns/constant.N0_DNS_NODE_ORIGIN_STAGING.html +++ b/pr/2937/docs/iroh/discovery/dns/constant.N0_DNS_NODE_ORIGIN_STAGING.html @@ -1,2 +1,2 @@ -N0_DNS_NODE_ORIGIN_STAGING in iroh::discovery::dns - Rust
iroh::discovery::dns

Constant N0_DNS_NODE_ORIGIN_STAGING

pub const N0_DNS_NODE_ORIGIN_STAGING: &'static str;
Available on non-wasm_browser only.
Expand description

The n0 testing DNS node origin, for testing.

+N0_DNS_NODE_ORIGIN_STAGING in iroh::discovery::dns - Rust
iroh::discovery::dns

Constant N0_DNS_NODE_ORIGIN_STAGING

Source
pub const N0_DNS_NODE_ORIGIN_STAGING: &'static str;
Available on non-wasm_browser only.
Expand description

The n0 testing DNS node origin, for testing.

\ No newline at end of file diff --git a/pr/2937/docs/iroh/discovery/struct.DiscoveryItem.html b/pr/2937/docs/iroh/discovery/struct.DiscoveryItem.html index 85a47ccc8b..ee05de2a88 100644 --- a/pr/2937/docs/iroh/discovery/struct.DiscoveryItem.html +++ b/pr/2937/docs/iroh/discovery/struct.DiscoveryItem.html @@ -19,9 +19,9 @@ this discovery item.

Source

pub fn to_node_addr(&self) -> NodeAddr

Converts into a NodeAddr by cloning the needed fields.

Source

pub fn into_node_addr(self) -> NodeAddr

Converts into a NodeAddr without cloning.

Source

pub fn user_data(&self) -> Option<UserData>

Returns any user-defined data.

-

Methods from Deref<Target = NodeData>§

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

Returns the relay URL of the node.

-

pub fn user_data(&self) -> Option<&UserData>

Returns the optional user-defined data of the node.

-

pub fn direct_addresses(&self) -> &BTreeSet<SocketAddr>

Returns the direct addresses of the node.

+

Methods from Deref<Target = NodeData>§

Source

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

Returns the relay URL of the node.

+
Source

pub fn user_data(&self) -> Option<&UserData>

Returns the optional user-defined data of the node.

+
Source

pub fn direct_addresses(&self) -> &BTreeSet<SocketAddr>

Returns the direct addresses of the node.

Trait Implementations§

Source§

impl Clone for DiscoveryItem

Source§

fn clone(&self) -> DiscoveryItem

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 DiscoveryItem

Source§

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

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

impl Deref for DiscoveryItem

Source§

type Target = NodeData

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl From<DiscoveryItem> for NodeInfo

Source§

fn from(item: DiscoveryItem) -> Self

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 diff --git a/pr/2937/docs/iroh/discovery/struct.NodeData.html b/pr/2937/docs/iroh/discovery/struct.NodeData.html index af67380a87..eb16b7a695 100644 --- a/pr/2937/docs/iroh/discovery/struct.NodeData.html +++ b/pr/2937/docs/iroh/discovery/struct.NodeData.html @@ -1,31 +1,31 @@ -NodeData in iroh::discovery - Rust
iroh::discovery

Struct NodeData

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

Data about a node that may be published to and resolved from discovery services.

+NodeData in iroh::discovery - Rust
iroh::discovery

Struct NodeData

Source
pub struct NodeData { /* private fields */ }
Expand description

Data about a node that may be published to and resolved from discovery services.

This includes an optional RelayUrl, a set of direct addresses, and the optional UserData, a string that can be set by applications and is not parsed or used by iroh itself.

This struct does not include the node’s NodeId, only the data about a certain node. See NodeInfo for a struct that contains a NodeId with associated NodeData.

-

Implementations§

§

impl NodeData

pub fn new( +

Implementations§

Source§

impl NodeData

Source

pub fn new( relay_url: Option<RelayUrl>, direct_addresses: BTreeSet<SocketAddr>, ) -> NodeData

Creates a new NodeData with a relay URL and a set of direct addresses.

-

pub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> NodeData

Sets the relay URL and returns the updated node data.

-

pub fn with_direct_addresses( +

Source

pub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> NodeData

Sets the relay URL and returns the updated node data.

+
Source

pub fn with_direct_addresses( self, direct_addresses: BTreeSet<SocketAddr>, ) -> NodeData

Sets the direct addresses and returns the updated node data.

-

pub fn with_user_data(self, user_data: Option<UserData>) -> NodeData

Sets the user-defined data and returns the updated node data.

-

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

Returns the relay URL of the node.

-

pub fn user_data(&self) -> Option<&UserData>

Returns the optional user-defined data of the node.

-

pub fn direct_addresses(&self) -> &BTreeSet<SocketAddr>

Returns the direct addresses of the node.

-

pub fn clear_direct_addresses(&mut self)

Removes all direct addresses from the node data.

-

pub fn add_direct_addresses( +

Source

pub fn with_user_data(self, user_data: Option<UserData>) -> NodeData

Sets the user-defined data and returns the updated node data.

+
Source

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

Returns the relay URL of the node.

+
Source

pub fn user_data(&self) -> Option<&UserData>

Returns the optional user-defined data of the node.

+
Source

pub fn direct_addresses(&self) -> &BTreeSet<SocketAddr>

Returns the direct addresses of the node.

+
Source

pub fn clear_direct_addresses(&mut self)

Removes all direct addresses from the node data.

+
Source

pub fn add_direct_addresses( &mut self, addrs: impl IntoIterator<Item = SocketAddr>, )

Adds direct addresses to the node data.

-

pub fn set_relay_url(&mut self, relay_url: Option<RelayUrl>)

Sets the relay URL of the node data.

-

pub fn set_user_data(&mut self, user_data: Option<UserData>)

Sets the user-defined data of the node data.

-

Trait Implementations§

§

impl Clone for NodeData

§

fn clone(&self) -> NodeData

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 NodeData

§

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

Formats the value using the given formatter. Read more
§

impl Default for NodeData

§

fn default() -> NodeData

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

impl From<NodeAddr> for NodeData

§

fn from(node_addr: NodeAddr) -> NodeData

Converts to this type from the input type.
§

impl PartialEq for NodeData

§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

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

impl Eq for NodeData

§

impl StructuralPartialEq for NodeData

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where +

Source

pub fn set_relay_url(&mut self, relay_url: Option<RelayUrl>)

Sets the relay URL of the node data.

+
Source

pub fn set_user_data(&mut self, user_data: Option<UserData>)

Sets the user-defined data of the node data.

+

Trait Implementations§

Source§

impl Clone for NodeData

Source§

fn clone(&self) -> NodeData

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 NodeData

Source§

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

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

impl Default for NodeData

Source§

fn default() -> NodeData

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

impl From<NodeAddr> for NodeData

Source§

fn from(node_addr: NodeAddr) -> NodeData

Converts to this type from the input type.
Source§

impl PartialEq for NodeData

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, +and should not be overridden without very good reason.
Source§

impl Eq for NodeData

Source§

impl StructuralPartialEq for NodeData

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/2937/docs/iroh/discovery/struct.NodeInfo.html b/pr/2937/docs/iroh/discovery/struct.NodeInfo.html index 0b772c760b..d776392a61 100644 --- a/pr/2937/docs/iroh/discovery/struct.NodeInfo.html +++ b/pr/2937/docs/iroh/discovery/struct.NodeInfo.html @@ -1,43 +1,43 @@ -NodeInfo in iroh::discovery - Rust
iroh::discovery

Struct NodeInfo

pub struct NodeInfo {
+NodeInfo in iroh::discovery - Rust
iroh::discovery

Struct NodeInfo

Source
pub struct NodeInfo {
     pub node_id: PublicKey,
     pub data: NodeData,
 }
Expand description

Information about a node that may be published to and resolved from discovery services.

This struct couples a NodeId with its associated NodeData.

Fields§

§node_id: PublicKey

The NodeId of the node this is about.

§data: NodeData

The information published about the node.

-

Implementations§

§

impl NodeInfo

pub fn new(node_id: PublicKey) -> NodeInfo

Creates a new NodeInfo with an empty NodeData.

-

pub fn from_parts(node_id: PublicKey, data: NodeData) -> NodeInfo

Creates a new NodeInfo from its parts.

-

pub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> NodeInfo

Sets the relay URL and returns the updated node info.

-

pub fn with_direct_addresses( +

Implementations§

Source§

impl NodeInfo

Source

pub fn new(node_id: PublicKey) -> NodeInfo

Creates a new NodeInfo with an empty NodeData.

+
Source

pub fn from_parts(node_id: PublicKey, data: NodeData) -> NodeInfo

Creates a new NodeInfo from its parts.

+
Source

pub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> NodeInfo

Sets the relay URL and returns the updated node info.

+
Source

pub fn with_direct_addresses( self, direct_addresses: BTreeSet<SocketAddr>, ) -> NodeInfo

Sets the direct addresses and returns the updated node info.

-

pub fn with_user_data(self, user_data: Option<UserData>) -> NodeInfo

Sets the user-defined data and returns the updated node info.

-

pub fn to_node_addr(&self) -> NodeAddr

Converts into a NodeAddr by cloning the needed fields.

-

pub fn into_node_addr(self) -> NodeAddr

Converts into a NodeAddr without cloning.

-

pub fn from_txt_lookup(lookup: TxtLookup) -> Result<NodeInfo, Error>

Available on non-wasm_browser only.

Parses a NodeInfo from a TXT records lookup.

-

pub fn from_pkarr_signed_packet( +

Source

pub fn with_user_data(self, user_data: Option<UserData>) -> NodeInfo

Sets the user-defined data and returns the updated node info.

+
Source

pub fn to_node_addr(&self) -> NodeAddr

Converts into a NodeAddr by cloning the needed fields.

+
Source

pub fn into_node_addr(self) -> NodeAddr

Converts into a NodeAddr without cloning.

+
Source

pub fn from_txt_lookup(lookup: TxtLookup) -> Result<NodeInfo, Error>

Available on non-wasm_browser only.

Parses a NodeInfo from a TXT records lookup.

+
Source

pub fn from_pkarr_signed_packet( packet: &SignedPacket, ) -> Result<NodeInfo, Error>

Parses a NodeInfo from a [pkarr::SignedPacket].

-

pub fn to_pkarr_signed_packet( +

Source

pub fn to_pkarr_signed_packet( &self, secret_key: &SecretKey, ttl: u32, ) -> Result<SignedPacket, Error>

Creates a [pkarr::SignedPacket].

This constructs a DNS packet and signs it with a SecretKey.

-

pub fn to_txt_strings(&self) -> Vec<String>

Converts into a list of {key}={value} strings.

-

Methods from Deref<Target = NodeData>§

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

Returns the relay URL of the node.

-

pub fn user_data(&self) -> Option<&UserData>

Returns the optional user-defined data of the node.

-

pub fn direct_addresses(&self) -> &BTreeSet<SocketAddr>

Returns the direct addresses of the node.

-

pub fn clear_direct_addresses(&mut self)

Removes all direct addresses from the node data.

-

pub fn add_direct_addresses( +

Source

pub fn to_txt_strings(&self) -> Vec<String>

Converts into a list of {key}={value} strings.

+

Methods from Deref<Target = NodeData>§

Source

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

Returns the relay URL of the node.

+
Source

pub fn user_data(&self) -> Option<&UserData>

Returns the optional user-defined data of the node.

+
Source

pub fn direct_addresses(&self) -> &BTreeSet<SocketAddr>

Returns the direct addresses of the node.

+
Source

pub fn clear_direct_addresses(&mut self)

Removes all direct addresses from the node data.

+
Source

pub fn add_direct_addresses( &mut self, addrs: impl IntoIterator<Item = SocketAddr>, )

Adds direct addresses to the node data.

-

pub fn set_relay_url(&mut self, relay_url: Option<RelayUrl>)

Sets the relay URL of the node data.

-

pub fn set_user_data(&mut self, user_data: Option<UserData>)

Sets the user-defined data of the node data.

-

Trait Implementations§

§

impl Clone for NodeInfo

§

fn clone(&self) -> NodeInfo

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 NodeInfo

§

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

Formats the value using the given formatter. Read more
§

impl Deref for NodeInfo

§

type Target = NodeData

The resulting type after dereferencing.
§

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

Dereferences the value.
§

impl DerefMut for NodeInfo

§

fn deref_mut(&mut self) -> &mut <NodeInfo as Deref>::Target

Mutably dereferences the value.
§

impl From<&TxtAttrs<IrohAttr>> for NodeInfo

§

fn from(attrs: &TxtAttrs<IrohAttr>) -> NodeInfo

Converts to this type from the input type.
Source§

impl From<DiscoveryItem> for NodeInfo

Source§

fn from(item: DiscoveryItem) -> Self

Converts to this type from the input type.
§

impl From<NodeAddr> for NodeInfo

§

fn from(addr: NodeAddr) -> NodeInfo

Converts to this type from the input type.
§

impl From<NodeInfo> for NodeAddr

§

fn from(value: NodeInfo) -> NodeAddr

Converts to this type from the input type.
§

impl From<TxtAttrs<IrohAttr>> for NodeInfo

§

fn from(attrs: TxtAttrs<IrohAttr>) -> NodeInfo

Converts to this type from the input type.
§

impl PartialEq for NodeInfo

§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

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

impl Eq for NodeInfo

§

impl StructuralPartialEq for NodeInfo

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where +

Source

pub fn set_relay_url(&mut self, relay_url: Option<RelayUrl>)

Sets the relay URL of the node data.

+
Source

pub fn set_user_data(&mut self, user_data: Option<UserData>)

Sets the user-defined data of the node data.

+

Trait Implementations§

Source§

impl Clone for NodeInfo

Source§

fn clone(&self) -> NodeInfo

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 NodeInfo

Source§

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

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

impl Deref for NodeInfo

Source§

type Target = NodeData

The resulting type after dereferencing.
Source§

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

Dereferences the value.
Source§

impl DerefMut for NodeInfo

Source§

fn deref_mut(&mut self) -> &mut <NodeInfo as Deref>::Target

Mutably dereferences the value.
Source§

impl From<&TxtAttrs<IrohAttr>> for NodeInfo

Source§

fn from(attrs: &TxtAttrs<IrohAttr>) -> NodeInfo

Converts to this type from the input type.
Source§

impl From<DiscoveryItem> for NodeInfo

Source§

fn from(item: DiscoveryItem) -> Self

Converts to this type from the input type.
Source§

impl From<NodeAddr> for NodeInfo

Source§

fn from(addr: NodeAddr) -> NodeInfo

Converts to this type from the input type.
Source§

impl From<NodeInfo> for NodeAddr

Source§

fn from(value: NodeInfo) -> NodeAddr

Converts to this type from the input type.
Source§

impl From<TxtAttrs<IrohAttr>> for NodeInfo

Source§

fn from(attrs: TxtAttrs<IrohAttr>) -> NodeInfo

Converts to this type from the input type.
Source§

impl PartialEq for NodeInfo

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, +and should not be overridden without very good reason.
Source§

impl Eq for NodeInfo

Source§

impl StructuralPartialEq for NodeInfo

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/2937/docs/iroh/discovery/struct.UserData.html b/pr/2937/docs/iroh/discovery/struct.UserData.html index bb19700b27..fef2d345f2 100644 --- a/pr/2937/docs/iroh/discovery/struct.UserData.html +++ b/pr/2937/docs/iroh/discovery/struct.UserData.html @@ -1,24 +1,24 @@ -UserData in iroh::discovery - Rust
iroh::discovery

Struct UserData

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

Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.

+UserData in iroh::discovery - Rust
iroh::discovery

Struct UserData

Source
pub struct UserData(/* private fields */);
Expand description

Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.

Iroh does not keep track of or examine the user-defined data.

UserData implements FromStr and TryFrom<String>, so you can convert &str and String into UserData easily.

-

Implementations§

§

impl UserData

pub const MAX_LENGTH: usize = 245usize

The max byte length allowed for user-defined data.

+

Implementations§

Source§

impl UserData

Source

pub const MAX_LENGTH: usize = 245usize

The max byte length allowed for user-defined data.

In DNS discovery services, the user-defined data is stored in a TXT record character string, which has a max length of 255 bytes. We need to subtract the user-data= prefix, which leaves 245 bytes for the actual user-defined data.

-

Trait Implementations§

§

impl AsRef<str> for UserData

§

fn as_ref(&self) -> &str

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

impl Clone for UserData

§

fn clone(&self) -> UserData

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 UserData

§

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

Formats the value using the given formatter. Read more
§

impl Display for UserData

§

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

Formats the value using the given formatter. Read more
§

impl FromStr for UserData

§

type Err = MaxLengthExceededError

The associated error which can be returned from parsing.
§

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

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

impl Hash for UserData

§

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

Trait Implementations§

Source§

impl AsRef<str> for UserData

Source§

fn as_ref(&self) -> &str

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

impl Clone for UserData

Source§

fn clone(&self) -> UserData

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 UserData

Source§

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

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

impl Display for UserData

Source§

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

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

impl FromStr for UserData

Source§

type Err = MaxLengthExceededError

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

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

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

impl Hash for UserData

Source§

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

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

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

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

impl Ord for UserData

§

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

Source§

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

Restrict a value to a certain interval. Read more
§

impl PartialEq for UserData

§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

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

impl PartialOrd for UserData

§

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

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

Tests less than or equal to (for self and other) and is used by the + Self: Sized,

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

impl PartialEq for UserData

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, +and should not be overridden without very good reason.
Source§

impl PartialOrd for UserData

Source§

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

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

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

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

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

impl TryFrom<String> for UserData

§

type Error = MaxLengthExceededError

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

fn try_from( +the >= operator. Read more

Source§

impl TryFrom<String> for UserData

Source§

type Error = MaxLengthExceededError

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

fn try_from( value: String, -) -> Result<UserData, <UserData as TryFrom<String>>::Error>

Performs the conversion.
§

impl Eq for UserData

§

impl StructuralPartialEq for UserData

Auto Trait Implementations§

§

impl Freeze for UserData

§

impl RefUnwindSafe for UserData

§

impl Send for UserData

§

impl Sync for UserData

§

impl Unpin for UserData

§

impl UnwindSafe for UserData

Blanket Implementations§

Source§

impl<T> Any for T

Performs the conversion.
Source§

impl Eq for UserData

Source§

impl StructuralPartialEq for UserData

Auto Trait Implementations§

§

impl Freeze for UserData

§

impl RefUnwindSafe for UserData

§

impl Send for UserData

§

impl Sync for UserData

§

impl Unpin for UserData

§

impl UnwindSafe for UserData

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/2937/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_PROD.html b/pr/2937/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_PROD.html index ca2c44ec84..1128ffc8b7 100644 --- a/pr/2937/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_PROD.html +++ b/pr/2937/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_PROD.html @@ -1,2 +1,2 @@ -N0_DNS_NODE_ORIGIN_PROD in iroh::dns - Rust
iroh::dns

Constant N0_DNS_NODE_ORIGIN_PROD

pub const N0_DNS_NODE_ORIGIN_PROD: &'static str;
Available on non-wasm_browser only.
Expand description

The n0 testing DNS node origin, for production.

+N0_DNS_NODE_ORIGIN_PROD in iroh::dns - Rust
iroh::dns

Constant N0_DNS_NODE_ORIGIN_PROD

Source
pub const N0_DNS_NODE_ORIGIN_PROD: &'static str;
Available on non-wasm_browser only.
Expand description

The n0 testing DNS node origin, for production.

\ No newline at end of file diff --git a/pr/2937/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_STAGING.html b/pr/2937/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_STAGING.html index 4a774fbf95..3d1110535f 100644 --- a/pr/2937/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_STAGING.html +++ b/pr/2937/docs/iroh/dns/constant.N0_DNS_NODE_ORIGIN_STAGING.html @@ -1,2 +1,2 @@ -N0_DNS_NODE_ORIGIN_STAGING in iroh::dns - Rust
iroh::dns

Constant N0_DNS_NODE_ORIGIN_STAGING

pub const N0_DNS_NODE_ORIGIN_STAGING: &'static str;
Available on non-wasm_browser only.
Expand description

The n0 testing DNS node origin, for testing.

+N0_DNS_NODE_ORIGIN_STAGING in iroh::dns - Rust
iroh::dns

Constant N0_DNS_NODE_ORIGIN_STAGING

Source
pub const N0_DNS_NODE_ORIGIN_STAGING: &'static str;
Available on non-wasm_browser only.
Expand description

The n0 testing DNS node origin, for testing.

\ No newline at end of file diff --git a/pr/2937/docs/iroh/dns/struct.DnsResolver.html b/pr/2937/docs/iroh/dns/struct.DnsResolver.html index ece1a30cb1..11f5117d1a 100644 --- a/pr/2937/docs/iroh/dns/struct.DnsResolver.html +++ b/pr/2937/docs/iroh/dns/struct.DnsResolver.html @@ -1,26 +1,26 @@ -DnsResolver in iroh::dns - Rust
iroh::dns

Struct DnsResolver

pub struct DnsResolver(/* private fields */);
Available on non-wasm_browser only.
Expand description

The DNS resolver used throughout iroh.

-

Implementations§

§

impl DnsResolver

pub fn new() -> DnsResolver

Create a new DNS resolver with sensible cross-platform defaults.

+DnsResolver in iroh::dns - Rust
iroh::dns

Struct DnsResolver

Source
pub struct DnsResolver(/* private fields */);
Available on non-wasm_browser only.
Expand description

The DNS resolver used throughout iroh.

+

Implementations§

Source§

impl DnsResolver

Source

pub fn new() -> DnsResolver

Create a new DNS resolver with sensible cross-platform defaults.

We first try to read the system’s resolver from /etc/resolv.conf. This does not work at least on some Androids, therefore we fallback to the default ResolverConfig which uses eg. to google’s 8.8.8.8 or 8.8.4.4.

-

pub fn with_nameserver(nameserver: SocketAddr) -> DnsResolver

Create a new DNS resolver configured with a single UDP DNS nameserver.

-

pub fn clear_cache(&self)

Removes all entries from the cache.

-

pub async fn lookup_txt( +

Source

pub fn with_nameserver(nameserver: SocketAddr) -> DnsResolver

Create a new DNS resolver configured with a single UDP DNS nameserver.

+
Source

pub fn clear_cache(&self)

Removes all entries from the cache.

+
Source

pub async fn lookup_txt( &self, host: impl ToString, timeout: Duration, -) -> Result<TxtLookup, Error>

Lookup a TXT record.

-

pub async fn lookup_ipv4( +) -> Result<TxtLookup, Error>

Lookup a TXT record.

+
Source

pub async fn lookup_ipv4( &self, host: impl ToString, timeout: Duration, ) -> Result<impl Iterator<Item = IpAddr>, Error>

Perform an ipv4 lookup with a timeout.

-

pub async fn lookup_ipv6( +

Source

pub async fn lookup_ipv6( &self, host: impl ToString, timeout: Duration, ) -> Result<impl Iterator<Item = IpAddr>, Error>

Perform an ipv6 lookup with a timeout.

-

pub async fn lookup_ipv4_ipv6( +

Source

pub async fn lookup_ipv4_ipv6( &self, host: impl ToString, timeout: Duration, @@ -28,13 +28,13 @@ to the default ResolverConfig which uses eg. to google’s 8.

LookupIpStrategy::Ipv4AndIpv6 will wait for ipv6 resolution timeout, even if it is not usable on the stack, so we manually query both lookups concurrently and time them out individually.

-

pub async fn resolve_host( +

Source

pub async fn resolve_host( &self, url: &Url, prefer_ipv6: bool, timeout: Duration, ) -> Result<IpAddr, Error>

Resolve a hostname from a URL to an IP address.

-

pub async fn lookup_ipv4_staggered( +

Source

pub async fn lookup_ipv4_staggered( &self, host: impl ToString, timeout: Duration, @@ -44,7 +44,7 @@ individually.

delays_ms with the first call being done immediately. [200ms, 300ms] results in calls at T+0ms, T+200ms and T+300ms. The timeout is applied to each call individually. The result of the first successful call is returned, or a summary of all errors otherwise.

-

pub async fn lookup_ipv6_staggered( +

Source

pub async fn lookup_ipv6_staggered( &self, host: impl ToString, timeout: Duration, @@ -54,7 +54,7 @@ result of the first successful call is returned, or a summary of all errors othe delays_ms with the first call being done immediately. [200ms, 300ms] results in calls at T+0ms, T+200ms and T+300ms. The timeout is applied to each call individually. The result of the first successful call is returned, or a summary of all errors otherwise.

-

pub async fn lookup_ipv4_ipv6_staggered( +

Source

pub async fn lookup_ipv4_ipv6_staggered( &self, host: impl ToString, timeout: Duration, @@ -65,18 +65,18 @@ result of the first successful call is returned, or a summary of all errors othe at T+0ms, T+200ms and T+300ms. The timeout is applied as stated in Self::lookup_ipv4_ipv6. The result of the first successful call is returned, or a summary of all errors otherwise.

-

pub async fn lookup_node_by_id( +

Source

pub async fn lookup_node_by_id( &self, node_id: &PublicKey, origin: &str, ) -> Result<NodeInfo, Error>

Looks up node info by NodeId and origin domain name.

To lookup nodes that published their node info to the DNS servers run by n0, pass N0_DNS_NODE_ORIGIN_PROD as origin.

-

pub async fn lookup_node_by_domain_name( +

Source

pub async fn lookup_node_by_domain_name( &self, name: &str, ) -> Result<NodeInfo, Error>

Looks up node info by DNS name.

-

pub async fn lookup_node_by_domain_name_staggered( +

Source

pub async fn lookup_node_by_domain_name_staggered( &self, name: &str, delays_ms: &[u64], @@ -85,7 +85,7 @@ pass

pub async fn lookup_node_by_id_staggered( +

Source

pub async fn lookup_node_by_id_staggered( &self, node_id: &PublicKey, origin: &str, @@ -95,7 +95,7 @@ summary of all errors otherwise.

delays_ms with the first call being done immediately. [200ms, 300ms] results in calls at T+0ms, T+200ms and T+300ms. The result of the first successful call is returned, or a summary of all errors otherwise.

-

Trait Implementations§

§

impl Clone for DnsResolver

§

fn clone(&self) -> DnsResolver

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 DnsResolver

§

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

Formats the value using the given formatter. Read more
§

impl Default for DnsResolver

§

fn default() -> DnsResolver

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

impl From<Resolver<GenericConnector<TokioRuntimeProvider>>> for DnsResolver

§

fn from( +

Trait Implementations§

Source§

impl Clone for DnsResolver

Source§

fn clone(&self) -> DnsResolver

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 DnsResolver

Source§

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

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

impl Default for DnsResolver

Source§

fn default() -> DnsResolver

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

impl From<Resolver<GenericConnector<TokioRuntimeProvider>>> for DnsResolver

Source§

fn from( resolver: Resolver<GenericConnector<TokioRuntimeProvider>>, ) -> DnsResolver

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for DnsResolver

§

impl !RefUnwindSafe for DnsResolver

§

impl Send for DnsResolver

§

impl Sync for DnsResolver

§

impl Unpin for DnsResolver

§

impl !UnwindSafe for DnsResolver

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/2937/docs/iroh/metrics/struct.RelayMetrics.html b/pr/2937/docs/iroh/metrics/struct.RelayMetrics.html index d0d27430a9..7c2bbe1860 100644 --- a/pr/2937/docs/iroh/metrics/struct.RelayMetrics.html +++ b/pr/2937/docs/iroh/metrics/struct.RelayMetrics.html @@ -1,4 +1,4 @@ -RelayMetrics in iroh::metrics - Rust
iroh::metrics

Struct RelayMetrics

pub struct RelayMetrics {
Show 21 fields +RelayMetrics in iroh::metrics - Rust
iroh::metrics

Struct RelayMetrics

Source
pub struct RelayMetrics {
Show 21 fields pub bytes_sent: Counter, pub bytes_recv: Counter, pub send_packets_sent: Counter, @@ -42,7 +42,7 @@
§unique_client_keys: Counter

Number of unique client keys per day

§websocket_accepts: Counter

Number of accepted websocket connections

§relay_accepts: Counter

Number of accepted ‘iroh derp http’ connection upgrades

-

Trait Implementations§

§

impl Clone for Metrics

§

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
§

impl Debug for Metrics

§

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

Formats the value using the given formatter. Read more
§

impl Default for Metrics

§

fn default() -> Metrics

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

impl Iterable for Metrics

§

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

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

impl Metric for Metrics

§

fn name() -> &'static str

The name of this metric group.
§

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

Available on crate feature metrics only.
Initializes this metric group.
§

fn with_metric<T, F>(f: F)
where +

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<(), Error>

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

impl Default for Metrics

Source§

fn default() -> Metrics

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 + 'static))>

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

Available on crate feature metrics only.
Initializes this metric group.
§

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

Available on crate feature metrics only.
Access to this metrics group to record a metric. Only records if this metric is registered in the global registry.
§

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

Attempts to get the current metric from the global registry.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where 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/2937/docs/iroh/node_info/constant.IROH_TXT_NAME.html b/pr/2937/docs/iroh/node_info/constant.IROH_TXT_NAME.html index ee2e460857..338afc266f 100644 --- a/pr/2937/docs/iroh/node_info/constant.IROH_TXT_NAME.html +++ b/pr/2937/docs/iroh/node_info/constant.IROH_TXT_NAME.html @@ -1,2 +1,2 @@ -IROH_TXT_NAME in iroh::node_info - Rust
iroh::node_info

Constant IROH_TXT_NAME

pub const IROH_TXT_NAME: &'static str;
Expand description

The DNS name for the iroh TXT record.

+IROH_TXT_NAME in iroh::node_info - Rust
iroh::node_info

Constant IROH_TXT_NAME

Source
pub const IROH_TXT_NAME: &'static str;
Expand description

The DNS name for the iroh TXT record.

\ No newline at end of file diff --git a/pr/2937/docs/iroh/node_info/index.html b/pr/2937/docs/iroh/node_info/index.html index 8dbf704fb8..6838622fc1 100644 --- a/pr/2937/docs/iroh/node_info/index.html +++ b/pr/2937/docs/iroh/node_info/index.html @@ -1,4 +1,4 @@ -iroh::node_info - Rust
iroh

Module node_info

Expand description

Support for handling DNS resource records for dialing by NodeId.

+iroh::node_info - Rust
iroh

Module node_info

Source
Expand description

Support for handling DNS resource records for dialing by NodeId.

Dialing by NodeId is supported by iroh nodes publishing Pkarr records to DNS servers or the Mainline DHT. This module supports creating and parsing these records.

DNS records are published under the following names:

diff --git a/pr/2937/docs/iroh/node_info/struct.MaxLengthExceededError.html b/pr/2937/docs/iroh/node_info/struct.MaxLengthExceededError.html index 0bd9ba6669..ea58cb2471 100644 --- a/pr/2937/docs/iroh/node_info/struct.MaxLengthExceededError.html +++ b/pr/2937/docs/iroh/node_info/struct.MaxLengthExceededError.html @@ -1,5 +1,5 @@ -MaxLengthExceededError in iroh::node_info - Rust
iroh::node_info

Struct MaxLengthExceededError

pub struct MaxLengthExceededError;
Expand description

Error returned when an input value is too long for UserData.

-

Trait Implementations§

§

impl Debug for MaxLengthExceededError

§

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

Formats the value using the given formatter. Read more
§

impl Display for MaxLengthExceededError

§

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

Formats the value using the given formatter. Read more
§

impl Error for MaxLengthExceededError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns 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

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where +MaxLengthExceededError in iroh::node_info - Rust
iroh::node_info

Struct MaxLengthExceededError

Source
pub struct MaxLengthExceededError;
Expand description

Error returned when an input value is too long for UserData.

+

Trait Implementations§

Source§

impl Debug for MaxLengthExceededError

Source§

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

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

impl Display for MaxLengthExceededError

Source§

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

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

impl Error for MaxLengthExceededError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns 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

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/2937/docs/iroh/node_info/struct.NodeData.html b/pr/2937/docs/iroh/node_info/struct.NodeData.html index 9066e6d75a..dc633285ad 100644 --- a/pr/2937/docs/iroh/node_info/struct.NodeData.html +++ b/pr/2937/docs/iroh/node_info/struct.NodeData.html @@ -1,31 +1,31 @@ -NodeData in iroh::node_info - Rust
iroh::node_info

Struct NodeData

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

Data about a node that may be published to and resolved from discovery services.

+NodeData in iroh::node_info - Rust
iroh::node_info

Struct NodeData

Source
pub struct NodeData { /* private fields */ }
Expand description

Data about a node that may be published to and resolved from discovery services.

This includes an optional RelayUrl, a set of direct addresses, and the optional UserData, a string that can be set by applications and is not parsed or used by iroh itself.

This struct does not include the node’s NodeId, only the data about a certain node. See NodeInfo for a struct that contains a NodeId with associated NodeData.

-

Implementations§

§

impl NodeData

pub fn new( +

Implementations§

Source§

impl NodeData

Source

pub fn new( relay_url: Option<RelayUrl>, direct_addresses: BTreeSet<SocketAddr>, ) -> NodeData

Creates a new NodeData with a relay URL and a set of direct addresses.

-

pub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> NodeData

Sets the relay URL and returns the updated node data.

-

pub fn with_direct_addresses( +

Source

pub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> NodeData

Sets the relay URL and returns the updated node data.

+
Source

pub fn with_direct_addresses( self, direct_addresses: BTreeSet<SocketAddr>, ) -> NodeData

Sets the direct addresses and returns the updated node data.

-

pub fn with_user_data(self, user_data: Option<UserData>) -> NodeData

Sets the user-defined data and returns the updated node data.

-

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

Returns the relay URL of the node.

-

pub fn user_data(&self) -> Option<&UserData>

Returns the optional user-defined data of the node.

-

pub fn direct_addresses(&self) -> &BTreeSet<SocketAddr>

Returns the direct addresses of the node.

-

pub fn clear_direct_addresses(&mut self)

Removes all direct addresses from the node data.

-

pub fn add_direct_addresses( +

Source

pub fn with_user_data(self, user_data: Option<UserData>) -> NodeData

Sets the user-defined data and returns the updated node data.

+
Source

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

Returns the relay URL of the node.

+
Source

pub fn user_data(&self) -> Option<&UserData>

Returns the optional user-defined data of the node.

+
Source

pub fn direct_addresses(&self) -> &BTreeSet<SocketAddr>

Returns the direct addresses of the node.

+
Source

pub fn clear_direct_addresses(&mut self)

Removes all direct addresses from the node data.

+
Source

pub fn add_direct_addresses( &mut self, addrs: impl IntoIterator<Item = SocketAddr>, )

Adds direct addresses to the node data.

-

pub fn set_relay_url(&mut self, relay_url: Option<RelayUrl>)

Sets the relay URL of the node data.

-

pub fn set_user_data(&mut self, user_data: Option<UserData>)

Sets the user-defined data of the node data.

-

Trait Implementations§

§

impl Clone for NodeData

§

fn clone(&self) -> NodeData

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 NodeData

§

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

Formats the value using the given formatter. Read more
§

impl Default for NodeData

§

fn default() -> NodeData

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

impl From<NodeAddr> for NodeData

§

fn from(node_addr: NodeAddr) -> NodeData

Converts to this type from the input type.
§

impl PartialEq for NodeData

§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

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

impl Eq for NodeData

§

impl StructuralPartialEq for NodeData

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where +

Source

pub fn set_relay_url(&mut self, relay_url: Option<RelayUrl>)

Sets the relay URL of the node data.

+
Source

pub fn set_user_data(&mut self, user_data: Option<UserData>)

Sets the user-defined data of the node data.

+

Trait Implementations§

Source§

impl Clone for NodeData

Source§

fn clone(&self) -> NodeData

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 NodeData

Source§

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

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

impl Default for NodeData

Source§

fn default() -> NodeData

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

impl From<NodeAddr> for NodeData

Source§

fn from(node_addr: NodeAddr) -> NodeData

Converts to this type from the input type.
Source§

impl PartialEq for NodeData

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, +and should not be overridden without very good reason.
Source§

impl Eq for NodeData

Source§

impl StructuralPartialEq for NodeData

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/2937/docs/iroh/node_info/struct.NodeInfo.html b/pr/2937/docs/iroh/node_info/struct.NodeInfo.html index fa3eb5e441..f9685a6534 100644 --- a/pr/2937/docs/iroh/node_info/struct.NodeInfo.html +++ b/pr/2937/docs/iroh/node_info/struct.NodeInfo.html @@ -1,43 +1,43 @@ -NodeInfo in iroh::node_info - Rust
iroh::node_info

Struct NodeInfo

pub struct NodeInfo {
+NodeInfo in iroh::node_info - Rust
iroh::node_info

Struct NodeInfo

Source
pub struct NodeInfo {
     pub node_id: PublicKey,
     pub data: NodeData,
 }
Expand description

Information about a node that may be published to and resolved from discovery services.

This struct couples a NodeId with its associated NodeData.

Fields§

§node_id: PublicKey

The NodeId of the node this is about.

§data: NodeData

The information published about the node.

-

Implementations§

§

impl NodeInfo

pub fn new(node_id: PublicKey) -> NodeInfo

Creates a new NodeInfo with an empty NodeData.

-

pub fn from_parts(node_id: PublicKey, data: NodeData) -> NodeInfo

Creates a new NodeInfo from its parts.

-

pub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> NodeInfo

Sets the relay URL and returns the updated node info.

-

pub fn with_direct_addresses( +

Implementations§

Source§

impl NodeInfo

Source

pub fn new(node_id: PublicKey) -> NodeInfo

Creates a new NodeInfo with an empty NodeData.

+
Source

pub fn from_parts(node_id: PublicKey, data: NodeData) -> NodeInfo

Creates a new NodeInfo from its parts.

+
Source

pub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> NodeInfo

Sets the relay URL and returns the updated node info.

+
Source

pub fn with_direct_addresses( self, direct_addresses: BTreeSet<SocketAddr>, ) -> NodeInfo

Sets the direct addresses and returns the updated node info.

-

pub fn with_user_data(self, user_data: Option<UserData>) -> NodeInfo

Sets the user-defined data and returns the updated node info.

-

pub fn to_node_addr(&self) -> NodeAddr

Converts into a NodeAddr by cloning the needed fields.

-

pub fn into_node_addr(self) -> NodeAddr

Converts into a NodeAddr without cloning.

-

pub fn from_txt_lookup(lookup: TxtLookup) -> Result<NodeInfo, Error>

Available on non-wasm_browser only.

Parses a NodeInfo from a TXT records lookup.

-

pub fn from_pkarr_signed_packet( +

Source

pub fn with_user_data(self, user_data: Option<UserData>) -> NodeInfo

Sets the user-defined data and returns the updated node info.

+
Source

pub fn to_node_addr(&self) -> NodeAddr

Converts into a NodeAddr by cloning the needed fields.

+
Source

pub fn into_node_addr(self) -> NodeAddr

Converts into a NodeAddr without cloning.

+
Source

pub fn from_txt_lookup(lookup: TxtLookup) -> Result<NodeInfo, Error>

Available on non-wasm_browser only.

Parses a NodeInfo from a TXT records lookup.

+
Source

pub fn from_pkarr_signed_packet( packet: &SignedPacket, ) -> Result<NodeInfo, Error>

Parses a NodeInfo from a [pkarr::SignedPacket].

-

pub fn to_pkarr_signed_packet( +

Source

pub fn to_pkarr_signed_packet( &self, secret_key: &SecretKey, ttl: u32, ) -> Result<SignedPacket, Error>

Creates a [pkarr::SignedPacket].

This constructs a DNS packet and signs it with a SecretKey.

-

pub fn to_txt_strings(&self) -> Vec<String>

Converts into a list of {key}={value} strings.

-

Methods from Deref<Target = NodeData>§

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

Returns the relay URL of the node.

-

pub fn user_data(&self) -> Option<&UserData>

Returns the optional user-defined data of the node.

-

pub fn direct_addresses(&self) -> &BTreeSet<SocketAddr>

Returns the direct addresses of the node.

-

pub fn clear_direct_addresses(&mut self)

Removes all direct addresses from the node data.

-

pub fn add_direct_addresses( +

Source

pub fn to_txt_strings(&self) -> Vec<String>

Converts into a list of {key}={value} strings.

+

Methods from Deref<Target = NodeData>§

Source

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

Returns the relay URL of the node.

+
Source

pub fn user_data(&self) -> Option<&UserData>

Returns the optional user-defined data of the node.

+
Source

pub fn direct_addresses(&self) -> &BTreeSet<SocketAddr>

Returns the direct addresses of the node.

+
Source

pub fn clear_direct_addresses(&mut self)

Removes all direct addresses from the node data.

+
Source

pub fn add_direct_addresses( &mut self, addrs: impl IntoIterator<Item = SocketAddr>, )

Adds direct addresses to the node data.

-

pub fn set_relay_url(&mut self, relay_url: Option<RelayUrl>)

Sets the relay URL of the node data.

-

pub fn set_user_data(&mut self, user_data: Option<UserData>)

Sets the user-defined data of the node data.

-

Trait Implementations§

§

impl Clone for NodeInfo

§

fn clone(&self) -> NodeInfo

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 NodeInfo

§

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

Formats the value using the given formatter. Read more
§

impl Deref for NodeInfo

§

type Target = NodeData

The resulting type after dereferencing.
§

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

Dereferences the value.
§

impl DerefMut for NodeInfo

§

fn deref_mut(&mut self) -> &mut <NodeInfo as Deref>::Target

Mutably dereferences the value.
§

impl From<&TxtAttrs<IrohAttr>> for NodeInfo

§

fn from(attrs: &TxtAttrs<IrohAttr>) -> NodeInfo

Converts to this type from the input type.
Source§

impl From<DiscoveryItem> for NodeInfo

Source§

fn from(item: DiscoveryItem) -> Self

Converts to this type from the input type.
§

impl From<NodeAddr> for NodeInfo

§

fn from(addr: NodeAddr) -> NodeInfo

Converts to this type from the input type.
§

impl From<NodeInfo> for NodeAddr

§

fn from(value: NodeInfo) -> NodeAddr

Converts to this type from the input type.
§

impl From<TxtAttrs<IrohAttr>> for NodeInfo

§

fn from(attrs: TxtAttrs<IrohAttr>) -> NodeInfo

Converts to this type from the input type.
§

impl PartialEq for NodeInfo

§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

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

impl Eq for NodeInfo

§

impl StructuralPartialEq for NodeInfo

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where +

Source

pub fn set_relay_url(&mut self, relay_url: Option<RelayUrl>)

Sets the relay URL of the node data.

+
Source

pub fn set_user_data(&mut self, user_data: Option<UserData>)

Sets the user-defined data of the node data.

+

Trait Implementations§

Source§

impl Clone for NodeInfo

Source§

fn clone(&self) -> NodeInfo

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 NodeInfo

Source§

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

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

impl Deref for NodeInfo

Source§

type Target = NodeData

The resulting type after dereferencing.
Source§

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

Dereferences the value.
Source§

impl DerefMut for NodeInfo

Source§

fn deref_mut(&mut self) -> &mut <NodeInfo as Deref>::Target

Mutably dereferences the value.
Source§

impl From<&TxtAttrs<IrohAttr>> for NodeInfo

Source§

fn from(attrs: &TxtAttrs<IrohAttr>) -> NodeInfo

Converts to this type from the input type.
Source§

impl From<DiscoveryItem> for NodeInfo

Source§

fn from(item: DiscoveryItem) -> Self

Converts to this type from the input type.
Source§

impl From<NodeAddr> for NodeInfo

Source§

fn from(addr: NodeAddr) -> NodeInfo

Converts to this type from the input type.
Source§

impl From<NodeInfo> for NodeAddr

Source§

fn from(value: NodeInfo) -> NodeAddr

Converts to this type from the input type.
Source§

impl From<TxtAttrs<IrohAttr>> for NodeInfo

Source§

fn from(attrs: TxtAttrs<IrohAttr>) -> NodeInfo

Converts to this type from the input type.
Source§

impl PartialEq for NodeInfo

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, +and should not be overridden without very good reason.
Source§

impl Eq for NodeInfo

Source§

impl StructuralPartialEq for NodeInfo

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/2937/docs/iroh/node_info/struct.UserData.html b/pr/2937/docs/iroh/node_info/struct.UserData.html index a2b69a66cf..e66ff7405a 100644 --- a/pr/2937/docs/iroh/node_info/struct.UserData.html +++ b/pr/2937/docs/iroh/node_info/struct.UserData.html @@ -1,24 +1,24 @@ -UserData in iroh::node_info - Rust
iroh::node_info

Struct UserData

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

Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.

+UserData in iroh::node_info - Rust
iroh::node_info

Struct UserData

Source
pub struct UserData(/* private fields */);
Expand description

Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.

Iroh does not keep track of or examine the user-defined data.

UserData implements FromStr and TryFrom<String>, so you can convert &str and String into UserData easily.

-

Implementations§

§

impl UserData

pub const MAX_LENGTH: usize = 245usize

The max byte length allowed for user-defined data.

+

Implementations§

Source§

impl UserData

Source

pub const MAX_LENGTH: usize = 245usize

The max byte length allowed for user-defined data.

In DNS discovery services, the user-defined data is stored in a TXT record character string, which has a max length of 255 bytes. We need to subtract the user-data= prefix, which leaves 245 bytes for the actual user-defined data.

-

Trait Implementations§

§

impl AsRef<str> for UserData

§

fn as_ref(&self) -> &str

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

impl Clone for UserData

§

fn clone(&self) -> UserData

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 UserData

§

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

Formats the value using the given formatter. Read more
§

impl Display for UserData

§

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

Formats the value using the given formatter. Read more
§

impl FromStr for UserData

§

type Err = MaxLengthExceededError

The associated error which can be returned from parsing.
§

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

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

impl Hash for UserData

§

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

Trait Implementations§

Source§

impl AsRef<str> for UserData

Source§

fn as_ref(&self) -> &str

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

impl Clone for UserData

Source§

fn clone(&self) -> UserData

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 UserData

Source§

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

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

impl Display for UserData

Source§

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

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

impl FromStr for UserData

Source§

type Err = MaxLengthExceededError

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

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

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

impl Hash for UserData

Source§

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

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

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

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

impl Ord for UserData

§

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

Source§

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

Restrict a value to a certain interval. Read more
§

impl PartialEq for UserData

§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

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

impl PartialOrd for UserData

§

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

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

Tests less than or equal to (for self and other) and is used by the + Self: Sized,

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

impl PartialEq for UserData

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, +and should not be overridden without very good reason.
Source§

impl PartialOrd for UserData

Source§

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

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

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

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

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

impl TryFrom<String> for UserData

§

type Error = MaxLengthExceededError

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

fn try_from( +the >= operator. Read more

Source§

impl TryFrom<String> for UserData

Source§

type Error = MaxLengthExceededError

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

fn try_from( value: String, -) -> Result<UserData, <UserData as TryFrom<String>>::Error>

Performs the conversion.
§

impl Eq for UserData

§

impl StructuralPartialEq for UserData

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T

Performs the conversion.
Source§

impl Eq for UserData

Source§

impl StructuralPartialEq for UserData

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/2937/docs/iroh/node_info/trait.NodeIdExt.html b/pr/2937/docs/iroh/node_info/trait.NodeIdExt.html index 5c8e1b93a6..c19caef22d 100644 --- a/pr/2937/docs/iroh/node_info/trait.NodeIdExt.html +++ b/pr/2937/docs/iroh/node_info/trait.NodeIdExt.html @@ -1,9 +1,9 @@ -NodeIdExt in iroh::node_info - Rust
iroh::node_info

Trait NodeIdExt

pub trait NodeIdExt {
+NodeIdExt in iroh::node_info - Rust
iroh::node_info

Trait NodeIdExt

Source
pub trait NodeIdExt {
     // Required methods
     fn to_z32(&self) -> String;
     fn from_z32(s: &str) -> Result<PublicKey, Error>;
 }
Expand description

Extension methods for NodeId to encode to and decode from [z32], which is the encoding used in [pkarr] domain names.

-

Required Methods§

fn to_z32(&self) -> String

Encodes a NodeId in [z-base-32] encoding.

-

fn from_z32(s: &str) -> Result<PublicKey, Error>

Parses a NodeId from [z-base-32] encoding.

-

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

\ No newline at end of file +

Required Methods§

Source

fn to_z32(&self) -> String

Encodes a NodeId in [z-base-32] encoding.

+
Source

fn from_z32(s: &str) -> Result<PublicKey, Error>

Parses a NodeId from [z-base-32] encoding.

+

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

\ No newline at end of file diff --git a/pr/2937/docs/iroh/struct.NodeAddr.html b/pr/2937/docs/iroh/struct.NodeAddr.html index cbb35ab406..158fffe338 100644 --- a/pr/2937/docs/iroh/struct.NodeAddr.html +++ b/pr/2937/docs/iroh/struct.NodeAddr.html @@ -44,7 +44,7 @@ whenever a connection to other nodes needs to be established.

Trait Implementations§

Source§

impl Clone for NodeAddr

Source§

fn clone(&self) -> NodeAddr

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

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

Performs copy-assignment from source. Read more
Source§

impl Debug for NodeAddr

Source§

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

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

impl<'de> Deserialize<'de> for NodeAddr

Source§

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

Deserialize this value from the given Serde deserializer. Read more
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.
§

impl From<NodeAddr> for NodeData

§

fn from(node_addr: NodeAddr) -> NodeData

Converts to this type from the input type.
§

impl From<NodeAddr> for NodeInfo

§

fn from(addr: NodeAddr) -> NodeInfo

Converts to this type from the input type.
§

impl From<NodeInfo> for NodeAddr

§

fn from(value: NodeInfo) -> NodeAddr

Converts to this type from the input type.
Source§

impl From<NodeTicket> for NodeAddr

Source§

fn from(ticket: NodeTicket) -> NodeAddr

Returns the addressing info from given ticket.

+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§

impl From<(PublicKey, Option<RelayUrl>, &[SocketAddr])> for NodeAddr

Source§

fn from(value: (PublicKey, Option<RelayUrl>, &[SocketAddr])) -> NodeAddr

Converts to this type from the input type.
Source§

impl From<NodeAddr> for NodeData

Source§

fn from(node_addr: NodeAddr) -> NodeData

Converts to this type from the input type.
Source§

impl From<NodeAddr> for NodeInfo

Source§

fn from(addr: NodeAddr) -> NodeInfo

Converts to this type from the input type.
Source§

impl From<NodeInfo> for NodeAddr

Source§

fn from(value: NodeInfo) -> NodeAddr

Converts to this type from the input type.
Source§

impl From<NodeTicket> for NodeAddr

Source§

fn from(ticket: NodeTicket) -> NodeAddr

Returns the addressing info from given ticket.

Source§

impl From<PublicKey> for NodeAddr

Source§

fn from(node_id: PublicKey) -> NodeAddr

Converts to this type from the input type.
Source§

impl From<RemoteInfo> for NodeAddr

Source§

fn from(info: RemoteInfo) -> Self

Converts to this type from the input type.
Source§

impl Ord for NodeAddr

Source§

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

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

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

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

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

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

fn clamp(self, min: Self, max: Self) -> Self
where diff --git a/pr/2937/docs/iroh/struct.PublicKey.html b/pr/2937/docs/iroh/struct.PublicKey.html index ffb5dae428..e502038fa3 100644 --- a/pr/2937/docs/iroh/struct.PublicKey.html +++ b/pr/2937/docs/iroh/struct.PublicKey.html @@ -22,7 +22,7 @@ representation of the key.

Source§

type Err = KeyParsingError

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

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

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

Source§

impl Hash for PublicKey

Source§

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

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

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

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

impl NodeIdExt for PublicKey

§

fn to_z32(&self) -> String

Encodes a NodeId in [z-base-32] encoding.
§

fn from_z32(s: &str) -> Result<PublicKey, Error>

Parses a NodeId from [z-base-32] encoding.
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
Source§

impl NodeIdExt for PublicKey

Source§

fn to_z32(&self) -> String

Encodes a NodeId in [z-base-32] encoding.
Source§

fn from_z32(s: &str) -> Result<PublicKey, Error>

Parses a NodeId from [z-base-32] encoding.
Source§

impl Ord for PublicKey

Source§

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

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

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

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

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

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

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

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

impl PartialEq for PublicKey

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, diff --git a/pr/2937/docs/iroh/struct.RelayMap.html b/pr/2937/docs/iroh/struct.RelayMap.html index bdc30b97e5..50ac2c436a 100644 --- a/pr/2937/docs/iroh/struct.RelayMap.html +++ b/pr/2937/docs/iroh/struct.RelayMap.html @@ -1,26 +1,26 @@ -RelayMap in iroh - Rust
iroh

Struct RelayMap

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

Configuration of all the relay servers that can be used.

-

Implementations§

§

impl RelayMap

pub fn urls(&self) -> impl Iterator<Item = &RelayUrl>

Returns the sorted relay URLs.

-

pub fn empty() -> RelayMap

Create an empty relay map.

-

pub fn nodes(&self) -> impl Iterator<Item = &Arc<RelayNode>>

Returns an Iterator over all known nodes.

-

pub fn contains_node(&self, url: &RelayUrl) -> bool

Is this a known node?

-

pub fn get_node(&self, url: &RelayUrl) -> Option<&Arc<RelayNode>>

Get the given node.

-

pub fn len(&self) -> usize

How many nodes are known?

-

pub fn is_empty(&self) -> bool

Are there any nodes in this map?

-

pub fn default_from_node(url: RelayUrl, stun_port: u16) -> RelayMap

Creates a new RelayMap with a single relay server configured.

+RelayMap in iroh - Rust
iroh

Struct RelayMap

Source
pub struct RelayMap { /* private fields */ }
Expand description

Configuration of all the relay servers that can be used.

+

Implementations§

Source§

impl RelayMap

Source

pub fn urls(&self) -> impl Iterator<Item = &RelayUrl>

Returns the sorted relay URLs.

+
Source

pub fn empty() -> RelayMap

Create an empty relay map.

+
Source

pub fn nodes(&self) -> impl Iterator<Item = &Arc<RelayNode>>

Returns an Iterator over all known nodes.

+
Source

pub fn contains_node(&self, url: &RelayUrl) -> bool

Is this a known node?

+
Source

pub fn get_node(&self, url: &RelayUrl) -> Option<&Arc<RelayNode>>

Get the given node.

+
Source

pub fn len(&self) -> usize

How many nodes are known?

+
Source

pub fn is_empty(&self) -> bool

Are there any nodes in this map?

+
Source

pub fn default_from_node(url: RelayUrl, stun_port: u16) -> RelayMap

Creates a new RelayMap with a single relay server configured.

Allows to set a custom STUN port and different IP addresses for IPv4 and IPv6. If IP addresses are provided, no DNS lookup will be performed.

Sets the port to the default DEFAULT_RELAY_QUIC_PORT.

-

pub fn from_url(url: RelayUrl) -> RelayMap

Returns a RelayMap from a RelayUrl.

+
Source

pub fn from_url(url: RelayUrl) -> RelayMap

Returns a RelayMap from a RelayUrl.

This will use the default STUN port, the default QUIC port (as defined by the iroh-relay crate) and IP addresses resolved from the URL’s host name via DNS. relay nodes are specified at <../../docs/relay_nodes.md>

-

pub fn from_nodes<I>( +

Source

pub fn from_nodes<I>( value: impl IntoIterator<Item = I>, ) -> Result<RelayMap, Error>
where I: Into<Arc<RelayNode>>,

Constructs the RelayMap from an iterator of RelayNodes.

-

Trait Implementations§

§

impl Clone for RelayMap

§

fn clone(&self) -> RelayMap

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 RelayMap

§

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

Formats the value using the given formatter. Read more
§

impl Display for RelayMap

§

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

Formats the value using the given formatter. Read more
§

impl PartialEq for RelayMap

§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

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

impl Eq for RelayMap

§

impl StructuralPartialEq for RelayMap

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where +

Trait Implementations§

Source§

impl Clone for RelayMap

Source§

fn clone(&self) -> RelayMap

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 RelayMap

Source§

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

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

impl Display for RelayMap

Source§

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

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

impl PartialEq for RelayMap

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, +and should not be overridden without very good reason.
Source§

impl Eq for RelayMap

Source§

impl StructuralPartialEq for RelayMap

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/2937/docs/iroh/struct.RelayNode.html b/pr/2937/docs/iroh/struct.RelayNode.html index 779a500100..9a259ad8aa 100644 --- a/pr/2937/docs/iroh/struct.RelayNode.html +++ b/pr/2937/docs/iroh/struct.RelayNode.html @@ -1,8 +1,8 @@ -RelayNode in iroh - Rust
iroh

Struct RelayNode

pub struct RelayNode {
+RelayNode in iroh - Rust
iroh

Struct RelayNode

Source
pub struct RelayNode {
     pub url: RelayUrl,
     pub stun_only: bool,
     pub stun_port: u16,
-    pub quic: Option<RelayQuicConfig>,
+    pub quic: Option<RelayQuicConfig>,
 }
Expand description

Information on a specific relay server.

Includes the Url where it can be dialed.

Fields§

§url: RelayUrl

The RelayUrl where this relay server can be dialed.

@@ -11,24 +11,24 @@ functionality is used.

§stun_port: u16

The stun port of the relay server.

Setting this to 0 means the default STUN port is used.

-
§quic: Option<RelayQuicConfig>

Configuration to speak to the QUIC endpoint on the relay server.

+
§quic: Option<RelayQuicConfig>

Configuration to speak to the QUIC endpoint on the relay server.

When None, we will not attempt to do QUIC address discovery with this relay server.

-

Trait Implementations§

§

impl Clone for RelayNode

§

fn clone(&self) -> RelayNode

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 RelayNode

§

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

Formats the value using the given formatter. Read more
§

impl<'de> Deserialize<'de> for RelayNode

§

fn deserialize<__D>( +

Trait Implementations§

Source§

impl Clone for RelayNode

Source§

fn clone(&self) -> RelayNode

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 RelayNode

Source§

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

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

impl<'de> Deserialize<'de> for RelayNode

Source§

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

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

impl Display for RelayNode

§

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

Formats the value using the given formatter. Read more
§

impl Ord for RelayNode

§

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

Source§

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

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

impl Ord for RelayNode

Source§

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

Restrict a value to a certain interval. Read more
§

impl PartialEq for RelayNode

§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

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

impl PartialOrd for RelayNode

§

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

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

Tests less than or equal to (for self and other) and is used by the + Self: Sized,

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

impl PartialEq for RelayNode

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, +and should not be overridden without very good reason.
Source§

impl PartialOrd for RelayNode

Source§

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

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

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

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

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

impl Serialize for RelayNode

§

fn serialize<__S>( +the >= operator. Read more

Source§

impl Serialize for RelayNode

Source§

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

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

impl Eq for RelayNode

§

impl StructuralPartialEq for RelayNode

Auto Trait Implementations§

Blanket Implementations§

Source§

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

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

impl Eq for RelayNode

Source§

impl StructuralPartialEq for RelayNode

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/2937/docs/iroh/test_utils/fn.run_relay_server.html b/pr/2937/docs/iroh/test_utils/fn.run_relay_server.html index c2bcfd742f..a227f826cc 100644 --- a/pr/2937/docs/iroh/test_utils/fn.run_relay_server.html +++ b/pr/2937/docs/iroh/test_utils/fn.run_relay_server.html @@ -1,4 +1,4 @@ -run_relay_server in iroh::test_utils - Rust
iroh::test_utils

Function run_relay_server

Source
pub async fn run_relay_server() -> Result<(RelayMap, RelayUrl, Server)>
Available on crate feature test-utils only.
Expand description

Runs a relay server with STUN and QUIC enabled suitable for tests.

+run_relay_server in iroh::test_utils - Rust
iroh::test_utils

Function run_relay_server

Source
pub async fn run_relay_server() -> Result<(RelayMap, RelayUrl, Server)>
Available on crate feature test-utils only.
Expand description

Runs a relay server with STUN and QUIC enabled suitable for tests.

The returned Url is the url of the relay server in the returned RelayMap. -When dropped, the returned [Server] does will stop running.

+When dropped, the returned Server does will stop running.

\ No newline at end of file diff --git a/pr/2937/docs/iroh/test_utils/fn.run_relay_server_with.html b/pr/2937/docs/iroh/test_utils/fn.run_relay_server_with.html index 818aec0d64..b8e547e382 100644 --- a/pr/2937/docs/iroh/test_utils/fn.run_relay_server_with.html +++ b/pr/2937/docs/iroh/test_utils/fn.run_relay_server_with.html @@ -1,9 +1,9 @@ run_relay_server_with in iroh::test_utils - Rust
iroh::test_utils

Function run_relay_server_with

Source
pub async fn run_relay_server_with(
-    stun: Option<StunConfig>,
+    stun: Option<StunConfig>,
     quic: bool,
-) -> Result<(RelayMap, RelayUrl, Server)>
Available on crate feature test-utils only.
Expand description

Runs a relay server.

+) -> Result<(RelayMap, RelayUrl, Server)>
Available on crate feature test-utils only.
Expand description

Runs a relay server.

stun can be set to None to disable stun, or set to Some StunConfig, to enable stun on a specific socket.

-

If quic is set to true, it will make the appropriate [QuicConfig] from the generated tls certificates and run the quic server at a random free port.

+

If quic is set to true, it will make the appropriate QuicConfig from the generated tls certificates and run the quic server at a random free port.

The return value is similar to run_relay_server.

\ No newline at end of file diff --git a/pr/2937/docs/iroh/test_utils/fn.run_relay_server_with_stun.html b/pr/2937/docs/iroh/test_utils/fn.run_relay_server_with_stun.html index 18796c59c2..3037a1795f 100644 --- a/pr/2937/docs/iroh/test_utils/fn.run_relay_server_with_stun.html +++ b/pr/2937/docs/iroh/test_utils/fn.run_relay_server_with_stun.html @@ -1,4 +1,4 @@ -run_relay_server_with_stun in iroh::test_utils - Rust
iroh::test_utils

Function run_relay_server_with_stun

Source
pub async fn run_relay_server_with_stun() -> Result<(RelayMap, RelayUrl, Server)>
Available on crate feature test-utils only.
Expand description

Runs a relay server with STUN enabled suitable for tests.

+run_relay_server_with_stun in iroh::test_utils - Rust
iroh::test_utils

Function run_relay_server_with_stun

Source
pub async fn run_relay_server_with_stun() -> Result<(RelayMap, RelayUrl, Server)>
Available on crate feature test-utils only.
Expand description

Runs a relay server with STUN enabled suitable for tests.

The returned Url is the url of the relay server in the returned RelayMap. -When dropped, the returned [Server] does will stop running.

+When dropped, the returned Server does will stop running.

\ No newline at end of file diff --git a/pr/2937/docs/iroh_net_report/struct.Client.html b/pr/2937/docs/iroh_net_report/struct.Client.html index eb3fc3d8d6..bd81916c1c 100644 --- a/pr/2937/docs/iroh_net_report/struct.Client.html +++ b/pr/2937/docs/iroh_net_report/struct.Client.html @@ -7,7 +7,7 @@ If all Addr::receive_stun_packet.

Implementations§

Source§

impl Client

Source

pub fn new( port_mapper: Option<Client>, - dns_resolver: DnsResolver, + dns_resolver: DnsResolver, ip_mapped_addrs: Option<IpMappedAddresses>, ) -> Result<Self>

Creates a new net_report client.

This starts a connected actor in the background. Once the client is dropped it will @@ -17,7 +17,7 @@ stop running.

allows sending messages to the actor.

Source

pub async fn get_report( &mut self, - relay_map: RelayMap, + relay_map: RelayMap, stun_sock_v4: Option<Arc<UdpSocket>>, stun_sock_v6: Option<Arc<UdpSocket>>, quic_config: Option<QuicConfig>, @@ -39,14 +39,14 @@ using QUIC address discovery.

This will attempt to use all probe protocols.

Source

pub async fn get_report_with_opts( &mut self, - relay_map: RelayMap, + relay_map: RelayMap, opts: Options, ) -> Result<Arc<Report>>

Runs a net_report, returning the report.

It may not be called concurrently with itself, &mut self takes care of that.

Look at Options for the different configuration options.

Source

pub async fn get_report_channel( &mut self, - relay_map: RelayMap, + relay_map: RelayMap, opts: Options, ) -> Result<Receiver<Result<Arc<Report>>>>

Get report with channel

Look at Options for the different configuration options.

diff --git a/pr/2937/docs/iroh_net_report/struct.RelayLatencies.html b/pr/2937/docs/iroh_net_report/struct.RelayLatencies.html index 56bc2acf04..8a648cb6eb 100644 --- a/pr/2937/docs/iroh_net_report/struct.RelayLatencies.html +++ b/pr/2937/docs/iroh_net_report/struct.RelayLatencies.html @@ -1,5 +1,5 @@ RelayLatencies in iroh_net_report - Rust
iroh_net_report

Struct RelayLatencies

Source
pub struct RelayLatencies(/* private fields */);
Expand description

Latencies per relay node.

-

Implementations§

Source§

impl RelayLatencies

Source

pub fn iter(&self) -> impl Iterator<Item = (&RelayUrl, Duration)> + '_

Returns an iterator over all the relays and their latencies.

+

Implementations§

Source§

impl RelayLatencies

Source

pub fn iter(&self) -> impl Iterator<Item = (&RelayUrl, Duration)> + '_

Returns an iterator over all the relays and their latencies.

Trait Implementations§

Source§

impl Clone for RelayLatencies

Source§

fn clone(&self) -> RelayLatencies

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 RelayLatencies

Source§

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

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

impl Default for RelayLatencies

Source§

fn default() -> RelayLatencies

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

impl PartialEq for RelayLatencies

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for RelayLatencies

Source§

impl StructuralPartialEq for RelayLatencies

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/2937/docs/iroh_net_report/struct.Report.html b/pr/2937/docs/iroh_net_report/struct.Report.html index 66c2343e2c..1ac89c38ec 100644 --- a/pr/2937/docs/iroh_net_report/struct.Report.html +++ b/pr/2937/docs/iroh_net_report/struct.Report.html @@ -11,7 +11,7 @@ pub mapping_varies_by_dest_ipv6: Option<bool>, pub hair_pinning: Option<bool>, pub portmap_probe: Option<ProbeOutput>, - pub preferred_relay: Option<RelayUrl>, + pub preferred_relay: Option<RelayUrl>, pub relay_latency: RelayLatencies, pub relay_v4_latency: RelayLatencies, pub relay_v6_latency: RelayLatencies, @@ -35,7 +35,7 @@ detecting rather than using it. For now.

§hair_pinning: Option<bool>

Whether the router supports communicating between two local devices through the NATted public IP address (on IPv4).

§portmap_probe: Option<ProbeOutput>

Probe indicating the presence of port mapping protocols on the LAN.

-
§preferred_relay: Option<RelayUrl>

None for unknown

+
§preferred_relay: Option<RelayUrl>

None for unknown

§relay_latency: RelayLatencies

keyed by relay Url

§relay_v4_latency: RelayLatencies

keyed by relay Url

§relay_v6_latency: RelayLatencies

keyed by relay Url

diff --git a/pr/2937/docs/type.impl/iroh/struct.PublicKey.js b/pr/2937/docs/type.impl/iroh/struct.PublicKey.js index 4d2f099bf1..baac467c70 100644 --- a/pr/2937/docs/type.impl/iroh/struct.PublicKey.js +++ b/pr/2937/docs/type.impl/iroh/struct.PublicKey.js @@ -1,9 +1,9 @@ (function() { - var type_impls = Object.fromEntries([["iroh",[["
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::NodeId"],["
Source§

impl Borrow<[u8; 32]> for PublicKey

Source§

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

Immutably borrows from an owned value. Read more
","Borrow<[u8; 32]>","iroh::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::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::NodeId"],["
Source§

impl<'de> Deserialize<'de> for PublicKey

Source§

fn deserialize<D>(\n deserializer: D,\n) -> Result<PublicKey, <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","iroh::NodeId"],["
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::NodeId"],["
Source§

impl From<VerifyingKey> for PublicKey

Source§

fn from(verifying_key: VerifyingKey) -> PublicKey

Converts to this type from the input type.
","From","iroh::NodeId"],["
Source§

impl FromStr for PublicKey

Deserialises the PublicKey from it’s base32 encoding.

\n

Display is capable of serialising this format.

\n
Source§

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::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::NodeId"],["
§

impl NodeIdExt for PublicKey

§

fn to_z32(&self) -> String

Encodes a NodeId in [z-base-32] encoding.
§

fn from_z32(s: &str) -> Result<PublicKey, Error>

Parses a NodeId from [z-base-32] encoding.
","NodeIdExt","iroh::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,

Restrict a value to a certain interval. Read more
","Ord","iroh::NodeId"],["
Source§

impl PartialEq for PublicKey

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient,\nand should not be overridden without very good reason.
","PartialEq","iroh::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

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

Tests less than or equal to (for self and other) and is used by the\n<= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the >\noperator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by\nthe >= operator. Read more
","PartialOrd","iroh::NodeId"],["
Source§

impl PublicKey

Source

pub const LENGTH: usize = 32usize

The length of an ed25519 PublicKey, in bytes.

\n
Source

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

Get this public key as a byte array.

\n
Source

pub fn public(&self) -> VerifyingKey

Returns the [VerifyingKey] for this PublicKey.

\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 hex string limited to the first 5 bytes for a friendly string\nrepresentation of the key.

\n
",0,"iroh::NodeId"],["
Source§

impl Serialize for PublicKey

Source§

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

Serialize this value into the given Serde serializer. Read more
","Serialize","iroh::NodeId"],["
Source§

impl TryFrom<&[u8]> for PublicKey

Source§

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::NodeId"],["
Source§

impl TryFrom<&[u8; 32]> for PublicKey

Source§

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::NodeId"],["
Source§

impl Copy for PublicKey

","Copy","iroh::NodeId"],["
Source§

impl Eq for PublicKey

","Eq","iroh::NodeId"],["
Source§

impl StructuralPartialEq for PublicKey

","StructuralPartialEq","iroh::NodeId"]]]]); + var type_impls = Object.fromEntries([["iroh",[["
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::NodeId"],["
Source§

impl Borrow<[u8; 32]> for PublicKey

Source§

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

Immutably borrows from an owned value. Read more
","Borrow<[u8; 32]>","iroh::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::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::NodeId"],["
Source§

impl<'de> Deserialize<'de> for PublicKey

Source§

fn deserialize<D>(\n deserializer: D,\n) -> Result<PublicKey, <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","iroh::NodeId"],["
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::NodeId"],["
Source§

impl From<VerifyingKey> for PublicKey

Source§

fn from(verifying_key: VerifyingKey) -> PublicKey

Converts to this type from the input type.
","From","iroh::NodeId"],["
Source§

impl FromStr for PublicKey

Deserialises the PublicKey from it’s base32 encoding.

\n

Display is capable of serialising this format.

\n
Source§

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::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::NodeId"],["
Source§

impl NodeIdExt for PublicKey

Source§

fn to_z32(&self) -> String

Encodes a NodeId in [z-base-32] encoding.
Source§

fn from_z32(s: &str) -> Result<PublicKey, Error>

Parses a NodeId from [z-base-32] encoding.
","NodeIdExt","iroh::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,

Restrict a value to a certain interval. Read more
","Ord","iroh::NodeId"],["
Source§

impl PartialEq for PublicKey

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient,\nand should not be overridden without very good reason.
","PartialEq","iroh::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

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

Tests less than or equal to (for self and other) and is used by the\n<= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the >\noperator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by\nthe >= operator. Read more
","PartialOrd","iroh::NodeId"],["
Source§

impl PublicKey

Source

pub const LENGTH: usize = 32usize

The length of an ed25519 PublicKey, in bytes.

\n
Source

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

Get this public key as a byte array.

\n
Source

pub fn public(&self) -> VerifyingKey

Returns the [VerifyingKey] for this PublicKey.

\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 hex string limited to the first 5 bytes for a friendly string\nrepresentation of the key.

\n
",0,"iroh::NodeId"],["
Source§

impl Serialize for PublicKey

Source§

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

Serialize this value into the given Serde serializer. Read more
","Serialize","iroh::NodeId"],["
Source§

impl TryFrom<&[u8]> for PublicKey

Source§

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::NodeId"],["
Source§

impl TryFrom<&[u8; 32]> for PublicKey

Source§

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::NodeId"],["
Source§

impl Copy for PublicKey

","Copy","iroh::NodeId"],["
Source§

impl Eq for PublicKey

","Eq","iroh::NodeId"],["
Source§

impl StructuralPartialEq for PublicKey

","StructuralPartialEq","iroh::NodeId"]]]]); if (window.register_type_impls) { window.register_type_impls(type_impls); } else { window.pending_type_impls = type_impls; } })() -//{"start":55,"fragment_lengths":[47658]} \ No newline at end of file +//{"start":55,"fragment_lengths":[47904]} \ No newline at end of file