pub fn endpoint_id_from_txt_name(name: &str) -> Result<EndpointId, ParseError>Expand description
Parses a EndpointId from iroh DNS name.
endpoint_id_from_txt_name
pub fn endpoint_id_from_txt_name(name: &str) -> Result<EndpointId, ParseError>Expand description
Parses a [EndpointId] from iroh DNS name.
Takes a DNS name and expects the first label to be IROH_TXT_NAME and the second
-label to be a z32 encoded EndpointId. Ignores subsequent labels.
EndpointId]. Ignores subsequent labels.
Module endpoint_info
Expand description
Support for handling DNS resource records for dialing by EndpointId.
Module endpoint_info
Expand description
Support for handling DNS resource records for dialing by [EndpointId].
DNS records are published under the following names:
_iroh.<z32-endpoint-id>.<origin-domain> TXT
The returned TXT records must contain a string value of the form key=value as defined
in RFC1464.
Structs§
- TxtAttrs
- Attributes parsed from
IROH_TXT_NAMETXT records.
Enums§
- Encoding
Error - Iroh
Attr - The attributes supported by iroh for
IROH_TXT_NAMEDNS resource records. - Parse
Error
Constants§
- IROH_
TXT_ NAME - The DNS name for the iroh TXT record.
Functions§
- endpoint_
id_ from_ txt_ name - Parses a
EndpointIdfrom iroh DNS name.
Structs§
- TxtAttrs
- Attributes parsed from
IROH_TXT_NAMETXT records.
Enums§
- Encoding
Error - Iroh
Attr - The attributes supported by iroh for
IROH_TXT_NAMEDNS resource records. - Parse
Error
Constants§
- IROH_
TXT_ NAME - The DNS name for the iroh TXT record.
Functions§
- endpoint_
id_ from_ txt_ name - Parses a [
EndpointId] from iroh DNS name.
FromStr and
Display.
Implementations§
Source§impl<T: FromStr + Display + Hash + Ord> TxtAttrs<T>
impl<T: FromStr + Display + Hash + Ord> TxtAttrs<T>
Sourcepub fn from_parts(
- endpoint_id: EndpointId,
+ endpoint_id: EndpointId,
pairs: impl Iterator<Item = (T, String)>,
) -> Self
pub fn from_parts( - endpoint_id: EndpointId, + endpoint_id: EndpointId, pairs: impl Iterator<Item = (T, String)>, ) -> Self
Creates TxtAttrs from an endpoint id and an iterator of key-value pairs.
Sourcepub fn from_strings(
- endpoint_id: EndpointId,
+ endpoint_id: EndpointId,
strings: impl Iterator<Item = String>,
) -> Result<Self, ParseError>
pub fn from_strings( - endpoint_id: EndpointId, + endpoint_id: EndpointId, strings: impl Iterator<Item = String>, ) -> Result<Self, ParseError>
Creates TxtAttrs from an endpoint id and an iterator of “{key}={value}” strings.
Sourcepub fn endpoint_id(&self) -> EndpointId
pub fn endpoint_id(&self) -> EndpointId
Returns the endpoint id.
+Sourcepub fn endpoint_id(&self) -> EndpointId
pub fn endpoint_id(&self) -> EndpointId
Returns the endpoint id.
Sourcepub fn from_txt_lookup(
name: String,
lookup: impl Iterator<Item = impl Display>,
@@ -24,10 +24,10 @@ values that implement Sourcepub fn to_txt_strings(&self) -> impl Iterator<Item = String> + '_
Converts to {key}={value} strings.
pub fn from_txt_lookup(
name: String,
lookup: impl Iterator<Item = impl Display>,
@@ -24,10 +24,10 @@ values that implement Sourcepub fn to_txt_strings(&self) -> impl Iterator<Item = String> + '_
Converts to {key}={value} strings.
pub fn to_txt_strings(&self) -> impl Iterator<Item = String> + '_
Converts to {key}={value} strings.
Sourcepub fn to_pkarr_signed_packet(
&self,
- secret_key: &SecretKey,
+ secret_key: &SecretKey,
ttl: u32,
) -> Result<SignedPacket, EncodingError>
pub fn to_pkarr_signed_packet( &self, - secret_key: &SecretKey, + secret_key: &SecretKey, ttl: u32, ) -> Result<SignedPacket, EncodingError>
Creates a pkarr::SignedPacket
This constructs a DNS packet and signs it with a SecretKey.
This constructs a DNS packet and signs it with a [SecretKey].
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for TxtAttrs<T>
impl<T> RefUnwindSafe for TxtAttrs<T>where
T: RefUnwindSafe,
impl<T> Send for TxtAttrs<T>where
T: Send,
impl<T> Sync for TxtAttrs<T>where
diff --git a/pr/4033/docs/iroh_dns/enum.DecodingError.html b/pr/4033/docs/iroh_dns/enum.DecodingError.html
index 17154d3684..92e50d2af4 100644
--- a/pr/4033/docs/iroh_dns/enum.DecodingError.html
+++ b/pr/4033/docs/iroh_dns/enum.DecodingError.html
@@ -8,12 +8,12 @@
meta: Meta,
},
InvalidKey {
- source: KeyParsingError,
+ source: KeyParsingError,
meta: Meta,
},
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.Trait Implementations§
Source§impl Debug for DecodingError
Source§impl Display for DecodingError
Source§impl Error for DecodingError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Source§impl From<DecodingError> for AnyError
Source§fn from(value: DecodingError) -> AnyError
Converts to this type from the input type.Source§impl From<DecodingError> for ParseError
Source§fn from(source: DecodingError) -> Self
Converts to this type from the input type.Source§impl StackError for DecodingError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.Source§fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
Returns the next source in the chain, if any.Source§fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.Auto Trait Implementations§
§impl Freeze for DecodingError
§impl RefUnwindSafe for DecodingError
§impl Send for DecodingError
§impl Sync for DecodingError
§impl Unpin for DecodingError
§impl UnwindSafe for DecodingError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
diff --git a/pr/4033/docs/iroh_dns/index.html b/pr/4033/docs/iroh_dns/index.html
index 0a7c5fa689..be602f0e22 100644
--- a/pr/4033/docs/iroh_dns/index.html
+++ b/pr/4033/docs/iroh_dns/index.html
@@ -1,5 +1,5 @@
iroh_dns - Rust Crate iroh_dns
Expand description
DNS-based endpoint discovery for iroh.
This crate contains the core types for publishing and resolving iroh endpoint
information via DNS, using the pkarr signed packet format.
-Modules§
- endpoint_
info - Support for handling DNS resource records for dialing by
EndpointId. - pkarr
- Pkarr signed packet encoding.
Enums§
Traits§
- Endpoint
IdExt - Extension methods for
EndpointId to encode to and decode from z-base-32,
+
Modules§
- endpoint_
info - Support for handling DNS resource records for dialing by [
EndpointId]. - pkarr
- Pkarr signed packet encoding.
Enums§
Traits§
- Endpoint
IdExt - Extension methods for [
EndpointId] to encode to and decode from z-base-32,
which is the encoding used by pkarr domain names.
\ No newline at end of file
diff --git a/pr/4033/docs/iroh_dns/pkarr/struct.SignedPacket.html b/pr/4033/docs/iroh_dns/pkarr/struct.SignedPacket.html
index 651c5a897c..4d719bcc57 100644
--- a/pr/4033/docs/iroh_dns/pkarr/struct.SignedPacket.html
+++ b/pr/4033/docs/iroh_dns/pkarr/struct.SignedPacket.html
@@ -3,7 +3,7 @@
The DNS packet must be at most 1000 bytes. Total max size is 1104 bytes.
Implementations§
Source§impl SignedPacket
Sourcepub fn from_txt_strings(
- secret_key: &SecretKey,
+ secret_key: &SecretKey,
name: &str,
values: impl IntoIterator<Item = impl AsRef<str>>,
ttl: u32,
@@ -11,7 +11,7 @@
This is the common case: multiple TXT values under the same DNS name (e.g. "_iroh").
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<SignedPacket, SignedPacketVerifyError>
Parse and verify a signed packet from its wire representation.
Sourcepub fn from_relay_payload(
- public_key: &PublicKey,
+ public_key: &PublicKey,
payload: &[u8],
) -> Result<SignedPacket, SignedPacketVerifyError>
Create from a public key and relay payload (signature + timestamp + dns).
Sourcepub fn from_bytes_unchecked(
@@ -20,8 +20,8 @@
Still validates minimum length and DNS parsing.
Sourcepub fn to_relay_payload(&self) -> Vec<u8> ⓘ
Return the relay payload (everything after the public key).
-Sourcepub fn public_key(&self) -> PublicKey
Return the public key.
-Sourcepub fn public_key(&self) -> PublicKey
Return the public key.
+Sourcepub fn encoded_packet(&self) -> &[u8] ⓘ
Return the encoded DNS packet bytes.
Sourcepub fn txt_records(&self, name: &str) -> Vec<String>
Iterate over TXT records under a specific DNS name.
diff --git a/pr/4033/docs/iroh_dns/trait.EndpointIdExt.html b/pr/4033/docs/iroh_dns/trait.EndpointIdExt.html
index 4ee78decb2..bdd3ab70e4 100644
--- a/pr/4033/docs/iroh_dns/trait.EndpointIdExt.html
+++ b/pr/4033/docs/iroh_dns/trait.EndpointIdExt.html
@@ -1,9 +1,9 @@
EndpointIdExt in iroh_dns - Rust EndpointIdExt
pub trait EndpointIdExt {
// Required methods
fn to_z32(&self) -> String;
- fn from_z32(s: &str) -> Result<EndpointId, DecodingError>;
-}
Expand description
Extension methods for EndpointId to encode to and decode from z-base-32,
+ fn from_z32(s: &str) -> Result<EndpointId, DecodingError>;
+}Expand description
Extension methods for [EndpointId] to encode to and decode from z-base-32,
which is the encoding used by pkarr domain names.
-
Required Methods§
Sourcefn to_z32(&self) -> String
Encodes a EndpointId in z-base-32 encoding.
-Sourcefn from_z32(s: &str) -> Result<EndpointId, DecodingError>
Parses a EndpointId 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 EndpointIdExt for EndpointId
Implementors§
\ No newline at end of file
+Required Methods§
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 EndpointIdExt for EndpointId
Implementors§
\ No newline at end of file
diff --git a/pr/4033/docs/src/iroh/address_lookup/pkarr/dht.rs.html b/pr/4033/docs/src/iroh/address_lookup/pkarr/dht.rs.html
index 1c099467aa..d8f61d7a24 100644
--- a/pr/4033/docs/src/iroh/address_lookup/pkarr/dht.rs.html
+++ b/pr/4033/docs/src/iroh/address_lookup/pkarr/dht.rs.html
@@ -330,7 +330,7 @@
330 #[ignore = "flaky"]
331 #[traced_test]
332 async fn dht_address_lookup_smoke() -> Result {
-333 let secret = SecretKey::generate(&mut rand::rng());
+333 let secret = SecretKey::generate();
334 let testnet = Testnet::new_async(3).await.anyerr()?;
335 let mut dht_builder = DhtBuilder::default();
336 dht_builder.bootstrap(&testnet.bootstrap);
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Trait Implementations§
Source§impl Debug for DecodingError
impl Debug for DecodingError
Source§impl Display for DecodingError
impl Display for DecodingError
Source§impl Error for DecodingError
impl Error for DecodingError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl From<DecodingError> for AnyError
impl From<DecodingError> for AnyError
Source§fn from(value: DecodingError) -> AnyError
fn from(value: DecodingError) -> AnyError
Source§impl From<DecodingError> for ParseError
impl From<DecodingError> for ParseError
Source§fn from(source: DecodingError) -> Self
fn from(source: DecodingError) -> Self
Source§impl StackError for DecodingError
impl StackError for DecodingError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Source§fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
Source§fn is_transparent(&self) -> bool
fn is_transparent(&self) -> bool
Auto Trait Implementations§
impl Freeze for DecodingError
impl RefUnwindSafe for DecodingError
impl Send for DecodingError
impl Sync for DecodingError
impl Unpin for DecodingError
impl UnwindSafe for DecodingError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
diff --git a/pr/4033/docs/iroh_dns/index.html b/pr/4033/docs/iroh_dns/index.html
index 0a7c5fa689..be602f0e22 100644
--- a/pr/4033/docs/iroh_dns/index.html
+++ b/pr/4033/docs/iroh_dns/index.html
@@ -1,5 +1,5 @@
iroh_dns - Rust Crate iroh_dns
Expand description
DNS-based endpoint discovery for iroh.
This crate contains the core types for publishing and resolving iroh endpoint
information via DNS, using the pkarr signed packet format.
-Modules§
- endpoint_
info - Support for handling DNS resource records for dialing by
EndpointId. - pkarr
- Pkarr signed packet encoding.
Enums§
Traits§
- Endpoint
IdExt - Extension methods for
EndpointId to encode to and decode from z-base-32,
+
Modules§
- endpoint_
info - Support for handling DNS resource records for dialing by [
EndpointId]. - pkarr
- Pkarr signed packet encoding.
Enums§
Traits§
- Endpoint
IdExt - Extension methods for [
EndpointId] to encode to and decode from z-base-32,
which is the encoding used by pkarr domain names.
\ No newline at end of file
diff --git a/pr/4033/docs/iroh_dns/pkarr/struct.SignedPacket.html b/pr/4033/docs/iroh_dns/pkarr/struct.SignedPacket.html
index 651c5a897c..4d719bcc57 100644
--- a/pr/4033/docs/iroh_dns/pkarr/struct.SignedPacket.html
+++ b/pr/4033/docs/iroh_dns/pkarr/struct.SignedPacket.html
@@ -3,7 +3,7 @@
The DNS packet must be at most 1000 bytes. Total max size is 1104 bytes.
impl<T> BorrowMut<T> for Twhere
diff --git a/pr/4033/docs/iroh_dns/index.html b/pr/4033/docs/iroh_dns/index.html
index 0a7c5fa689..be602f0e22 100644
--- a/pr/4033/docs/iroh_dns/index.html
+++ b/pr/4033/docs/iroh_dns/index.html
@@ -1,5 +1,5 @@
iroh_dns - Rust Crate iroh_dns
Expand description
DNS-based endpoint discovery for iroh.
This crate contains the core types for publishing and resolving iroh endpoint
information via DNS, using the pkarr signed packet format.
-Modules§
- endpoint_
info - Support for handling DNS resource records for dialing by
EndpointId. - pkarr
- Pkarr signed packet encoding.
Enums§
Traits§
- Endpoint
IdExt - Extension methods for
EndpointId to encode to and decode from z-base-32,
+
Modules§
- endpoint_
info - Support for handling DNS resource records for dialing by [
EndpointId]. - pkarr
- Pkarr signed packet encoding.
Enums§
Traits§
- Endpoint
IdExt - Extension methods for [
EndpointId] to encode to and decode from z-base-32,
which is the encoding used by pkarr domain names.
\ No newline at end of file
diff --git a/pr/4033/docs/iroh_dns/pkarr/struct.SignedPacket.html b/pr/4033/docs/iroh_dns/pkarr/struct.SignedPacket.html
index 651c5a897c..4d719bcc57 100644
--- a/pr/4033/docs/iroh_dns/pkarr/struct.SignedPacket.html
+++ b/pr/4033/docs/iroh_dns/pkarr/struct.SignedPacket.html
@@ -3,7 +3,7 @@
Crate iroh_dns
Expand description
DNS-based endpoint discovery for iroh.
This crate contains the core types for publishing and resolving iroh endpoint information via DNS, using the pkarr signed packet format.
-Modules§
- endpoint_
info - Support for handling DNS resource records for dialing by
EndpointId. - pkarr
- Pkarr signed packet encoding.
Enums§
Traits§
- Endpoint
IdExt - Extension methods for
EndpointIdto encode to and decode from z-base-32, +
Modules§
- endpoint_
info - Support for handling DNS resource records for dialing by [
EndpointId]. - pkarr
- Pkarr signed packet encoding.
Enums§
Traits§
- Endpoint
IdExt - Extension methods for [
EndpointId] to encode to and decode from z-base-32, which is the encoding used by pkarr domain names.
The DNS packet must be at most 1000 bytes. Total max size is 1104 bytes.
Implementations§
Source§impl SignedPacket
impl SignedPacket
Sourcepub fn from_txt_strings(
- secret_key: &SecretKey,
+ secret_key: &SecretKey,
name: &str,
values: impl IntoIterator<Item = impl AsRef<str>>,
ttl: u32,
@@ -11,7 +11,7 @@
This is the common case: multiple TXT values under the same DNS name (e.g. "_iroh").
pub fn from_txt_strings( - secret_key: &SecretKey, + secret_key: &SecretKey, name: &str, values: impl IntoIterator<Item = impl AsRef<str>>, ttl: u32, @@ -11,7 +11,7 @@
This is the common case: multiple TXT values under the same DNS name (e.g. "_iroh").
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<SignedPacket, SignedPacketVerifyError>
pub fn from_bytes(bytes: &[u8]) -> Result<SignedPacket, SignedPacketVerifyError>
Parse and verify a signed packet from its wire representation.
Sourcepub fn from_relay_payload(
- public_key: &PublicKey,
+ public_key: &PublicKey,
payload: &[u8],
) -> Result<SignedPacket, SignedPacketVerifyError>
pub fn from_relay_payload( - public_key: &PublicKey, + public_key: &PublicKey, payload: &[u8], ) -> Result<SignedPacket, SignedPacketVerifyError>
Create from a public key and relay payload (signature + timestamp + dns).
Sourcepub fn from_bytes_unchecked(
@@ -20,8 +20,8 @@
Still validates minimum length and DNS parsing.
pub fn from_bytes_unchecked( @@ -20,8 +20,8 @@
Still validates minimum length and DNS parsing.
Sourcepub fn to_relay_payload(&self) -> Vec<u8> ⓘ
pub fn to_relay_payload(&self) -> Vec<u8> ⓘ
Return the relay payload (everything after the public key).
-Sourcepub fn public_key(&self) -> PublicKey
pub fn public_key(&self) -> PublicKey
Return the public key.
-Sourcepub fn public_key(&self) -> PublicKey
pub fn public_key(&self) -> PublicKey
Return the public key.
+Sourcepub fn encoded_packet(&self) -> &[u8] ⓘ
pub fn encoded_packet(&self) -> &[u8] ⓘ
Return the encoded DNS packet bytes.
Sourcepub fn txt_records(&self, name: &str) -> Vec<String>
pub fn txt_records(&self, name: &str) -> Vec<String>
Iterate over TXT records under a specific DNS name.
diff --git a/pr/4033/docs/iroh_dns/trait.EndpointIdExt.html b/pr/4033/docs/iroh_dns/trait.EndpointIdExt.html index 4ee78decb2..bdd3ab70e4 100644 --- a/pr/4033/docs/iroh_dns/trait.EndpointIdExt.html +++ b/pr/4033/docs/iroh_dns/trait.EndpointIdExt.html @@ -1,9 +1,9 @@EndpointIdExt
pub trait EndpointIdExt {
// Required methods
fn to_z32(&self) -> String;
- fn from_z32(s: &str) -> Result<EndpointId, DecodingError>;
-}Expand description
Extension methods for Extension methods for [EndpointId to encode to and decode from z-base-32,
+ fn from_z32(s: &str) -> Result<EndpointId, DecodingError>;
+}Expand description
EndpointId] to encode to and decode from z-base-32,
which is the encoding used by pkarr domain names.
Required Methods§
Sourcefn to_z32(&self) -> String
fn to_z32(&self) -> String
Encodes a EndpointId in z-base-32 encoding.
Sourcefn from_z32(s: &str) -> Result<EndpointId, DecodingError>
fn from_z32(s: &str) -> Result<EndpointId, DecodingError>
Parses a EndpointId 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 EndpointIdExt for EndpointId
impl EndpointIdExt for EndpointId
Implementors§
Required Methods§
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.