diff --git a/pr/3176/docs/iroh/discovery/struct.NodeInfo.html b/pr/3176/docs/iroh/discovery/struct.NodeInfo.html index 339305cfde..225e7d8872 100644 --- a/pr/3176/docs/iroh/discovery/struct.NodeInfo.html +++ b/pr/3176/docs/iroh/discovery/struct.NodeInfo.html @@ -1,24 +1,24 @@ -NodeInfo in iroh::discovery - Rust
iroh::discovery

Struct NodeInfo

Source
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 the iroh node contained in an IROH_TXT_NAME TXT resource record.

Fields§

§node_id: PublicKey

The NodeId.

§data: NodeData

The information published about the node.

-

Implementations§

Source§

impl NodeInfo

Source

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

Creates a new NodeInfo from its parts.

-
Source

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

Parses a NodeInfo from a TXT records lookup.

-
Source

pub fn from_pkarr_signed_packet( +

Implementations§

Source§

impl NodeInfo

Source

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

Creates a new NodeInfo from its parts.

+
Source

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

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

-
Source

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.

-
Source

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

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

-
Source

pub fn into_node_addr_and_user_data(self) -> (NodeAddr, Option<UserData>)

Converts into a NodeAddr and optional UserData.

-

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 From<&TxtAttrs<IrohAttr>> for NodeInfo

Source§

fn from(attrs: &TxtAttrs<IrohAttr>) -> 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 +

Source

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

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

+
Source

pub fn into_node_addr_and_user_data(self) -> (NodeAddr, Option<UserData>)

Converts into a NodeAddr and optional UserData.

+

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 From<&TxtAttrs<IrohAttr>> for NodeInfo

Source§

fn from(attrs: &TxtAttrs<IrohAttr>) -> 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/3176/docs/iroh/discovery/struct.UserData.html b/pr/3176/docs/iroh/discovery/struct.UserData.html index 5743f8a611..a2962ec983 100644 --- a/pr/3176/docs/iroh/discovery/struct.UserData.html +++ b/pr/3176/docs/iroh/discovery/struct.UserData.html @@ -1,7 +1,7 @@ UserData in iroh::discovery - Rust
iroh::discovery

Struct UserData

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

Below the hood this is a utf-8 String that is less than or equal to 253 bytes.

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

TODO: more explanation of how to get the user defined data of a node.

-

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 +

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
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 @@ -11,7 +11,7 @@ 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
Source§

impl TryFrom<String> for UserData

Source§

type Error = MaxLengthExceededError

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

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.
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 diff --git a/pr/3176/docs/iroh/dns/node_info/constant.USER_DATA_MAX_LENGTH.html b/pr/3176/docs/iroh/dns/node_info/constant.USER_DATA_MAX_LENGTH.html index 7b05b7c1f0..6939a622ac 100644 --- a/pr/3176/docs/iroh/dns/node_info/constant.USER_DATA_MAX_LENGTH.html +++ b/pr/3176/docs/iroh/dns/node_info/constant.USER_DATA_MAX_LENGTH.html @@ -1,2 +1,5 @@ -USER_DATA_MAX_LENGTH in iroh::dns::node_info - Rust
iroh::dns::node_info

Constant USER_DATA_MAX_LENGTH

Source
pub const USER_DATA_MAX_LENGTH: usize = 255; // 255usize
Expand description

The max byte length allowed for user defined data.

+USER_DATA_MAX_LENGTH in iroh::dns::node_info - Rust
iroh::dns::node_info

Constant USER_DATA_MAX_LENGTH

Source
pub const USER_DATA_MAX_LENGTH: usize = 245; // 245usize
Expand description

The max byte length allowed for user defined data.

+

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

\ No newline at end of file diff --git a/pr/3176/docs/iroh/dns/node_info/struct.MaxLengthExceededError.html b/pr/3176/docs/iroh/dns/node_info/struct.MaxLengthExceededError.html index 2d07d4ffb4..5b114a8502 100644 --- a/pr/3176/docs/iroh/dns/node_info/struct.MaxLengthExceededError.html +++ b/pr/3176/docs/iroh/dns/node_info/struct.MaxLengthExceededError.html @@ -1,5 +1,5 @@ -MaxLengthExceededError in iroh::dns::node_info - Rust
iroh::dns::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 +MaxLengthExceededError in iroh::dns::node_info - Rust
iroh::dns::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/3176/docs/iroh/dns/node_info/struct.NodeInfo.html b/pr/3176/docs/iroh/dns/node_info/struct.NodeInfo.html index a0f94425d7..19d6cd2fc0 100644 --- a/pr/3176/docs/iroh/dns/node_info/struct.NodeInfo.html +++ b/pr/3176/docs/iroh/dns/node_info/struct.NodeInfo.html @@ -1,24 +1,24 @@ -NodeInfo in iroh::dns::node_info - Rust
iroh::dns::node_info

Struct NodeInfo

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

Struct NodeInfo

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

Information about the iroh node contained in an IROH_TXT_NAME TXT resource record.

Fields§

§node_id: PublicKey

The NodeId.

§data: NodeData

The information published about the node.

-

Implementations§

Source§

impl NodeInfo

Source

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

Creates a new NodeInfo from its parts.

-
Source

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

Parses a NodeInfo from a TXT records lookup.

-
Source

pub fn from_pkarr_signed_packet( +

Implementations§

Source§

impl NodeInfo

Source

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

Creates a new NodeInfo from its parts.

+
Source

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

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

-
Source

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.

-
Source

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

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

-
Source

pub fn into_node_addr_and_user_data(self) -> (NodeAddr, Option<UserData>)

Converts into a NodeAddr and optional UserData.

-

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 From<&TxtAttrs<IrohAttr>> for NodeInfo

Source§

fn from(attrs: &TxtAttrs<IrohAttr>) -> 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 +

Source

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

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

+
Source

pub fn into_node_addr_and_user_data(self) -> (NodeAddr, Option<UserData>)

Converts into a NodeAddr and optional UserData.

+

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 From<&TxtAttrs<IrohAttr>> for NodeInfo

Source§

fn from(attrs: &TxtAttrs<IrohAttr>) -> 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/3176/docs/iroh/dns/node_info/struct.UserData.html b/pr/3176/docs/iroh/dns/node_info/struct.UserData.html index a647557f04..7567bf4289 100644 --- a/pr/3176/docs/iroh/dns/node_info/struct.UserData.html +++ b/pr/3176/docs/iroh/dns/node_info/struct.UserData.html @@ -1,7 +1,7 @@ UserData in iroh::dns::node_info - Rust
iroh::dns::node_info

Struct UserData

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

Below the hood this is a utf-8 String that is less than or equal to 253 bytes.

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

TODO: more explanation of how to get the user defined data of a node.

-

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 +

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
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 @@ -11,7 +11,7 @@ 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
Source§

impl TryFrom<String> for UserData

Source§

type Error = MaxLengthExceededError

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

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.
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 diff --git a/pr/3176/docs/iroh/struct.NodeAddr.html b/pr/3176/docs/iroh/struct.NodeAddr.html index 1a428e7316..bd3e2a83e7 100644 --- a/pr/3176/docs/iroh/struct.NodeAddr.html +++ b/pr/3176/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.
Source§

impl From<NodeAddr> for NodeData

Source§

fn from(node_addr: NodeAddr) -> NodeData

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.

+ __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<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/3176/docs/iroh_net_report/struct.Client.html b/pr/3176/docs/iroh_net_report/struct.Client.html index 4cc1899d63..b26f34faf5 100644 --- a/pr/3176/docs/iroh_net_report/struct.Client.html +++ b/pr/3176/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/3176/docs/iroh_net_report/struct.RelayLatencies.html b/pr/3176/docs/iroh_net_report/struct.RelayLatencies.html index a2d3b88d82..8494e5ed26 100644 --- a/pr/3176/docs/iroh_net_report/struct.RelayLatencies.html +++ b/pr/3176/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/3176/docs/iroh_net_report/struct.Report.html b/pr/3176/docs/iroh_net_report/struct.Report.html index ac3dcd8786..5a58065db3 100644 --- a/pr/3176/docs/iroh_net_report/struct.Report.html +++ b/pr/3176/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/3176/docs/iroh_relay/client/enum.ReceivedMessage.html b/pr/3176/docs/iroh_relay/client/enum.ReceivedMessage.html index 035d4a5eba..bd3dd90464 100644 --- a/pr/3176/docs/iroh_relay/client/enum.ReceivedMessage.html +++ b/pr/3176/docs/iroh_relay/client/enum.ReceivedMessage.html @@ -1,9 +1,9 @@ ReceivedMessage in iroh_relay::client - Rust
iroh_relay::client

Enum ReceivedMessage

Source
pub enum ReceivedMessage {
     ReceivedPacket {
-        remote_node_id: NodeId,
+        remote_node_id: NodeId,
         data: Bytes,
     },
-    NodeGone(NodeId),
+    NodeGone(NodeId),
     Ping([u8; 8]),
     Pong([u8; 8]),
     KeepAlive,
@@ -17,9 +17,9 @@
 }
Expand description

The messages received from a framed relay stream.

This is a type-validated version of the Frames on the RelayCodec.

Variants§

§

ReceivedPacket

Represents an incoming packet.

-

Fields

§remote_node_id: NodeId

The NodeId of the packet sender.

+

Fields

§remote_node_id: NodeId

The [NodeId] of the packet sender.

§data: Bytes

The received packet bytes.

-
§

NodeGone(NodeId)

Indicates that the client identified by the underlying public key had previously sent you a +

§

NodeGone(NodeId)

Indicates that the client identified by the underlying public key had previously sent you a packet but has now disconnected from the server.

§

Ping([u8; 8])

Request from a client or server to reply to the other side with a ReceivedMessage::Pong with the given payload.

diff --git a/pr/3176/docs/iroh_relay/client/enum.SendMessage.html b/pr/3176/docs/iroh_relay/client/enum.SendMessage.html index 8007446751..675dfc000f 100644 --- a/pr/3176/docs/iroh_relay/client/enum.SendMessage.html +++ b/pr/3176/docs/iroh_relay/client/enum.SendMessage.html @@ -1,9 +1,9 @@ SendMessage in iroh_relay::client - Rust
iroh_relay::client

Enum SendMessage

Source
pub enum SendMessage {
-    SendPacket(NodeId, Bytes),
+    SendPacket(NodeId, Bytes),
     Ping([u8; 8]),
     Pong([u8; 8]),
 }
Expand description

Messages we can send to a relay server.

-

Variants§

§

SendPacket(NodeId, Bytes)

Send a packet of data to the NodeId.

+

Variants§

§

SendPacket(NodeId, Bytes)

Send a packet of data to the [NodeId].

§

Ping([u8; 8])

Sends a ping message to the connected relay server.

§

Pong([u8; 8])

Sends a pong message to the connected relay server.

Trait Implementations§

Source§

impl Debug for SendMessage

Source§

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

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

impl Sink<SendMessage> for Client

Source§

type Error = ConnSendError

The type of value produced by the sink when an error occurs.
Source§

fn poll_ready( diff --git a/pr/3176/docs/iroh_relay/client/struct.ClientBuilder.html b/pr/3176/docs/iroh_relay/client/struct.ClientBuilder.html index dced614e31..7307aac7f2 100644 --- a/pr/3176/docs/iroh_relay/client/struct.ClientBuilder.html +++ b/pr/3176/docs/iroh_relay/client/struct.ClientBuilder.html @@ -1,7 +1,7 @@ ClientBuilder in iroh_relay::client - Rust
iroh_relay::client

Struct ClientBuilder

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

Build a Client.

Implementations§

Source§

impl ClientBuilder

Source

pub fn new( - url: impl Into<RelayUrl>, - secret_key: SecretKey, + url: impl Into<RelayUrl>, + secret_key: SecretKey, dns_resolver: DnsResolver, ) -> Self

Create a new ClientBuilder

Source

pub fn protocol(self, protocol: Protocol) -> Self

Sets whether to connect to the relay via websockets or not. diff --git a/pr/3176/docs/iroh_relay/dns/index.html b/pr/3176/docs/iroh_relay/dns/index.html index b08dc85482..0970232562 100644 --- a/pr/3176/docs/iroh_relay/dns/index.html +++ b/pr/3176/docs/iroh_relay/dns/index.html @@ -1,2 +1,2 @@ iroh_relay::dns - Rust

iroh_relay

Module dns

Source
Available on non-wasm_browser only.
Expand description

DNS resolver

-

Modules§

Structs§

Constants§

\ No newline at end of file +

Modules§

  • Support for handling DNS resource records for dialing by [NodeId].

Structs§

Constants§

\ No newline at end of file diff --git a/pr/3176/docs/iroh_relay/dns/node_info/constant.USER_DATA_MAX_LENGTH.html b/pr/3176/docs/iroh_relay/dns/node_info/constant.USER_DATA_MAX_LENGTH.html index b4b56ebc33..aca4cd4e58 100644 --- a/pr/3176/docs/iroh_relay/dns/node_info/constant.USER_DATA_MAX_LENGTH.html +++ b/pr/3176/docs/iroh_relay/dns/node_info/constant.USER_DATA_MAX_LENGTH.html @@ -1,2 +1,5 @@ -USER_DATA_MAX_LENGTH in iroh_relay::dns::node_info - Rust
iroh_relay::dns::node_info

Constant USER_DATA_MAX_LENGTH

Source
pub const USER_DATA_MAX_LENGTH: usize = 255;
Available on non-wasm_browser only.
Expand description

The max byte length allowed for user defined data.

+USER_DATA_MAX_LENGTH in iroh_relay::dns::node_info - Rust
iroh_relay::dns::node_info

Constant USER_DATA_MAX_LENGTH

Source
pub const USER_DATA_MAX_LENGTH: usize = 245;
Available on non-wasm_browser only.
Expand description

The max byte length allowed for user defined data.

+

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

\ No newline at end of file diff --git a/pr/3176/docs/iroh_relay/dns/node_info/index.html b/pr/3176/docs/iroh_relay/dns/node_info/index.html index 8a44c0528b..29789f35b7 100644 --- a/pr/3176/docs/iroh_relay/dns/node_info/index.html +++ b/pr/3176/docs/iroh_relay/dns/node_info/index.html @@ -1,5 +1,5 @@ -iroh_relay::dns::node_info - Rust
iroh_relay::dns

Module node_info

Source
Available on non-wasm_browser only.
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 +iroh_relay::dns::node_info - Rust

iroh_relay::dns

Module node_info

Source
Available on non-wasm_browser only.
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:

_iroh.<z32-node-id>.<origin-domain> TXT

@@ -8,7 +8,7 @@ servers or the Mainline DHT. This module supports creating and parsing these re

_iroh is the record name as defined by IROH_TXT_NAME.

  • -

    <z32-node-id> is the z-base-32 encoding of the NodeId.

    +

    <z32-node-id> is the z-base-32 encoding of the [NodeId].

  • <origin-domain> is the domain name of the publishing DNS server, @@ -23,12 +23,12 @@ servers or the Mainline DHT. This module supports creating and parsing these re in RFC1464. The following attributes are defined:

    • -

      relay=<url>: The home RelayUrl of this node.

      +

      relay=<url>: The home RelayUrl of this node.

    • addr=<addr> <addr>: A space-separated list of sockets addresses for this iroh node. Each address is an IPv4 or IPv6 address with a port.

    -
  • Structs§

    • Error returned when an input value is too long for UserData.
    • The information that can be published about a node in discovery services.
    • Information about the iroh node contained in an IROH_TXT_NAME TXT resource record.
    • Below the hood this is a utf-8 String that is less than or equal to 253 bytes.

    Constants§

    Traits§

    • Extension methods for NodeId to encode to and decode from [z32], +

    Structs§

    • Error returned when an input value is too long for UserData.
    • The information that can be published about a node in discovery services.
    • Information about the iroh node contained in an IROH_TXT_NAME TXT resource record.
    • Below the hood this is a utf-8 String that is less than or equal to 253 bytes.

    Constants§

    Traits§

    • Extension methods for [NodeId] to encode to and decode from [z32], which is the encoding used in [pkarr] domain names.
    \ No newline at end of file diff --git a/pr/3176/docs/iroh_relay/dns/node_info/struct.MaxLengthExceededError.html b/pr/3176/docs/iroh_relay/dns/node_info/struct.MaxLengthExceededError.html index 603f61c24d..8975934144 100644 --- a/pr/3176/docs/iroh_relay/dns/node_info/struct.MaxLengthExceededError.html +++ b/pr/3176/docs/iroh_relay/dns/node_info/struct.MaxLengthExceededError.html @@ -1,5 +1,5 @@ -MaxLengthExceededError in iroh_relay::dns::node_info - Rust
    iroh_relay::dns::node_info

    Struct MaxLengthExceededError

    Source
    pub struct MaxLengthExceededError;
    Available on non-wasm_browser only.
    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

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

    impl Display for MaxLengthExceededError

    Source§

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

    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 +MaxLengthExceededError in iroh_relay::dns::node_info - Rust
    iroh_relay::dns::node_info

    Struct MaxLengthExceededError

    Source
    pub struct MaxLengthExceededError;
    Available on non-wasm_browser only.
    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

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

    impl Display for MaxLengthExceededError

    Source§

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

    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/3176/docs/iroh_relay/dns/node_info/struct.NodeData.html b/pr/3176/docs/iroh_relay/dns/node_info/struct.NodeData.html index 87e37f931d..70ba428526 100644 --- a/pr/3176/docs/iroh_relay/dns/node_info/struct.NodeData.html +++ b/pr/3176/docs/iroh_relay/dns/node_info/struct.NodeData.html @@ -1,30 +1,30 @@ NodeData in iroh_relay::dns::node_info - Rust
    iroh_relay::dns::node_info

    Struct NodeData

    Source
    #[non_exhaustive]
    pub struct NodeData { - pub relay_url: Option<RelayUrl>, + pub relay_url: Option<RelayUrl>, pub direct_addresses: BTreeSet<SocketAddr>, pub user_data: Option<UserData>, }
    Available on non-wasm_browser only.
    Expand description

    The information that can be published about a node in discovery services.

    -

    This includes an optional RelayUrl, a set of direct addresses, and the optional +

    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.

    The fields are not public, but there are setter and getter functions for all fields contained in the struct.

    -

    Fields (Non-exhaustive)§

    This struct is marked as non-exhaustive
    Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
    §relay_url: Option<RelayUrl>

    URL of the home relay of this node.

    +

    Fields (Non-exhaustive)§

    This struct is marked as non-exhaustive
    Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
    §relay_url: Option<RelayUrl>

    URL of the home relay of this node.

    §direct_addresses: BTreeSet<SocketAddr>

    Direct addresses where this node can be reached.

    §user_data: Option<UserData>

    Optional user-defined UserData for this node.

    Implementations§

    Source§

    impl NodeData

    Source

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

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

    -
    Source

    pub fn with_relay_url(self, relay_url: impl Into<RelayUrl>) -> Self

    Sets the relay URL.

    +
    Source

    pub fn with_relay_url(self, relay_url: impl Into<RelayUrl>) -> Self

    Sets the relay URL.

    Source

    pub fn with_direct_addrs(self, direct_addrs: BTreeSet<SocketAddr>) -> Self

    Sets the direct addresses.

    Source

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

    Sets the user data.

    Source

    pub fn clear_direct_addresses(&mut self)

    Removes all direct addresses.

    -
    Source

    pub fn into_node_addr(self, node_id: NodeId) -> NodeAddr

    Converts into a NodeAddr.

    +
    Source

    pub fn into_node_addr(self, node_id: NodeId) -> NodeAddr

    Converts into a [NodeAddr].

    Source

    pub fn into_node_addr_and_user_data( self, - node_id: NodeId, -) -> (NodeAddr, Option<UserData>)

    Converts into a NodeAddr and UserData.

    -

    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

    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) -> Self

    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, + node_id: NodeId, +) -> (NodeAddr, Option<UserData>)

    Converts into a [NodeAddr] and UserData.

    +

    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

    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) -> Self

    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 diff --git a/pr/3176/docs/iroh_relay/dns/node_info/struct.NodeInfo.html b/pr/3176/docs/iroh_relay/dns/node_info/struct.NodeInfo.html index 62e388457f..fabd230387 100644 --- a/pr/3176/docs/iroh_relay/dns/node_info/struct.NodeInfo.html +++ b/pr/3176/docs/iroh_relay/dns/node_info/struct.NodeInfo.html @@ -1,22 +1,22 @@ -NodeInfo in iroh_relay::dns::node_info - Rust
    iroh_relay::dns::node_info

    Struct NodeInfo

    Source
    pub struct NodeInfo {
    -    pub node_id: NodeId,
    +NodeInfo in iroh_relay::dns::node_info - Rust
    iroh_relay::dns::node_info

    Struct NodeInfo

    Source
    pub struct NodeInfo {
    +    pub node_id: NodeId,
         pub data: NodeData,
     }
    Available on non-wasm_browser only.
    Expand description

    Information about the iroh node contained in an IROH_TXT_NAME TXT resource record.

    -

    Fields§

    §node_id: NodeId

    The NodeId.

    +

    Fields§

    §node_id: NodeId

    The [NodeId].

    §data: NodeData

    The information published about the node.

    -

    Implementations§

    Source§

    impl NodeInfo

    Source

    pub fn new(node_id: NodeId, data: NodeData) -> Self

    Creates a new NodeInfo from its parts.

    -
    Source

    pub fn from_txt_lookup(lookup: TxtLookup) -> Result<Self>

    Parses a NodeInfo from a TXT records lookup.

    -
    Source

    pub fn from_pkarr_signed_packet(packet: &SignedPacket) -> Result<Self>

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

    -
    Source

    pub fn to_pkarr_signed_packet( +

    Implementations§

    Source§

    impl NodeInfo

    Source

    pub fn new(node_id: NodeId, data: NodeData) -> Self

    Creates a new NodeInfo from its parts.

    +
    Source

    pub fn from_txt_lookup(lookup: TxtLookup) -> Result<Self>

    Parses a NodeInfo from a TXT records lookup.

    +
    Source

    pub fn from_pkarr_signed_packet(packet: &SignedPacket) -> Result<Self>

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

    +
    Source

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

    Creates a [pkarr::SignedPacket].

    -

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

    -
    Source

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

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

    -
    Source

    pub fn into_node_addr_and_user_data(self) -> (NodeAddr, Option<UserData>)

    Converts into a NodeAddr and optional UserData.

    -

    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

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

    impl From<NodeInfo> for NodeAddr

    Source§

    fn from(value: NodeInfo) -> Self

    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 +

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

    +

    Source

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

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

    +
    Source

    pub fn into_node_addr_and_user_data(self) -> (NodeAddr, Option<UserData>)

    Converts into a [NodeAddr] and optional UserData.

    +

    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

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

    impl From<NodeInfo> for NodeAddr

    Source§

    fn from(value: NodeInfo) -> Self

    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/3176/docs/iroh_relay/dns/node_info/struct.UserData.html b/pr/3176/docs/iroh_relay/dns/node_info/struct.UserData.html index 120576e6f6..13de07f718 100644 --- a/pr/3176/docs/iroh_relay/dns/node_info/struct.UserData.html +++ b/pr/3176/docs/iroh_relay/dns/node_info/struct.UserData.html @@ -1,7 +1,7 @@ UserData in iroh_relay::dns::node_info - Rust
    iroh_relay::dns::node_info

    Struct UserData

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

    Below the hood this is a utf-8 String that is less than or equal to 253 bytes.

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

    TODO: more explanation of how to get the user defined data of a node.

    -

    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

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

    impl Display for UserData

    Source§

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

    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<Self, Self::Err>

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

    impl Hash for UserData

    Source§

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

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

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

    Trait Implementations§

    Source§

    impl 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

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

    impl Display for UserData

    Source§

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

    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<Self, Self::Err>

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

    impl Hash for UserData

    Source§

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

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

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

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

    impl Ord for 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 @@ -10,7 +10,7 @@ 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
    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<Self, Self::Error>

    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 +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<Self, Self::Error>

    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/3176/docs/iroh_relay/dns/node_info/trait.NodeIdExt.html b/pr/3176/docs/iroh_relay/dns/node_info/trait.NodeIdExt.html index 2f3c047c2a..78b2f53295 100644 --- a/pr/3176/docs/iroh_relay/dns/node_info/trait.NodeIdExt.html +++ b/pr/3176/docs/iroh_relay/dns/node_info/trait.NodeIdExt.html @@ -1,9 +1,9 @@ NodeIdExt in iroh_relay::dns::node_info - Rust
    iroh_relay::dns::node_info

    Trait NodeIdExt

    Source
    pub trait NodeIdExt {
         // Required methods
         fn to_z32(&self) -> String;
    -    fn from_z32(s: &str) -> Result<NodeId>;
    -}
    Available on non-wasm_browser only.
    Expand description

    Extension methods for NodeId to encode to and decode from [z32], + fn from_z32(s: &str) -> Result<NodeId>; +}

    Available on non-wasm_browser only.
    Expand description

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

    -

    Required Methods§

    Source

    fn to_z32(&self) -> String

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

    -
    Source

    fn from_z32(s: &str) -> Result<NodeId>

    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.

    Implementations on Foreign Types§

    Source§

    impl NodeIdExt for NodeId

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

    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.

    Implementations on Foreign Types§

    Source§

    impl NodeIdExt for NodeId

    Source§

    fn to_z32(&self) -> String

    Source§

    fn from_z32(s: &str) -> Result<NodeId>

    Implementors§

    \ No newline at end of file diff --git a/pr/3176/docs/iroh_relay/dns/struct.DnsResolver.html b/pr/3176/docs/iroh_relay/dns/struct.DnsResolver.html index 86185712e8..a581298a87 100644 --- a/pr/3176/docs/iroh_relay/dns/struct.DnsResolver.html +++ b/pr/3176/docs/iroh_relay/dns/struct.DnsResolver.html @@ -67,9 +67,9 @@ at T+0ms, T+200ms and T+300ms. The timeout is applied as stated in summary of all errors otherwise.

    Source

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

    Looks up node info by NodeId and origin domain name.

    +) -> Result<NodeInfo>

    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.

    Source

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

    Looks up node info by DNS name.

    @@ -84,10 +84,10 @@ at T+0ms, T+200ms and T+300ms. The result of the first successful call is return summary of all errors otherwise.

    Source

    pub async fn lookup_node_by_id_staggered( &self, - node_id: &NodeId, + node_id: &NodeId, origin: &str, delays_ms: &[u64], -) -> Result<NodeInfo>

    Looks up node info by NodeId and origin domain name.

    +) -> Result<NodeInfo>

    Looks up node info by [NodeId] and origin domain name.

    From the moment this function is called, each lookup is scheduled after the delays in 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 diff --git a/pr/3176/docs/iroh_relay/server/enum.AccessConfig.html b/pr/3176/docs/iroh_relay/server/enum.AccessConfig.html index f5e6aa995f..4cb7d85f22 100644 --- a/pr/3176/docs/iroh_relay/server/enum.AccessConfig.html +++ b/pr/3176/docs/iroh_relay/server/enum.AccessConfig.html @@ -1,10 +1,10 @@ AccessConfig in iroh_relay::server - Rust

    iroh_relay::server

    Enum AccessConfig

    Source
    pub enum AccessConfig {
         Everyone,
    -    Restricted(Box<dyn Fn(NodeId) -> Boxed<Access> + Send + Sync + 'static>),
    +    Restricted(Box<dyn Fn(NodeId) -> Boxed<Access> + Send + Sync + 'static>),
     }
    Available on crate feature server only.
    Expand description

    Controls which nodes are allowed to use the relay.

    Variants§

    §

    Everyone

    Everyone

    -
    §

    Restricted(Box<dyn Fn(NodeId) -> Boxed<Access> + Send + Sync + 'static>)

    Only nodes for which the function returns Access::Allow.

    -

    Implementations§

    Source§

    impl AccessConfig

    Source

    pub async fn is_allowed(&self, node: NodeId) -> bool

    Is this node allowed?

    +
    §

    Restricted(Box<dyn Fn(NodeId) -> Boxed<Access> + Send + Sync + 'static>)

    Only nodes for which the function returns Access::Allow.

    +

    Implementations§

    Source§

    impl AccessConfig

    Source

    pub async fn is_allowed(&self, node: NodeId) -> bool

    Is this node allowed?

    Trait Implementations§

    Source§

    impl Debug for AccessConfig

    Source§

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

    Formats the value using the given formatter. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    Source§

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

    Source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    §

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

    §

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

    §

    impl<'a, T, E> AsTaggedImplicit<'a, E> for T
    where diff --git a/pr/3176/docs/iroh_relay/server/struct.Server.html b/pr/3176/docs/iroh_relay/server/struct.Server.html index f7f28655dc..98ffc18bcc 100644 --- a/pr/3176/docs/iroh_relay/server/struct.Server.html +++ b/pr/3176/docs/iroh_relay/server/struct.Server.html @@ -14,9 +14,9 @@ case there is an error in the server before it is shut down.

    Source

    pub fn quic_addr(&self) -> Option<SocketAddr>

    The socket address the QUIC server is listening on.

    Source

    pub fn stun_addr(&self) -> Option<SocketAddr>

    The socket address the STUN server is listening on.

    Source

    pub fn certificates(&self) -> Option<Vec<CertificateDer<'static>>>

    The certificates chain if configured with manual TLS certificates.

    -
    Source

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

    Available on crate feature test-utils only.

    Get the server’s https RelayUrl.

    +
    Source

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

    Available on crate feature test-utils only.

    Get the server’s https [RelayUrl].

    This uses Self::https_addr so it’s mostly useful for local development.

    -
    Source

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

    Available on crate feature test-utils only.

    Get the server’s http RelayUrl.

    +
    Source

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

    Available on crate feature test-utils only.

    Get the server’s http [RelayUrl].

    This uses Self::http_addr so it’s mostly useful for local development.

    Trait Implementations§

    Source§

    impl Debug for Server

    Source§

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

    Formats the value using the given formatter. Read more

    Auto Trait Implementations§

    §

    impl Freeze for Server

    §

    impl RefUnwindSafe for Server

    §

    impl Send for Server

    §

    impl Sync for Server

    §

    impl Unpin for Server

    §

    impl UnwindSafe for Server

    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/3176/docs/iroh_relay/struct.RelayMap.html b/pr/3176/docs/iroh_relay/struct.RelayMap.html index ca3050feae..ca46b361fb 100644 --- a/pr/3176/docs/iroh_relay/struct.RelayMap.html +++ b/pr/3176/docs/iroh_relay/struct.RelayMap.html @@ -1,16 +1,16 @@ RelayMap in iroh_relay - Rust
    iroh_relay

    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.

    +

    Implementations§

    Source§

    impl RelayMap

    Source

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

    Returns the sorted relay URLs.

    Source

    pub fn empty() -> Self

    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 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) -> Self

    Creates a new RelayMap with a single relay server configured.

    +
    Source

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

    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.

    -
    Source

    pub fn from_url(url: RelayUrl) -> Self

    Returns a RelayMap from a RelayUrl.

    +
    Source

    pub fn from_url(url: RelayUrl) -> Self

    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. diff --git a/pr/3176/docs/iroh_relay/struct.RelayNode.html b/pr/3176/docs/iroh_relay/struct.RelayNode.html index 037a98f5b6..20e1e45d10 100644 --- a/pr/3176/docs/iroh_relay/struct.RelayNode.html +++ b/pr/3176/docs/iroh_relay/struct.RelayNode.html @@ -1,11 +1,11 @@ RelayNode in iroh_relay - Rust

    iroh_relay

    Struct RelayNode

    Source
    pub struct RelayNode {
    -    pub url: RelayUrl,
    +    pub url: RelayUrl,
         pub stun_only: bool,
         pub stun_port: u16,
         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.

    +

    Fields§

    §url: RelayUrl

    The [RelayUrl] where this relay server can be dialed.

    §stun_only: bool

    Whether this relay server should only be used for STUN requests.

    This essentially allows you to use a normal STUN server as a relay node, no relay functionality is used.

    diff --git a/pr/3176/docs/src/iroh_relay/dns/node_info.rs.html b/pr/3176/docs/src/iroh_relay/dns/node_info.rs.html index 07262c5162..365f7c744d 100644 --- a/pr/3176/docs/src/iroh_relay/dns/node_info.rs.html +++ b/pr/3176/docs/src/iroh_relay/dns/node_info.rs.html @@ -687,7 +687,11 @@ 686 687 688 -689
    //! Support for handling DNS resource records for dialing by [`NodeId`].
    +689
    +690
    +691
    +692
    +693
    //! 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.
    @@ -862,7 +866,11 @@
     pub struct UserData(String);
     
     /// The max byte length allowed for user defined data.
    -pub const USER_DATA_MAX_LENGTH: usize = 255;
    +///
    +/// In DNS discovery services, the user data is stored in a TXT record character string,
    +/// which has a max length of 255 bytes. We need to subtract "user-data=", which leaves
    +/// 245 bytes for the actual user data.
    +pub const USER_DATA_MAX_LENGTH: usize = 245;
     
     /// Error returned when an input value is too long for [`UserData`].
     #[derive(Debug, thiserror::Error)]
    diff --git a/pr/3176/docs/trait.impl/core/convert/trait.From.js b/pr/3176/docs/trait.impl/core/convert/trait.From.js
    index 44ea0fc254..794ccb9db8 100644
    --- a/pr/3176/docs/trait.impl/core/convert/trait.From.js
    +++ b/pr/3176/docs/trait.impl/core/convert/trait.From.js
    @@ -1,9 +1,9 @@
     (function() {
    -    var implementors = Object.fromEntries([["iroh",[["impl From<RemoteInfo> for NodeAddr"],["impl<T> From<T> for ConcurrentDiscovery
    where\n T: IntoIterator<Item = Box<dyn Discovery>>,
    "]]],["iroh_base",[["impl From<(PublicKey, Option<RelayUrl>, &[SocketAddr])> for NodeAddr"],["impl From<ParseError> for RelayUrlParseError"],["impl From<Url> for RelayUrl"],["impl From<NodeAddr> for NodeTicket"],["impl From<PublicKey> for NodeAddr"],["impl From<RelayUrl> for Url"],["impl From<NodeTicket> for NodeAddr"],["impl From<DecodeError> for KeyParsingError"],["impl From<DecodeError> for Error"],["impl From<Error> for KeyParsingError"],["impl From<Error> for Error"],["impl From<SigningKey> for SecretKey"],["impl From<VerifyingKey> for PublicKey"],["impl From<[u8; 32]> for SecretKey"]]],["iroh_relay",[["impl From<Error> for ConnSendError"],["impl From<NodeAddr> for NodeData"],["impl From<NodeInfo> for NodeAddr"],["impl From<Error> for ConnSendError"],["impl From<Resolver<GenericConnector<TokioRuntimeProvider>>> for DnsResolver"],["impl From<TxtLookup> for TxtLookup"]]]]); + var implementors = Object.fromEntries([["iroh",[["impl From<RemoteInfo> for NodeAddr"],["impl<T> From<T> for ConcurrentDiscovery
    where\n T: IntoIterator<Item = Box<dyn Discovery>>,
    "]]],["iroh_base",[["impl From<(PublicKey, Option<RelayUrl>, &[SocketAddr])> for NodeAddr"],["impl From<ParseError> for RelayUrlParseError"],["impl From<Url> for RelayUrl"],["impl From<NodeAddr> for NodeTicket"],["impl From<PublicKey> for NodeAddr"],["impl From<RelayUrl> for Url"],["impl From<NodeTicket> for NodeAddr"],["impl From<DecodeError> for KeyParsingError"],["impl From<DecodeError> for Error"],["impl From<Error> for KeyParsingError"],["impl From<Error> for Error"],["impl From<SigningKey> for SecretKey"],["impl From<VerifyingKey> for PublicKey"],["impl From<[u8; 32]> for SecretKey"]]],["iroh_relay",[["impl From<Error> for ConnSendError"],["impl From<NodeInfo> for NodeAddr"],["impl From<Error> for ConnSendError"],["impl From<NodeAddr> for NodeData"],["impl From<Resolver<GenericConnector<TokioRuntimeProvider>>> for DnsResolver"],["impl From<TxtLookup> for TxtLookup"]]]]); if (window.register_implementors) { window.register_implementors(implementors); } else { window.pending_implementors = implementors; } })() -//{"start":57,"fragment_lengths":[1219,5343,2245]} \ No newline at end of file +//{"start":57,"fragment_lengths":[1219,5343,2001]} \ No newline at end of file