mirror of
https://github.com/n0-computer/iroh.git
synced 2026-12-03 08:01:40 +00:00
deploy: 719bb17cdadc897e058a860de5929c858ca280cf
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -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 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
|
||||
</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
|
||||
<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
@@ -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="Cryptographic key handling for `iroh-net`."><title>iroh_net::key - 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 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_net/index.html">iroh_net</a><span class="version">0.28.1</span></h2></div><h2 class="location"><a href="#">Module key</a></h2><div class="sidebar-elems"><section><ul class="block"><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#constants">Constants</a></li><li><a href="#types">Type Aliases</a></li></ul></section><h2><a href="../index.html">In crate iroh_net</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>Module <a href="../index.html">iroh_net</a>::<wbr><a class="mod" href="#">key</a><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><span class="out-of-band"><button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Cryptographic key handling for <code>iroh-net</code>.</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="Cryptographic key handling for `iroh-net`."><title>iroh_net::key - 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 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_net/index.html">iroh_net</a><span class="version">0.28.1</span></h2></div><h2 class="location"><a href="#">Module key</a></h2><div class="sidebar-elems"><section><ul class="block"><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#constants">Constants</a></li><li><a href="#types">Type Aliases</a></li></ul></section><h2><a href="../index.html">In crate iroh_net</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>Module <a href="../index.html">iroh_net</a>::<wbr><a class="mod" href="#">key</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_base/lib.rs.html#12">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Cryptographic key handling for <code>iroh-net</code>.</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.PublicKey.html" title="struct iroh_net::key::PublicKey">PublicKey</a></div><div class="desc docblock-short">A public key.</div></li><li><div class="item-name"><a class="struct" href="struct.SecretKey.html" title="struct iroh_net::key::SecretKey">SecretKey</a></div><div class="desc docblock-short">A secret key.</div></li><li><div class="item-name"><a class="struct" href="struct.SharedSecret.html" title="struct iroh_net::key::SharedSecret">SharedSecret</a></div><div class="desc docblock-short">Shared Secret.</div></li><li><div class="item-name"><a class="struct" href="struct.Signature.html" title="struct iroh_net::key::Signature">Signature</a></div><div class="desc docblock-short">Ed25519 signature.</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.KeyParsingError.html" title="enum iroh_net::key::KeyParsingError">KeyParsingError</a></div><div class="desc docblock-short">Error when deserialising a <a href="struct.PublicKey.html" title="struct iroh_net::key::PublicKey"><code>PublicKey</code></a> or a <a href="struct.SecretKey.html" title="struct iroh_net::key::SecretKey"><code>SecretKey</code></a>.</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.PUBLIC_KEY_LENGTH.html" title="constant iroh_net::key::PUBLIC_KEY_LENGTH">PUBLIC_KEY_LENGTH</a></div><div class="desc docblock-short">The length of an ed25519 <code>PublicKey</code>, in bytes.</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::key::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
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="The identifier for a node in the (iroh) network."><title>NodeId in iroh_net::key - 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 type"><!--[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><h2 class="location"><a href="#">NodeId</a></h2><div class="sidebar-elems"><section><h3><a href="#aliased-type">Aliased type</a></h3></section><h2><a href="index.html">In iroh_net::key</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>Type Alias <a href="../index.html">iroh_net</a>::<wbr><a href="index.html">key</a>::<wbr><a class="type" href="#">NodeId</a><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><span class="out-of-band"><button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div><pre class="rust item-decl"><code>pub type NodeId = <a class="struct" href="struct.PublicKey.html" title="struct iroh_net::key::PublicKey">PublicKey</a>;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The identifier for a node in the (iroh) network.</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 identifier for a node in the (iroh) network."><title>NodeId in iroh_net::key - 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 type"><!--[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><h2 class="location"><a href="#">NodeId</a></h2><div class="sidebar-elems"><section><h3><a href="#aliased-type">Aliased type</a></h3></section><h2><a href="index.html">In iroh_net::key</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>Type Alias <a href="../index.html">iroh_net</a>::<wbr><a href="index.html">key</a>::<wbr><a class="type" href="#">NodeId</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_base/key.rs.html#107">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div><pre class="rust item-decl"><code>pub type NodeId = <a class="struct" href="struct.PublicKey.html" title="struct iroh_net::key::PublicKey">PublicKey</a>;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The identifier for a node in the (iroh) network.</p>
|
||||
<p>Each node in iroh has a unique identifier created as a cryptographic key. This can be
|
||||
used to globally identify a node. Since it is also a cryptographic key it is also the
|
||||
mechanism by which all traffic is always encrypted for a specific node only.</p>
|
||||
|
||||
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><Client>,
|
||||
port_mapper: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../portmapper/struct.Client.html" title="struct portmapper::Client">Client</a>>,
|
||||
dns_resolver: DnsResolver
|
||||
) -> <a class="type" href="https://docs.rs/anyhow/1.0.93/anyhow/type.Result.html" title="type anyhow::Result">Result</a><Self></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
|
||||
@@ -14,8 +14,8 @@ stop running.</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/netcheck.rs.html#241-252">source</a><h4 class="code-header">pub async fn <a href="#method.get_report" class="fn">get_report</a>(
|
||||
&mut self,
|
||||
dm: <a class="struct" href="../struct.RelayMap.html" title="struct iroh_net::RelayMap">RelayMap</a>,
|
||||
stun_conn4: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><UdpSocket>>,
|
||||
stun_conn6: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><UdpSocket>>
|
||||
stun_conn4: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../netwatch/udp/struct.UdpSocket.html" title="struct netwatch::udp::UdpSocket">UdpSocket</a>>>,
|
||||
stun_conn6: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../netwatch/udp/struct.UdpSocket.html" title="struct netwatch::udp::UdpSocket">UdpSocket</a>>>
|
||||
) -> <a class="type" href="https://docs.rs/anyhow/1.0.93/anyhow/type.Result.html" title="type anyhow::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="struct.Report.html" title="struct iroh_net::netcheck::Report">Report</a>>></h4></section></summary><div class="docblock"><p>Runs a netcheck, returning the report.</p>
|
||||
<p>It may not be called concurrently with itself, <code>&mut self</code> takes care of that.</p>
|
||||
<p>The <em>stun_conn4</em> and <em>stun_conn6</em> endpoints are bound UDP sockets to use to send out
|
||||
@@ -29,8 +29,8 @@ may not be as reliable.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_report_channel" class="method"><a class="src rightside" href="../../src/iroh_net/netcheck.rs.html#255-273">source</a><h4 class="code-header">pub async fn <a href="#method.get_report_channel" class="fn">get_report_channel</a>(
|
||||
&mut self,
|
||||
dm: <a class="struct" href="../struct.RelayMap.html" title="struct iroh_net::RelayMap">RelayMap</a>,
|
||||
stun_conn4: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><UdpSocket>>,
|
||||
stun_conn6: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><UdpSocket>>
|
||||
stun_conn4: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../netwatch/udp/struct.UdpSocket.html" title="struct netwatch::udp::UdpSocket">UdpSocket</a>>>,
|
||||
stun_conn6: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../netwatch/udp/struct.UdpSocket.html" title="struct netwatch::udp::UdpSocket">UdpSocket</a>>>
|
||||
) -> <a class="type" href="https://docs.rs/anyhow/1.0.93/anyhow/type.Result.html" title="type anyhow::Result">Result</a><Receiver<<a class="type" href="https://docs.rs/anyhow/1.0.93/anyhow/type.Result.html" title="type anyhow::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="struct.Report.html" title="struct iroh_net::netcheck::Report">Report</a>>>>></h4></section></summary><div class="docblock"><p>Get report with channel</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-Debug-for-Client" class="impl"><a class="src rightside" href="../../src/iroh_net/netcheck.rs.html#169">source</a><a href="#impl-Debug-for-Client" 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.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.fmt" class="method trait-impl"><a class="src rightside" href="../../src/iroh_net/netcheck.rs.html#169">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>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a><'_>) -> <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></div><h2 id="synthetic-implementations" class="section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor">§</a></h2><div id="synthetic-implementations-list"><section id="impl-Freeze-for-Client" class="impl"><a href="#impl-Freeze-for-Client" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Freeze.html" title="trait core::marker::Freeze">Freeze</a> for <a class="struct" href="struct.Client.html" title="struct iroh_net::netcheck::Client">Client</a></h3></section><section id="impl-RefUnwindSafe-for-Client" class="impl"><a href="#impl-RefUnwindSafe-for-Client" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.Client.html" title="struct iroh_net::netcheck::Client">Client</a></h3></section><section id="impl-Send-for-Client" class="impl"><a href="#impl-Send-for-Client" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.Client.html" title="struct iroh_net::netcheck::Client">Client</a></h3></section><section id="impl-Sync-for-Client" class="impl"><a href="#impl-Sync-for-Client" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.Client.html" title="struct iroh_net::netcheck::Client">Client</a></h3></section><section id="impl-Unpin-for-Client" class="impl"><a href="#impl-Unpin-for-Client" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.Client.html" title="struct iroh_net::netcheck::Client">Client</a></h3></section><section id="impl-UnwindSafe-for-Client" class="impl"><a href="#impl-UnwindSafe-for-Client" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.Client.html" title="struct iroh_net::netcheck::Client">Client</a></h3></section></div><h2 id="blanket-implementations" class="section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor">§</a></h2><div id="blanket-implementations-list"><details class="toggle implementors-toggle"><summary><section id="impl-Any-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#140">source</a><a href="#impl-Any-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T<div class="where">where
|
||||
T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#141">source</a><a href="#method.type_id" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fn">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></section></summary><div class='docblock'>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-AsTaggedExplicit%3C'a,+E%3E-for-T" class="impl"><a href="#impl-AsTaggedExplicit%3C'a,+E%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<'a, T, E> AsTaggedExplicit<'a, E> for T<div class="where">where
|
||||
|
||||
@@ -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><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>>,
|
||||
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><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>>,
|
||||
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><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>>,
|
||||
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><ProbeOutput>,
|
||||
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><<a class="struct" href="../../portmapper/struct.ProbeOutput.html" title="struct portmapper::ProbeOutput">ProbeOutput</a>>,
|
||||
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><<a class="struct" href="../struct.RelayUrl.html" title="struct iroh_net::RelayUrl">RelayUrl</a>>,
|
||||
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><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>></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><ProbeOutput></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><<a class="struct" href="../../portmapper/struct.ProbeOutput.html" title="struct portmapper::ProbeOutput">ProbeOutput</a>></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><<a class="struct" href="../struct.RelayUrl.html" title="struct iroh_net::RelayUrl">RelayUrl</a>></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>
|
||||
|
||||
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
@@ -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>−</span>]</button></span></div><pre class="rust item-decl"><code>pub async fn run_relay_server() -> <a class="type" href="https://docs.rs/anyhow/1.0.93/anyhow/type.Result.html" title="type anyhow::Result">Result</a><(<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)></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>−</span>]</button></span></div><pre class="rust item-decl"><code>pub async fn run_relay_server() -> <a class="type" href="https://docs.rs/anyhow/1.0.93/anyhow/type.Result.html" title="type anyhow::Result">Result</a><(<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>)></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 [<code>Server</code>] does will stop running.</p>
|
||||
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>
|
||||
</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>−</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><StunConfig>
|
||||
) -> <a class="type" href="https://docs.rs/anyhow/1.0.93/anyhow/type.Result.html" title="type anyhow::Result">Result</a><(<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)></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><<a class="struct" href="../../iroh_relay/server/struct.StunConfig.html" title="struct iroh_relay::server::StunConfig">StunConfig</a>>
|
||||
) -> <a class="type" href="https://docs.rs/anyhow/1.0.93/anyhow/type.Result.html" title="type anyhow::Result">Result</a><(<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>)></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,13 +1,13 @@
|
||||
<!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 ticket is a serializable object combining information required for an operation."><title>Ticket in iroh_net::ticket - 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 trait"><!--[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><h2 class="location"><a href="#">Ticket</a></h2><div class="sidebar-elems"><section><h3><a href="#required-associated-consts">Required Associated Constants</a></h3><ul class="block"><li><a href="#associatedconstant.KIND">KIND</a></li></ul><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.from_bytes">from_bytes</a></li><li><a href="#tymethod.to_bytes">to_bytes</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.deserialize">deserialize</a></li><li><a href="#method.serialize">serialize</a></li></ul><h3><a href="#object-safety">Object Safety</a></h3><h3><a href="#implementors">Implementors</a></h3></section><h2><a href="index.html">In iroh_net::ticket</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>Trait <a href="../index.html">iroh_net</a>::<wbr><a href="index.html">ticket</a>::<wbr><a class="trait" href="#">Ticket</a><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><span class="out-of-band"><button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div><pre class="rust item-decl"><code>pub trait Ticket: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> {
|
||||
<!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 ticket is a serializable object combining information required for an operation."><title>Ticket in iroh_net::ticket - 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 trait"><!--[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><h2 class="location"><a href="#">Ticket</a></h2><div class="sidebar-elems"><section><h3><a href="#required-associated-consts">Required Associated Constants</a></h3><ul class="block"><li><a href="#associatedconstant.KIND">KIND</a></li></ul><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.from_bytes">from_bytes</a></li><li><a href="#tymethod.to_bytes">to_bytes</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.deserialize">deserialize</a></li><li><a href="#method.serialize">serialize</a></li></ul><h3><a href="#object-safety">Object Safety</a></h3><h3><a href="#implementors">Implementors</a></h3></section><h2><a href="index.html">In iroh_net::ticket</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>Trait <a href="../index.html">iroh_net</a>::<wbr><a href="index.html">ticket</a>::<wbr><a class="trait" href="#">Ticket</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_base/ticket.rs.html#29">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div><pre class="rust item-decl"><code>pub trait Ticket: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> {
|
||||
const <a href="#associatedconstant.KIND" class="constant">KIND</a>: &'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>;
|
||||
|
||||
// Required methods
|
||||
fn <a href="#tymethod.to_bytes" class="fn">to_bytes</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>> <a href="#" class="tooltip" data-notable-ty="Vec<u8>">ⓘ</a>;
|
||||
<span class="item-spacer"></span> fn <a href="#tymethod.from_bytes" class="fn">from_bytes</a>(bytes: &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Error>;
|
||||
<span class="item-spacer"></span> fn <a href="#tymethod.from_bytes" class="fn">from_bytes</a>(bytes: &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, <a class="enum" href="../../iroh_base/ticket/enum.Error.html" title="enum iroh_base::ticket::Error">Error</a>>;
|
||||
|
||||
// Provided methods
|
||||
fn <a href="#method.serialize" class="fn">serialize</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a> { ... }
|
||||
<span class="item-spacer"></span> fn <a href="#method.deserialize" class="fn">deserialize</a>(str: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Error> { ... }
|
||||
<span class="item-spacer"></span> fn <a href="#method.deserialize" class="fn">deserialize</a>(str: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, <a class="enum" href="../../iroh_base/ticket/enum.Error.html" title="enum iroh_base::ticket::Error">Error</a>> { ... }
|
||||
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A ticket is a serializable object combining information required for an operation.</p>
|
||||
<p>Typically tickets contain all information required for an operation, e.g. an iroh blob
|
||||
ticket would contain the hash of the data as well as information about how to reach the
|
||||
@@ -18,10 +18,10 @@ ticket will be prepended to the string to make it somewhat self describing.</p>
|
||||
versioning, others might not.</p>
|
||||
<p>The serialization format for converting the ticket from and to bytes is left
|
||||
to the implementer. We recommend using <a href="https://docs.rs/postcard/latest/postcard/">postcard</a> for serialization.</p>
|
||||
</div></details><h2 id="required-associated-consts" class="section-header">Required Associated Constants<a href="#required-associated-consts" class="anchor">§</a></h2><div class="methods"><details class="toggle" open><summary><section id="associatedconstant.KIND" class="method"><h4 class="code-header">const <a href="#associatedconstant.KIND" class="constant">KIND</a>: &'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></h4></section></summary><div class="docblock"><p>String prefix describing the kind of iroh ticket.</p>
|
||||
</div></details><h2 id="required-associated-consts" class="section-header">Required Associated Constants<a href="#required-associated-consts" class="anchor">§</a></h2><div class="methods"><details class="toggle" open><summary><section id="associatedconstant.KIND" class="method"><a class="src rightside" href="../../src/iroh_base/ticket.rs.html#33">source</a><h4 class="code-header">const <a href="#associatedconstant.KIND" class="constant">KIND</a>: &'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></h4></section></summary><div class="docblock"><p>String prefix describing the kind of iroh ticket.</p>
|
||||
<p>This should be lower case ascii characters.</p>
|
||||
</div></details></div><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.to_bytes" class="method"><h4 class="code-header">fn <a href="#tymethod.to_bytes" class="fn">to_bytes</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>> <a href="#" class="tooltip" data-notable-ty="Vec<u8>">ⓘ</a></h4></section></summary><div class="docblock"><p>Serialize to bytes used in the base32 string representation.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.from_bytes" class="method"><h4 class="code-header">fn <a href="#tymethod.from_bytes" class="fn">from_bytes</a>(bytes: &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Error></h4></section></summary><div class="docblock"><p>Deserialize from the base32 string representation bytes.</p>
|
||||
</div></details></div><h2 id="provided-methods" class="section-header">Provided Methods<a href="#provided-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="method.serialize" class="method"><h4 class="code-header">fn <a href="#method.serialize" class="fn">serialize</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></h4></section></summary><div class="docblock"><p>Serialize to string.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.deserialize" class="method"><h4 class="code-header">fn <a href="#method.deserialize" class="fn">deserialize</a>(str: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Error></h4></section></summary><div class="docblock"><p>Deserialize from a string.</p>
|
||||
</div></details></div><h2 id="object-safety" class="section-header">Object Safety<a href="#object-safety" class="anchor">§</a></h2><div class="object-safety-info">This trait is <b>not</b> <a href="https://doc.rust-lang.org/nightly/reference/items/traits.html#object-safety">object safe</a>.</div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><details class="toggle implementors-toggle"><summary><section id="impl-Ticket-for-NodeTicket" class="impl"><a href="#impl-Ticket-for-NodeTicket" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Ticket.html" title="trait iroh_net::ticket::Ticket">Ticket</a> for <a class="struct" href="struct.NodeTicket.html" title="struct iroh_net::ticket::NodeTicket">NodeTicket</a></h3></section></summary><div class="impl-items"><section id="associatedconstant.KIND-1" class="associatedconstant trait-impl"><a href="#associatedconstant.KIND-1" class="anchor">§</a><h4 class="code-header">const <a href="#associatedconstant.KIND" class="constant">KIND</a>: &'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a> = "node"</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Ticket-for-BlobTicket" class="impl"><a href="#impl-Ticket-for-BlobTicket" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Ticket.html" title="trait iroh_net::ticket::Ticket">Ticket</a> for BlobTicket</h3></section></summary><div class="impl-items"><section id="associatedconstant.KIND-2" class="associatedconstant trait-impl"><a href="#associatedconstant.KIND-2" class="anchor">§</a><h4 class="code-header">const <a href="#associatedconstant.KIND" class="constant">KIND</a>: &'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a> = "blob"</h4></section></div></details></div><script src="../../trait.impl/iroh_base/ticket/trait.Ticket.js" data-ignore-extern-crates="iroh_base" async></script><script type="text/json" id="notable-traits-data">{"Vec<u8>":"<h3>Notable traits for <code><a class=\"struct\" href=\"https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html\" title=\"struct alloc::vec::Vec\">Vec</a><<a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.u8.html\">u8</a>, A></code></h3><pre><code><div class=\"where\">impl<A> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/io/trait.Write.html\" title=\"trait std::io::Write\">Write</a> for <a class=\"struct\" href=\"https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html\" title=\"struct alloc::vec::Vec\">Vec</a><<a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.u8.html\">u8</a>, A><div class=\"where\">where\n A: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/alloc/trait.Allocator.html\" title=\"trait core::alloc::Allocator\">Allocator</a>,</div></div>"}</script></section></div></main></body></html>
|
||||
</div></details></div><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.to_bytes" class="method"><a class="src rightside" href="../../src/iroh_base/ticket.rs.html#36">source</a><h4 class="code-header">fn <a href="#tymethod.to_bytes" class="fn">to_bytes</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>> <a href="#" class="tooltip" data-notable-ty="Vec<u8>">ⓘ</a></h4></section></summary><div class="docblock"><p>Serialize to bytes used in the base32 string representation.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.from_bytes" class="method"><a class="src rightside" href="../../src/iroh_base/ticket.rs.html#39">source</a><h4 class="code-header">fn <a href="#tymethod.from_bytes" class="fn">from_bytes</a>(bytes: &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, <a class="enum" href="../../iroh_base/ticket/enum.Error.html" title="enum iroh_base::ticket::Error">Error</a>></h4></section></summary><div class="docblock"><p>Deserialize from the base32 string representation bytes.</p>
|
||||
</div></details></div><h2 id="provided-methods" class="section-header">Provided Methods<a href="#provided-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="method.serialize" class="method"><a class="src rightside" href="../../src/iroh_base/ticket.rs.html#42">source</a><h4 class="code-header">fn <a href="#method.serialize" class="fn">serialize</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></h4></section></summary><div class="docblock"><p>Serialize to string.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.deserialize" class="method"><a class="src rightside" href="../../src/iroh_base/ticket.rs.html#49">source</a><h4 class="code-header">fn <a href="#method.deserialize" class="fn">deserialize</a>(str: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, <a class="enum" href="../../iroh_base/ticket/enum.Error.html" title="enum iroh_base::ticket::Error">Error</a>></h4></section></summary><div class="docblock"><p>Deserialize from a string.</p>
|
||||
</div></details></div><h2 id="object-safety" class="section-header">Object Safety<a href="#object-safety" class="anchor">§</a></h2><div class="object-safety-info">This trait is <b>not</b> <a href="https://doc.rust-lang.org/nightly/reference/items/traits.html#object-safety">object safe</a>.</div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><details class="toggle implementors-toggle"><summary><section id="impl-Ticket-for-BlobTicket" class="impl"><a class="src rightside" href="../../src/iroh_base/ticket/blob.rs.html#37">source</a><a href="#impl-Ticket-for-BlobTicket" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Ticket.html" title="trait iroh_net::ticket::Ticket">Ticket</a> for <a class="struct" href="../../iroh_base/ticket/blob/struct.BlobTicket.html" title="struct iroh_base::ticket::blob::BlobTicket">BlobTicket</a></h3></section></summary><div class="impl-items"><section id="associatedconstant.KIND-1" class="associatedconstant trait-impl"><a class="src rightside" href="../../src/iroh_base/ticket/blob.rs.html#38">source</a><a href="#associatedconstant.KIND-1" class="anchor">§</a><h4 class="code-header">const <a href="#associatedconstant.KIND" class="constant">KIND</a>: &'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a> = "blob"</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Ticket-for-NodeTicket" class="impl"><a class="src rightside" href="../../src/iroh_base/ticket/node.rs.html#42">source</a><a href="#impl-Ticket-for-NodeTicket" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Ticket.html" title="trait iroh_net::ticket::Ticket">Ticket</a> for <a class="struct" href="struct.NodeTicket.html" title="struct iroh_net::ticket::NodeTicket">NodeTicket</a></h3></section></summary><div class="impl-items"><section id="associatedconstant.KIND-2" class="associatedconstant trait-impl"><a class="src rightside" href="../../src/iroh_base/ticket/node.rs.html#43">source</a><a href="#associatedconstant.KIND-2" class="anchor">§</a><h4 class="code-header">const <a href="#associatedconstant.KIND" class="constant">KIND</a>: &'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a> = "node"</h4></section></div></details></div><script src="../../trait.impl/iroh_base/ticket/trait.Ticket.js" data-ignore-extern-crates="iroh_base" async></script><script type="text/json" id="notable-traits-data">{"Vec<u8>":"<h3>Notable traits for <code><a class=\"struct\" href=\"https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html\" title=\"struct alloc::vec::Vec\">Vec</a><<a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.u8.html\">u8</a>, A></code></h3><pre><code><div class=\"where\">impl<A> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/io/trait.Write.html\" title=\"trait std::io::Write\">Write</a> for <a class=\"struct\" href=\"https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html\" title=\"struct alloc::vec::Vec\">Vec</a><<a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.u8.html\">u8</a>, A><div class=\"where\">where\n A: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/alloc/trait.Allocator.html\" title=\"trait core::alloc::Allocator\">Allocator</a>,</div></div>"}</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="The identifier for a node in the (iroh) network."><title>NodeId in iroh_net - 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 type"><!--[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><h2 class="location"><a href="#">NodeId</a></h2><div class="sidebar-elems"><section><h3><a href="#aliased-type">Aliased type</a></h3></section><h2><a href="index.html">In crate iroh_net</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>Type Alias <a href="index.html">iroh_net</a>::<wbr><a class="type" href="#">NodeId</a><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><span class="out-of-band"><button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div><pre class="rust item-decl"><code>pub type NodeId = <a class="struct" href="key/struct.PublicKey.html" title="struct iroh_net::key::PublicKey">PublicKey</a>;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The identifier for a node in the (iroh) network.</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 identifier for a node in the (iroh) network."><title>NodeId in iroh_net - 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 type"><!--[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><h2 class="location"><a href="#">NodeId</a></h2><div class="sidebar-elems"><section><h3><a href="#aliased-type">Aliased type</a></h3></section><h2><a href="index.html">In crate iroh_net</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>Type Alias <a href="index.html">iroh_net</a>::<wbr><a class="type" href="#">NodeId</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_base/key.rs.html#107">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div><pre class="rust item-decl"><code>pub type NodeId = <a class="struct" href="key/struct.PublicKey.html" title="struct iroh_net::key::PublicKey">PublicKey</a>;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The identifier for a node in the (iroh) network.</p>
|
||||
<p>Each node in iroh has a unique identifier created as a cryptographic key. This can be
|
||||
used to globally identify a node. Since it is also a cryptographic key it is also the
|
||||
mechanism by which all traffic is always encrypted for a specific node only.</p>
|
||||
|
||||
File diff suppressed because one or more lines are too long
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="Handler for incoming connections."><title>ProtocolHandler in iroh_router - 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_router" 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 trait"><!--[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_router/index.html">iroh_router</a><span class="version">0.28.0</span></h2></div><h2 class="location"><a href="#">ProtocolHandler</a></h2><div class="sidebar-elems"><section><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.accept">accept</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.shutdown">shutdown</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><h2><a href="index.html">In crate iroh_router</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_router/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>Trait <a href="index.html">iroh_router</a>::<wbr><a class="trait" href="#">ProtocolHandler</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_router/protocol.rs.html#17-27">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div><pre class="rust item-decl"><code>pub trait ProtocolHandler: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + IntoArcAny + <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> + 'static {
|
||||
// Required method
|
||||
fn <a href="#tymethod.accept" class="fn">accept</a>(self: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><Self>, conn: <a class="struct" href="../iroh_net/endpoint/struct.Connecting.html" title="struct iroh_net::endpoint::Connecting">Connecting</a>) -> BoxedFuture<<a class="type" href="https://docs.rs/anyhow/1.0.93/anyhow/type.Result.html" title="type anyhow::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>>>;
|
||||
fn <a href="#tymethod.accept" class="fn">accept</a>(self: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><Self>, conn: Connecting) -> BoxedFuture<<a class="type" href="https://docs.rs/anyhow/1.0.93/anyhow/type.Result.html" title="type anyhow::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>>>;
|
||||
|
||||
// Provided method
|
||||
fn <a href="#method.shutdown" class="fn">shutdown</a>(self: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><Self>) -> BoxedFuture<<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>> { ... }
|
||||
@@ -10,7 +10,7 @@
|
||||
<p>Implement this trait on a struct that should handle incoming connections.
|
||||
The protocol handler must then be registered on the node for an ALPN protocol with
|
||||
<a href="struct.RouterBuilder.html#method.accept" title="method iroh_router::RouterBuilder::accept"><code>crate::RouterBuilder::accept</code></a>.</p>
|
||||
</div></details><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.accept" class="method"><a class="src rightside" href="../src/iroh_router/protocol.rs.html#21">source</a><h4 class="code-header">fn <a href="#tymethod.accept" class="fn">accept</a>(self: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><Self>, conn: <a class="struct" href="../iroh_net/endpoint/struct.Connecting.html" title="struct iroh_net::endpoint::Connecting">Connecting</a>) -> BoxedFuture<<a class="type" href="https://docs.rs/anyhow/1.0.93/anyhow/type.Result.html" title="type anyhow::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>>></h4></section></summary><div class="docblock"><p>Handle an incoming connection.</p>
|
||||
</div></details><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.accept" class="method"><a class="src rightside" href="../src/iroh_router/protocol.rs.html#21">source</a><h4 class="code-header">fn <a href="#tymethod.accept" class="fn">accept</a>(self: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><Self>, conn: Connecting) -> BoxedFuture<<a class="type" href="https://docs.rs/anyhow/1.0.93/anyhow/type.Result.html" title="type anyhow::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>>></h4></section></summary><div class="docblock"><p>Handle an incoming connection.</p>
|
||||
<p>This runs on a freshly spawned tokio task so this can be long-running.</p>
|
||||
</div></details></div><h2 id="provided-methods" class="section-header">Provided Methods<a href="#provided-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="method.shutdown" class="method"><a class="src rightside" href="../src/iroh_router/protocol.rs.html#24-26">source</a><h4 class="code-header">fn <a href="#method.shutdown" class="fn">shutdown</a>(self: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><Self>) -> BoxedFuture<<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></h4></section></summary><div class="docblock"><p>Called when the node shuts down.</p>
|
||||
</div></details></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"></div><script src="../trait.impl/iroh_router/protocol/trait.ProtocolHandler.js" async></script></section></div></main></body></html>
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
searchState.loadedDescShard("netwatch", 0, "Networking related utilities\nIp family selection between Ipv4 and Ipv6.\nWrapper around a tokio UDP socket that handles the fact …\nIpv4\nIpv6\nBind to the given port and listen on all interfaces.\nBind to any provided <code>SocketAddr</code>.\nBind to the given port only on localhost.\nBind only Ipv4 on localhost.\nBind only Ipv6 on localhost.\nBind only Ipv4 on any interface.\nBind only Ipv6 on any interface.\nCloses the socket, and waits for the underlying <code>libc::close</code>…\nTODO\nReturns the argument unchanged.\nReturns the argument unchanged.\nContains helpers for looking up system network interfaces.\nCalls <code>U::from(self)</code>.\nCalls <code>U::from(self)</code>.\nIP address related utilities.\nIs the socket broken and needs a rebind?\nReturns the matching localhost address.\nReturns the local address of this socket.\nMarks this socket as needing a rebind\nMonitoring of networking interfaces and route changes.\nRebind the underlying socket.\nTODO\nTODO\nTODO\nTODO\nReturns the matching default address.\nUse the socket\nThe details about a default route.\nLikely IPs of the residentla router, and the ip address of …\nRepresents a network interface.\nStructure of an IP network, either IPv4 or IPv6.\nIntended to store the state of the machine’s network …\nStructure of IPv4 Network.\nStructure of IPv6 Network.\nThe IP address of this structure.\nA list of all ip addresses of this interface.\nLike <code>DefaultRoutDetails::new</code> but only returns the …\nCreates a fake interface state for usage in tests.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nIp of the router.\nWhether the machine has some non-localhost, non-link-local …\nWhether this machine has an IPv6 Global or Unique Local …\nThe interface name. It’s like “eth0” (Linux), “…\nMaps from an interface name interface.\nCalls <code>U::from(self)</code>.\nCalls <code>U::from(self)</code>.\nCalls <code>U::from(self)</code>.\nCalls <code>U::from(self)</code>.\nCalls <code>U::from(self)</code>.\nOur local Ip if known.\nReturns the state of all the current machine’s network …\nReads the default route from the current system and …\nReturns the likely IP of the residential router, which …\nList of machine’s IP addresses.\nReturns the argument unchanged.\nCalls <code>U::from(self)</code>.\nReturns true if the address is a unicast address with …\nLoopback addresses.\nReturns the machine’s IP addresses. If there are no …\nRegular addresses.\nToken to remove a callback\nMonitors networking interface and route changes.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCalls <code>U::from(self)</code>.\nCalls <code>U::from(self)</code>.\nPotential change detected outside\nCreate a new monitor.\nSubscribe to network changes.\nUnsubscribe a callback from network changes, using the …")
|
||||
searchState.loadedDescShard("netwatch", 0, "Networking related utilities\nIp family selection between Ipv4 and Ipv6.\nWrapper around a tokio UDP socket that handles the fact …\nIpv4\nIpv6\nBind to the given port and listen on all interfaces.\nBind to any provided <code>SocketAddr</code>.\nBind to the given port only on localhost.\nBind only Ipv4 on localhost.\nBind only Ipv6 on localhost.\nBind only Ipv4 on any interface.\nBind only Ipv6 on any interface.\nCloses the socket, and waits for the underlying <code>libc::close</code>…\nTODO\nReturns the argument unchanged.\nReturns the argument unchanged.\nHandle potential read errors, updating internal state.\nHandle potential write errors, updating internal state.\nContains helpers for looking up system network interfaces.\nCalls <code>U::from(self)</code>.\nCalls <code>U::from(self)</code>.\nIP address related utilities.\nIs the socket broken and needs a rebind?\nReturns the matching localhost address.\nReturns the local address of this socket.\nMarks this socket as needing a rebind\nMonitoring of networking interfaces and route changes.\nPoll for writable\nRebind the underlying socket.\nTODO\nTODO\nTODO\nTODO\nReturns the matching default address.\nUse the socket\nThe details about a default route.\nLikely IPs of the residentla router, and the ip address of …\nRepresents a network interface.\nStructure of an IP network, either IPv4 or IPv6.\nIntended to store the state of the machine’s network …\nStructure of IPv4 Network.\nStructure of IPv6 Network.\nThe IP address of this structure.\nA list of all ip addresses of this interface.\nLike <code>DefaultRoutDetails::new</code> but only returns the …\nCreates a fake interface state for usage in tests.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nIp of the router.\nWhether the machine has some non-localhost, non-link-local …\nWhether this machine has an IPv6 Global or Unique Local …\nThe interface name. It’s like “eth0” (Linux), “…\nMaps from an interface name interface.\nCalls <code>U::from(self)</code>.\nCalls <code>U::from(self)</code>.\nCalls <code>U::from(self)</code>.\nCalls <code>U::from(self)</code>.\nCalls <code>U::from(self)</code>.\nOur local Ip if known.\nReturns the state of all the current machine’s network …\nReads the default route from the current system and …\nReturns the likely IP of the residential router, which …\nList of machine’s IP addresses.\nReturns the argument unchanged.\nCalls <code>U::from(self)</code>.\nReturns true if the address is a unicast address with …\nLoopback addresses.\nReturns the machine’s IP addresses. If there are no …\nRegular addresses.\nToken to remove a callback\nMonitors networking interface and route changes.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCalls <code>U::from(self)</code>.\nCalls <code>U::from(self)</code>.\nPotential change detected outside\nCreate a new monitor.\nSubscribe to network changes.\nUnsubscribe a callback from network changes, using the …")
|
||||
@@ -261,13 +261,72 @@
|
||||
<a href="#261" id="261">261</a>
|
||||
<a href="#262" id="262">262</a>
|
||||
<a href="#263" id="263">263</a>
|
||||
<a href="#264" id="264">264</a>
|
||||
<a href="#265" id="265">265</a>
|
||||
<a href="#266" id="266">266</a>
|
||||
<a href="#267" id="267">267</a>
|
||||
<a href="#268" id="268">268</a>
|
||||
<a href="#269" id="269">269</a>
|
||||
<a href="#270" id="270">270</a>
|
||||
<a href="#271" id="271">271</a>
|
||||
<a href="#272" id="272">272</a>
|
||||
<a href="#273" id="273">273</a>
|
||||
<a href="#274" id="274">274</a>
|
||||
<a href="#275" id="275">275</a>
|
||||
<a href="#276" id="276">276</a>
|
||||
<a href="#277" id="277">277</a>
|
||||
<a href="#278" id="278">278</a>
|
||||
<a href="#279" id="279">279</a>
|
||||
<a href="#280" id="280">280</a>
|
||||
<a href="#281" id="281">281</a>
|
||||
<a href="#282" id="282">282</a>
|
||||
<a href="#283" id="283">283</a>
|
||||
<a href="#284" id="284">284</a>
|
||||
<a href="#285" id="285">285</a>
|
||||
<a href="#286" id="286">286</a>
|
||||
<a href="#287" id="287">287</a>
|
||||
<a href="#288" id="288">288</a>
|
||||
<a href="#289" id="289">289</a>
|
||||
<a href="#290" id="290">290</a>
|
||||
<a href="#291" id="291">291</a>
|
||||
<a href="#292" id="292">292</a>
|
||||
<a href="#293" id="293">293</a>
|
||||
<a href="#294" id="294">294</a>
|
||||
<a href="#295" id="295">295</a>
|
||||
<a href="#296" id="296">296</a>
|
||||
<a href="#297" id="297">297</a>
|
||||
<a href="#298" id="298">298</a>
|
||||
<a href="#299" id="299">299</a>
|
||||
<a href="#300" id="300">300</a>
|
||||
<a href="#301" id="301">301</a>
|
||||
<a href="#302" id="302">302</a>
|
||||
<a href="#303" id="303">303</a>
|
||||
<a href="#304" id="304">304</a>
|
||||
<a href="#305" id="305">305</a>
|
||||
<a href="#306" id="306">306</a>
|
||||
<a href="#307" id="307">307</a>
|
||||
<a href="#308" id="308">308</a>
|
||||
<a href="#309" id="309">309</a>
|
||||
<a href="#310" id="310">310</a>
|
||||
<a href="#311" id="311">311</a>
|
||||
<a href="#312" id="312">312</a>
|
||||
<a href="#313" id="313">313</a>
|
||||
<a href="#314" id="314">314</a>
|
||||
<a href="#315" id="315">315</a>
|
||||
<a href="#316" id="316">316</a>
|
||||
<a href="#317" id="317">317</a>
|
||||
<a href="#318" id="318">318</a>
|
||||
<a href="#319" id="319">319</a>
|
||||
<a href="#320" id="320">320</a>
|
||||
<a href="#321" id="321">321</a>
|
||||
<a href="#322" id="322">322</a>
|
||||
</pre></div><pre class="rust"><code><span class="kw">use </span>std::{
|
||||
fmt::Debug,
|
||||
io,
|
||||
net::SocketAddr,
|
||||
pin::Pin,
|
||||
sync::Arc,
|
||||
task::{ready, Context, Poll},
|
||||
sync::{Arc, RwLock},
|
||||
task::{Context, Poll},
|
||||
};
|
||||
|
||||
<span class="kw">use </span>anyhow::{bail, Context <span class="kw">as _</span>};
|
||||
@@ -275,13 +334,13 @@
|
||||
<span class="kw">use </span>quinn::AsyncUdpSocket;
|
||||
<span class="kw">use </span>quinn_udp::{Transmit, UdpSockRef};
|
||||
<span class="kw">use </span>tokio::io::Interest;
|
||||
<span class="kw">use </span>tracing::{debug, trace};
|
||||
<span class="kw">use </span>tracing::{debug, trace, warn};
|
||||
|
||||
<span class="doccomment">/// A UDP socket implementing Quinn's [`AsyncUdpSocket`].
|
||||
</span><span class="attr">#[derive(Debug)]
|
||||
</span><span class="kw">pub struct </span>UdpConn {
|
||||
io: Arc<UdpSocket>,
|
||||
inner: quinn_udp::UdpSocketState,
|
||||
inner: RwLock<quinn_udp::UdpSocketState>,
|
||||
}
|
||||
|
||||
<span class="kw">impl </span>UdpConn {
|
||||
@@ -297,11 +356,11 @@
|
||||
|
||||
<span class="prelude-val">Ok</span>(<span class="self">Self </span>{
|
||||
io: Arc::new(sock),
|
||||
inner: state,
|
||||
inner: RwLock::new(state),
|
||||
})
|
||||
}
|
||||
|
||||
<span class="kw">pub</span>(<span class="kw">super</span>) <span class="kw">fn </span>rebind(<span class="kw-2">&mut </span><span class="self">self</span>) -> anyhow::Result<()> {
|
||||
<span class="kw">pub</span>(<span class="kw">super</span>) <span class="kw">fn </span>rebind(<span class="kw-2">&</span><span class="self">self</span>) -> anyhow::Result<()> {
|
||||
<span class="comment">// Rebind underlying socket
|
||||
</span><span class="self">self</span>.io.rebind()<span class="question-mark">?</span>;
|
||||
|
||||
@@ -309,7 +368,7 @@
|
||||
</span><span class="kw">let </span>new_state = <span class="self">self</span>.io.with_socket(|socket| {
|
||||
quinn_udp::UdpSocketState::new(quinn_udp::UdpSockRef::from(socket))
|
||||
})<span class="question-mark">?</span>;
|
||||
<span class="self">self</span>.inner = new_state;
|
||||
<span class="kw-2">*</span><span class="self">self</span>.inner.write().unwrap() = new_state;
|
||||
<span class="prelude-val">Ok</span>(())
|
||||
}
|
||||
|
||||
@@ -330,12 +389,38 @@
|
||||
}
|
||||
|
||||
<span class="kw">fn </span>try_send(<span class="kw-2">&</span><span class="self">self</span>, transmit: <span class="kw-2">&</span>Transmit<<span class="lifetime">'_</span>>) -> io::Result<()> {
|
||||
<span class="self">self</span>.io.try_io(Interest::WRITABLE, || {
|
||||
<span class="self">self</span>.io.with_socket(|io| {
|
||||
<span class="kw">let </span>sock_ref = UdpSockRef::from(io);
|
||||
<span class="self">self</span>.inner.send(sock_ref, transmit)
|
||||
})
|
||||
})
|
||||
<span class="kw">loop </span>{
|
||||
<span class="kw">if </span><span class="self">self</span>.io.is_broken() {
|
||||
<span class="kw">match </span><span class="self">self</span>.rebind() {
|
||||
<span class="prelude-val">Ok</span>(()) => {
|
||||
<span class="comment">// all good
|
||||
</span>}
|
||||
<span class="prelude-val">Err</span>(err) => {
|
||||
<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><span class="prelude-val">Err</span>(err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">let </span>res = <span class="self">self</span>.io.try_io(Interest::WRITABLE, || {
|
||||
<span class="self">self</span>.io.with_socket(|io| {
|
||||
<span class="kw">let </span>sock_ref = UdpSockRef::from(io);
|
||||
<span class="self">self</span>.inner.read().unwrap().send(sock_ref, transmit)
|
||||
})
|
||||
});
|
||||
<span class="kw">match </span>res {
|
||||
<span class="prelude-val">Ok</span>(()) => <span class="kw">return </span><span class="prelude-val">Ok</span>(()),
|
||||
<span class="prelude-val">Err</span>(err) => <span class="kw">match </span><span class="self">self</span>.io.handle_write_error(err) {
|
||||
<span class="prelude-val">Some</span>(err) => <span class="kw">return </span><span class="prelude-val">Err</span>(err),
|
||||
<span class="prelude-val">None </span>=> {
|
||||
<span class="kw">continue</span>;
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">fn </span>poll_recv(
|
||||
@@ -345,22 +430,55 @@
|
||||
meta: <span class="kw-2">&mut </span>[quinn_udp::RecvMeta],
|
||||
) -> Poll<io::Result<usize>> {
|
||||
<span class="kw">loop </span>{
|
||||
<span class="macro">ready!</span>(<span class="self">self</span>.io.with_socket(|io| io.poll_recv_ready(cx)))<span class="question-mark">?</span>;
|
||||
<span class="kw">if let </span><span class="prelude-val">Ok</span>(res) = <span class="self">self</span>.io.try_io(Interest::READABLE, || {
|
||||
<span class="self">self</span>.io
|
||||
.with_socket(|io| <span class="self">self</span>.inner.recv(io.into(), bufs, meta))
|
||||
}) {
|
||||
<span class="kw">for </span>meta <span class="kw">in </span>meta.iter().take(res) {
|
||||
<span class="macro">trace!</span>(
|
||||
src = %meta.addr,
|
||||
len = meta.len,
|
||||
count = meta.len / meta.stride,
|
||||
dst = %meta.dst_ip.map(|x| x.to_string()).unwrap_or_default(),
|
||||
<span class="string">"UDP recv"
|
||||
</span>);
|
||||
<span class="kw">if </span><span class="self">self</span>.io.is_broken() {
|
||||
<span class="kw">match </span><span class="self">self</span>.rebind() {
|
||||
<span class="prelude-val">Ok</span>(()) => {
|
||||
<span class="comment">// all good
|
||||
</span>}
|
||||
<span class="prelude-val">Err</span>(err) => {
|
||||
<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::NotConnected, err.to_string());
|
||||
<span class="kw">return </span>Poll::Ready(<span class="prelude-val">Err</span>(err));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">return </span>Poll::Ready(<span class="prelude-val">Ok</span>(res));
|
||||
<span class="kw">match </span><span class="self">self</span>.io.with_socket(|io| io.poll_recv_ready(cx)) {
|
||||
Poll::Pending => <span class="kw">return </span>Poll::Pending,
|
||||
Poll::Ready(<span class="prelude-val">Ok</span>(())) => {}
|
||||
Poll::Ready(<span class="prelude-val">Err</span>(err)) => <span class="kw">match </span><span class="self">self</span>.io.handle_read_error(err) {
|
||||
<span class="prelude-val">Some</span>(err) => <span class="kw">return </span>Poll::Ready(<span class="prelude-val">Err</span>(err)),
|
||||
<span class="prelude-val">None </span>=> {
|
||||
<span class="kw">continue</span>;
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
<span class="kw">let </span>res = <span class="self">self</span>.io.try_io(Interest::READABLE, || {
|
||||
<span class="self">self</span>.io
|
||||
.with_socket(|io| <span class="self">self</span>.inner.read().unwrap().recv(io.into(), bufs, meta))
|
||||
});
|
||||
<span class="kw">match </span>res {
|
||||
<span class="prelude-val">Ok</span>(count) => {
|
||||
<span class="kw">for </span>meta <span class="kw">in </span>meta.iter().take(count) {
|
||||
<span class="macro">trace!</span>(
|
||||
src = %meta.addr,
|
||||
len = meta.len,
|
||||
count = meta.len / meta.stride,
|
||||
dst = %meta.dst_ip.map(|x| x.to_string()).unwrap_or_default(),
|
||||
<span class="string">"UDP recv"
|
||||
</span>);
|
||||
}
|
||||
<span class="kw">return </span>Poll::Ready(<span class="prelude-val">Ok</span>(count));
|
||||
}
|
||||
<span class="prelude-val">Err</span>(err) => <span class="kw">match </span><span class="self">self</span>.io.handle_read_error(err) {
|
||||
<span class="prelude-val">Some</span>(err) => <span class="kw">return </span>Poll::Ready(<span class="prelude-val">Err</span>(err)),
|
||||
<span class="prelude-val">None </span>=> {
|
||||
<span class="kw">continue</span>;
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -370,15 +488,15 @@
|
||||
}
|
||||
|
||||
<span class="kw">fn </span>may_fragment(<span class="kw-2">&</span><span class="self">self</span>) -> bool {
|
||||
<span class="self">self</span>.inner.may_fragment()
|
||||
<span class="self">self</span>.inner.read().unwrap().may_fragment()
|
||||
}
|
||||
|
||||
<span class="kw">fn </span>max_transmit_segments(<span class="kw-2">&</span><span class="self">self</span>) -> usize {
|
||||
<span class="self">self</span>.inner.max_gso_segments()
|
||||
<span class="self">self</span>.inner.read().unwrap().max_gso_segments()
|
||||
}
|
||||
|
||||
<span class="kw">fn </span>max_receive_segments(<span class="kw-2">&</span><span class="self">self</span>) -> usize {
|
||||
<span class="self">self</span>.inner.gro_segments()
|
||||
<span class="self">self</span>.inner.read().unwrap().gro_segments()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -427,7 +545,7 @@
|
||||
|
||||
<span class="kw">impl </span>quinn::UdpPoller <span class="kw">for </span>IoPoller {
|
||||
<span class="kw">fn </span>poll_writable(<span class="self">self</span>: Pin<<span class="kw-2">&mut </span><span class="self">Self</span>>, cx: <span class="kw-2">&mut </span>Context) -> Poll<io::Result<()>> {
|
||||
<span class="self">self</span>.io.with_socket(|io| io.poll_send_ready(cx))
|
||||
<span class="self">self</span>.io.poll_writable(cx)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -673,6 +673,11 @@
|
||||
<a href="#673" id="673">673</a>
|
||||
<a href="#674" id="674">674</a>
|
||||
<a href="#675" id="675">675</a>
|
||||
<a href="#676" id="676">676</a>
|
||||
<a href="#677" id="677">677</a>
|
||||
<a href="#678" id="678">678</a>
|
||||
<a href="#679" id="679">679</a>
|
||||
<a href="#680" id="680">680</a>
|
||||
</pre></div><pre class="rust"><code><span class="kw">use </span>std::{
|
||||
future::Future,
|
||||
io::ErrorKind,
|
||||
@@ -885,7 +890,7 @@
|
||||
<span class="doccomment">/// Handle potential read errors, updating internal state.
|
||||
///
|
||||
/// Returns `Some(error)` if the error is fatal otherwise `None.
|
||||
</span><span class="kw">fn </span>handle_read_error(<span class="kw-2">&</span><span class="self">self</span>, error: std::io::Error) -> <span class="prelude-ty">Option</span><std::io::Error> {
|
||||
</span><span class="kw">pub fn </span>handle_read_error(<span class="kw-2">&</span><span class="self">self</span>, error: std::io::Error) -> <span class="prelude-ty">Option</span><std::io::Error> {
|
||||
<span class="kw">match </span>error.kind() {
|
||||
std::io::ErrorKind::NotConnected => {
|
||||
<span class="comment">// This indicates the underlying socket is broken, and we should attempt to rebind it
|
||||
@@ -899,7 +904,7 @@
|
||||
<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">&</span><span class="self">self</span>, error: std::io::Error) -> <span class="prelude-ty">Option</span><std::io::Error> {
|
||||
</span><span class="kw">pub fn </span>handle_write_error(<span class="kw-2">&</span><span class="self">self</span>, error: std::io::Error) -> <span class="prelude-ty">Option</span><std::io::Error> {
|
||||
<span class="kw">match </span>error.kind() {
|
||||
std::io::ErrorKind::BrokenPipe => {
|
||||
<span class="comment">// This indicates the underlying socket is broken, and we should attempt to rebind it
|
||||
@@ -909,6 +914,40 @@
|
||||
<span class="kw">_ </span>=> <span class="prelude-val">Some</span>(error),
|
||||
}
|
||||
}
|
||||
|
||||
<span class="doccomment">/// Poll for writable
|
||||
</span><span class="kw">pub fn </span>poll_writable(<span class="kw-2">&</span><span class="self">self</span>, cx: <span class="kw-2">&mut </span>std::task::Context<<span class="lifetime">'_</span>>) -> Poll<std::io::Result<()>> {
|
||||
<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>.is_broken() {
|
||||
<span class="kw">match </span><span class="self">self</span>.rebind() {
|
||||
<span class="prelude-val">Ok</span>(()) => {
|
||||
<span class="comment">// all good
|
||||
</span>}
|
||||
<span class="prelude-val">Err</span>(err) => {
|
||||
<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.read().unwrap();
|
||||
<span class="kw">let </span>socket = guard.as_ref().expect(<span class="string">"missing socket"</span>);
|
||||
|
||||
<span class="kw">match </span>socket.poll_send_ready(cx) {
|
||||
Poll::Pending => <span class="kw">return </span>Poll::Pending,
|
||||
Poll::Ready(<span class="prelude-val">Ok</span>(())) => <span class="kw">return </span>Poll::Ready(<span class="prelude-val">Ok</span>(())),
|
||||
Poll::Ready(<span class="prelude-val">Err</span>(err)) => {
|
||||
<span class="kw">if let </span><span class="prelude-val">Some</span>(err) = <span class="self">self</span>.handle_write_error(err) {
|
||||
<span class="kw">return </span>Poll::Ready(<span class="prelude-val">Err</span>(err));
|
||||
}
|
||||
<span class="kw">continue</span>;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
<span class="doccomment">/// Receive future
|
||||
@@ -1037,37 +1076,8 @@
|
||||
<span class="kw">impl </span>Future <span class="kw">for </span>WritableFut<<span class="lifetime">'_</span>> {
|
||||
<span class="kw">type </span>Output = std::io::Result<()>;
|
||||
|
||||
<span class="kw">fn </span>poll(<span class="self">self</span>: Pin<<span class="kw-2">&mut </span><span class="self">Self</span>>, c: <span class="kw-2">&mut </span>std::task::Context<<span class="lifetime">'_</span>>) -> Poll<<span class="self">Self</span>::Output> {
|
||||
<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>(()) => {
|
||||
<span class="comment">// all good
|
||||
</span>}
|
||||
<span class="prelude-val">Err</span>(err) => {
|
||||
<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>);
|
||||
|
||||
<span class="kw">match </span>socket.poll_send_ready(c) {
|
||||
Poll::Pending => <span class="kw">return </span>Poll::Pending,
|
||||
Poll::Ready(<span class="prelude-val">Ok</span>(())) => <span class="kw">return </span>Poll::Ready(<span class="prelude-val">Ok</span>(())),
|
||||
Poll::Ready(<span class="prelude-val">Err</span>(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>;
|
||||
}
|
||||
}
|
||||
}
|
||||
<span class="kw">fn </span>poll(<span class="self">self</span>: Pin<<span class="kw-2">&mut </span><span class="self">Self</span>>, cx: <span class="kw-2">&mut </span>std::task::Context<<span class="lifetime">'_</span>>) -> Poll<<span class="self">Self</span>::Output> {
|
||||
<span class="self">self</span>.socket.poll_writable(cx)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user