mirror of
https://github.com/n0-computer/iroh.git
synced 2026-11-30 16:03:05 +00:00
deploy: 39c1918286332ed60b2febef1a0c35ec10e45a73
This commit is contained in:
@@ -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="The `Endpoint` allows establishing connections to other iroh nodes."><title>iroh::endpoint - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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-6c3ea77c.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.87.0-nightly (f280acf4c 2025-02-19)" data-channel="nightly" data-search-js="search-f7327375.js" data-settings-js="settings-6dad6058.js" ><script src="../../static.files/storage-3a5871a4.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-5332ae0c.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.91.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module endpoint</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="#enums" title="Enums">Enums</a></li><li><a href="#constants" title="Constants">Constants</a></li><li><a href="#traits" title="Traits">Traits</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"><div class="rustdoc-breadcrumbs"><a href="../index.html">iroh</a></div><h1>Module <span>endpoint</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/endpoint.rs.html#1-3279">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The <a href="struct.Endpoint.html" title="struct iroh::endpoint::Endpoint"><code>Endpoint</code></a> allows establishing connections to other iroh 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="The `Endpoint` allows establishing connections to other iroh nodes."><title>iroh::endpoint - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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-6c3ea77c.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.87.0-nightly (f280acf4c 2025-02-19)" data-channel="nightly" data-search-js="search-f7327375.js" data-settings-js="settings-6dad6058.js" ><script src="../../static.files/storage-3a5871a4.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-5332ae0c.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.91.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module endpoint</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="#enums" title="Enums">Enums</a></li><li><a href="#constants" title="Constants">Constants</a></li><li><a href="#traits" title="Traits">Traits</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"><div class="rustdoc-breadcrumbs"><a href="../index.html">iroh</a></div><h1>Module <span>endpoint</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/endpoint.rs.html#1-3277">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The <a href="struct.Endpoint.html" title="struct iroh::endpoint::Endpoint"><code>Endpoint</code></a> allows establishing connections to other iroh nodes.</p>
|
||||
<p>The <a href="struct.Endpoint.html" title="struct iroh::endpoint::Endpoint"><code>Endpoint</code></a> is the main API interface to manage a local iroh node. It allows
|
||||
connecting to and accepting connections from other nodes. See the <a href="../index.html" title="mod iroh">module docs</a> for
|
||||
more details on how iroh connections work.</p>
|
||||
|
||||
@@ -3256,24 +3256,22 @@
|
||||
<a href=#3256 id=3256 data-nosnippet>3256</a> <span class="kw">let </span>conn = endpoint.connect(<span class="kw-2">*</span>id, NOOP_ALPN).<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
<a href=#3257 id=3257 data-nosnippet>3257</a> conn.close(<span class="number">0u32</span>.into(), <span class="string">b"done"</span>);
|
||||
<a href=#3258 id=3258 data-nosnippet>3258</a> }
|
||||
<a href=#3259 id=3259 data-nosnippet>3259</a> <span class="kw">let </span>dt0 = t0.elapsed();
|
||||
<a href=#3259 id=3259 data-nosnippet>3259</a> <span class="kw">let </span>dt0 = t0.elapsed().as_secs_f64();
|
||||
<a href=#3260 id=3260 data-nosnippet>3260</a> <span class="kw">let </span>t1 = Instant::now();
|
||||
<a href=#3261 id=3261 data-nosnippet>3261</a> <span class="kw">for </span>id <span class="kw">in </span><span class="kw-2">&</span>ids {
|
||||
<a href=#3262 id=3262 data-nosnippet>3262</a> <span class="kw">let </span>conn = endpoint.connect(<span class="kw-2">*</span>id, NOOP_ALPN).<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
<a href=#3263 id=3263 data-nosnippet>3263</a> conn.close(<span class="number">0u32</span>.into(), <span class="string">b"done"</span>);
|
||||
<a href=#3264 id=3264 data-nosnippet>3264</a> }
|
||||
<a href=#3265 id=3265 data-nosnippet>3265</a> <span class="kw">let </span>dt1 = t1.elapsed();
|
||||
<a href=#3266 id=3266 data-nosnippet>3266</a> <span class="macro">println!</span>(
|
||||
<a href=#3267 id=3267 data-nosnippet>3267</a> <span class="string">"Round 0: {}s, {}s per connection"</span>,
|
||||
<a href=#3268 id=3268 data-nosnippet>3268</a> dt0.as_secs_f64(),
|
||||
<a href=#3269 id=3269 data-nosnippet>3269</a> dt0.as_secs_f64() / (n <span class="kw">as </span>f64)
|
||||
<a href=#3270 id=3270 data-nosnippet>3270</a> );
|
||||
<a href=#3271 id=3271 data-nosnippet>3271</a> <span class="macro">println!</span>(
|
||||
<a href=#3272 id=3272 data-nosnippet>3272</a> <span class="string">"Round 1: {}s, {}s per connection"</span>,
|
||||
<a href=#3273 id=3273 data-nosnippet>3273</a> dt1.as_secs_f64(),
|
||||
<a href=#3274 id=3274 data-nosnippet>3274</a> dt1.as_secs_f64() / (n <span class="kw">as </span>f64)
|
||||
<a href=#3275 id=3275 data-nosnippet>3275</a> );
|
||||
<a href=#3276 id=3276 data-nosnippet>3276</a> <span class="macro">assert!</span>(dt0.as_secs_f64() / dt1.as_secs_f64() < <span class="number">20.0</span>);
|
||||
<a href=#3277 id=3277 data-nosnippet>3277</a> <span class="prelude-val">Ok</span>(())
|
||||
<a href=#3278 id=3278 data-nosnippet>3278</a> }
|
||||
<a href=#3279 id=3279 data-nosnippet>3279</a>}</code></pre></div></section></main></body></html>
|
||||
<a href=#3265 id=3265 data-nosnippet>3265</a> <span class="kw">let </span>dt1 = t1.elapsed().as_secs_f64();
|
||||
<a href=#3266 id=3266 data-nosnippet>3266</a>
|
||||
<a href=#3267 id=3267 data-nosnippet>3267</a> <span class="macro">println!</span>(<span class="string">"Round 0: {}s, {}s per connection"</span>, dt0, dt0 / (n <span class="kw">as </span>f64));
|
||||
<a href=#3268 id=3268 data-nosnippet>3268</a> <span class="macro">println!</span>(<span class="string">"Round 1: {}s, {}s per connection"</span>, dt1, dt1 / (n <span class="kw">as </span>f64));
|
||||
<a href=#3269 id=3269 data-nosnippet>3269</a> <span class="macro">assert!</span>(
|
||||
<a href=#3270 id=3270 data-nosnippet>3270</a> dt0 / dt1 < <span class="number">20.0</span>,
|
||||
<a href=#3271 id=3271 data-nosnippet>3271</a> <span class="string">"First round: {}s, second round {}s"</span>,
|
||||
<a href=#3272 id=3272 data-nosnippet>3272</a> dt0,
|
||||
<a href=#3273 id=3273 data-nosnippet>3273</a> dt1
|
||||
<a href=#3274 id=3274 data-nosnippet>3274</a> );
|
||||
<a href=#3275 id=3275 data-nosnippet>3275</a> <span class="prelude-val">Ok</span>(())
|
||||
<a href=#3276 id=3276 data-nosnippet>3276</a> }
|
||||
<a href=#3277 id=3277 data-nosnippet>3277</a>}</code></pre></div></section></main></body></html>
|
||||
Reference in New Issue
Block a user