deploy: 72ce071a8fcae81f2972ff56d414b535d84111af

This commit is contained in:
dignifiedquire
2024-11-19 13:25:28 +00:00
parent b9806007ed
commit c54e96b571
14 changed files with 246 additions and 42 deletions
+1 -1
View File
@@ -162,5 +162,5 @@ connecting using only the <a href="type.NodeId.html" title="type iroh_net::NodeI
<span class="prelude-val">Ok</span>(())
}</code></pre></div>
<p>Please see the examples directory for more nuanced examples.</p>
</div></details><h2 id="reexports" class="section-header">Re-exports<a href="#reexports" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name" id="reexport.Endpoint"><code>pub use endpoint::<a class="struct" href="endpoint/struct.Endpoint.html" title="struct iroh_net::endpoint::Endpoint">Endpoint</a>;</code></div></li><li><div class="item-name" id="reexport.relay"><code>pub use <a class="mod" href="../iroh_relay/index.html" title="mod iroh_relay">iroh_relay</a> as relay;</code></div></li></ul><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="mod" href="defaults/index.html" title="mod iroh_net::defaults">defaults</a></div><div class="desc docblock-short">Default values used in <a href="index.html" title="mod iroh_net"><code>iroh-net</code></a></div></li><li><div class="item-name"><a class="mod" href="dialer/index.html" title="mod iroh_net::dialer">dialer</a></div><div class="desc docblock-short">A dialer to conveniently dial many nodes.</div></li><li><div class="item-name"><a class="mod" href="discovery/index.html" title="mod iroh_net::discovery">discovery</a></div><div class="desc docblock-short">Node address discovery.</div></li><li><div class="item-name"><a class="mod" href="dns/index.html" title="mod iroh_net::dns">dns</a></div><div class="desc docblock-short">This module exports a DNS resolver, which is also the default resolver used in the
</div></details><h2 id="reexports" class="section-header">Re-exports<a href="#reexports" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name" id="reexport.Endpoint"><code>pub use endpoint::<a class="struct" href="endpoint/struct.Endpoint.html" title="struct iroh_net::endpoint::Endpoint">Endpoint</a>;</code></div></li><li><div class="item-name" id="reexport.relay"><code>pub use iroh_relay as relay;</code></div></li></ul><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="mod" href="defaults/index.html" title="mod iroh_net::defaults">defaults</a></div><div class="desc docblock-short">Default values used in <a href="index.html" title="mod iroh_net"><code>iroh-net</code></a></div></li><li><div class="item-name"><a class="mod" href="dialer/index.html" title="mod iroh_net::dialer">dialer</a></div><div class="desc docblock-short">A dialer to conveniently dial many nodes.</div></li><li><div class="item-name"><a class="mod" href="discovery/index.html" title="mod iroh_net::discovery">discovery</a></div><div class="desc docblock-short">Node address discovery.</div></li><li><div class="item-name"><a class="mod" href="dns/index.html" title="mod iroh_net::dns">dns</a></div><div class="desc docblock-short">This module exports a DNS resolver, which is also the default resolver used in the
<a href="endpoint/struct.Endpoint.html" title="struct iroh_net::endpoint::Endpoint"><code>crate::Endpoint</code></a> if no custom resolver is configured.</div></li><li><div class="item-name"><a class="mod" href="endpoint/index.html" title="mod iroh_net::endpoint">endpoint</a></div><div class="desc docblock-short">The <a href="endpoint/struct.Endpoint.html" title="struct iroh_net::endpoint::Endpoint"><code>Endpoint</code></a> allows establishing connections to other iroh-net nodes.</div></li><li><div class="item-name"><a class="mod" href="key/index.html" title="mod iroh_net::key">key</a></div><div class="desc docblock-short">Cryptographic key handling for <code>iroh-net</code>.</div></li><li><div class="item-name"><a class="mod" href="metrics/index.html" title="mod iroh_net::metrics">metrics</a></div><div class="desc docblock-short">Co-locating all of the iroh-net metrics structs</div></li><li><div class="item-name"><a class="mod" href="netcheck/index.html" title="mod iroh_net::netcheck">netcheck</a></div><div class="desc docblock-short">Checks the network conditions from the current host.</div></li><li><div class="item-name"><a class="mod" href="ping/index.html" title="mod iroh_net::ping">ping</a></div><div class="desc docblock-short">Allows sending ICMP echo requests to a host in order to determine network latency.</div></li><li><div class="item-name"><a class="mod" href="test_utils/index.html" title="mod iroh_net::test_utils">test_utils</a><span class="stab portability" title="Available on `test` or crate feature `test-utils` only"><code>test</code> or <code>test-utils</code></span></div><div class="desc docblock-short">Internal utilities to support testing.</div></li><li><div class="item-name"><a class="mod" href="ticket/index.html" title="mod iroh_net::ticket">ticket</a></div><div class="desc docblock-short">Tickets supported by iroh-net</div></li><li><div class="item-name"><a class="mod" href="tls/index.html" title="mod iroh_net::tls">tls</a></div><div class="desc docblock-short">TLS configuration based on libp2p TLS specs.</div></li></ul><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.AddrInfo.html" title="struct iroh_net::AddrInfo">AddrInfo</a></div><div class="desc docblock-short">Network paths to contact an iroh-net node.</div></li><li><div class="item-name"><a class="struct" href="struct.NodeAddr.html" title="struct iroh_net::NodeAddr">NodeAddr</a></div><div class="desc docblock-short">Network-level addressing information for an iroh-net node.</div></li><li><div class="item-name"><a class="struct" href="struct.RelayMap.html" title="struct iroh_net::RelayMap">RelayMap</a></div><div class="desc docblock-short">Configuration of all the relay servers that can be used.</div></li><li><div class="item-name"><a class="struct" href="struct.RelayNode.html" title="struct iroh_net::RelayNode">RelayNode</a></div><div class="desc docblock-short">Information on a specific relay server.</div></li><li><div class="item-name"><a class="struct" href="struct.RelayUrl.html" title="struct iroh_net::RelayUrl">RelayUrl</a></div><div class="desc docblock-short">A URL identifying a relay server.</div></li></ul><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="enum" href="enum.RelayMode.html" title="enum iroh_net::RelayMode">RelayMode</a></div><div class="desc docblock-short">Configuration of the relay servers for an <a href="endpoint/struct.Endpoint.html" title="struct iroh_net::endpoint::Endpoint"><code>Endpoint</code></a>.</div></li></ul><h2 id="types" class="section-header">Type Aliases<a href="#types" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="type" href="type.NodeId.html" title="type iroh_net::NodeId">NodeId</a></div><div class="desc docblock-short">The identifier for a node in the (iroh) network.</div></li></ul></section></div></main></body></html>
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -6,7 +6,7 @@ If all <a href="struct.Client.html" title="struct iroh_net::netcheck::Client"><c
<p>While running the netcheck 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/netcheck.rs.html#203-274">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::netcheck::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/netcheck.rs.html#208-218">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;<a class="struct" href="../../portmapper/struct.Client.html" title="struct portmapper::Client">Client</a>&gt;,
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: DnsResolver
) -&gt; <a class="type" href="https://docs.rs/anyhow/1.0.93/anyhow/type.Result.html" title="type anyhow::Result">Result</a>&lt;Self&gt;</h4></section></summary><div class="docblock"><p>Creates a new netcheck client.</p>
<p>This starts a connected actor in the background. Once the client is dropped it will
@@ -10,7 +10,7 @@
pub mapping_varies_by_dest_ip: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>&gt;,
pub mapping_varies_by_dest_ipv6: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>&gt;,
pub hair_pinning: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>&gt;,
pub portmap_probe: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../portmapper/struct.ProbeOutput.html" title="struct portmapper::ProbeOutput">ProbeOutput</a>&gt;,
pub portmap_probe: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;ProbeOutput&gt;,
pub preferred_relay: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../struct.RelayUrl.html" title="struct iroh_net::RelayUrl">RelayUrl</a>&gt;,
pub relay_latency: <a class="struct" href="struct.RelayLatencies.html" title="struct iroh_net::netcheck::RelayLatencies">RelayLatencies</a>,
pub relay_v4_latency: <a class="struct" href="struct.RelayLatencies.html" title="struct iroh_net::netcheck::RelayLatencies">RelayLatencies</a>,
@@ -34,7 +34,7 @@
detecting rather than using it. For now.</p>
</div><span id="structfield.hair_pinning" class="structfield section-header"><a href="#structfield.hair_pinning" class="anchor field">§</a><code>hair_pinning: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>&gt;</code></span><div class="docblock"><p>Whether the router supports communicating between two local devices through the NATted
public IP address (on IPv4).</p>
</div><span id="structfield.portmap_probe" class="structfield section-header"><a href="#structfield.portmap_probe" class="anchor field">§</a><code>portmap_probe: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../portmapper/struct.ProbeOutput.html" title="struct portmapper::ProbeOutput">ProbeOutput</a>&gt;</code></span><div class="docblock"><p>Probe indicating the presence of port mapping protocols on the LAN.</p>
</div><span id="structfield.portmap_probe" class="structfield section-header"><a href="#structfield.portmap_probe" class="anchor field">§</a><code>portmap_probe: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;ProbeOutput&gt;</code></span><div class="docblock"><p>Probe indicating the presence of port mapping protocols on the LAN.</p>
</div><span id="structfield.preferred_relay" class="structfield section-header"><a href="#structfield.preferred_relay" class="anchor field">§</a><code>preferred_relay: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../struct.RelayUrl.html" title="struct iroh_net::RelayUrl">RelayUrl</a>&gt;</code></span><div class="docblock"><p><code>None</code> for unknown</p>
</div><span id="structfield.relay_latency" class="structfield section-header"><a href="#structfield.relay_latency" class="anchor field">§</a><code>relay_latency: <a class="struct" href="struct.RelayLatencies.html" title="struct iroh_net::netcheck::RelayLatencies">RelayLatencies</a></code></span><div class="docblock"><p>keyed by relay Url</p>
</div><span id="structfield.relay_v4_latency" class="structfield section-header"><a href="#structfield.relay_v4_latency" class="anchor field">§</a><code>relay_v4_latency: <a class="struct" href="struct.RelayLatencies.html" title="struct iroh_net::netcheck::RelayLatencies">RelayLatencies</a></code></span><div class="docblock"><p>keyed by relay Url</p>
@@ -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="Runs a relay server with STUN enabled suitable for tests."><title>run_relay_server in iroh_net::test_utils - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.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-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-b21aa549bf6d91ff.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh_net" data-themes="" data-resource-suffix="" data-rustdoc-version="1.80.0-nightly (c987ad527 2024-05-01)" data-channel="nightly" data-search-js="search-bf21c90c8c1d92b1.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../static.files/storage-e32f0c247825364d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-20a3ad099b048cf2.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-09095024cf37855e.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-2c020d218678b618.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_net/index.html">iroh_net</a><span class="version">0.28.1</span></h2></div><div class="sidebar-elems"><h2><a href="index.html">In iroh_net::test_utils</a></h2></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><div id="sidebar-button" tabindex="-1"><a href="../../iroh_net/all.html" title="show sidebar"></a></div><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Type ‘S’ or ‘/’ to search, ‘?’ for more options…" type="search"><div id="help-button" tabindex="-1"><a href="../../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings">Settings</a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Function <a href="../index.html">iroh_net</a>::<wbr><a href="index.html">test_utils</a>::<wbr><a class="fn" href="#">run_relay_server</a><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><span class="out-of-band"><a class="src" href="../../src/iroh_net/test_utils.rs.html#26-31">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><pre class="rust item-decl"><code>pub async fn run_relay_server() -&gt; <a class="type" href="https://docs.rs/anyhow/1.0.93/anyhow/type.Result.html" title="type anyhow::Result">Result</a>&lt;(<a class="struct" href="../struct.RelayMap.html" title="struct iroh_net::RelayMap">RelayMap</a>, <a class="struct" href="../struct.RelayUrl.html" title="struct iroh_net::RelayUrl">RelayUrl</a>, <a class="struct" href="../../iroh_relay/server/struct.Server.html" title="struct iroh_relay::server::Server">Server</a>)&gt;</code></pre><span class="item-info"><div class="stab portability">Available on <strong><code>test</code> or crate feature <code>test-utils</code></strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Runs a relay server with STUN enabled suitable for tests.</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="Runs a relay server with STUN enabled suitable for tests."><title>run_relay_server in iroh_net::test_utils - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.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-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-b21aa549bf6d91ff.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh_net" data-themes="" data-resource-suffix="" data-rustdoc-version="1.80.0-nightly (c987ad527 2024-05-01)" data-channel="nightly" data-search-js="search-bf21c90c8c1d92b1.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../static.files/storage-e32f0c247825364d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-20a3ad099b048cf2.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-09095024cf37855e.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-2c020d218678b618.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_net/index.html">iroh_net</a><span class="version">0.28.1</span></h2></div><div class="sidebar-elems"><h2><a href="index.html">In iroh_net::test_utils</a></h2></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><div id="sidebar-button" tabindex="-1"><a href="../../iroh_net/all.html" title="show sidebar"></a></div><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Type ‘S’ or ‘/’ to search, ‘?’ for more options…" type="search"><div id="help-button" tabindex="-1"><a href="../../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings">Settings</a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Function <a href="../index.html">iroh_net</a>::<wbr><a href="index.html">test_utils</a>::<wbr><a class="fn" href="#">run_relay_server</a><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><span class="out-of-band"><a class="src" href="../../src/iroh_net/test_utils.rs.html#26-31">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><pre class="rust item-decl"><code>pub async fn run_relay_server() -&gt; <a class="type" href="https://docs.rs/anyhow/1.0.93/anyhow/type.Result.html" title="type anyhow::Result">Result</a>&lt;(<a class="struct" href="../struct.RelayMap.html" title="struct iroh_net::RelayMap">RelayMap</a>, <a class="struct" href="../struct.RelayUrl.html" title="struct iroh_net::RelayUrl">RelayUrl</a>, Server)&gt;</code></pre><span class="item-info"><div class="stab portability">Available on <strong><code>test</code> or crate feature <code>test-utils</code></strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Runs a relay server with STUN enabled suitable for tests.</p>
<p>The returned <code>Url</code> is the url of the relay server in the returned <a href="../struct.RelayMap.html" title="struct iroh_net::RelayMap"><code>RelayMap</code></a>.
When dropped, the returned <a href="../../iroh_relay/server/struct.Server.html" title="struct iroh_relay::server::Server"><code>Server</code></a> does will stop running.</p>
When dropped, the returned [<code>Server</code>] does will stop running.</p>
</div></details></section></div></main></body></html>
@@ -1,6 +1,6 @@
<!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="Runs a relay server."><title>run_relay_server_with in iroh_net::test_utils - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.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-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-b21aa549bf6d91ff.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh_net" data-themes="" data-resource-suffix="" data-rustdoc-version="1.80.0-nightly (c987ad527 2024-05-01)" data-channel="nightly" data-search-js="search-bf21c90c8c1d92b1.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../static.files/storage-e32f0c247825364d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-20a3ad099b048cf2.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-09095024cf37855e.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-2c020d218678b618.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_net/index.html">iroh_net</a><span class="version">0.28.1</span></h2></div><div class="sidebar-elems"><h2><a href="index.html">In iroh_net::test_utils</a></h2></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><div id="sidebar-button" tabindex="-1"><a href="../../iroh_net/all.html" title="show sidebar"></a></div><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Type ‘S’ or ‘/’ to search, ‘?’ for more options…" type="search"><div id="help-button" tabindex="-1"><a href="../../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings">Settings</a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Function <a href="../index.html">iroh_net</a>::<wbr><a href="index.html">test_utils</a>::<wbr><a class="fn" href="#">run_relay_server_with</a><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><span class="out-of-band"><a class="src" href="../../src/iroh_net/test_utils.rs.html#39-76">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><pre class="rust item-decl"><code>pub async fn run_relay_server_with(
stun: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../iroh_relay/server/struct.StunConfig.html" title="struct iroh_relay::server::StunConfig">StunConfig</a>&gt;
) -&gt; <a class="type" href="https://docs.rs/anyhow/1.0.93/anyhow/type.Result.html" title="type anyhow::Result">Result</a>&lt;(<a class="struct" href="../struct.RelayMap.html" title="struct iroh_net::RelayMap">RelayMap</a>, <a class="struct" href="../struct.RelayUrl.html" title="struct iroh_net::RelayUrl">RelayUrl</a>, <a class="struct" href="../../iroh_relay/server/struct.Server.html" title="struct iroh_relay::server::Server">Server</a>)&gt;</code></pre><span class="item-info"><div class="stab portability">Available on <strong><code>test</code> or crate feature <code>test-utils</code></strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Runs a relay server.</p>
stun: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;StunConfig&gt;
) -&gt; <a class="type" href="https://docs.rs/anyhow/1.0.93/anyhow/type.Result.html" title="type anyhow::Result">Result</a>&lt;(<a class="struct" href="../struct.RelayMap.html" title="struct iroh_net::RelayMap">RelayMap</a>, <a class="struct" href="../struct.RelayUrl.html" title="struct iroh_net::RelayUrl">RelayUrl</a>, Server)&gt;</code></pre><span class="item-info"><div class="stab portability">Available on <strong><code>test</code> or crate feature <code>test-utils</code></strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Runs a relay server.</p>
<p><code>stun</code> can be set to <code>None</code> to disable stun, or set to <code>Some</code> <code>StunConfig</code>,
to enable stun on a specific socket.</p>
<p>The return value is similar to <a href="fn.run_relay_server.html" title="fn iroh_net::test_utils::run_relay_server"><code>run_relay_server</code></a>.</p>
File diff suppressed because one or more lines are too long
@@ -1,6 +1,6 @@
<!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="Create and run a client"><title>client in iroh_net_bench::iroh - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.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-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-b21aa549bf6d91ff.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh_net_bench" data-themes="" data-resource-suffix="" data-rustdoc-version="1.80.0-nightly (c987ad527 2024-05-01)" data-channel="nightly" data-search-js="search-bf21c90c8c1d92b1.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../static.files/storage-e32f0c247825364d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-20a3ad099b048cf2.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-09095024cf37855e.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-2c020d218678b618.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_net_bench/index.html">iroh_net_bench</a><span class="version">0.27.0</span></h2></div><div class="sidebar-elems"><h2><a href="index.html">In iroh_net_bench::iroh</a></h2></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><div id="sidebar-button" tabindex="-1"><a href="../../iroh_net_bench/all.html" title="show sidebar"></a></div><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Type ‘S’ or ‘/’ to search, ‘?’ for more options…" type="search"><div id="help-button" tabindex="-1"><a href="../../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings">Settings</a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Function <a href="../index.html">iroh_net_bench</a>::<wbr><a href="index.html">iroh</a>::<wbr><a class="fn" href="#">client</a><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><span class="out-of-band"><a class="src" href="../../src/iroh_net_bench/iroh.rs.html#62-78">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><pre class="rust item-decl"><code>pub async fn client(
server_addr: <a class="struct" href="../../iroh_base/node_addr/struct.NodeAddr.html" title="struct iroh_base::node_addr::NodeAddr">NodeAddr</a>,
relay_url: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../iroh_base/node_addr/struct.RelayUrl.html" title="struct iroh_base::node_addr::RelayUrl">RelayUrl</a>&gt;,
server_addr: NodeAddr,
relay_url: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;RelayUrl&gt;,
opt: <a class="struct" href="../struct.Opt.html" title="struct iroh_net_bench::Opt">Opt</a>
) -&gt; <a class="type" href="https://docs.rs/anyhow/1.0.93/anyhow/type.Result.html" title="type anyhow::Result">Result</a>&lt;<a class="struct" href="../struct.ClientStats.html" title="struct iroh_net_bench::ClientStats">ClientStats</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Create and run a client</p>
</div></details></section></div></main></body></html>
@@ -1,6 +1,6 @@
<!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="Create a client endpoint and client connection"><title>connect_client in iroh_net_bench::iroh - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.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-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-b21aa549bf6d91ff.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh_net_bench" data-themes="" data-resource-suffix="" data-rustdoc-version="1.80.0-nightly (c987ad527 2024-05-01)" data-channel="nightly" data-search-js="search-bf21c90c8c1d92b1.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../static.files/storage-e32f0c247825364d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-20a3ad099b048cf2.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-09095024cf37855e.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-2c020d218678b618.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_net_bench/index.html">iroh_net_bench</a><span class="version">0.27.0</span></h2></div><div class="sidebar-elems"><h2><a href="index.html">In iroh_net_bench::iroh</a></h2></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><div id="sidebar-button" tabindex="-1"><a href="../../iroh_net_bench/all.html" title="show sidebar"></a></div><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Type ‘S’ or ‘/’ to search, ‘?’ for more options…" type="search"><div id="help-button" tabindex="-1"><a href="../../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings">Settings</a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Function <a href="../index.html">iroh_net_bench</a>::<wbr><a href="index.html">iroh</a>::<wbr><a class="fn" href="#">connect_client</a><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><span class="out-of-band"><a class="src" href="../../src/iroh_net_bench/iroh.rs.html#81-118">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><pre class="rust item-decl"><code>pub async fn connect_client(
server_addr: <a class="struct" href="../../iroh_base/node_addr/struct.NodeAddr.html" title="struct iroh_base::node_addr::NodeAddr">NodeAddr</a>,
relay_url: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../iroh_base/node_addr/struct.RelayUrl.html" title="struct iroh_base::node_addr::RelayUrl">RelayUrl</a>&gt;,
server_addr: NodeAddr,
relay_url: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;RelayUrl&gt;,
opt: <a class="struct" href="../struct.Opt.html" title="struct iroh_net_bench::Opt">Opt</a>
) -&gt; <a class="type" href="https://docs.rs/anyhow/1.0.93/anyhow/type.Result.html" title="type anyhow::Result">Result</a>&lt;(<a class="struct" href="../../iroh_net/endpoint/struct.Endpoint.html" title="struct iroh_net::endpoint::Endpoint">Endpoint</a>, Connection)&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Create a client endpoint and client connection</p>
) -&gt; <a class="type" href="https://docs.rs/anyhow/1.0.93/anyhow/type.Result.html" title="type anyhow::Result">Result</a>&lt;(Endpoint, Connection)&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Create a client endpoint and client connection</p>
</div></details></section></div></main></body></html>
@@ -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="Take the provided endpoint and run the server"><title>server in iroh_net_bench::iroh - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.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-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-b21aa549bf6d91ff.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh_net_bench" data-themes="" data-resource-suffix="" data-rustdoc-version="1.80.0-nightly (c987ad527 2024-05-01)" data-channel="nightly" data-search-js="search-bf21c90c8c1d92b1.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../static.files/storage-e32f0c247825364d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-20a3ad099b048cf2.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-09095024cf37855e.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-2c020d218678b618.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_net_bench/index.html">iroh_net_bench</a><span class="version">0.27.0</span></h2></div><div class="sidebar-elems"><h2><a href="index.html">In iroh_net_bench::iroh</a></h2></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><div id="sidebar-button" tabindex="-1"><a href="../../iroh_net_bench/all.html" title="show sidebar"></a></div><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Type ‘S’ or ‘/’ to search, ‘?’ for more options…" type="search"><div id="help-button" tabindex="-1"><a href="../../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings">Settings</a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Function <a href="../index.html">iroh_net_bench</a>::<wbr><a href="index.html">iroh</a>::<wbr><a class="fn" href="#">server</a><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><span class="out-of-band"><a class="src" href="../../src/iroh_net_bench/iroh.rs.html#237-288">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><pre class="rust item-decl"><code>pub async fn server(endpoint: <a class="struct" href="../../iroh_net/endpoint/struct.Endpoint.html" title="struct iroh_net::endpoint::Endpoint">Endpoint</a>, opt: <a class="struct" href="../struct.Opt.html" title="struct iroh_net_bench::Opt">Opt</a>) -&gt; <a class="type" href="https://docs.rs/anyhow/1.0.93/anyhow/type.Result.html" title="type anyhow::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Take the provided endpoint and run the server</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="Take the provided endpoint and run the server"><title>server in iroh_net_bench::iroh - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.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-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-b21aa549bf6d91ff.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh_net_bench" data-themes="" data-resource-suffix="" data-rustdoc-version="1.80.0-nightly (c987ad527 2024-05-01)" data-channel="nightly" data-search-js="search-bf21c90c8c1d92b1.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../static.files/storage-e32f0c247825364d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-20a3ad099b048cf2.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-09095024cf37855e.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-2c020d218678b618.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_net_bench/index.html">iroh_net_bench</a><span class="version">0.27.0</span></h2></div><div class="sidebar-elems"><h2><a href="index.html">In iroh_net_bench::iroh</a></h2></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><div id="sidebar-button" tabindex="-1"><a href="../../iroh_net_bench/all.html" title="show sidebar"></a></div><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Type ‘S’ or ‘/’ to search, ‘?’ for more options…" type="search"><div id="help-button" tabindex="-1"><a href="../../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings">Settings</a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Function <a href="../index.html">iroh_net_bench</a>::<wbr><a href="index.html">iroh</a>::<wbr><a class="fn" href="#">server</a><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><span class="out-of-band"><a class="src" href="../../src/iroh_net_bench/iroh.rs.html#237-288">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><pre class="rust item-decl"><code>pub async fn server(endpoint: Endpoint, opt: <a class="struct" href="../struct.Opt.html" title="struct iroh_net_bench::Opt">Opt</a>) -&gt; <a class="type" href="https://docs.rs/anyhow/1.0.93/anyhow/type.Result.html" title="type anyhow::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Take the provided endpoint and run the server</p>
</div></details></section></div></main></body></html>
@@ -1,6 +1,6 @@
<!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="Creates a server endpoint which runs on the given runtime"><title>server_endpoint in iroh_net_bench::iroh - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.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-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-b21aa549bf6d91ff.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh_net_bench" data-themes="" data-resource-suffix="" data-rustdoc-version="1.80.0-nightly (c987ad527 2024-05-01)" data-channel="nightly" data-search-js="search-bf21c90c8c1d92b1.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../static.files/storage-e32f0c247825364d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-20a3ad099b048cf2.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-09095024cf37855e.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-2c020d218678b618.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_net_bench/index.html">iroh_net_bench</a><span class="version">0.27.0</span></h2></div><div class="sidebar-elems"><h2><a href="index.html">In iroh_net_bench::iroh</a></h2></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><div id="sidebar-button" tabindex="-1"><a href="../../iroh_net_bench/all.html" title="show sidebar"></a></div><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Type ‘S’ or ‘/’ to search, ‘?’ for more options…" type="search"><div id="help-button" tabindex="-1"><a href="../../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings">Settings</a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Function <a href="../index.html">iroh_net_bench</a>::<wbr><a href="index.html">iroh</a>::<wbr><a class="fn" href="#">server_endpoint</a><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><span class="out-of-band"><a class="src" href="../../src/iroh_net_bench/iroh.rs.html#22-59">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><pre class="rust item-decl"><code>pub fn server_endpoint(
rt: &amp;Runtime,
relay_url: &amp;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../iroh_base/node_addr/struct.RelayUrl.html" title="struct iroh_base::node_addr::RelayUrl">RelayUrl</a>&gt;,
relay_url: &amp;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;RelayUrl&gt;,
opt: &amp;<a class="struct" href="../struct.Opt.html" title="struct iroh_net_bench::Opt">Opt</a>
) -&gt; (<a class="struct" href="../../iroh_base/node_addr/struct.NodeAddr.html" title="struct iroh_base::node_addr::NodeAddr">NodeAddr</a>, <a class="struct" href="../../iroh_net/endpoint/struct.Endpoint.html" title="struct iroh_net::endpoint::Endpoint">Endpoint</a>)</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Creates a server endpoint which runs on the given runtime</p>
) -&gt; (NodeAddr, Endpoint)</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Creates a server endpoint which runs on the given runtime</p>
</div></details></section></div></main></body></html>
File diff suppressed because one or more lines are too long
+222 -18
View File
@@ -571,6 +571,108 @@
<a href="#571" id="571">571</a>
<a href="#572" id="572">572</a>
<a href="#573" id="573">573</a>
<a href="#574" id="574">574</a>
<a href="#575" id="575">575</a>
<a href="#576" id="576">576</a>
<a href="#577" id="577">577</a>
<a href="#578" id="578">578</a>
<a href="#579" id="579">579</a>
<a href="#580" id="580">580</a>
<a href="#581" id="581">581</a>
<a href="#582" id="582">582</a>
<a href="#583" id="583">583</a>
<a href="#584" id="584">584</a>
<a href="#585" id="585">585</a>
<a href="#586" id="586">586</a>
<a href="#587" id="587">587</a>
<a href="#588" id="588">588</a>
<a href="#589" id="589">589</a>
<a href="#590" id="590">590</a>
<a href="#591" id="591">591</a>
<a href="#592" id="592">592</a>
<a href="#593" id="593">593</a>
<a href="#594" id="594">594</a>
<a href="#595" id="595">595</a>
<a href="#596" id="596">596</a>
<a href="#597" id="597">597</a>
<a href="#598" id="598">598</a>
<a href="#599" id="599">599</a>
<a href="#600" id="600">600</a>
<a href="#601" id="601">601</a>
<a href="#602" id="602">602</a>
<a href="#603" id="603">603</a>
<a href="#604" id="604">604</a>
<a href="#605" id="605">605</a>
<a href="#606" id="606">606</a>
<a href="#607" id="607">607</a>
<a href="#608" id="608">608</a>
<a href="#609" id="609">609</a>
<a href="#610" id="610">610</a>
<a href="#611" id="611">611</a>
<a href="#612" id="612">612</a>
<a href="#613" id="613">613</a>
<a href="#614" id="614">614</a>
<a href="#615" id="615">615</a>
<a href="#616" id="616">616</a>
<a href="#617" id="617">617</a>
<a href="#618" id="618">618</a>
<a href="#619" id="619">619</a>
<a href="#620" id="620">620</a>
<a href="#621" id="621">621</a>
<a href="#622" id="622">622</a>
<a href="#623" id="623">623</a>
<a href="#624" id="624">624</a>
<a href="#625" id="625">625</a>
<a href="#626" id="626">626</a>
<a href="#627" id="627">627</a>
<a href="#628" id="628">628</a>
<a href="#629" id="629">629</a>
<a href="#630" id="630">630</a>
<a href="#631" id="631">631</a>
<a href="#632" id="632">632</a>
<a href="#633" id="633">633</a>
<a href="#634" id="634">634</a>
<a href="#635" id="635">635</a>
<a href="#636" id="636">636</a>
<a href="#637" id="637">637</a>
<a href="#638" id="638">638</a>
<a href="#639" id="639">639</a>
<a href="#640" id="640">640</a>
<a href="#641" id="641">641</a>
<a href="#642" id="642">642</a>
<a href="#643" id="643">643</a>
<a href="#644" id="644">644</a>
<a href="#645" id="645">645</a>
<a href="#646" id="646">646</a>
<a href="#647" id="647">647</a>
<a href="#648" id="648">648</a>
<a href="#649" id="649">649</a>
<a href="#650" id="650">650</a>
<a href="#651" id="651">651</a>
<a href="#652" id="652">652</a>
<a href="#653" id="653">653</a>
<a href="#654" id="654">654</a>
<a href="#655" id="655">655</a>
<a href="#656" id="656">656</a>
<a href="#657" id="657">657</a>
<a href="#658" id="658">658</a>
<a href="#659" id="659">659</a>
<a href="#660" id="660">660</a>
<a href="#661" id="661">661</a>
<a href="#662" id="662">662</a>
<a href="#663" id="663">663</a>
<a href="#664" id="664">664</a>
<a href="#665" id="665">665</a>
<a href="#666" id="666">666</a>
<a href="#667" id="667">667</a>
<a href="#668" id="668">668</a>
<a href="#669" id="669">669</a>
<a href="#670" id="670">670</a>
<a href="#671" id="671">671</a>
<a href="#672" id="672">672</a>
<a href="#673" id="673">673</a>
<a href="#674" id="674">674</a>
<a href="#675" id="675">675</a>
</pre></div><pre class="rust"><code><span class="kw">use </span>std::{
future::Future,
io::ErrorKind,
@@ -784,6 +886,20 @@
///
/// Returns `Some(error)` if the error is fatal otherwise `None.
</span><span class="kw">fn </span>handle_read_error(<span class="kw-2">&amp;</span><span class="self">self</span>, error: std::io::Error) -&gt; <span class="prelude-ty">Option</span>&lt;std::io::Error&gt; {
<span class="kw">match </span>error.kind() {
std::io::ErrorKind::NotConnected =&gt; {
<span class="comment">// This indicates the underlying socket is broken, and we should attempt to rebind it
</span><span class="self">self</span>.mark_broken();
<span class="prelude-val">None
</span>}
<span class="kw">_ </span>=&gt; <span class="prelude-val">Some</span>(error),
}
}
<span class="doccomment">/// Handle potential write errors, updating internal state.
///
/// Returns `Some(error)` if the error is fatal otherwise `None.
</span><span class="kw">fn </span>handle_write_error(<span class="kw-2">&amp;</span><span class="self">self</span>, error: std::io::Error) -&gt; <span class="prelude-ty">Option</span>&lt;std::io::Error&gt; {
<span class="kw">match </span>error.kind() {
std::io::ErrorKind::BrokenPipe =&gt; {
<span class="comment">// This indicates the underlying socket is broken, and we should attempt to rebind it
@@ -809,22 +925,46 @@
<span class="kw">let </span><span class="self">Self </span>{ socket, buffer } = <span class="kw-2">&amp;mut *</span><span class="self">self</span>;
<span class="kw">loop </span>{
<span class="kw">let </span>guard = socket.socket.read().unwrap();
<span class="kw">let </span>socket = guard.as_ref().expect(<span class="string">"missing socket"</span>);
<span class="comment">// check if the socket needs a rebind
</span><span class="kw">if </span>socket.is_broken() {
<span class="kw">match </span>socket.rebind() {
<span class="prelude-val">Ok</span>(()) =&gt; {
<span class="comment">// all good
</span>}
<span class="prelude-val">Err</span>(err) =&gt; {
<span class="macro">warn!</span>(<span class="string">"failed to rebind socket: {:?}"</span>, err);
<span class="comment">// TODO: improve error
</span><span class="kw">let </span>err =
std::io::Error::new(std::io::ErrorKind::BrokenPipe, err.to_string());
<span class="kw">return </span>Poll::Ready(<span class="prelude-val">Err</span>(err));
}
}
}
<span class="kw">match </span>socket.poll_recv_ready(cx) {
<span class="kw">let </span>guard = socket.socket.read().unwrap();
<span class="kw">let </span>inner_socket = guard.as_ref().expect(<span class="string">"missing socket"</span>);
<span class="kw">match </span>inner_socket.poll_recv_ready(cx) {
Poll::Pending =&gt; <span class="kw">return </span>Poll::Pending,
Poll::Ready(<span class="prelude-val">Ok</span>(())) =&gt; {
<span class="kw">let </span>res = socket.try_recv(buffer);
<span class="kw">let </span>res = inner_socket.try_recv(buffer);
<span class="kw">if let </span><span class="prelude-val">Err</span>(err) = res {
<span class="kw">if </span>err.kind() == ErrorKind::WouldBlock {
<span class="kw">continue</span>;
}
<span class="kw">return </span>Poll::Ready(<span class="prelude-val">Err</span>(err));
<span class="kw">if let </span><span class="prelude-val">Some</span>(err) = socket.handle_read_error(err) {
<span class="kw">return </span>Poll::Ready(<span class="prelude-val">Err</span>(err));
}
<span class="kw">continue</span>;
}
<span class="kw">return </span>Poll::Ready(res);
}
Poll::Ready(<span class="prelude-val">Err</span>(err)) =&gt; <span class="kw">return </span>Poll::Ready(<span class="prelude-val">Err</span>(err)),
Poll::Ready(<span class="prelude-val">Err</span>(err)) =&gt; {
<span class="kw">if let </span><span class="prelude-val">Some</span>(err) = socket.handle_read_error(err) {
<span class="kw">return </span>Poll::Ready(<span class="prelude-val">Err</span>(err));
}
<span class="kw">continue</span>;
}
}
}
}
@@ -844,22 +984,45 @@
<span class="kw">let </span><span class="self">Self </span>{ socket, buffer } = <span class="kw-2">&amp;mut *</span><span class="self">self</span>;
<span class="kw">loop </span>{
<span class="comment">// check if the socket needs a rebind
</span><span class="kw">if </span>socket.is_broken() {
<span class="kw">match </span>socket.rebind() {
<span class="prelude-val">Ok</span>(()) =&gt; {
<span class="comment">// all good
</span>}
<span class="prelude-val">Err</span>(err) =&gt; {
<span class="macro">warn!</span>(<span class="string">"failed to rebind socket: {:?}"</span>, err);
<span class="comment">// TODO: improve error
</span><span class="kw">let </span>err =
std::io::Error::new(std::io::ErrorKind::BrokenPipe, err.to_string());
<span class="kw">return </span>Poll::Ready(<span class="prelude-val">Err</span>(err));
}
}
}
<span class="kw">let </span>guard = socket.socket.read().unwrap();
<span class="kw">let </span>socket = guard.as_ref().expect(<span class="string">"missing socket"</span>);
<span class="kw">let </span>inner_socket = guard.as_ref().expect(<span class="string">"missing socket"</span>);
<span class="kw">match </span>socket.poll_recv_ready(cx) {
<span class="kw">match </span>inner_socket.poll_recv_ready(cx) {
Poll::Pending =&gt; <span class="kw">return </span>Poll::Pending,
Poll::Ready(<span class="prelude-val">Ok</span>(())) =&gt; {
<span class="kw">let </span>res = socket.try_recv_from(buffer);
<span class="kw">let </span>res = inner_socket.try_recv_from(buffer);
<span class="kw">if let </span><span class="prelude-val">Err</span>(err) = res {
<span class="kw">if </span>err.kind() == ErrorKind::WouldBlock {
<span class="kw">continue</span>;
}
<span class="kw">return </span>Poll::Ready(<span class="prelude-val">Err</span>(err));
<span class="kw">if let </span><span class="prelude-val">Some</span>(err) = socket.handle_read_error(err) {
<span class="kw">return </span>Poll::Ready(<span class="prelude-val">Err</span>(err));
}
<span class="kw">continue</span>;
}
<span class="kw">return </span>Poll::Ready(res);
}
Poll::Ready(<span class="prelude-val">Err</span>(err)) =&gt; <span class="kw">return </span>Poll::Ready(<span class="prelude-val">Err</span>(err)),
Poll::Ready(<span class="prelude-val">Err</span>(err)) =&gt; {
<span class="kw">if let </span><span class="prelude-val">Some</span>(err) = socket.handle_read_error(err) {
<span class="kw">return </span>Poll::Ready(<span class="prelude-val">Err</span>(err));
}
<span class="kw">continue</span>;
}
}
}
}
@@ -875,10 +1038,36 @@
<span class="kw">type </span>Output = std::io::Result&lt;()&gt;;
<span class="kw">fn </span>poll(<span class="self">self</span>: Pin&lt;<span class="kw-2">&amp;mut </span><span class="self">Self</span>&gt;, c: <span class="kw-2">&amp;mut </span>std::task::Context&lt;<span class="lifetime">'_</span>&gt;) -&gt; Poll&lt;<span class="self">Self</span>::Output&gt; {
<span class="kw">let </span>guard = <span class="self">self</span>.socket.socket.read().unwrap();
<span class="kw">let </span>socket = guard.as_ref().expect(<span class="string">"missing socket"</span>);
<span class="kw">loop </span>{
<span class="comment">// check if the socket needs a rebind
</span><span class="kw">if </span><span class="self">self</span>.socket.is_broken() {
<span class="kw">match </span><span class="self">self</span>.socket.rebind() {
<span class="prelude-val">Ok</span>(()) =&gt; {
<span class="comment">// all good
</span>}
<span class="prelude-val">Err</span>(err) =&gt; {
<span class="macro">warn!</span>(<span class="string">"failed to rebind socket: {:?}"</span>, err);
<span class="comment">// TODO: improve error
</span><span class="kw">let </span>err =
std::io::Error::new(std::io::ErrorKind::BrokenPipe, err.to_string());
<span class="kw">return </span>Poll::Ready(<span class="prelude-val">Err</span>(err));
}
}
}
<span class="kw">let </span>guard = <span class="self">self</span>.socket.socket.read().unwrap();
<span class="kw">let </span>socket = guard.as_ref().expect(<span class="string">"missing socket"</span>);
socket.poll_send_ready(c)
<span class="kw">match </span>socket.poll_send_ready(c) {
Poll::Pending =&gt; <span class="kw">return </span>Poll::Pending,
Poll::Ready(<span class="prelude-val">Ok</span>(())) =&gt; <span class="kw">return </span>Poll::Ready(<span class="prelude-val">Ok</span>(())),
Poll::Ready(<span class="prelude-val">Err</span>(err)) =&gt; {
<span class="kw">if let </span><span class="prelude-val">Some</span>(err) = <span class="self">self</span>.socket.handle_write_error(err) {
<span class="kw">return </span>Poll::Ready(<span class="prelude-val">Err</span>(err));
}
<span class="kw">continue</span>;
}
}
}
}
}
@@ -894,6 +1083,21 @@
<span class="kw">fn </span>poll(<span class="self">self</span>: Pin&lt;<span class="kw-2">&amp;mut </span><span class="self">Self</span>&gt;, c: <span class="kw-2">&amp;mut </span>std::task::Context&lt;<span class="lifetime">'_</span>&gt;) -&gt; Poll&lt;<span class="self">Self</span>::Output&gt; {
<span class="kw">loop </span>{
<span class="comment">// check if the socket needs a rebind
</span><span class="kw">if </span><span class="self">self</span>.socket.is_broken() {
<span class="kw">match </span><span class="self">self</span>.socket.rebind() {
<span class="prelude-val">Ok</span>(()) =&gt; {
<span class="comment">// all good
</span>}
<span class="prelude-val">Err</span>(err) =&gt; {
<span class="macro">warn!</span>(<span class="string">"failed to rebind socket: {:?}"</span>, err);
<span class="comment">// TODO: improve error
</span><span class="kw">let </span>err =
std::io::Error::new(std::io::ErrorKind::BrokenPipe, err.to_string());
<span class="kw">return </span>Poll::Ready(<span class="prelude-val">Err</span>(err));
}
}
}
<span class="kw">let </span>guard = <span class="self">self</span>.socket.socket.read().unwrap();
<span class="kw">let </span>socket = guard.as_ref().expect(<span class="string">"missing socket"</span>);
@@ -905,7 +1109,7 @@
<span class="kw">if </span>err.kind() == ErrorKind::WouldBlock {
<span class="kw">continue</span>;
}
<span class="kw">if let </span><span class="prelude-val">Some</span>(err) = <span class="self">self</span>.socket.handle_read_error(err) {
<span class="kw">if let </span><span class="prelude-val">Some</span>(err) = <span class="self">self</span>.socket.handle_write_error(err) {
<span class="kw">return </span>Poll::Ready(<span class="prelude-val">Err</span>(err));
}
<span class="kw">continue</span>;
@@ -913,7 +1117,7 @@
<span class="kw">return </span>Poll::Ready(res);
}
Poll::Ready(<span class="prelude-val">Err</span>(err)) =&gt; {
<span class="kw">if let </span><span class="prelude-val">Some</span>(err) = <span class="self">self</span>.socket.handle_read_error(err) {
<span class="kw">if let </span><span class="prelude-val">Some</span>(err) = <span class="self">self</span>.socket.handle_write_error(err) {
<span class="kw">return </span>Poll::Ready(<span class="prelude-val">Err</span>(err));
}
<span class="kw">continue</span>;
@@ -964,7 +1168,7 @@
<span class="kw">continue</span>;
}
<span class="kw">if let </span><span class="prelude-val">Some</span>(err) = <span class="self">self</span>.socket.handle_read_error(err) {
<span class="kw">if let </span><span class="prelude-val">Some</span>(err) = <span class="self">self</span>.socket.handle_write_error(err) {
<span class="kw">return </span>Poll::Ready(<span class="prelude-val">Err</span>(err));
}
<span class="kw">continue</span>;
@@ -972,7 +1176,7 @@
<span class="kw">return </span>Poll::Ready(res);
}
Poll::Ready(<span class="prelude-val">Err</span>(err)) =&gt; {
<span class="kw">if let </span><span class="prelude-val">Some</span>(err) = <span class="self">self</span>.socket.handle_read_error(err) {
<span class="kw">if let </span><span class="prelude-val">Some</span>(err) = <span class="self">self</span>.socket.handle_write_error(err) {
<span class="kw">return </span>Poll::Ready(<span class="prelude-val">Err</span>(err));
}
<span class="kw">continue</span>;