deploy: dd0816806317618e2fee6d3f8b93ca83028a7912

This commit is contained in:
Frando
2025-02-13 22:50:08 +00:00
parent e2547bb516
commit 6c8d412c7b
10 changed files with 56 additions and 41 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Node address discovery."><title>iroh::discovery - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-dbdb5eec.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh" data-themes="" data-resource-suffix="" data-rustdoc-version="1.85.0-nightly (d10a6823f 2024-11-29)" data-channel="nightly" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../iroh/index.html">iroh</a><span class="version">0.32.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module discovery</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#examples" title="Examples">Examples</a></li></ul><h3><a href="#modules">Module Items</a></h3><ul class="block"><li><a href="#modules" title="Modules">Modules</a></li><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#traits" title="Traits">Traits</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate iroh</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">iroh</a></span><h1>Module <span>discovery</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/iroh/discovery.rs.html#1-942">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Node address discovery.</p>
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Node address discovery."><title>iroh::discovery - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-dbdb5eec.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh" data-themes="" data-resource-suffix="" data-rustdoc-version="1.85.0-nightly (d10a6823f 2024-11-29)" data-channel="nightly" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../iroh/index.html">iroh</a><span class="version">0.32.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module discovery</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#examples" title="Examples">Examples</a></li></ul><h3><a href="#modules">Module Items</a></h3><ul class="block"><li><a href="#modules" title="Modules">Modules</a></li><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#traits" title="Traits">Traits</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate iroh</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">iroh</a></span><h1>Module <span>discovery</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/iroh/discovery.rs.html#1-949">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Node address discovery.</p>
<p>To connect to an iroh node a <a href="../struct.NodeAddr.html" title="struct iroh::NodeAddr"><code>NodeAddr</code></a> is needed, which may contain a
<a href="../struct.RelayUrl.html" title="struct iroh::RelayUrl"><code>RelayUrl</code></a> or one or more <em>direct addresses</em> in addition to the <a href="../type.NodeId.html" title="type iroh::NodeId"><code>NodeId</code></a>.</p>
<p>Since there is a conversion from <a href="../type.NodeId.html" title="type iroh::NodeId"><code>NodeId</code></a> to <a href="../struct.NodeAddr.html" title="struct iroh::NodeAddr"><code>NodeAddr</code></a>, you can also use
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -50,4 +50,4 @@ should be sent on all streams.</p>
<p>The <a href="../endpoint/struct.Endpoint.html" title="struct iroh::endpoint::Endpoint"><code>crate::endpoint::Endpoint</code></a> will <code>subscribe</code> to the discovery system
and add the discovered addresses to the internal address book as they arrive
on this stream.</p>
</div></details></div><h2 id="foreign-impls" class="section-header">Implementations on Foreign Types<a href="#foreign-impls" class="anchor">§</a></h2><section id="impl-Discovery-for-Arc%3CT%3E" class="impl"><a class="src rightside" href="../../src/iroh/discovery.rs.html#195">Source</a><a href="#impl-Discovery-for-Arc%3CT%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T: <a class="trait" href="trait.Discovery.html" title="trait iroh::discovery::Discovery">Discovery</a>&gt; <a class="trait" href="trait.Discovery.html" title="trait iroh::discovery::Discovery">Discovery</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a>&lt;T&gt;</h3></section><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-Discovery-for-DnsDiscovery" class="impl"><a class="src rightside" href="../../src/iroh/discovery/dns.rs.html#65-78">Source</a><a href="#impl-Discovery-for-DnsDiscovery" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Discovery.html" title="trait iroh::discovery::Discovery">Discovery</a> for <a class="struct" href="dns/struct.DnsDiscovery.html" title="struct iroh::discovery::dns::DnsDiscovery">DnsDiscovery</a></h3></section><section id="impl-Discovery-for-LocalSwarmDiscovery" class="impl"><a class="src rightside" href="../../src/iroh/discovery/local_swarm_discovery.rs.html#355-386">Source</a><a href="#impl-Discovery-for-LocalSwarmDiscovery" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Discovery.html" title="trait iroh::discovery::Discovery">Discovery</a> for <a class="struct" href="local_swarm_discovery/struct.LocalSwarmDiscovery.html" title="struct iroh::discovery::local_swarm_discovery::LocalSwarmDiscovery">LocalSwarmDiscovery</a></h3><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>discovery-local-network</code></strong> only.</div></span></section><section id="impl-Discovery-for-DhtDiscovery" class="impl"><a class="src rightside" href="../../src/iroh/discovery/pkarr/dht.rs.html#339-384">Source</a><a href="#impl-Discovery-for-DhtDiscovery" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Discovery.html" title="trait iroh::discovery::Discovery">Discovery</a> for <a class="struct" href="pkarr/dht/struct.DhtDiscovery.html" title="struct iroh::discovery::pkarr::dht::DhtDiscovery">DhtDiscovery</a></h3><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>discovery-pkarr-dht</code></strong> only.</div></span></section><section id="impl-Discovery-for-PkarrPublisher" class="impl"><a class="src rightside" href="../../src/iroh/discovery/pkarr.rs.html#207-211">Source</a><a href="#impl-Discovery-for-PkarrPublisher" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Discovery.html" title="trait iroh::discovery::Discovery">Discovery</a> for <a class="struct" href="pkarr/struct.PkarrPublisher.html" title="struct iroh::discovery::pkarr::PkarrPublisher">PkarrPublisher</a></h3></section><section id="impl-Discovery-for-PkarrResolver" class="impl"><a class="src rightside" href="../../src/iroh/discovery/pkarr.rs.html#324-336">Source</a><a href="#impl-Discovery-for-PkarrResolver" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Discovery.html" title="trait iroh::discovery::Discovery">Discovery</a> for <a class="struct" href="pkarr/struct.PkarrResolver.html" title="struct iroh::discovery::pkarr::PkarrResolver">PkarrResolver</a></h3></section><section id="impl-Discovery-for-StaticProvider" class="impl"><a class="src rightside" href="../../src/iroh/discovery/static_provider.rs.html#184-211">Source</a><a href="#impl-Discovery-for-StaticProvider" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Discovery.html" title="trait iroh::discovery::Discovery">Discovery</a> for <a class="struct" href="static_provider/struct.StaticProvider.html" title="struct iroh::discovery::static_provider::StaticProvider">StaticProvider</a></h3></section><section id="impl-Discovery-for-ConcurrentDiscovery" class="impl"><a class="src rightside" href="../../src/iroh/discovery.rs.html#307-339">Source</a><a href="#impl-Discovery-for-ConcurrentDiscovery" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Discovery.html" title="trait iroh::discovery::Discovery">Discovery</a> for <a class="struct" href="struct.ConcurrentDiscovery.html" title="struct iroh::discovery::ConcurrentDiscovery">ConcurrentDiscovery</a></h3></section></div><script src="../../trait.impl/iroh/discovery/trait.Discovery.js" data-ignore-extern-crates="alloc" async></script></section></div></main></body></html>
</div></details></div><h2 id="foreign-impls" class="section-header">Implementations on Foreign Types<a href="#foreign-impls" class="anchor">§</a></h2><section id="impl-Discovery-for-Arc%3CT%3E" class="impl"><a class="src rightside" href="../../src/iroh/discovery.rs.html#195">Source</a><a href="#impl-Discovery-for-Arc%3CT%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T: <a class="trait" href="trait.Discovery.html" title="trait iroh::discovery::Discovery">Discovery</a>&gt; <a class="trait" href="trait.Discovery.html" title="trait iroh::discovery::Discovery">Discovery</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a>&lt;T&gt;</h3></section><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-Discovery-for-DnsDiscovery" class="impl"><a class="src rightside" href="../../src/iroh/discovery/dns.rs.html#65-78">Source</a><a href="#impl-Discovery-for-DnsDiscovery" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Discovery.html" title="trait iroh::discovery::Discovery">Discovery</a> for <a class="struct" href="dns/struct.DnsDiscovery.html" title="struct iroh::discovery::dns::DnsDiscovery">DnsDiscovery</a></h3></section><section id="impl-Discovery-for-LocalSwarmDiscovery" class="impl"><a class="src rightside" href="../../src/iroh/discovery/local_swarm_discovery.rs.html#355-386">Source</a><a href="#impl-Discovery-for-LocalSwarmDiscovery" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Discovery.html" title="trait iroh::discovery::Discovery">Discovery</a> for <a class="struct" href="local_swarm_discovery/struct.LocalSwarmDiscovery.html" title="struct iroh::discovery::local_swarm_discovery::LocalSwarmDiscovery">LocalSwarmDiscovery</a></h3><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>discovery-local-network</code></strong> only.</div></span></section><section id="impl-Discovery-for-DhtDiscovery" class="impl"><a class="src rightside" href="../../src/iroh/discovery/pkarr/dht.rs.html#339-384">Source</a><a href="#impl-Discovery-for-DhtDiscovery" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Discovery.html" title="trait iroh::discovery::Discovery">Discovery</a> for <a class="struct" href="pkarr/dht/struct.DhtDiscovery.html" title="struct iroh::discovery::pkarr::dht::DhtDiscovery">DhtDiscovery</a></h3><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>discovery-pkarr-dht</code></strong> only.</div></span></section><section id="impl-Discovery-for-PkarrPublisher" class="impl"><a class="src rightside" href="../../src/iroh/discovery/pkarr.rs.html#207-211">Source</a><a href="#impl-Discovery-for-PkarrPublisher" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Discovery.html" title="trait iroh::discovery::Discovery">Discovery</a> for <a class="struct" href="pkarr/struct.PkarrPublisher.html" title="struct iroh::discovery::pkarr::PkarrPublisher">PkarrPublisher</a></h3></section><section id="impl-Discovery-for-PkarrResolver" class="impl"><a class="src rightside" href="../../src/iroh/discovery/pkarr.rs.html#324-336">Source</a><a href="#impl-Discovery-for-PkarrResolver" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Discovery.html" title="trait iroh::discovery::Discovery">Discovery</a> for <a class="struct" href="pkarr/struct.PkarrResolver.html" title="struct iroh::discovery::pkarr::PkarrResolver">PkarrResolver</a></h3></section><section id="impl-Discovery-for-StaticProvider" class="impl"><a class="src rightside" href="../../src/iroh/discovery/static_provider.rs.html#184-211">Source</a><a href="#impl-Discovery-for-StaticProvider" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Discovery.html" title="trait iroh::discovery::Discovery">Discovery</a> for <a class="struct" href="static_provider/struct.StaticProvider.html" title="struct iroh::discovery::static_provider::StaticProvider">StaticProvider</a></h3></section><section id="impl-Discovery-for-ConcurrentDiscovery" class="impl"><a class="src rightside" href="../../src/iroh/discovery.rs.html#314-346">Source</a><a href="#impl-Discovery-for-ConcurrentDiscovery" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Discovery.html" title="trait iroh::discovery::Discovery">Discovery</a> for <a class="struct" href="struct.ConcurrentDiscovery.html" title="struct iroh::discovery::ConcurrentDiscovery">ConcurrentDiscovery</a></h3></section></div><script src="../../trait.impl/iroh/discovery/trait.Discovery.js" data-ignore-extern-crates="alloc" async></script></section></div></main></body></html>
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+24 -10
View File
@@ -940,7 +940,14 @@
<a href="#939" id="939">939</a>
<a href="#940" id="940">940</a>
<a href="#941" id="941">941</a>
<a href="#942" id="942">942</a></pre></div><pre class="rust"><code><span class="doccomment">//! Node address discovery.
<a href="#942" id="942">942</a>
<a href="#943" id="943">943</a>
<a href="#944" id="944">944</a>
<a href="#945" id="945">945</a>
<a href="#946" id="946">946</a>
<a href="#947" id="947">947</a>
<a href="#948" id="948">948</a>
<a href="#949" id="949">949</a></pre></div><pre class="rust"><code><span class="doccomment">//! Node address discovery.
//!
//! To connect to an iroh node a [`NodeAddr`] is needed, which may contain a
//! [`RelayUrl`] or one or more *direct addresses* in addition to the [`NodeId`].
@@ -1159,13 +1166,6 @@
</span>last_updated: <span class="prelude-ty">Option</span>&lt;u64&gt;,
}
<span class="kw">impl </span>std::ops::Deref <span class="kw">for </span>DiscoveryItem {
<span class="kw">type </span>Target = NodeData;
<span class="kw">fn </span>deref(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; <span class="kw-2">&amp;</span><span class="self">Self</span>::Target {
<span class="kw-2">&amp;</span><span class="self">self</span>.node_info.data
}
}
<span class="kw">impl </span>DiscoveryItem {
<span class="doccomment">/// Creates a new [`DiscoveryItem`] from a [`NodeInfo`].
</span><span class="kw">pub fn </span>new(node_info: NodeInfo, provenance: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str, last_updated: <span class="prelude-ty">Option</span>&lt;u64&gt;) -&gt; <span class="self">Self </span>{
@@ -1188,12 +1188,13 @@
<span class="doccomment">/// Returns the provenance of this discovery item.
///
/// The provenance is a static string to identify the discovery source.
/// The provenance is a static string which identifies the discovery service that produced
/// this discovery item.
</span><span class="kw">pub fn </span>provenance(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str {
<span class="self">self</span>.provenance
}
<span class="doccomment">/// Returns the optional timestamp when this node address info was last updated.
<span class="doccomment">/// Returns the optional timestamp when this node info was last updated.
///
/// The value is microseconds since the unix epoch.
</span><span class="kw">pub fn </span>last_updated(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; <span class="prelude-ty">Option</span>&lt;u64&gt; {
@@ -1211,6 +1212,19 @@
}
}
<span class="kw">impl </span>std::ops::Deref <span class="kw">for </span>DiscoveryItem {
<span class="kw">type </span>Target = NodeData;
<span class="kw">fn </span>deref(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; <span class="kw-2">&amp;</span><span class="self">Self</span>::Target {
<span class="kw-2">&amp;</span><span class="self">self</span>.node_info.data
}
}
<span class="kw">impl </span>From&lt;DiscoveryItem&gt; <span class="kw">for </span>NodeInfo {
<span class="kw">fn </span>from(item: DiscoveryItem) -&gt; <span class="self">Self </span>{
item.node_info
}
}
<span class="doccomment">/// A discovery service that combines multiple discovery sources.
///
/// The discovery services will resolve concurrently.
File diff suppressed because one or more lines are too long