deploy: cc124e99094066e2aa8185846b25d148d929a703

This commit is contained in:
dignifiedquire
2025-04-29 13:08:23 +00:00
parent df376fa976
commit b90da71cfb
29 changed files with 160 additions and 128 deletions
+1 -1
View File
@@ -1,2 +1,2 @@
<!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="DNS node discovery for iroh"><title>iroh::discovery::dns - 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.34.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module dns</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#constants" title="Constants">Constants</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In iroh::<wbr>discovery</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>::<wbr><a href="../index.html">discovery</a></span><h1>Module <span>dns</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/dns.rs.html#1-78">Source</a> </span></div><span class="item-info"><div class="stab portability">Available on <strong>non-<code>wasm_browser</code></strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>DNS node discovery for iroh</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="DNS node discovery for iroh"><title>iroh::discovery::dns - 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.34.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module dns</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#constants" title="Constants">Constants</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In iroh::<wbr>discovery</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>::<wbr><a href="../index.html">discovery</a></span><h1>Module <span>dns</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/dns.rs.html#1-81">Source</a> </span></div><span class="item-info"><div class="stab portability">Available on <strong>non-<code>wasm_browser</code></strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>DNS node discovery for iroh</p>
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="struct" href="struct.DnsDiscovery.html" title="struct iroh::discovery::dns::DnsDiscovery">DnsDiscovery</a></div><div class="desc docblock-short">DNS node discovery</div></li></ul><h2 id="constants" class="section-header">Constants<a href="#constants" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="constant" href="constant.N0_DNS_NODE_ORIGIN_PROD.html" title="constant iroh::discovery::dns::N0_DNS_NODE_ORIGIN_PROD">N0_<wbr>DNS_<wbr>NODE_<wbr>ORIGIN_<wbr>PROD</a></div><div class="desc docblock-short">The n0 testing DNS node origin, for production.</div></li><li><div class="item-name"><a class="constant" href="constant.N0_DNS_NODE_ORIGIN_STAGING.html" title="constant iroh::discovery::dns::N0_DNS_NODE_ORIGIN_STAGING">N0_<wbr>DNS_<wbr>NODE_<wbr>ORIGIN_<wbr>STAGING</a></div><div class="desc docblock-short">The n0 testing DNS node origin, for testing.</div></li></ul></section></div></main></body></html>
File diff suppressed because one or more lines are too long
@@ -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="Name of this discovery service."><title>NAME in iroh::discovery::mdns - 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 constant"><!--[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.34.1</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In iroh::<wbr>discovery::<wbr>mdns</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>::<wbr><a href="../index.html">discovery</a>::<wbr><a href="index.html">mdns</a></span><h1>Constant <span class="constant">NAME</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/mdns.rs.html#64">Source</a> </span></div><pre class="rust item-decl"><code>pub const NAME: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a> = &quot;local.swarm.discovery&quot;;</code></pre><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>discovery-local-network</code></strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Name of this discovery service.</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="Name of this discovery service."><title>NAME in iroh::discovery::mdns - 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 constant"><!--[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.34.1</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In iroh::<wbr>discovery::<wbr>mdns</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>::<wbr><a href="../index.html">discovery</a>::<wbr><a href="index.html">mdns</a></span><h1>Constant <span class="constant">NAME</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/mdns.rs.html#63">Source</a> </span></div><pre class="rust item-decl"><code>pub const NAME: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a> = &quot;local.swarm.discovery&quot;;</code></pre><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>discovery-local-network</code></strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Name of this discovery service.</p>
<p>Used as the <code>provenance</code> field in <a href="../struct.DiscoveryItem.html" title="struct iroh::discovery::DiscoveryItem"><code>DiscoveryItem</code></a>s.</p>
<p>Used in the <a href="../../endpoint/enum.Source.html#variant.Discovery" title="variant iroh::endpoint::Source::Discovery"><code>crate::endpoint::Source::Discovery</code></a> enum variant as the <code>name</code>.</p>
</div></details></section></div></main></body></html>
+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="A discovery service that uses an mdns-like service to discover local nodes."><title>iroh::discovery::mdns - 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.34.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module mdns</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#constants" title="Constants">Constants</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In iroh::<wbr>discovery</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>::<wbr><a href="../index.html">discovery</a></span><h1>Module <span>mdns</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/mdns.rs.html#1-503">Source</a> </span></div><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>discovery-local-network</code></strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A discovery service that uses an mdns-like service to discover local nodes.</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="A discovery service that uses an mdns-like service to discover local nodes."><title>iroh::discovery::mdns - 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.34.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module mdns</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#constants" title="Constants">Constants</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In iroh::<wbr>discovery</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>::<wbr><a href="../index.html">discovery</a></span><h1>Module <span>mdns</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/mdns.rs.html#1-506">Source</a> </span></div><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>discovery-local-network</code></strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A discovery service that uses an mdns-like service to discover local nodes.</p>
<p>This allows you to use an mdns-like swarm discovery service to find address information about nodes that are on your local network, no relay or outside internet needed.
See the <a href="https://crates.io/crates/swarm-discovery"><code>swarm-discovery</code></a> crate for more details.</p>
<p>When <a href="struct.MdnsDiscovery.html" title="struct iroh::discovery::mdns::MdnsDiscovery"><code>MdnsDiscovery</code></a> is enabled, it’s possible to get a list of the locally discovered nodes by filtering a list of <code>RemoteInfo</code>s.</p>
File diff suppressed because one or more lines are too long
@@ -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="Pkarr based node discovery for iroh, supporting both relay servers and the DHT."><title>iroh::discovery::pkarr::dht - 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.34.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module dht</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In iroh::<wbr>discovery::<wbr>pkarr</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>::<wbr><a href="../../index.html">discovery</a>::<wbr><a href="../index.html">pkarr</a></span><h1>Module <span>dht</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/pkarr/dht.rs.html#1-446">Source</a> </span></div><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>discovery-pkarr-dht</code></strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Pkarr based node discovery for iroh, supporting both relay servers and the DHT.</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="Pkarr based node discovery for iroh, supporting both relay servers and the DHT."><title>iroh::discovery::pkarr::dht - 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.34.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module dht</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In iroh::<wbr>discovery::<wbr>pkarr</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>::<wbr><a href="../../index.html">discovery</a>::<wbr><a href="../index.html">pkarr</a></span><h1>Module <span>dht</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/pkarr/dht.rs.html#1-445">Source</a> </span></div><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>discovery-pkarr-dht</code></strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Pkarr based node discovery for iroh, supporting both relay servers and the DHT.</p>
<p>This module contains pkarr-based node discovery for iroh which can use both pkarr
relay servers as well as the Mainline DHT directly. See the <a href="../index.html" title="mod iroh::discovery::pkarr">pkarr module</a> for an
overview of pkarr.</p>
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+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="A discovery service which publishes and resolves node information using a pkarr relay."><title>iroh::discovery::pkarr - 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.34.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module pkarr</a></h2><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="#constants" title="Constants">Constants</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In iroh::<wbr>discovery</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>::<wbr><a href="../index.html">discovery</a></span><h1>Module <span>pkarr</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/pkarr.rs.html#1-404">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A discovery service which publishes and resolves node information using a <a href="https://pkarr.org">pkarr</a> relay.</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="A discovery service which publishes and resolves node information using a pkarr relay."><title>iroh::discovery::pkarr - 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.34.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module pkarr</a></h2><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="#constants" title="Constants">Constants</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In iroh::<wbr>discovery</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>::<wbr><a href="../index.html">discovery</a></span><h1>Module <span>pkarr</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/pkarr.rs.html#1-408">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A discovery service which publishes and resolves node information using a <a href="https://pkarr.org">pkarr</a> relay.</p>
<p>Public-Key Addressable Resource Records, <a href="https://pkarr.org">pkarr</a>, is a system which allows publishing
<a href="https://en.wikipedia.org/wiki/Domain_Name_System#Resource_records">DNS Resource Records</a> owned by a particular <a href="../../struct.SecretKey.html" title="struct iroh::SecretKey"><code>SecretKey</code></a> under a name derived from its
corresponding <a href="../../struct.PublicKey.html" title="struct iroh::PublicKey"><code>PublicKey</code></a>, also known as the <a href="../../type.NodeId.html" title="type iroh::NodeId"><code>NodeId</code></a>. Additionally this pkarr
File diff suppressed because one or more lines are too long
@@ -11,7 +11,7 @@ the <a href="struct.PkarrPublisher.html" title="struct iroh::discovery::pkarr::P
<p>When running with the environment variable <code>IROH_FORCE_STAGING_RELAYS</code>
set to any non empty value <a href="constant.N0_DNS_PKARR_RELAY_STAGING.html" title="constant iroh::discovery::pkarr::N0_DNS_PKARR_RELAY_STAGING"><code>N0_DNS_PKARR_RELAY_STAGING</code></a>
server is used instead.</p>
</div></details></div></details></div><h2 id="trait-implementations" class="section-header">Trait Implementations<a href="#trait-implementations" class="anchor">§</a></h2><div id="trait-implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-Clone-for-PkarrResolver" class="impl"><a class="src rightside" href="../../../src/iroh/discovery/pkarr.rs.html#290">Source</a><a href="#impl-Clone-for-PkarrResolver" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="struct.PkarrResolver.html" title="struct iroh::discovery::pkarr::PkarrResolver">PkarrResolver</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.clone" class="method trait-impl"><a class="src rightside" href="../../../src/iroh/discovery/pkarr.rs.html#290">Source</a><a href="#method.clone" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone" class="fn">clone</a>(&amp;self) -&gt; <a class="struct" href="struct.PkarrResolver.html" title="struct iroh::discovery::pkarr::PkarrResolver">PkarrResolver</a></h4></section></summary><div class='docblock'>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.clone_from" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/clone.rs.html#174">Source</a></span><a href="#method.clone_from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from" class="fn">clone_from</a>(&amp;mut self, source: &amp;Self)</h4></section></summary><div class='docblock'>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Debug-for-PkarrResolver" class="impl"><a class="src rightside" href="../../../src/iroh/discovery/pkarr.rs.html#290">Source</a><a href="#impl-Debug-for-PkarrResolver" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="struct.PkarrResolver.html" title="struct iroh::discovery::pkarr::PkarrResolver">PkarrResolver</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.fmt" class="method trait-impl"><a class="src rightside" href="../../../src/iroh/discovery/pkarr.rs.html#290">Source</a><a href="#method.fmt" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt" class="fn">fmt</a>(&amp;self, __derive_more_f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4></section></summary><div class='docblock'>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><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="struct.PkarrResolver.html" title="struct iroh::discovery::pkarr::PkarrResolver">PkarrResolver</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.resolve" class="method trait-impl"><a class="src rightside" href="../../../src/iroh/discovery/pkarr.rs.html#325-335">Source</a><a href="#method.resolve" class="anchor">§</a><h4 class="code-header">fn <a href="../trait.Discovery.html#method.resolve" class="fn">resolve</a>(
</div></details></div></details></div><h2 id="trait-implementations" class="section-header">Trait Implementations<a href="#trait-implementations" class="anchor">§</a></h2><div id="trait-implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-Clone-for-PkarrResolver" class="impl"><a class="src rightside" href="../../../src/iroh/discovery/pkarr.rs.html#290">Source</a><a href="#impl-Clone-for-PkarrResolver" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="struct.PkarrResolver.html" title="struct iroh::discovery::pkarr::PkarrResolver">PkarrResolver</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.clone" class="method trait-impl"><a class="src rightside" href="../../../src/iroh/discovery/pkarr.rs.html#290">Source</a><a href="#method.clone" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone" class="fn">clone</a>(&amp;self) -&gt; <a class="struct" href="struct.PkarrResolver.html" title="struct iroh::discovery::pkarr::PkarrResolver">PkarrResolver</a></h4></section></summary><div class='docblock'>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.clone_from" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/clone.rs.html#174">Source</a></span><a href="#method.clone_from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from" class="fn">clone_from</a>(&amp;mut self, source: &amp;Self)</h4></section></summary><div class='docblock'>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Debug-for-PkarrResolver" class="impl"><a class="src rightside" href="../../../src/iroh/discovery/pkarr.rs.html#290">Source</a><a href="#impl-Debug-for-PkarrResolver" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="struct.PkarrResolver.html" title="struct iroh::discovery::pkarr::PkarrResolver">PkarrResolver</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.fmt" class="method trait-impl"><a class="src rightside" href="../../../src/iroh/discovery/pkarr.rs.html#290">Source</a><a href="#method.fmt" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt" class="fn">fmt</a>(&amp;self, __derive_more_f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4></section></summary><div class='docblock'>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Discovery-for-PkarrResolver" class="impl"><a class="src rightside" href="../../../src/iroh/discovery/pkarr.rs.html#324-340">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="struct.PkarrResolver.html" title="struct iroh::discovery::pkarr::PkarrResolver">PkarrResolver</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.resolve" class="method trait-impl"><a class="src rightside" href="../../../src/iroh/discovery/pkarr.rs.html#325-339">Source</a><a href="#method.resolve" class="anchor">§</a><h4 class="code-header">fn <a href="../trait.Discovery.html#method.resolve" class="fn">resolve</a>(
&amp;self,
_ep: <a class="struct" href="../../endpoint/struct.Endpoint.html" title="struct iroh::endpoint::Endpoint">Endpoint</a>,
node_id: <a class="type" href="../../type.NodeId.html" title="type iroh::NodeId">NodeId</a>,
@@ -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#199">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><span class="item-info"><div class="stab portability">Available on <strong>non-<code>wasm_browser</code></strong> only.</div></span></section><section id="impl-Discovery-for-MdnsDiscovery" class="impl"><a class="src rightside" href="../../src/iroh/discovery/mdns.rs.html#375-406">Source</a><a href="#impl-Discovery-for-MdnsDiscovery" 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="mdns/struct.MdnsDiscovery.html" title="struct iroh::discovery::mdns::MdnsDiscovery">MdnsDiscovery</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#189-216">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#323-355">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#199">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#64-81">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><span class="item-info"><div class="stab portability">Available on <strong>non-<code>wasm_browser</code></strong> only.</div></span></section><section id="impl-Discovery-for-MdnsDiscovery" class="impl"><a class="src rightside" href="../../src/iroh/discovery/mdns.rs.html#374-409">Source</a><a href="#impl-Discovery-for-MdnsDiscovery" 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="mdns/struct.MdnsDiscovery.html" title="struct iroh::discovery::mdns::MdnsDiscovery">MdnsDiscovery</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#338-383">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-340">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#189-216">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#323-355">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>
@@ -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="Attempts to bind a local socket to send STUN packets from."><title>bind_local_stun_socket in iroh::net_report - 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 fn"><!--[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.34.1</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In iroh::<wbr>net_<wbr>report</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>::<wbr><a href="index.html">net_report</a></span><h1>Function <span class="fn">bind_local_stun_socket</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/net_report.rs.html#811-855">Source</a> </span></div><pre class="rust item-decl"><code>pub fn bind_local_stun_socket(
<!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="Attempts to bind a local socket to send STUN packets from."><title>bind_local_stun_socket in iroh::net_report - 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 fn"><!--[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.34.1</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In iroh::<wbr>net_<wbr>report</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>::<wbr><a href="index.html">net_report</a></span><h1>Function <span class="fn">bind_local_stun_socket</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/net_report.rs.html#815-859">Source</a> </span></div><pre class="rust item-decl"><code>pub fn bind_local_stun_socket(
network: IpFamily,
actor_addr: <a class="struct" href="struct.Addr.html" title="struct iroh::net_report::Addr">Addr</a>,
cancel_token: CancellationToken,
+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="Checks the network conditions from the current host."><title>iroh::net_report - 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.34.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module net_<wbr>report</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#functions" title="Functions">Functions</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>net_report</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/net_report.rs.html#1-1392">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Checks the network conditions from the current host.</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="Checks the network conditions from the current host."><title>iroh::net_report - 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.34.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module net_<wbr>report</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#functions" title="Functions">Functions</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>net_report</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/net_report.rs.html#1-1400">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Checks the network conditions from the current host.</p>
<p>NetReport is responsible for finding out the network conditions of the current host, like
whether it is connected to the internet via IPv4 and/or IPv6, what the NAT situation is
etc and reachability to the configured relays.</p>
File diff suppressed because one or more lines are too long
@@ -5,7 +5,7 @@ it is idle unless <a href="struct.Client.html#method.get_report" title="method i
If all <a href="struct.Client.html" title="struct iroh::net_report::Client"><code>Client</code></a>s are dropped the actor stops running.</p>
<p>While running the net_report actor expects to be passed all received stun packets using
<code>Addr::receive_stun_packet</code>.</p>
</div></details><h2 id="implementations" class="section-header">Implementations<a href="#implementations" class="anchor">§</a></h2><div id="implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-Client" class="impl"><a class="src rightside" href="../../src/iroh/net_report.rs.html#243-355">Source</a><a href="#impl-Client" class="anchor">§</a><h3 class="code-header">impl <a class="struct" href="struct.Client.html" title="struct iroh::net_report::Client">Client</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.new" class="method"><a class="src rightside" href="../../src/iroh/net_report.rs.html#248-270">Source</a><h4 class="code-header">pub fn <a href="#method.new" class="fn">new</a>(
</div></details><h2 id="implementations" class="section-header">Implementations<a href="#implementations" class="anchor">§</a></h2><div id="implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-Client" class="impl"><a class="src rightside" href="../../src/iroh/net_report.rs.html#243-359">Source</a><a href="#impl-Client" class="anchor">§</a><h3 class="code-header">impl <a class="struct" href="struct.Client.html" title="struct iroh::net_report::Client">Client</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.new" class="method"><a class="src rightside" href="../../src/iroh/net_report.rs.html#248-270">Source</a><h4 class="code-header">pub fn <a href="#method.new" class="fn">new</a>(
port_mapper: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Client&gt;,
dns_resolver: <a class="struct" href="../dns/struct.DnsResolver.html" title="struct iroh::dns::DnsResolver">DnsResolver</a>,
ip_mapped_addrs: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;IpMappedAddresses&gt;,
@@ -15,7 +15,7 @@ stop running.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.addr" class="method"><a class="src rightside" href="../../src/iroh/net_report.rs.html#276-278">Source</a><h4 class="code-header">pub fn <a href="#method.addr" class="fn">addr</a>(&amp;self) -&gt; <a class="struct" href="struct.Addr.html" title="struct iroh::net_report::Addr">Addr</a></h4></section></summary><div class="docblock"><p>Returns a new address to send messages to this actor.</p>
<p>Unlike the client itself the returned <a href="struct.Addr.html" title="struct iroh::net_report::Addr"><code>Addr</code></a> does not own the actor task, it only
allows sending messages to the actor.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_report" class="method"><a class="src rightside" href="../../src/iroh/net_report.rs.html#329-335">Source</a><h4 class="code-header">pub async fn <a href="#method.get_report" class="fn">get_report</a>(
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_report" class="method"><a class="src rightside" href="../../src/iroh/net_report.rs.html#329-339">Source</a><h4 class="code-header">pub async fn <a href="#method.get_report" class="fn">get_report</a>(
&amp;mut self,
relay_map: <a class="struct" href="../struct.RelayMap.html" title="struct iroh::RelayMap">RelayMap</a>,
opts: <a class="struct" href="struct.Options.html" title="struct iroh::net_report::Options">Options</a>,
+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="Tools for spawning an accept loop that routes incoming requests to the right protocol."><title>iroh::protocol - 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.34.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module protocol</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#example" title="Example">Example</a></li></ul><h3><a href="#structs">Module Items</a></h3><ul class="block"><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>protocol</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/protocol.rs.html#1-505">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Tools for spawning an accept loop that routes incoming requests to the right protocol.</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="Tools for spawning an accept loop that routes incoming requests to the right protocol."><title>iroh::protocol - 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.34.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module protocol</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#example" title="Example">Example</a></li></ul><h3><a href="#structs">Module Items</a></h3><ul class="block"><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>protocol</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/protocol.rs.html#1-504">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Tools for spawning an accept loop that routes incoming requests to the right protocol.</p>
<h3 id="example"><a class="doc-anchor" href="#example">§</a>Example</h3>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>endpoint = Endpoint::builder().discovery_n0().bind().<span class="kw">await</span><span class="question-mark">?</span>;
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
File diff suppressed because one or more lines are too long
+10 -4
View File
@@ -76,10 +76,12 @@
<a href="#75" id="75">75</a>
<a href="#76" id="76">76</a>
<a href="#77" id="77">77</a>
<a href="#78" id="78">78</a></pre></div><pre class="rust"><code><span class="doccomment">//! DNS node discovery for iroh
<a href="#78" id="78">78</a>
<a href="#79" id="79">79</a>
<a href="#80" id="80">80</a>
<a href="#81" id="81">81</a></pre></div><pre class="rust"><code><span class="doccomment">//! DNS node discovery for iroh
</span><span class="kw">use </span>anyhow::Result;
<span class="kw">use </span>iroh_base::NodeId;
</span><span class="kw">use </span>iroh_base::NodeId;
<span class="kw">pub use </span>iroh_relay::dns::{N0_DNS_NODE_ORIGIN_PROD, N0_DNS_NODE_ORIGIN_STAGING};
<span class="kw">use </span>n0_future::boxed::BoxStream;
@@ -141,7 +143,11 @@
}
<span class="kw">impl </span>Discovery <span class="kw">for </span>DnsDiscovery {
<span class="kw">fn </span>resolve(<span class="kw-2">&amp;</span><span class="self">self</span>, ep: Endpoint, node_id: NodeId) -&gt; <span class="prelude-ty">Option</span>&lt;BoxStream&lt;<span class="prelude-ty">Result</span>&lt;DiscoveryItem&gt;&gt;&gt; {
<span class="kw">fn </span>resolve(
<span class="kw-2">&amp;</span><span class="self">self</span>,
ep: Endpoint,
node_id: NodeId,
) -&gt; <span class="prelude-ty">Option</span>&lt;BoxStream&lt;anyhow::Result&lt;DiscoveryItem&gt;&gt;&gt; {
<span class="kw">let </span>resolver = ep.dns_resolver().clone();
<span class="kw">let </span>origin_domain = <span class="self">self</span>.origin_domain.clone();
<span class="kw">let </span>fut = <span class="kw">async move </span>{
+14 -8
View File
@@ -501,7 +501,10 @@
<a href="#500" id="500">500</a>
<a href="#501" id="501">501</a>
<a href="#502" id="502">502</a>
<a href="#503" id="503">503</a></pre></div><pre class="rust"><code><span class="doccomment">//! A discovery service that uses an mdns-like service to discover local nodes.
<a href="#503" id="503">503</a>
<a href="#504" id="504">504</a>
<a href="#505" id="505">505</a>
<a href="#506" id="506">506</a></pre></div><pre class="rust"><code><span class="doccomment">//! A discovery service that uses an mdns-like service to discover local nodes.
//!
//! This allows you to use an mdns-like swarm discovery service to find address information about nodes that are on your local network, no relay or outside internet needed.
//! See the [`swarm-discovery`](https://crates.io/crates/swarm-discovery) crate for more details.
@@ -538,7 +541,6 @@
net::{IpAddr, SocketAddr},
};
<span class="kw">use </span>anyhow::Result;
<span class="kw">use </span>derive_more::FromStr;
<span class="kw">use </span>iroh_base::{NodeId, PublicKey};
<span class="kw">use </span>n0_future::{
@@ -586,7 +588,7 @@
<span class="attr">#[derive(Debug)]
</span><span class="kw">enum </span>Message {
Discovery(String, Peer),
Resolve(NodeId, mpsc::Sender&lt;<span class="prelude-ty">Result</span>&lt;DiscoveryItem&gt;&gt;),
Resolve(NodeId, mpsc::Sender&lt;anyhow::Result&lt;DiscoveryItem&gt;&gt;),
Timeout(NodeId, usize),
Subscribe(mpsc::Sender&lt;DiscoveryItem&gt;),
}
@@ -641,7 +643,7 @@
///
/// # Panics
/// This relies on [`tokio::runtime::Handle::current`] and will panic if called outside of the context of a tokio runtime.
</span><span class="kw">pub fn </span>new(node_id: NodeId) -&gt; <span class="prelude-ty">Result</span>&lt;<span class="self">Self</span>&gt; {
</span><span class="kw">pub fn </span>new(node_id: NodeId) -&gt; anyhow::Result&lt;<span class="self">Self</span>&gt; {
<span class="macro">debug!</span>(<span class="string">"Creating new MdnsDiscovery service"</span>);
<span class="kw">let </span>(send, <span class="kw-2">mut </span>recv) = mpsc::channel(<span class="number">64</span>);
<span class="kw">let </span>task_sender = send.clone();
@@ -657,7 +659,7 @@
<span class="kw">let </span><span class="kw-2">mut </span>last_id = <span class="number">0</span>;
<span class="kw">let </span><span class="kw-2">mut </span>senders: HashMap&lt;
PublicKey,
HashMap&lt;usize, mpsc::Sender&lt;<span class="prelude-ty">Result</span>&lt;DiscoveryItem&gt;&gt;&gt;,
HashMap&lt;usize, mpsc::Sender&lt;anyhow::Result&lt;DiscoveryItem&gt;&gt;&gt;,
&gt; = HashMap::default();
<span class="kw">let </span><span class="kw-2">mut </span>timeouts = JoinSet::new();
<span class="kw">loop </span>{
@@ -809,7 +811,7 @@
sender: mpsc::Sender&lt;Message&gt;,
socketaddrs: BTreeSet&lt;SocketAddr&gt;,
rt: <span class="kw-2">&amp;</span>tokio::runtime::Handle,
) -&gt; <span class="prelude-ty">Result</span>&lt;DropGuard&gt; {
) -&gt; anyhow::Result&lt;DropGuard&gt; {
<span class="kw">let </span>spawn_rt = rt.clone();
<span class="kw">let </span>callback = <span class="kw">move </span>|node_id: <span class="kw-2">&amp;</span>str, peer: <span class="kw-2">&amp;</span>Peer| {
<span class="macro">trace!</span>(
@@ -876,7 +878,11 @@
}
<span class="kw">impl </span>Discovery <span class="kw">for </span>MdnsDiscovery {
<span class="kw">fn </span>resolve(<span class="kw-2">&amp;</span><span class="self">self</span>, _ep: Endpoint, node_id: NodeId) -&gt; <span class="prelude-ty">Option</span>&lt;BoxStream&lt;<span class="prelude-ty">Result</span>&lt;DiscoveryItem&gt;&gt;&gt; {
<span class="kw">fn </span>resolve(
<span class="kw-2">&amp;</span><span class="self">self</span>,
_ep: Endpoint,
node_id: NodeId,
) -&gt; <span class="prelude-ty">Option</span>&lt;BoxStream&lt;anyhow::Result&lt;DiscoveryItem&gt;&gt;&gt; {
<span class="kw">use </span>futures_util::FutureExt;
<span class="kw">let </span>(send, recv) = mpsc::channel(<span class="number">20</span>);
@@ -998,7 +1004,7 @@
<span class="prelude-val">Ok</span>(())
}
<span class="kw">fn </span>make_discoverer() -&gt; <span class="prelude-ty">Result</span>&lt;(PublicKey, MdnsDiscovery)&gt; {
<span class="kw">fn </span>make_discoverer() -&gt; anyhow::Result&lt;(PublicKey, MdnsDiscovery)&gt; {
<span class="kw">let </span>node_id = SecretKey::generate(rand::thread_rng()).public();
<span class="prelude-val">Ok</span>((node_id, MdnsDiscovery::new(node_id)<span class="question-mark">?</span>))
}
+12 -4
View File
@@ -402,7 +402,11 @@
<a href="#401" id="401">401</a>
<a href="#402" id="402">402</a>
<a href="#403" id="403">403</a>
<a href="#404" id="404">404</a></pre></div><pre class="rust"><code><span class="doccomment">//! A discovery service which publishes and resolves node information using a [pkarr] relay.
<a href="#404" id="404">404</a>
<a href="#405" id="405">405</a>
<a href="#406" id="406">406</a>
<a href="#407" id="407">407</a>
<a href="#408" id="408">408</a></pre></div><pre class="rust"><code><span class="doccomment">//! A discovery service which publishes and resolves node information using a [pkarr] relay.
//!
//! Public-Key Addressable Resource Records, [pkarr], is a system which allows publishing
//! [DNS Resource Records] owned by a particular [`SecretKey`] under a name derived from its
@@ -450,7 +454,7 @@
</span><span class="kw">use </span>std::sync::Arc;
<span class="kw">use </span>anyhow::{anyhow, bail, <span class="prelude-ty">Result</span>};
<span class="kw">use </span>anyhow::{anyhow, bail};
<span class="kw">use </span>iroh_base::{NodeId, SecretKey};
<span class="kw">use </span>iroh_relay::node_info::NodeInfo;
<span class="kw">use </span>n0_future::{
@@ -667,7 +671,7 @@
}
}
<span class="kw">async fn </span>publish_current(<span class="kw-2">&amp;</span><span class="self">self</span>, info: NodeInfo) -&gt; <span class="prelude-ty">Result</span>&lt;()&gt; {
<span class="kw">async fn </span>publish_current(<span class="kw-2">&amp;</span><span class="self">self</span>, info: NodeInfo) -&gt; anyhow::Result&lt;()&gt; {
<span class="macro">debug!</span>(
data = <span class="question-mark">?</span>info.data,
pkarr_relay = %<span class="self">self</span>.pkarr_client.pkarr_relay_url,
@@ -726,7 +730,11 @@
}
<span class="kw">impl </span>Discovery <span class="kw">for </span>PkarrResolver {
<span class="kw">fn </span>resolve(<span class="kw-2">&amp;</span><span class="self">self</span>, _ep: Endpoint, node_id: NodeId) -&gt; <span class="prelude-ty">Option</span>&lt;BoxStream&lt;<span class="prelude-ty">Result</span>&lt;DiscoveryItem&gt;&gt;&gt; {
<span class="kw">fn </span>resolve(
<span class="kw-2">&amp;</span><span class="self">self</span>,
_ep: Endpoint,
node_id: NodeId,
) -&gt; <span class="prelude-ty">Option</span>&lt;BoxStream&lt;anyhow::Result&lt;DiscoveryItem&gt;&gt;&gt; {
<span class="kw">let </span>pkarr_client = <span class="self">self</span>.pkarr_client.clone();
<span class="kw">let </span>fut = <span class="kw">async move </span>{
<span class="kw">let </span>signed_packet = pkarr_client.resolve(node_id).<span class="kw">await</span><span class="question-mark">?</span>;
@@ -443,8 +443,7 @@
<a href="#442" id="442">442</a>
<a href="#443" id="443">443</a>
<a href="#444" id="444">444</a>
<a href="#445" id="445">445</a>
<a href="#446" id="446">446</a></pre></div><pre class="rust"><code><span class="doccomment">//! Pkarr based node discovery for iroh, supporting both relay servers and the DHT.
<a href="#445" id="445">445</a></pre></div><pre class="rust"><code><span class="doccomment">//! Pkarr based node discovery for iroh, supporting both relay servers and the DHT.
//!
//! This module contains pkarr-based node discovery for iroh which can use both pkarr
//! relay servers as well as the Mainline DHT directly. See the [pkarr module] for an
@@ -453,7 +452,6 @@
//! [pkarr module]: super
</span><span class="kw">use </span>std::sync::{Arc, Mutex};
<span class="kw">use </span>anyhow::Result;
<span class="kw">use </span>iroh_base::{NodeId, SecretKey};
<span class="kw">use </span>n0_future::{
boxed::BoxStream,
@@ -536,7 +534,7 @@
}
<span class="kw">impl </span>Inner {
<span class="kw">async fn </span>resolve_relay(<span class="kw-2">&amp;</span><span class="self">self</span>, key: pkarr::PublicKey) -&gt; <span class="prelude-ty">Option</span>&lt;<span class="prelude-ty">Result</span>&lt;DiscoveryItem&gt;&gt; {
<span class="kw">async fn </span>resolve_relay(<span class="kw-2">&amp;</span><span class="self">self</span>, key: pkarr::PublicKey) -&gt; <span class="prelude-ty">Option</span>&lt;anyhow::Result&lt;DiscoveryItem&gt;&gt; {
<span class="macro">tracing::info!</span>(<span class="string">"resolving {} from relay {:?}"</span>, key.to_z32(), <span class="self">self</span>.relay_url);
<span class="kw">let </span>maybe_packet = <span class="self">self
@@ -566,7 +564,7 @@
}
}
}
<span class="kw">async fn </span>resolve_dht(<span class="kw-2">&amp;</span><span class="self">self</span>, key: pkarr::PublicKey) -&gt; <span class="prelude-ty">Option</span>&lt;<span class="prelude-ty">Result</span>&lt;DiscoveryItem&gt;&gt; {
<span class="kw">async fn </span>resolve_dht(<span class="kw-2">&amp;</span><span class="self">self</span>, key: pkarr::PublicKey) -&gt; <span class="prelude-ty">Option</span>&lt;anyhow::Result&lt;DiscoveryItem&gt;&gt; {
<span class="macro">tracing::info!</span>(<span class="string">"resolving {} from DHT"</span>, key.to_z32());
<span class="kw">let </span>maybe_packet = <span class="self">self</span>.pkarr.resolve(<span class="kw-2">&amp;</span>key).<span class="kw">await</span>;
@@ -681,7 +679,7 @@
</span>}
<span class="doccomment">/// Builds the discovery mechanism.
</span><span class="kw">pub fn </span>build(<span class="self">self</span>) -&gt; <span class="prelude-ty">Result</span>&lt;DhtDiscovery&gt; {
</span><span class="kw">pub fn </span>build(<span class="self">self</span>) -&gt; anyhow::Result&lt;DhtDiscovery&gt; {
<span class="kw">let </span>pkarr = <span class="kw">match </span><span class="self">self</span>.client {
<span class="prelude-val">Some</span>(client) =&gt; client,
<span class="prelude-val">None </span>=&gt; PkarrClient::new(Default::default())<span class="question-mark">?</span>,
+31 -15
View File
@@ -1390,7 +1390,15 @@
<a href="#1389" id="1389">1389</a>
<a href="#1390" id="1390">1390</a>
<a href="#1391" id="1391">1391</a>
<a href="#1392" id="1392">1392</a></pre></div><pre class="rust"><code><span class="doccomment">//! Checks the network conditions from the current host.
<a href="#1392" id="1392">1392</a>
<a href="#1393" id="1393">1393</a>
<a href="#1394" id="1394">1394</a>
<a href="#1395" id="1395">1395</a>
<a href="#1396" id="1396">1396</a>
<a href="#1397" id="1397">1397</a>
<a href="#1398" id="1398">1398</a>
<a href="#1399" id="1399">1399</a>
<a href="#1400" id="1400">1400</a></pre></div><pre class="rust"><code><span class="doccomment">//! Checks the network conditions from the current host.
//!
//! NetReport is responsible for finding out the network conditions of the current host, like
//! whether it is connected to the internet via IPv4 and/or IPv6, what the NAT situation is
@@ -1409,7 +1417,7 @@
sync::Arc,
};
<span class="kw">use </span>anyhow::{anyhow, <span class="prelude-ty">Result</span>};
<span class="kw">use </span>anyhow::anyhow;
<span class="kw">use </span>bytes::Bytes;
<span class="kw">use </span>iroh_base::RelayUrl;
<span class="attr">#[cfg(feature = <span class="string">"metrics"</span>)]
@@ -1641,7 +1649,7 @@
<span class="attr">#[cfg(not(wasm_browser))] </span>port_mapper: <span class="prelude-ty">Option</span>&lt;portmapper::Client&gt;,
<span class="attr">#[cfg(not(wasm_browser))] </span>dns_resolver: DnsResolver,
<span class="attr">#[cfg(not(wasm_browser))] </span>ip_mapped_addrs: <span class="prelude-ty">Option</span>&lt;IpMappedAddresses&gt;,
) -&gt; <span class="prelude-ty">Result</span>&lt;<span class="self">Self</span>&gt; {
) -&gt; anyhow::Result&lt;<span class="self">Self</span>&gt; {
<span class="kw">let </span><span class="kw-2">mut </span>actor = Actor::new(
<span class="attr">#[cfg(not(wasm_browser))]
</span>port_mapper,
@@ -1698,7 +1706,7 @@
<span class="attr">#[cfg(not(wasm_browser))] </span>stun_sock_v4: <span class="prelude-ty">Option</span>&lt;Arc&lt;UdpSocket&gt;&gt;,
<span class="attr">#[cfg(not(wasm_browser))] </span>stun_sock_v6: <span class="prelude-ty">Option</span>&lt;Arc&lt;UdpSocket&gt;&gt;,
<span class="attr">#[cfg(not(wasm_browser))] </span>quic_config: <span class="prelude-ty">Option</span>&lt;QuicConfig&gt;,
) -&gt; <span class="prelude-ty">Result</span>&lt;Arc&lt;Report&gt;&gt; {
) -&gt; anyhow::Result&lt;Arc&lt;Report&gt;&gt; {
<span class="attr">#[cfg(not(wasm_browser))]
</span><span class="kw">let </span>opts = Options::default()
.stun_v4(stun_sock_v4)
@@ -1718,7 +1726,11 @@
/// It may not be called concurrently with itself, `&amp;mut self` takes care of that.
///
/// Look at [`Options`] for the different configuration options.
</span><span class="kw">pub async fn </span>get_report(<span class="kw-2">&amp;mut </span><span class="self">self</span>, relay_map: RelayMap, opts: Options) -&gt; <span class="prelude-ty">Result</span>&lt;Arc&lt;Report&gt;&gt; {
</span><span class="kw">pub async fn </span>get_report(
<span class="kw-2">&amp;mut </span><span class="self">self</span>,
relay_map: RelayMap,
opts: Options,
) -&gt; anyhow::Result&lt;Arc&lt;Report&gt;&gt; {
<span class="kw">let </span>rx = <span class="self">self</span>.get_report_channel(relay_map, opts).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="kw">match </span>rx.<span class="kw">await </span>{
<span class="prelude-val">Ok</span>(res) =&gt; res,
@@ -1733,7 +1745,7 @@
<span class="kw-2">&amp;mut </span><span class="self">self</span>,
relay_map: RelayMap,
opts: Options,
) -&gt; <span class="prelude-ty">Result</span>&lt;oneshot::Receiver&lt;<span class="prelude-ty">Result</span>&lt;Arc&lt;Report&gt;&gt;&gt;&gt; {
) -&gt; anyhow::Result&lt;oneshot::Receiver&lt;anyhow::Result&lt;Arc&lt;Report&gt;&gt;&gt;&gt; {
<span class="kw">let </span>(tx, rx) = oneshot::channel();
<span class="self">self</span>.addr
.send(Message::RunCheck {
@@ -1769,7 +1781,7 @@
<span class="doccomment">/// Options for the report
</span>opts: Options,
<span class="doccomment">/// Channel to receive the response.
</span>response_tx: oneshot::Sender&lt;<span class="prelude-ty">Result</span>&lt;Arc&lt;Report&gt;&gt;&gt;,
</span>response_tx: oneshot::Sender&lt;anyhow::Result&lt;Arc&lt;Report&gt;&gt;&gt;,
},
<span class="doccomment">/// A report produced by the [`reportgen`] actor.
</span>ReportReady { report: Box&lt;Report&gt; },
@@ -1883,7 +1895,7 @@
<span class="attr">#[cfg(not(wasm_browser))] </span>port_mapper: <span class="prelude-ty">Option</span>&lt;portmapper::Client&gt;,
<span class="attr">#[cfg(not(wasm_browser))] </span>dns_resolver: DnsResolver,
<span class="attr">#[cfg(not(wasm_browser))] </span>ip_mapped_addrs: <span class="prelude-ty">Option</span>&lt;IpMappedAddresses&gt;,
) -&gt; <span class="prelude-ty">Result</span>&lt;<span class="self">Self</span>&gt; {
) -&gt; anyhow::Result&lt;<span class="self">Self</span>&gt; {
<span class="comment">// TODO: consider an instrumented flume channel so we have metrics.
</span><span class="kw">let </span>(sender, receiver) = mpsc::channel(<span class="number">32</span>);
<span class="prelude-val">Ok</span>(<span class="self">Self </span>{
@@ -1949,7 +1961,7 @@
<span class="kw-2">&amp;mut </span><span class="self">self</span>,
relay_map: RelayMap,
opts: Options,
response_tx: oneshot::Sender&lt;<span class="prelude-ty">Result</span>&lt;Arc&lt;Report&gt;&gt;&gt;,
response_tx: oneshot::Sender&lt;anyhow::Result&lt;Arc&lt;Report&gt;&gt;&gt;,
) {
<span class="kw">let </span>protocols = opts.to_protocols();
<span class="attr">#[cfg(not(wasm_browser))]
@@ -2172,7 +2184,7 @@
<span class="doccomment">/// The handle of the [`reportgen`] actor, cancels the actor on drop.
</span>_reportgen: reportgen::Client,
<span class="doccomment">/// Where to send the completed report.
</span>report_tx: oneshot::Sender&lt;<span class="prelude-ty">Result</span>&lt;Arc&lt;Report&gt;&gt;&gt;,
</span>report_tx: oneshot::Sender&lt;anyhow::Result&lt;Arc&lt;Report&gt;&gt;&gt;,
}
<span class="doccomment">/// Test if IPv6 works at all, or if it's been hard disabled at the OS level.
@@ -2247,7 +2259,11 @@
}
<span class="doccomment">/// Receive STUN response from a UDP socket, pass it to the actor.
</span><span class="kw">async fn </span>recv_stun_once(sock: <span class="kw-2">&amp;</span>UdpSocket, buf: <span class="kw-2">&amp;mut </span>[u8], actor_addr: <span class="kw-2">&amp;</span>Addr) -&gt; <span class="prelude-ty">Result</span>&lt;()&gt; {
</span><span class="kw">async fn </span>recv_stun_once(
sock: <span class="kw-2">&amp;</span>UdpSocket,
buf: <span class="kw-2">&amp;mut </span>[u8],
actor_addr: <span class="kw-2">&amp;</span>Addr,
) -&gt; anyhow::Result&lt;()&gt; {
<span class="kw">let </span>(count, <span class="kw-2">mut </span>from_addr) = sock
.recv_from(buf)
.<span class="kw">await
@@ -2451,7 +2467,7 @@
<span class="attr">#[tokio::test]
#[traced_test]
</span><span class="kw">async fn </span>test_basic() -&gt; <span class="prelude-ty">Result</span>&lt;()&gt; {
</span><span class="kw">async fn </span>test_basic() -&gt; anyhow::Result&lt;()&gt; {
<span class="kw">let </span>(stun_addr, stun_stats, _cleanup_guard) =
stun_utils::serve(<span class="string">"127.0.0.1"</span>.parse().unwrap()).<span class="kw">await</span><span class="question-mark">?</span>;
@@ -2494,7 +2510,7 @@
<span class="attr">#[tokio::test]
#[traced_test]
</span><span class="kw">async fn </span>test_udp_blocked() -&gt; <span class="prelude-ty">Result</span>&lt;()&gt; {
</span><span class="kw">async fn </span>test_udp_blocked() -&gt; anyhow::Result&lt;()&gt; {
<span class="comment">// Create a "STUN server", which will never respond to anything. This is how UDP to
// the STUN server being blocked will look like from the client's perspective.
</span><span class="kw">let </span>blackhole = tokio::net::UdpSocket::bind(<span class="string">"127.0.0.1:0"</span>).<span class="kw">await</span><span class="question-mark">?</span>;
@@ -2545,7 +2561,7 @@
}
<span class="attr">#[tokio::test(flavor = <span class="string">"current_thread"</span>, start_paused = <span class="bool-val">true</span>)]
</span><span class="kw">async fn </span>test_add_report_history_set_preferred_relay() -&gt; <span class="prelude-ty">Result</span>&lt;()&gt; {
</span><span class="kw">async fn </span>test_add_report_history_set_preferred_relay() -&gt; anyhow::Result&lt;()&gt; {
<span class="kw">fn </span>relay_url(i: u16) -&gt; RelayUrl {
<span class="macro">format!</span>(<span class="string">"http://{i}.com"</span>).parse().unwrap()
}
@@ -2726,7 +2742,7 @@
}
<span class="attr">#[tokio::test]
</span><span class="kw">async fn </span>test_hairpin() -&gt; <span class="prelude-ty">Result</span>&lt;()&gt; {
</span><span class="kw">async fn </span>test_hairpin() -&gt; anyhow::Result&lt;()&gt; {
<span class="comment">// Hairpinning is initiated after we discover our own IPv4 socket address (IP +
// port) via STUN, so the test needs to have a STUN server and perform STUN over
// IPv4 first. Hairpinning detection works by sending a STUN *request* to **our own
@@ -1782,7 +1782,7 @@
task::{Context, Poll},
};
<span class="kw">use </span>anyhow::{anyhow, bail, Context <span class="kw">as _</span>, <span class="prelude-ty">Result</span>};
<span class="kw">use </span>anyhow::{anyhow, bail, Context <span class="kw">as _</span>};
<span class="kw">use </span>iroh_base::RelayUrl;
<span class="attr">#[cfg(feature = <span class="string">"metrics"</span>)]
</span><span class="kw">use </span>iroh_metrics::inc;
@@ -2005,7 +2005,7 @@
/// - Receives actor messages (sent by those futures).
/// - Updates the report, cancels unneeded futures.
/// - Sends the report to the net_report actor.
</span><span class="kw">async fn </span>run_inner(<span class="kw-2">&amp;mut </span><span class="self">self</span>) -&gt; <span class="prelude-ty">Result</span>&lt;()&gt; {
</span><span class="kw">async fn </span>run_inner(<span class="kw-2">&amp;mut </span><span class="self">self</span>) -&gt; anyhow::Result&lt;()&gt; {
<span class="attr">#[cfg(not(wasm_browser))]
</span><span class="kw">let </span>port_mapper = <span class="self">self</span>.socket_state.port_mapper.is_some();
<span class="attr">#[cfg(wasm_browser)]
@@ -2329,7 +2329,7 @@
/// failure permanent. Probes in a probe set are essentially retries.
/// - Once there are [`ProbeReport`]s from enough nodes, all remaining probes are
/// aborted. That is, the main actor loop stops polling them.
</span><span class="kw">async fn </span>spawn_probes_task(<span class="kw-2">&amp;mut </span><span class="self">self</span>) -&gt; <span class="prelude-ty">Result</span>&lt;JoinSet&lt;<span class="prelude-ty">Result</span>&lt;ProbeReport&gt;&gt;&gt; {
</span><span class="kw">async fn </span>spawn_probes_task(<span class="kw-2">&amp;mut </span><span class="self">self</span>) -&gt; anyhow::Result&lt;JoinSet&lt;anyhow::Result&lt;ProbeReport&gt;&gt;&gt; {
<span class="attr">#[cfg(not(wasm_browser))]
</span><span class="kw">let </span>if_state = interfaces::State::new().<span class="kw">await</span>;
<span class="attr">#[cfg(not(wasm_browser))]
@@ -2781,7 +2781,7 @@
dns_resolver: <span class="kw-2">&amp;</span>DnsResolver,
dm: <span class="kw-2">&amp;</span>RelayMap,
preferred_relay: <span class="prelude-ty">Option</span>&lt;RelayUrl&gt;,
) -&gt; <span class="prelude-ty">Result</span>&lt;bool&gt; {
) -&gt; anyhow::Result&lt;bool&gt; {
<span class="comment">// If we have a preferred relay node and we can use it for non-STUN requests, try that;
// otherwise, pick a random one suitable for non-STUN requests.
</span><span class="kw">let </span>preferred_relay = preferred_relay.and_then(|url| <span class="kw">match </span>dm.get_node(<span class="kw-2">&amp;</span>url) {
@@ -2859,7 +2859,7 @@
}
<span class="doccomment">/// Returns the proper port based on the protocol of the probe.
</span><span class="kw">fn </span>get_port(relay_node: <span class="kw-2">&amp;</span>RelayNode, proto: <span class="kw-2">&amp;</span>ProbeProto) -&gt; <span class="prelude-ty">Result</span>&lt;u16&gt; {
</span><span class="kw">fn </span>get_port(relay_node: <span class="kw-2">&amp;</span>RelayNode, proto: <span class="kw-2">&amp;</span>ProbeProto) -&gt; anyhow::Result&lt;u16&gt; {
<span class="kw">match </span>proto {
<span class="attr">#[cfg(not(wasm_browser))]
</span>ProbeProto::QuicIpv4 | ProbeProto::QuicIpv6 =&gt; {
@@ -2898,7 +2898,7 @@
dns_resolver: <span class="kw-2">&amp;</span>DnsResolver,
relay_node: <span class="kw-2">&amp;</span>RelayNode,
proto: ProbeProto,
) -&gt; <span class="prelude-ty">Result</span>&lt;SocketAddr&gt; {
) -&gt; anyhow::Result&lt;SocketAddr&gt; {
<span class="kw">if </span>relay_node.stun_only &amp;&amp; !<span class="macro">matches!</span>(proto, ProbeProto::StunIpv4 | ProbeProto::StunIpv6) {
<span class="macro">bail!</span>(<span class="string">"Relay node not suitable for non-STUN probes"</span>);
}
@@ -2925,7 +2925,7 @@
dns_resolver: <span class="kw-2">&amp;</span>DnsResolver,
relay: <span class="kw-2">&amp;</span>RelayNode,
port: u16,
) -&gt; <span class="prelude-ty">Result</span>&lt;SocketAddr&gt; {
) -&gt; anyhow::Result&lt;SocketAddr&gt; {
<span class="kw">match </span>relay.url.host() {
<span class="prelude-val">Some</span>(url::Host::Domain(hostname)) =&gt; {
<span class="macro">debug!</span>(%hostname, <span class="string">"Performing DNS A lookup for relay addr"</span>);
@@ -2955,7 +2955,7 @@
dns_resolver: <span class="kw-2">&amp;</span>DnsResolver,
relay: <span class="kw-2">&amp;</span>RelayNode,
port: u16,
) -&gt; <span class="prelude-ty">Result</span>&lt;SocketAddr&gt; {
) -&gt; anyhow::Result&lt;SocketAddr&gt; {
<span class="kw">match </span>relay.url.host() {
<span class="prelude-val">Some</span>(url::Host::Domain(hostname)) =&gt; {
<span class="macro">debug!</span>(%hostname, <span class="string">"Performing DNS AAAA lookup for relay addr"</span>);
@@ -3031,7 +3031,7 @@
<span class="attr">#[cfg(not(wasm_browser))] </span>dns_resolver: <span class="kw-2">&amp;</span>DnsResolver,
node: <span class="kw-2">&amp;</span>RelayNode,
certs: <span class="prelude-ty">Option</span>&lt;Vec&lt;rustls::pki_types::CertificateDer&lt;<span class="lifetime">'static</span>&gt;&gt;&gt;,
) -&gt; <span class="prelude-ty">Result</span>&lt;(Duration, IpAddr)&gt; {
) -&gt; anyhow::Result&lt;(Duration, IpAddr)&gt; {
<span class="kw">let </span>url = node.url.join(RELAY_PROBE_PATH)<span class="question-mark">?</span>;
<span class="comment">// This should also use same connection establishment as relay client itself, which
@@ -1185,7 +1185,7 @@
</span><span class="kw">use </span>std::{collections::BTreeSet, fmt, sync::Arc};
<span class="kw">use </span>anyhow::{ensure, <span class="prelude-ty">Result</span>};
<span class="kw">use </span>anyhow::ensure;
<span class="kw">use </span>iroh_base::RelayUrl;
<span class="kw">use </span>iroh_relay::{RelayMap, RelayNode};
<span class="kw">use </span>n0_future::time::Duration;
@@ -1376,7 +1376,7 @@
}
}
<span class="kw">fn </span>push(<span class="kw-2">&amp;mut </span><span class="self">self</span>, probe: Probe) -&gt; <span class="prelude-ty">Result</span>&lt;()&gt; {
<span class="kw">fn </span>push(<span class="kw-2">&amp;mut </span><span class="self">self</span>, probe: Probe) -&gt; anyhow::Result&lt;()&gt; {
<span class="macro">ensure!</span>(probe.proto() == <span class="self">self</span>.proto, <span class="string">"mismatching probe proto"</span>);
<span class="self">self</span>.probes.push(probe);
<span class="prelude-val">Ok</span>(())
+14 -16
View File
@@ -502,8 +502,7 @@
<a href="#501" id="501">501</a>
<a href="#502" id="502">502</a>
<a href="#503" id="503">503</a>
<a href="#504" id="504">504</a>
<a href="#505" id="505">505</a></pre></div><pre class="rust"><code><span class="doccomment">//! Tools for spawning an accept loop that routes incoming requests to the right protocol.
<a href="#504" id="504">504</a></pre></div><pre class="rust"><code><span class="doccomment">//! Tools for spawning an accept loop that routes incoming requests to the right protocol.
//!
//! ## Example
//!
@@ -544,7 +543,6 @@
//! ```
</span><span class="kw">use </span>std::{collections::BTreeMap, sync::Arc};
<span class="kw">use </span>anyhow::Result;
<span class="kw">use </span>iroh_base::NodeId;
<span class="kw">use </span>n0_future::{
boxed::BoxFuture,
@@ -620,7 +618,7 @@
<span class="doccomment">/// Optional interception point to handle the `Connecting` state.
///
/// This enables accepting 0-RTT data from clients, among other things.
</span><span class="kw">fn </span>on_connecting(<span class="kw-2">&amp;</span><span class="self">self</span>, connecting: Connecting) -&gt; BoxFuture&lt;<span class="prelude-ty">Result</span>&lt;Connection&gt;&gt; {
</span><span class="kw">fn </span>on_connecting(<span class="kw-2">&amp;</span><span class="self">self</span>, connecting: Connecting) -&gt; BoxFuture&lt;anyhow::Result&lt;Connection&gt;&gt; {
Box::pin(<span class="kw">async move </span>{
<span class="kw">let </span>conn = connecting.<span class="kw">await</span><span class="question-mark">?</span>;
<span class="prelude-val">Ok</span>(conn)
@@ -630,7 +628,7 @@
<span class="doccomment">/// Handle an incoming connection.
///
/// This runs on a freshly spawned tokio task so this can be long-running.
</span><span class="kw">fn </span>accept(<span class="kw-2">&amp;</span><span class="self">self</span>, connection: Connection) -&gt; BoxFuture&lt;<span class="prelude-ty">Result</span>&lt;()&gt;&gt;;
</span><span class="kw">fn </span>accept(<span class="kw-2">&amp;</span><span class="self">self</span>, connection: Connection) -&gt; BoxFuture&lt;anyhow::Result&lt;()&gt;&gt;;
<span class="doccomment">/// Called when the node shuts down.
</span><span class="kw">fn </span>shutdown(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; BoxFuture&lt;()&gt; {
@@ -639,11 +637,11 @@
}
<span class="kw">impl</span>&lt;T: ProtocolHandler&gt; ProtocolHandler <span class="kw">for </span>Arc&lt;T&gt; {
<span class="kw">fn </span>on_connecting(<span class="kw-2">&amp;</span><span class="self">self</span>, conn: Connecting) -&gt; BoxFuture&lt;<span class="prelude-ty">Result</span>&lt;Connection&gt;&gt; {
<span class="kw">fn </span>on_connecting(<span class="kw-2">&amp;</span><span class="self">self</span>, conn: Connecting) -&gt; BoxFuture&lt;anyhow::Result&lt;Connection&gt;&gt; {
<span class="self">self</span>.as_ref().on_connecting(conn)
}
<span class="kw">fn </span>accept(<span class="kw-2">&amp;</span><span class="self">self</span>, conn: Connection) -&gt; BoxFuture&lt;<span class="prelude-ty">Result</span>&lt;()&gt;&gt; {
<span class="kw">fn </span>accept(<span class="kw-2">&amp;</span><span class="self">self</span>, conn: Connection) -&gt; BoxFuture&lt;anyhow::Result&lt;()&gt;&gt; {
<span class="self">self</span>.as_ref().accept(conn)
}
@@ -653,11 +651,11 @@
}
<span class="kw">impl</span>&lt;T: ProtocolHandler&gt; ProtocolHandler <span class="kw">for </span>Box&lt;T&gt; {
<span class="kw">fn </span>on_connecting(<span class="kw-2">&amp;</span><span class="self">self</span>, conn: Connecting) -&gt; BoxFuture&lt;<span class="prelude-ty">Result</span>&lt;Connection&gt;&gt; {
<span class="kw">fn </span>on_connecting(<span class="kw-2">&amp;</span><span class="self">self</span>, conn: Connecting) -&gt; BoxFuture&lt;anyhow::Result&lt;Connection&gt;&gt; {
<span class="self">self</span>.as_ref().on_connecting(conn)
}
<span class="kw">fn </span>accept(<span class="kw-2">&amp;</span><span class="self">self</span>, conn: Connection) -&gt; BoxFuture&lt;<span class="prelude-ty">Result</span>&lt;()&gt;&gt; {
<span class="kw">fn </span>accept(<span class="kw-2">&amp;</span><span class="self">self</span>, conn: Connection) -&gt; BoxFuture&lt;anyhow::Result&lt;()&gt;&gt; {
<span class="self">self</span>.as_ref().accept(conn)
}
@@ -720,7 +718,7 @@
///
/// If some [`ProtocolHandler`] panicked in the accept loop, this will propagate
/// that panic into the result here.
</span><span class="kw">pub async fn </span>shutdown(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; <span class="prelude-ty">Result</span>&lt;()&gt; {
</span><span class="kw">pub async fn </span>shutdown(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; anyhow::Result&lt;()&gt; {
<span class="kw">if </span><span class="self">self</span>.is_shutdown() {
<span class="kw">return </span><span class="prelude-val">Ok</span>(());
}
@@ -760,7 +758,7 @@
}
<span class="doccomment">/// Spawns an accept loop and returns a handle to it encapsulated as the [`Router`].
</span><span class="kw">pub async fn </span>spawn(<span class="self">self</span>) -&gt; <span class="prelude-ty">Result</span>&lt;Router&gt; {
</span><span class="kw">pub async fn </span>spawn(<span class="self">self</span>) -&gt; anyhow::Result&lt;Router&gt; {
<span class="comment">// Update the endpoint with our alpns.
</span><span class="kw">let </span>alpns = <span class="self">self
</span>.protocols
@@ -916,11 +914,11 @@
}
<span class="kw">impl</span>&lt;P: ProtocolHandler + Clone&gt; ProtocolHandler <span class="kw">for </span>AccessLimit&lt;P&gt; {
<span class="kw">fn </span>on_connecting(<span class="kw-2">&amp;</span><span class="self">self</span>, conn: Connecting) -&gt; BoxFuture&lt;<span class="prelude-ty">Result</span>&lt;Connection&gt;&gt; {
<span class="kw">fn </span>on_connecting(<span class="kw-2">&amp;</span><span class="self">self</span>, conn: Connecting) -&gt; BoxFuture&lt;anyhow::Result&lt;Connection&gt;&gt; {
<span class="self">self</span>.proto.on_connecting(conn)
}
<span class="kw">fn </span>accept(<span class="kw-2">&amp;</span><span class="self">self</span>, conn: Connection) -&gt; BoxFuture&lt;<span class="prelude-ty">Result</span>&lt;()&gt;&gt; {
<span class="kw">fn </span>accept(<span class="kw-2">&amp;</span><span class="self">self</span>, conn: Connection) -&gt; BoxFuture&lt;anyhow::Result&lt;()&gt;&gt; {
<span class="kw">let </span>this = <span class="self">self</span>.clone();
Box::pin(<span class="kw">async move </span>{
<span class="kw">let </span>remote = conn.remote_node_id()<span class="question-mark">?</span>;
@@ -944,7 +942,7 @@
<span class="kw">use super</span>::<span class="kw-2">*</span>;
<span class="attr">#[tokio::test]
</span><span class="kw">async fn </span>test_shutdown() -&gt; <span class="prelude-ty">Result</span>&lt;()&gt; {
</span><span class="kw">async fn </span>test_shutdown() -&gt; anyhow::Result&lt;()&gt; {
<span class="kw">let </span>endpoint = Endpoint::builder().bind().<span class="kw">await</span><span class="question-mark">?</span>;
<span class="kw">let </span>router = Router::builder(endpoint.clone()).spawn().<span class="kw">await</span><span class="question-mark">?</span>;
@@ -966,7 +964,7 @@
<span class="kw">const </span>ECHO_ALPN: <span class="kw-2">&amp;</span>[u8] = <span class="string">b"/iroh/echo/1"</span>;
<span class="kw">impl </span>ProtocolHandler <span class="kw">for </span>Echo {
<span class="kw">fn </span>accept(<span class="kw-2">&amp;</span><span class="self">self</span>, connection: Connection) -&gt; BoxFuture&lt;<span class="prelude-ty">Result</span>&lt;()&gt;&gt; {
<span class="kw">fn </span>accept(<span class="kw-2">&amp;</span><span class="self">self</span>, connection: Connection) -&gt; BoxFuture&lt;anyhow::Result&lt;()&gt;&gt; {
<span class="macro">println!</span>(<span class="string">"accepting echo"</span>);
Box::pin(<span class="kw">async move </span>{
<span class="kw">let </span>(<span class="kw-2">mut </span>send, <span class="kw-2">mut </span>recv) = connection.accept_bi().<span class="kw">await</span><span class="question-mark">?</span>;
@@ -982,7 +980,7 @@
}
}
<span class="attr">#[tokio::test]
</span><span class="kw">async fn </span>test_limiter() -&gt; <span class="prelude-ty">Result</span>&lt;()&gt; {
</span><span class="kw">async fn </span>test_limiter() -&gt; anyhow::Result&lt;()&gt; {
<span class="kw">let </span>e1 = Endpoint::builder().bind().<span class="kw">await</span><span class="question-mark">?</span>;
<span class="comment">// deny all access
</span><span class="kw">let </span>proto = AccessLimit::new(Echo, |_node_id| <span class="bool-val">false</span>);