mirror of
https://github.com/n0-computer/iroh.git
synced 2026-11-30 08:01:44 +00:00
deploy: 9aec1d043c0bfac499cccc653496578fe001cac2
This commit is contained in:
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="The n0 testing DNS node origin, for production."><title>N0_DNS_NODE_ORIGIN_PROD in iroh::discovery::dns - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-6c3ea77c.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="iroh" data-themes="" data-resource-suffix="" data-rustdoc-version="1.87.0-nightly (f280acf4c 2025-02-19)" data-channel="nightly" data-search-js="search-f7327375.js" data-settings-js="settings-6dad6058.js" ><script src="../../../static.files/storage-3a5871a4.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../static.files/main-5332ae0c.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../iroh/index.html">iroh</a><span class="version">0.92.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In iroh::<wbr>discovery::<wbr>dns</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">iroh</a>::<wbr><a href="../index.html">discovery</a>::<wbr><a href="index.html">dns</a></div><h1>Constant <span class="constant">N0_DNS_NODE_ORIGIN_PROD</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/iroh_relay/dns.rs.html#27">Source</a> </span></div><pre class="rust item-decl"><code>pub const N0_DNS_NODE_ORIGIN_PROD: &'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>;</code></pre><span class="item-info"><div class="stab portability">Available on <strong>non-<code>wasm_browser</code></strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The n0 testing DNS node origin, for production.</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 n0 testing DNS node origin, for production."><title>N0_DNS_NODE_ORIGIN_PROD in iroh::discovery::dns - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-6c3ea77c.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="iroh" data-themes="" data-resource-suffix="" data-rustdoc-version="1.87.0-nightly (f280acf4c 2025-02-19)" data-channel="nightly" data-search-js="search-f7327375.js" data-settings-js="settings-6dad6058.js" ><script src="../../../static.files/storage-3a5871a4.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../static.files/main-5332ae0c.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../iroh/index.html">iroh</a><span class="version">0.92.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In iroh::<wbr>discovery::<wbr>dns</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">iroh</a>::<wbr><a href="../index.html">discovery</a>::<wbr><a href="index.html">dns</a></div><h1>Constant <span class="constant">N0_DNS_NODE_ORIGIN_PROD</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/iroh_relay/dns.rs.html#28">Source</a> </span></div><pre class="rust item-decl"><code>pub const N0_DNS_NODE_ORIGIN_PROD: &'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>;</code></pre><span class="item-info"><div class="stab portability">Available on <strong>non-<code>wasm_browser</code></strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The n0 testing DNS node origin, for production.</p>
|
||||
</div></details></section></div></main></body></html>
|
||||
@@ -1,2 +1,2 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="The n0 testing DNS node origin, for testing."><title>N0_DNS_NODE_ORIGIN_STAGING in iroh::discovery::dns - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-6c3ea77c.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="iroh" data-themes="" data-resource-suffix="" data-rustdoc-version="1.87.0-nightly (f280acf4c 2025-02-19)" data-channel="nightly" data-search-js="search-f7327375.js" data-settings-js="settings-6dad6058.js" ><script src="../../../static.files/storage-3a5871a4.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../static.files/main-5332ae0c.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../iroh/index.html">iroh</a><span class="version">0.92.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In iroh::<wbr>discovery::<wbr>dns</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">iroh</a>::<wbr><a href="../index.html">discovery</a>::<wbr><a href="index.html">dns</a></div><h1>Constant <span class="constant">N0_DNS_NODE_ORIGIN_STAGING</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/iroh_relay/dns.rs.html#29">Source</a> </span></div><pre class="rust item-decl"><code>pub const N0_DNS_NODE_ORIGIN_STAGING: &'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>;</code></pre><span class="item-info"><div class="stab portability">Available on <strong>non-<code>wasm_browser</code></strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The n0 testing DNS node origin, for testing.</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 n0 testing DNS node origin, for testing."><title>N0_DNS_NODE_ORIGIN_STAGING in iroh::discovery::dns - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-6c3ea77c.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="iroh" data-themes="" data-resource-suffix="" data-rustdoc-version="1.87.0-nightly (f280acf4c 2025-02-19)" data-channel="nightly" data-search-js="search-f7327375.js" data-settings-js="settings-6dad6058.js" ><script src="../../../static.files/storage-3a5871a4.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../static.files/main-5332ae0c.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../iroh/index.html">iroh</a><span class="version">0.92.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In iroh::<wbr>discovery::<wbr>dns</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">iroh</a>::<wbr><a href="../index.html">discovery</a>::<wbr><a href="index.html">dns</a></div><h1>Constant <span class="constant">N0_DNS_NODE_ORIGIN_STAGING</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/iroh_relay/dns.rs.html#30">Source</a> </span></div><pre class="rust item-decl"><code>pub const N0_DNS_NODE_ORIGIN_STAGING: &'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>;</code></pre><span class="item-info"><div class="stab portability">Available on <strong>non-<code>wasm_browser</code></strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The n0 testing DNS node origin, for testing.</p>
|
||||
</div></details></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
File diff suppressed because one or more lines are too long
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="The n0 testing DNS node origin, for production."><title>N0_DNS_NODE_ORIGIN_PROD in iroh::dns - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-6c3ea77c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh" data-themes="" data-resource-suffix="" data-rustdoc-version="1.87.0-nightly (f280acf4c 2025-02-19)" data-channel="nightly" data-search-js="search-f7327375.js" data-settings-js="settings-6dad6058.js" ><script src="../../static.files/storage-3a5871a4.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5332ae0c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../iroh/index.html">iroh</a><span class="version">0.92.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In iroh::<wbr>dns</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">iroh</a>::<wbr><a href="index.html">dns</a></div><h1>Constant <span class="constant">N0_DNS_NODE_ORIGIN_PROD</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/iroh_relay/dns.rs.html#27">Source</a> </span></div><pre class="rust item-decl"><code>pub const N0_DNS_NODE_ORIGIN_PROD: &'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>;</code></pre><span class="item-info"><div class="stab portability">Available on <strong>non-<code>wasm_browser</code></strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The n0 testing DNS node origin, for production.</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 n0 testing DNS node origin, for production."><title>N0_DNS_NODE_ORIGIN_PROD in iroh::dns - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-6c3ea77c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh" data-themes="" data-resource-suffix="" data-rustdoc-version="1.87.0-nightly (f280acf4c 2025-02-19)" data-channel="nightly" data-search-js="search-f7327375.js" data-settings-js="settings-6dad6058.js" ><script src="../../static.files/storage-3a5871a4.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5332ae0c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../iroh/index.html">iroh</a><span class="version">0.92.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In iroh::<wbr>dns</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">iroh</a>::<wbr><a href="index.html">dns</a></div><h1>Constant <span class="constant">N0_DNS_NODE_ORIGIN_PROD</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/iroh_relay/dns.rs.html#28">Source</a> </span></div><pre class="rust item-decl"><code>pub const N0_DNS_NODE_ORIGIN_PROD: &'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>;</code></pre><span class="item-info"><div class="stab portability">Available on <strong>non-<code>wasm_browser</code></strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The n0 testing DNS node origin, for production.</p>
|
||||
</div></details></section></div></main></body></html>
|
||||
@@ -1,2 +1,2 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="The n0 testing DNS node origin, for testing."><title>N0_DNS_NODE_ORIGIN_STAGING in iroh::dns - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-6c3ea77c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh" data-themes="" data-resource-suffix="" data-rustdoc-version="1.87.0-nightly (f280acf4c 2025-02-19)" data-channel="nightly" data-search-js="search-f7327375.js" data-settings-js="settings-6dad6058.js" ><script src="../../static.files/storage-3a5871a4.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5332ae0c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../iroh/index.html">iroh</a><span class="version">0.92.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In iroh::<wbr>dns</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">iroh</a>::<wbr><a href="index.html">dns</a></div><h1>Constant <span class="constant">N0_DNS_NODE_ORIGIN_STAGING</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/iroh_relay/dns.rs.html#29">Source</a> </span></div><pre class="rust item-decl"><code>pub const N0_DNS_NODE_ORIGIN_STAGING: &'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>;</code></pre><span class="item-info"><div class="stab portability">Available on <strong>non-<code>wasm_browser</code></strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The n0 testing DNS node origin, for testing.</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 n0 testing DNS node origin, for testing."><title>N0_DNS_NODE_ORIGIN_STAGING in iroh::dns - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-6c3ea77c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh" data-themes="" data-resource-suffix="" data-rustdoc-version="1.87.0-nightly (f280acf4c 2025-02-19)" data-channel="nightly" data-search-js="search-f7327375.js" data-settings-js="settings-6dad6058.js" ><script src="../../static.files/storage-3a5871a4.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5332ae0c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../iroh/index.html">iroh</a><span class="version">0.92.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In iroh::<wbr>dns</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">iroh</a>::<wbr><a href="index.html">dns</a></div><h1>Constant <span class="constant">N0_DNS_NODE_ORIGIN_STAGING</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/iroh_relay/dns.rs.html#30">Source</a> </span></div><pre class="rust item-decl"><code>pub const N0_DNS_NODE_ORIGIN_STAGING: &'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>;</code></pre><span class="item-info"><div class="stab portability">Available on <strong>non-<code>wasm_browser</code></strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The n0 testing DNS node origin, for testing.</p>
|
||||
</div></details></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="The DNS name for the iroh TXT record."><title>IROH_TXT_NAME in iroh::node_info - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-6c3ea77c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh" data-themes="" data-resource-suffix="" data-rustdoc-version="1.87.0-nightly (f280acf4c 2025-02-19)" data-channel="nightly" data-search-js="search-f7327375.js" data-settings-js="settings-6dad6058.js" ><script src="../../static.files/storage-3a5871a4.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5332ae0c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../iroh/index.html">iroh</a><span class="version">0.92.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In iroh::<wbr>node_<wbr>info</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">iroh</a>::<wbr><a href="index.html">node_info</a></div><h1>Constant <span class="constant">IROH_TXT_NAME</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/iroh_relay/node_info.rs.html#59">Source</a> </span></div><pre class="rust item-decl"><code>pub const IROH_TXT_NAME: &'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The DNS name for the iroh TXT record.</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 DNS name for the iroh TXT record."><title>IROH_TXT_NAME in iroh::node_info - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-6c3ea77c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh" data-themes="" data-resource-suffix="" data-rustdoc-version="1.87.0-nightly (f280acf4c 2025-02-19)" data-channel="nightly" data-search-js="search-f7327375.js" data-settings-js="settings-6dad6058.js" ><script src="../../static.files/storage-3a5871a4.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5332ae0c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../iroh/index.html">iroh</a><span class="version">0.92.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In iroh::<wbr>node_<wbr>info</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">iroh</a>::<wbr><a href="index.html">node_info</a></div><h1>Constant <span class="constant">IROH_TXT_NAME</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/iroh_relay/node_info.rs.html#49">Source</a> </span></div><pre class="rust item-decl"><code>pub const IROH_TXT_NAME: &'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The DNS name for the iroh TXT record.</p>
|
||||
</div></details></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
@@ -30,5 +30,5 @@ in <a href="https://www.rfc-editor.org/rfc/rfc1464">RFC1464</a>. The following
|
||||
Each address is an IPv4 or IPv6 address with a port.</p>
|
||||
</li>
|
||||
</ul>
|
||||
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.MaxLengthExceededError.html" title="struct iroh::node_info::MaxLengthExceededError">MaxLength<wbr>Exceeded<wbr>Error</a></dt><dd>Error returned when an input value is too long for <a href="../discovery/struct.UserData.html" title="struct iroh::discovery::UserData"><code>UserData</code></a>.</dd><dt><a class="struct" href="struct.NodeData.html" title="struct iroh::node_info::NodeData">Node<wbr>Data</a></dt><dd>Data about a node that may be published to and resolved from discovery services.</dd><dt><a class="struct" href="struct.NodeInfo.html" title="struct iroh::node_info::NodeInfo">Node<wbr>Info</a></dt><dd>Information about a node that may be published to and resolved from discovery services.</dd><dt><a class="struct" href="struct.UserData.html" title="struct iroh::node_info::UserData">User<wbr>Data</a></dt><dd>Under the hood this is a UTF-8 String is no longer than <a href="../discovery/struct.UserData.html#associatedconstant.MAX_LENGTH" title="associated constant iroh::discovery::UserData::MAX_LENGTH"><code>UserData::MAX_LENGTH</code></a> bytes.</dd></dl><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><dl class="item-table"><dt><a class="enum" href="enum.DecodingError.html" title="enum iroh::node_info::DecodingError">Decoding<wbr>Error</a></dt><dt><a class="enum" href="enum.EncodingError.html" title="enum iroh::node_info::EncodingError">Encoding<wbr>Error</a></dt><dt><a class="enum" href="enum.LookupError.html" title="enum iroh::node_info::LookupError">Lookup<wbr>Error</a><wbr><span class="stab portability" title="Available on non-`wasm_browser` only">Non-<code>wasm_browser</code></span></dt><dt><a class="enum" href="enum.ParseError.html" title="enum iroh::node_info::ParseError">Parse<wbr>Error</a></dt></dl><h2 id="constants" class="section-header">Constants<a href="#constants" class="anchor">§</a></h2><dl class="item-table"><dt><a class="constant" href="constant.IROH_TXT_NAME.html" title="constant iroh::node_info::IROH_TXT_NAME">IROH_<wbr>TXT_<wbr>NAME</a></dt><dd>The DNS name for the iroh TXT record.</dd></dl><h2 id="traits" class="section-header">Traits<a href="#traits" class="anchor">§</a></h2><dl class="item-table"><dt><a class="trait" href="trait.NodeIdExt.html" title="trait iroh::node_info::NodeIdExt">Node<wbr>IdExt</a></dt><dd>Extension methods for <a href="../type.NodeId.html" title="type iroh::NodeId"><code>NodeId</code></a> to encode to and decode from [<code>z32</code>],
|
||||
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.MaxLengthExceededError.html" title="struct iroh::node_info::MaxLengthExceededError">MaxLength<wbr>Exceeded<wbr>Error</a></dt><dd>Error returned when an input value is too long for <a href="../discovery/struct.UserData.html" title="struct iroh::discovery::UserData"><code>UserData</code></a>.</dd><dt><a class="struct" href="struct.NodeData.html" title="struct iroh::node_info::NodeData">Node<wbr>Data</a></dt><dd>Data about a node that may be published to and resolved from discovery services.</dd><dt><a class="struct" href="struct.NodeInfo.html" title="struct iroh::node_info::NodeInfo">Node<wbr>Info</a></dt><dd>Information about a node that may be published to and resolved from discovery services.</dd><dt><a class="struct" href="struct.UserData.html" title="struct iroh::node_info::UserData">User<wbr>Data</a></dt><dd>Under the hood this is a UTF-8 String is no longer than <a href="../discovery/struct.UserData.html#associatedconstant.MAX_LENGTH" title="associated constant iroh::discovery::UserData::MAX_LENGTH"><code>UserData::MAX_LENGTH</code></a> bytes.</dd></dl><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><dl class="item-table"><dt><a class="enum" href="enum.DecodingError.html" title="enum iroh::node_info::DecodingError">Decoding<wbr>Error</a></dt><dt><a class="enum" href="enum.EncodingError.html" title="enum iroh::node_info::EncodingError">Encoding<wbr>Error</a></dt><dt><a class="enum" href="enum.ParseError.html" title="enum iroh::node_info::ParseError">Parse<wbr>Error</a></dt></dl><h2 id="constants" class="section-header">Constants<a href="#constants" class="anchor">§</a></h2><dl class="item-table"><dt><a class="constant" href="constant.IROH_TXT_NAME.html" title="constant iroh::node_info::IROH_TXT_NAME">IROH_<wbr>TXT_<wbr>NAME</a></dt><dd>The DNS name for the iroh TXT record.</dd></dl><h2 id="traits" class="section-header">Traits<a href="#traits" class="anchor">§</a></h2><dl class="item-table"><dt><a class="trait" href="trait.NodeIdExt.html" title="trait iroh::node_info::NodeIdExt">Node<wbr>IdExt</a></dt><dd>Extension methods for <a href="../type.NodeId.html" title="type iroh::NodeId"><code>NodeId</code></a> to encode to and decode from [<code>z32</code>],
|
||||
which is the encoding used in [<code>pkarr</code>] domain names.</dd></dl></section></div></main></body></html>
|
||||
@@ -1 +1 @@
|
||||
window.SIDEBAR_ITEMS = {"constant":["IROH_TXT_NAME"],"enum":["DecodingError","EncodingError","LookupError","ParseError"],"struct":["MaxLengthExceededError","NodeData","NodeInfo","UserData"],"trait":["NodeIdExt"]};
|
||||
window.SIDEBAR_ITEMS = {"constant":["IROH_TXT_NAME"],"enum":["DecodingError","EncodingError","ParseError"],"struct":["MaxLengthExceededError","NodeData","NodeInfo","UserData"],"trait":["NodeIdExt"]};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,9 +1,9 @@
|
||||
<!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="Extension methods for `NodeId` to encode to and decode from `z32`, which is the encoding used in `pkarr` domain names."><title>NodeIdExt in iroh::node_info - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-6c3ea77c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh" data-themes="" data-resource-suffix="" data-rustdoc-version="1.87.0-nightly (f280acf4c 2025-02-19)" data-channel="nightly" data-search-js="search-f7327375.js" data-settings-js="settings-6dad6058.js" ><script src="../../static.files/storage-3a5871a4.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5332ae0c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc 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/index.html">iroh</a><span class="version">0.92.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Node<wbr>IdExt</a></h2><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.from_z32" title="from_z32">from_z32</a></li><li><a href="#tymethod.to_z32" title="to_z32">to_z32</a></li></ul><h3><a href="#dyn-compatibility">Dyn Compatibility</a></h3><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In iroh::<wbr>node_<wbr>info</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">iroh</a>::<wbr><a href="index.html">node_info</a></div><h1>Trait <span class="trait">NodeIdExt</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/iroh_relay/node_info.rs.html#99">Source</a> </span></div><pre class="rust item-decl"><code>pub trait NodeIdExt {
|
||||
<!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="Extension methods for `NodeId` to encode to and decode from `z32`, which is the encoding used in `pkarr` domain names."><title>NodeIdExt in iroh::node_info - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-6c3ea77c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh" data-themes="" data-resource-suffix="" data-rustdoc-version="1.87.0-nightly (f280acf4c 2025-02-19)" data-channel="nightly" data-search-js="search-f7327375.js" data-settings-js="settings-6dad6058.js" ><script src="../../static.files/storage-3a5871a4.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5332ae0c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc 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/index.html">iroh</a><span class="version">0.92.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Node<wbr>IdExt</a></h2><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.from_z32" title="from_z32">from_z32</a></li><li><a href="#tymethod.to_z32" title="to_z32">to_z32</a></li></ul><h3><a href="#dyn-compatibility">Dyn Compatibility</a></h3><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In iroh::<wbr>node_<wbr>info</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">iroh</a>::<wbr><a href="index.html">node_info</a></div><h1>Trait <span class="trait">NodeIdExt</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/iroh_relay/node_info.rs.html#89">Source</a> </span></div><pre class="rust item-decl"><code>pub trait NodeIdExt {
|
||||
// Required methods
|
||||
fn <a href="#tymethod.to_z32" class="fn">to_z32</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="#tymethod.from_z32" class="fn">from_z32</a>(s: &<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><<a class="struct" href="../struct.PublicKey.html" title="struct iroh::PublicKey">PublicKey</a>, <a class="enum" href="enum.DecodingError.html" title="enum iroh::node_info::DecodingError">DecodingError</a>>;
|
||||
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Extension methods for <a href="../type.NodeId.html" title="type iroh::NodeId"><code>NodeId</code></a> to encode to and decode from [<code>z32</code>],
|
||||
which is the encoding used in [<code>pkarr</code>] domain names.</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.to_z32" class="method"><a class="src rightside" href="../../src/iroh_relay/node_info.rs.html#103">Source</a><h4 class="code-header">fn <a href="#tymethod.to_z32" class="fn">to_z32</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>Encodes a <a href="../type.NodeId.html" title="type iroh::NodeId"><code>NodeId</code></a> in [<code>z-base-32</code>] encoding.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.from_z32" class="method"><a class="src rightside" href="../../src/iroh_relay/node_info.rs.html#108">Source</a><h4 class="code-header">fn <a href="#tymethod.from_z32" class="fn">from_z32</a>(s: &<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><<a class="struct" href="../struct.PublicKey.html" title="struct iroh::PublicKey">PublicKey</a>, <a class="enum" href="enum.DecodingError.html" title="enum iroh::node_info::DecodingError">DecodingError</a>></h4></section></summary><div class="docblock"><p>Parses a <a href="../type.NodeId.html" title="type iroh::NodeId"><code>NodeId</code></a> from [<code>z-base-32</code>] encoding.</p>
|
||||
</div></details></div><h2 id="dyn-compatibility" class="section-header">Dyn Compatibility<a href="#dyn-compatibility" class="anchor">§</a></h2><div class="dyn-compatibility-info"><p>This trait is <b>not</b> <a href="https://doc.rust-lang.org/nightly/reference/items/traits.html#dyn-compatibility">dyn compatible</a>.</p><p><i>In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.</i></p></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-NodeIdExt-for-PublicKey" class="impl"><a class="src rightside" href="../../src/iroh_relay/node_info.rs.html#111">Source</a><a href="#impl-NodeIdExt-for-PublicKey" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.NodeIdExt.html" title="trait iroh::node_info::NodeIdExt">NodeIdExt</a> for <a class="struct" href="../struct.PublicKey.html" title="struct iroh::PublicKey">PublicKey</a></h3></section></div><script src="../../trait.impl/iroh_relay/node_info/trait.NodeIdExt.js" data-ignore-extern-crates="iroh_base" async></script></section></div></main></body></html>
|
||||
</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.to_z32" class="method"><a class="src rightside" href="../../src/iroh_relay/node_info.rs.html#93">Source</a><h4 class="code-header">fn <a href="#tymethod.to_z32" class="fn">to_z32</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>Encodes a <a href="../type.NodeId.html" title="type iroh::NodeId"><code>NodeId</code></a> in [<code>z-base-32</code>] encoding.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.from_z32" class="method"><a class="src rightside" href="../../src/iroh_relay/node_info.rs.html#98">Source</a><h4 class="code-header">fn <a href="#tymethod.from_z32" class="fn">from_z32</a>(s: &<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><<a class="struct" href="../struct.PublicKey.html" title="struct iroh::PublicKey">PublicKey</a>, <a class="enum" href="enum.DecodingError.html" title="enum iroh::node_info::DecodingError">DecodingError</a>></h4></section></summary><div class="docblock"><p>Parses a <a href="../type.NodeId.html" title="type iroh::NodeId"><code>NodeId</code></a> from [<code>z-base-32</code>] encoding.</p>
|
||||
</div></details></div><h2 id="dyn-compatibility" class="section-header">Dyn Compatibility<a href="#dyn-compatibility" class="anchor">§</a></h2><div class="dyn-compatibility-info"><p>This trait is <b>not</b> <a href="https://doc.rust-lang.org/nightly/reference/items/traits.html#dyn-compatibility">dyn compatible</a>.</p><p><i>In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.</i></p></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-NodeIdExt-for-PublicKey" class="impl"><a class="src rightside" href="../../src/iroh_relay/node_info.rs.html#101">Source</a><a href="#impl-NodeIdExt-for-PublicKey" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.NodeIdExt.html" title="trait iroh::node_info::NodeIdExt">NodeIdExt</a> for <a class="struct" href="../struct.PublicKey.html" title="struct iroh::PublicKey">PublicKey</a></h3></section></div><script src="../../trait.impl/iroh_relay/node_info/trait.NodeIdExt.js" data-ignore-extern-crates="iroh_base" async></script></section></div></main></body></html>
|
||||
File diff suppressed because one or more lines are too long
@@ -109,7 +109,7 @@ indices from <code>[N - M, N)</code> (excluding the index <code>N</code> itself)
|
||||
</div><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Err" class="associatedtype trait-impl"><a class="src rightside" href="../src/iroh_base/key.rs.html#232">Source</a><a href="#associatedtype.Err" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html#associatedtype.Err" class="associatedtype">Err</a> = <a class="enum" href="enum.KeyParsingError.html" title="enum iroh::KeyParsingError">KeyParsingError</a></h4></section></summary><div class='docblock'>The associated error which can be returned from parsing.</div></details><details class="toggle method-toggle" open><summary><section id="method.from_str" class="method trait-impl"><a class="src rightside" href="../src/iroh_base/key.rs.html#234">Source</a><a href="#method.from_str" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html#tymethod.from_str" class="fn">from_str</a>(s: &<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><<a class="struct" href="struct.PublicKey.html" title="struct iroh::PublicKey">PublicKey</a>, <<a class="struct" href="struct.PublicKey.html" title="struct iroh::PublicKey">PublicKey</a> as <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html" title="trait core::str::traits::FromStr">FromStr</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html#associatedtype.Err" title="type core::str::traits::FromStr::Err">Err</a>></h4></section></summary><div class='docblock'>Parses a string <code>s</code> to return a value of this type. <a href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html#tymethod.from_str">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Hash-for-PublicKey" class="impl"><a class="src rightside" href="../src/iroh_base/key.rs.html#68">Source</a><a href="#impl-Hash-for-PublicKey" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> for <a class="struct" href="struct.PublicKey.html" title="struct iroh::PublicKey">PublicKey</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.hash" class="method trait-impl"><a class="src rightside" href="../src/iroh_base/key.rs.html#69">Source</a><a href="#method.hash" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash" class="fn">hash</a><H>(&self, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut H</a>)<div class="where">where
|
||||
H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>,</div></h4></section></summary><div class='docblock'>Feeds this value into the given <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher"><code>Hasher</code></a>. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.hash_slice" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.3.0">1.3.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/hash/mod.rs.html#235-237">Source</a></span><a href="#method.hash_slice" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice" class="fn">hash_slice</a><H>(data: &[Self], state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut H</a>)<div class="where">where
|
||||
H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>,
|
||||
Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class='docblock'>Feeds a slice of this type into the given <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher"><code>Hasher</code></a>. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-NodeIdExt-for-PublicKey" class="impl"><a class="src rightside" href="../src/iroh_relay/node_info.rs.html#111">Source</a><a href="#impl-NodeIdExt-for-PublicKey" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="node_info/trait.NodeIdExt.html" title="trait iroh::node_info::NodeIdExt">NodeIdExt</a> for <a class="struct" href="struct.PublicKey.html" title="struct iroh::PublicKey">PublicKey</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.to_z32" class="method trait-impl"><a class="src rightside" href="../src/iroh_relay/node_info.rs.html#112">Source</a><a href="#method.to_z32" class="anchor">§</a><h4 class="code-header">fn <a href="node_info/trait.NodeIdExt.html#tymethod.to_z32" class="fn">to_z32</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'>Encodes a <a href="type.NodeId.html" title="type iroh::NodeId"><code>NodeId</code></a> in [<code>z-base-32</code>] encoding.</div></details><details class="toggle method-toggle" open><summary><section id="method.from_z32" class="method trait-impl"><a class="src rightside" href="../src/iroh_relay/node_info.rs.html#116">Source</a><a href="#method.from_z32" class="anchor">§</a><h4 class="code-header">fn <a href="node_info/trait.NodeIdExt.html#tymethod.from_z32" class="fn">from_z32</a>(s: &<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><<a class="struct" href="struct.PublicKey.html" title="struct iroh::PublicKey">PublicKey</a>, <a class="enum" href="node_info/enum.DecodingError.html" title="enum iroh::node_info::DecodingError">DecodingError</a>></h4></section></summary><div class='docblock'>Parses a <a href="type.NodeId.html" title="type iroh::NodeId"><code>NodeId</code></a> from [<code>z-base-32</code>] encoding.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Ord-for-PublicKey" class="impl"><a class="src rightside" href="../src/iroh_base/key.rs.html#48">Source</a><a href="#impl-Ord-for-PublicKey" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> for <a class="struct" href="struct.PublicKey.html" title="struct iroh::PublicKey">PublicKey</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.cmp" class="method trait-impl"><a class="src rightside" href="../src/iroh_base/key.rs.html#49">Source</a><a href="#method.cmp" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp" class="fn">cmp</a>(&self, other: &<a class="struct" href="struct.PublicKey.html" title="struct iroh::PublicKey">PublicKey</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a></h4></section></summary><div class='docblock'>This method returns an <a href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering"><code>Ordering</code></a> between <code>self</code> and <code>other</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.max" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.21.0">1.21.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#998-1000">Source</a></span><a href="#method.max" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max" class="fn">max</a>(self, other: Self) -> Self<div class="where">where
|
||||
Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class='docblock'>Feeds a slice of this type into the given <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher"><code>Hasher</code></a>. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-NodeIdExt-for-PublicKey" class="impl"><a class="src rightside" href="../src/iroh_relay/node_info.rs.html#101">Source</a><a href="#impl-NodeIdExt-for-PublicKey" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="node_info/trait.NodeIdExt.html" title="trait iroh::node_info::NodeIdExt">NodeIdExt</a> for <a class="struct" href="struct.PublicKey.html" title="struct iroh::PublicKey">PublicKey</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.to_z32" class="method trait-impl"><a class="src rightside" href="../src/iroh_relay/node_info.rs.html#102">Source</a><a href="#method.to_z32" class="anchor">§</a><h4 class="code-header">fn <a href="node_info/trait.NodeIdExt.html#tymethod.to_z32" class="fn">to_z32</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'>Encodes a <a href="type.NodeId.html" title="type iroh::NodeId"><code>NodeId</code></a> in [<code>z-base-32</code>] encoding.</div></details><details class="toggle method-toggle" open><summary><section id="method.from_z32" class="method trait-impl"><a class="src rightside" href="../src/iroh_relay/node_info.rs.html#106">Source</a><a href="#method.from_z32" class="anchor">§</a><h4 class="code-header">fn <a href="node_info/trait.NodeIdExt.html#tymethod.from_z32" class="fn">from_z32</a>(s: &<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><<a class="struct" href="struct.PublicKey.html" title="struct iroh::PublicKey">PublicKey</a>, <a class="enum" href="node_info/enum.DecodingError.html" title="enum iroh::node_info::DecodingError">DecodingError</a>></h4></section></summary><div class='docblock'>Parses a <a href="type.NodeId.html" title="type iroh::NodeId"><code>NodeId</code></a> from [<code>z-base-32</code>] encoding.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Ord-for-PublicKey" class="impl"><a class="src rightside" href="../src/iroh_base/key.rs.html#48">Source</a><a href="#impl-Ord-for-PublicKey" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> for <a class="struct" href="struct.PublicKey.html" title="struct iroh::PublicKey">PublicKey</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.cmp" class="method trait-impl"><a class="src rightside" href="../src/iroh_base/key.rs.html#49">Source</a><a href="#method.cmp" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp" class="fn">cmp</a>(&self, other: &<a class="struct" href="struct.PublicKey.html" title="struct iroh::PublicKey">PublicKey</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a></h4></section></summary><div class='docblock'>This method returns an <a href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering"><code>Ordering</code></a> between <code>self</code> and <code>other</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.max" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.21.0">1.21.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#998-1000">Source</a></span><a href="#method.max" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max" class="fn">max</a>(self, other: Self) -> Self<div class="where">where
|
||||
Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class='docblock'>Compares and returns the maximum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.min" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.21.0">1.21.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#1037-1039">Source</a></span><a href="#method.min" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min" class="fn">min</a>(self, other: Self) -> Self<div class="where">where
|
||||
Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class='docblock'>Compares and returns the minimum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.clamp" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.50.0">1.50.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#1063-1065">Source</a></span><a href="#method.clamp" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp" class="fn">clamp</a>(self, min: Self, max: Self) -> Self<div class="where">where
|
||||
Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class='docblock'>Restrict a value to a certain interval. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-PartialEq-for-PublicKey" class="impl"><a class="src rightside" href="../src/iroh_base/key.rs.html#24">Source</a><a href="#impl-PartialEq-for-PublicKey" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a> for <a class="struct" href="struct.PublicKey.html" title="struct iroh::PublicKey">PublicKey</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.eq" class="method trait-impl"><a class="src rightside" href="../src/iroh_base/key.rs.html#24">Source</a><a href="#method.eq" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq" class="fn">eq</a>(&self, other: &<a class="struct" href="struct.PublicKey.html" title="struct iroh::PublicKey">PublicKey</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>.</div></details><details class="toggle method-toggle" open><summary><section id="method.ne" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#261">Source</a></span><a href="#method.ne" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne" class="fn">ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&Rhs</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>!=</code>. The default implementation is almost always sufficient,
|
||||
|
||||
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="The n0 testing DNS node origin, for production."><title>N0_DNS_NODE_ORIGIN_PROD in iroh_relay::dns - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-6c3ea77c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh_relay" data-themes="" data-resource-suffix="" data-rustdoc-version="1.87.0-nightly (f280acf4c 2025-02-19)" data-channel="nightly" data-search-js="search-f7327375.js" data-settings-js="settings-6dad6058.js" ><script src="../../static.files/storage-3a5871a4.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5332ae0c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../iroh_relay/index.html">iroh_<wbr>relay</a><span class="version">0.92.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In iroh_<wbr>relay::<wbr>dns</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">iroh_relay</a>::<wbr><a href="index.html">dns</a></div><h1>Constant <span class="constant">N0_DNS_NODE_ORIGIN_PROD</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/iroh_relay/dns.rs.html#27">Source</a> </span></div><pre class="rust item-decl"><code>pub const N0_DNS_NODE_ORIGIN_PROD: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a> = "dns.iroh.link";</code></pre><span class="item-info"><div class="stab portability">Available on <strong>non-<code>wasm_browser</code></strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The n0 testing DNS node origin, for production.</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 n0 testing DNS node origin, for production."><title>N0_DNS_NODE_ORIGIN_PROD in iroh_relay::dns - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-6c3ea77c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh_relay" data-themes="" data-resource-suffix="" data-rustdoc-version="1.87.0-nightly (f280acf4c 2025-02-19)" data-channel="nightly" data-search-js="search-f7327375.js" data-settings-js="settings-6dad6058.js" ><script src="../../static.files/storage-3a5871a4.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5332ae0c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../iroh_relay/index.html">iroh_<wbr>relay</a><span class="version">0.92.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In iroh_<wbr>relay::<wbr>dns</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">iroh_relay</a>::<wbr><a href="index.html">dns</a></div><h1>Constant <span class="constant">N0_DNS_NODE_ORIGIN_PROD</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/iroh_relay/dns.rs.html#28">Source</a> </span></div><pre class="rust item-decl"><code>pub const N0_DNS_NODE_ORIGIN_PROD: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a> = "dns.iroh.link";</code></pre><span class="item-info"><div class="stab portability">Available on <strong>non-<code>wasm_browser</code></strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The n0 testing DNS node origin, for production.</p>
|
||||
</div></details></section></div></main></body></html>
|
||||
@@ -1,2 +1,2 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="The n0 testing DNS node origin, for testing."><title>N0_DNS_NODE_ORIGIN_STAGING in iroh_relay::dns - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-6c3ea77c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh_relay" data-themes="" data-resource-suffix="" data-rustdoc-version="1.87.0-nightly (f280acf4c 2025-02-19)" data-channel="nightly" data-search-js="search-f7327375.js" data-settings-js="settings-6dad6058.js" ><script src="../../static.files/storage-3a5871a4.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5332ae0c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../iroh_relay/index.html">iroh_<wbr>relay</a><span class="version">0.92.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In iroh_<wbr>relay::<wbr>dns</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">iroh_relay</a>::<wbr><a href="index.html">dns</a></div><h1>Constant <span class="constant">N0_DNS_NODE_ORIGIN_STAGING</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/iroh_relay/dns.rs.html#29">Source</a> </span></div><pre class="rust item-decl"><code>pub const N0_DNS_NODE_ORIGIN_STAGING: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a> = "staging-dns.iroh.link";</code></pre><span class="item-info"><div class="stab portability">Available on <strong>non-<code>wasm_browser</code></strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The n0 testing DNS node origin, for testing.</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 n0 testing DNS node origin, for testing."><title>N0_DNS_NODE_ORIGIN_STAGING in iroh_relay::dns - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-6c3ea77c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh_relay" data-themes="" data-resource-suffix="" data-rustdoc-version="1.87.0-nightly (f280acf4c 2025-02-19)" data-channel="nightly" data-search-js="search-f7327375.js" data-settings-js="settings-6dad6058.js" ><script src="../../static.files/storage-3a5871a4.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5332ae0c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../iroh_relay/index.html">iroh_<wbr>relay</a><span class="version">0.92.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In iroh_<wbr>relay::<wbr>dns</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">iroh_relay</a>::<wbr><a href="index.html">dns</a></div><h1>Constant <span class="constant">N0_DNS_NODE_ORIGIN_STAGING</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/iroh_relay/dns.rs.html#30">Source</a> </span></div><pre class="rust item-decl"><code>pub const N0_DNS_NODE_ORIGIN_STAGING: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a> = "staging-dns.iroh.link";</code></pre><span class="item-info"><div class="stab portability">Available on <strong>non-<code>wasm_browser</code></strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The n0 testing DNS node origin, for testing.</p>
|
||||
</div></details></section></div></main></body></html>
|
||||
File diff suppressed because one or more lines are too long
+6
-14
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="DNS resolver"><title>iroh_relay::dns - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-6c3ea77c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh_relay" data-themes="" data-resource-suffix="" data-rustdoc-version="1.87.0-nightly (f280acf4c 2025-02-19)" data-channel="nightly" data-search-js="search-f7327375.js" data-settings-js="settings-6dad6058.js" ><script src="../../static.files/storage-3a5871a4.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-5332ae0c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../iroh_relay/index.html">iroh_<wbr>relay</a><span class="version">0.92.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module dns</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#enums" title="Enums">Enums</a></li><li><a href="#constants" title="Constants">Constants</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate iroh_<wbr>relay</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">iroh_relay</a></div><h1>Module <span>dns</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/iroh_relay/dns.rs.html#1-593">Source</a> </span></div><span class="item-info"><div class="stab portability">Available on <strong>non-<code>wasm_browser</code></strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>DNS resolver</p>
|
||||
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.DnsResolver.html" title="struct iroh_relay::dns::DnsResolver">DnsResolver</a></dt><dd>The DNS resolver used throughout <code>iroh</code>.</dd><dt><a class="struct" href="struct.StaggeredError.html" title="struct iroh_relay::dns::StaggeredError">Staggered<wbr>Error</a></dt><dd>Error returned when an input value is too long for <a href="../node_info/struct.UserData.html" title="struct iroh_relay::node_info::UserData"><code>crate::node_info::UserData</code></a>.</dd><dt><a class="struct" href="struct.TXT.html" title="struct iroh_relay::dns::TXT">TXT</a></dt><dd>Record data for a TXT record</dd><dt><a class="struct" href="struct.TxtLookup.html" title="struct iroh_relay::dns::TxtLookup">TxtLookup</a></dt><dd>TXT records returned from <a href="struct.DnsResolver.html#method.lookup_txt" title="method iroh_relay::dns::DnsResolver::lookup_txt"><code>DnsResolver::lookup_txt</code></a></dd></dl><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><dl class="item-table"><dt><a class="enum" href="enum.DnsError.html" title="enum iroh_relay::dns::DnsError">DnsError</a></dt><dd>Potential errors related to dns.</dd></dl><h2 id="constants" class="section-header">Constants<a href="#constants" class="anchor">§</a></h2><dl class="item-table"><dt><a class="constant" href="constant.N0_DNS_NODE_ORIGIN_PROD.html" title="constant iroh_relay::dns::N0_DNS_NODE_ORIGIN_PROD">N0_<wbr>DNS_<wbr>NODE_<wbr>ORIGIN_<wbr>PROD</a></dt><dd>The n0 testing DNS node origin, for production.</dd><dt><a class="constant" href="constant.N0_DNS_NODE_ORIGIN_STAGING.html" title="constant iroh_relay::dns::N0_DNS_NODE_ORIGIN_STAGING">N0_<wbr>DNS_<wbr>NODE_<wbr>ORIGIN_<wbr>STAGING</a></dt><dd>The n0 testing DNS node origin, for testing.</dd></dl></section></div></main></body></html>
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="DNS resolver"><title>iroh_relay::dns - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-6c3ea77c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh_relay" data-themes="" data-resource-suffix="" data-rustdoc-version="1.87.0-nightly (f280acf4c 2025-02-19)" data-channel="nightly" data-search-js="search-f7327375.js" data-settings-js="settings-6dad6058.js" ><script src="../../static.files/storage-3a5871a4.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-5332ae0c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../iroh_relay/index.html">iroh_<wbr>relay</a><span class="version">0.92.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module dns</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#enums" title="Enums">Enums</a></li><li><a href="#constants" title="Constants">Constants</a></li><li><a href="#traits" title="Traits">Traits</a></li><li><a href="#types" title="Type Aliases">Type Aliases</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate iroh_<wbr>relay</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">iroh_relay</a></div><h1>Module <span>dns</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/iroh_relay/dns.rs.html#1-827">Source</a> </span></div><span class="item-info"><div class="stab portability">Available on <strong>non-<code>wasm_browser</code></strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>DNS resolver</p>
|
||||
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.DnsResolver.html" title="struct iroh_relay::dns::DnsResolver">DnsResolver</a></dt><dd>The DNS resolver used throughout <code>iroh</code>.</dd><dt><a class="struct" href="struct.StaggeredError.html" title="struct iroh_relay::dns::StaggeredError">Staggered<wbr>Error</a></dt><dd>Error returned when an input value is too long for <a href="../node_info/struct.UserData.html" title="struct iroh_relay::node_info::UserData"><code>crate::node_info::UserData</code></a>.</dd><dt><a class="struct" href="struct.TxtRecordData.html" title="struct iroh_relay::dns::TxtRecordData">TxtRecord<wbr>Data</a></dt><dd>Record data for a TXT record.</dd></dl><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><dl class="item-table"><dt><a class="enum" href="enum.DnsError.html" title="enum iroh_relay::dns::DnsError">DnsError</a></dt><dd>Potential errors related to dns.</dd><dt><a class="enum" href="enum.LookupError.html" title="enum iroh_relay::dns::LookupError">Lookup<wbr>Error</a></dt></dl><h2 id="constants" class="section-header">Constants<a href="#constants" class="anchor">§</a></h2><dl class="item-table"><dt><a class="constant" href="constant.N0_DNS_NODE_ORIGIN_PROD.html" title="constant iroh_relay::dns::N0_DNS_NODE_ORIGIN_PROD">N0_<wbr>DNS_<wbr>NODE_<wbr>ORIGIN_<wbr>PROD</a></dt><dd>The n0 testing DNS node origin, for production.</dd><dt><a class="constant" href="constant.N0_DNS_NODE_ORIGIN_STAGING.html" title="constant iroh_relay::dns::N0_DNS_NODE_ORIGIN_STAGING">N0_<wbr>DNS_<wbr>NODE_<wbr>ORIGIN_<wbr>STAGING</a></dt><dd>The n0 testing DNS node origin, for testing.</dd></dl><h2 id="traits" class="section-header">Traits<a href="#traits" class="anchor">§</a></h2><dl class="item-table"><dt><a class="trait" href="trait.Resolver.html" title="trait iroh_relay::dns::Resolver">Resolver</a></dt><dd>Trait for DNS resolvers used in iroh.</dd></dl><h2 id="types" class="section-header">Type Aliases<a href="#types" class="anchor">§</a></h2><dl class="item-table"><dt><a class="type" href="type.BoxIter.html" title="type iroh_relay::dns::BoxIter">BoxIter</a></dt><dd>Boxed iterator alias.</dd></dl></section></div></main></body></html>
|
||||
@@ -1 +1 @@
|
||||
window.SIDEBAR_ITEMS = {"constant":["N0_DNS_NODE_ORIGIN_PROD","N0_DNS_NODE_ORIGIN_STAGING"],"enum":["DnsError"],"struct":["DnsResolver","StaggeredError","TXT","TxtLookup"]};
|
||||
window.SIDEBAR_ITEMS = {"constant":["N0_DNS_NODE_ORIGIN_PROD","N0_DNS_NODE_ORIGIN_STAGING"],"enum":["DnsError","LookupError"],"struct":["DnsResolver","StaggeredError","TxtRecordData"],"trait":["Resolver"],"type":["BoxIter"]};
|
||||
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
+9
-4
File diff suppressed because one or more lines are too long
@@ -0,0 +1,38 @@
|
||||
<!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="Trait for DNS resolvers used in iroh."><title>Resolver in iroh_relay::dns - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-6c3ea77c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh_relay" data-themes="" data-resource-suffix="" data-rustdoc-version="1.87.0-nightly (f280acf4c 2025-02-19)" data-channel="nightly" data-search-js="search-f7327375.js" data-settings-js="settings-6dad6058.js" ><script src="../../static.files/storage-3a5871a4.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5332ae0c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc 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_relay/index.html">iroh_<wbr>relay</a><span class="version">0.92.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Resolver</a></h2><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.clear_cache" title="clear_cache">clear_cache</a></li><li><a href="#tymethod.lookup_ipv4" title="lookup_ipv4">lookup_ipv4</a></li><li><a href="#tymethod.lookup_ipv6" title="lookup_ipv6">lookup_ipv6</a></li><li><a href="#tymethod.lookup_txt" title="lookup_txt">lookup_txt</a></li><li><a href="#tymethod.reset" title="reset">reset</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In iroh_<wbr>relay::<wbr>dns</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">iroh_relay</a>::<wbr><a href="index.html">dns</a></div><h1>Trait <span class="trait">Resolver</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/iroh_relay/dns.rs.html#36-54">Source</a> </span></div><pre class="rust item-decl"><code>pub trait Resolver:
|
||||
<a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a>
|
||||
+ <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>
|
||||
+ 'static {
|
||||
// Required methods
|
||||
fn <a href="#tymethod.lookup_ipv4" class="fn">lookup_ipv4</a>(
|
||||
&self,
|
||||
host: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>,
|
||||
) -> BoxFuture<<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="type" href="type.BoxIter.html" title="type iroh_relay::dns::BoxIter">BoxIter</a><<a class="struct" href="https://doc.rust-lang.org/nightly/core/net/ip_addr/struct.Ipv4Addr.html" title="struct core::net::ip_addr::Ipv4Addr">Ipv4Addr</a>>, <a class="enum" href="enum.DnsError.html" title="enum iroh_relay::dns::DnsError">DnsError</a>>>;
|
||||
<span class="item-spacer"></span> fn <a href="#tymethod.lookup_ipv6" class="fn">lookup_ipv6</a>(
|
||||
&self,
|
||||
host: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>,
|
||||
) -> BoxFuture<<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="type" href="type.BoxIter.html" title="type iroh_relay::dns::BoxIter">BoxIter</a><<a class="struct" href="https://doc.rust-lang.org/nightly/core/net/ip_addr/struct.Ipv6Addr.html" title="struct core::net::ip_addr::Ipv6Addr">Ipv6Addr</a>>, <a class="enum" href="enum.DnsError.html" title="enum iroh_relay::dns::DnsError">DnsError</a>>>;
|
||||
<span class="item-spacer"></span> fn <a href="#tymethod.lookup_txt" class="fn">lookup_txt</a>(
|
||||
&self,
|
||||
host: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>,
|
||||
) -> BoxFuture<<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="type" href="type.BoxIter.html" title="type iroh_relay::dns::BoxIter">BoxIter</a><<a class="struct" href="struct.TxtRecordData.html" title="struct iroh_relay::dns::TxtRecordData">TxtRecordData</a>>, <a class="enum" href="enum.DnsError.html" title="enum iroh_relay::dns::DnsError">DnsError</a>>>;
|
||||
<span class="item-spacer"></span> fn <a href="#tymethod.clear_cache" class="fn">clear_cache</a>(&self);
|
||||
<span class="item-spacer"></span> fn <a href="#tymethod.reset" class="fn">reset</a>(&mut self);
|
||||
}</code></pre><span class="item-info"><div class="stab portability">Available on <strong>non-<code>wasm_browser</code></strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Trait for DNS resolvers used in iroh.</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.lookup_ipv4" class="method"><a class="src rightside" href="../../src/iroh_relay/dns.rs.html#38">Source</a><h4 class="code-header">fn <a href="#tymethod.lookup_ipv4" class="fn">lookup_ipv4</a>(
|
||||
&self,
|
||||
host: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>,
|
||||
) -> BoxFuture<<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="type" href="type.BoxIter.html" title="type iroh_relay::dns::BoxIter">BoxIter</a><<a class="struct" href="https://doc.rust-lang.org/nightly/core/net/ip_addr/struct.Ipv4Addr.html" title="struct core::net::ip_addr::Ipv4Addr">Ipv4Addr</a>>, <a class="enum" href="enum.DnsError.html" title="enum iroh_relay::dns::DnsError">DnsError</a>>></h4></section></summary><div class="docblock"><p>Looks up an IPv4 address.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.lookup_ipv6" class="method"><a class="src rightside" href="../../src/iroh_relay/dns.rs.html#41">Source</a><h4 class="code-header">fn <a href="#tymethod.lookup_ipv6" class="fn">lookup_ipv6</a>(
|
||||
&self,
|
||||
host: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>,
|
||||
) -> BoxFuture<<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="type" href="type.BoxIter.html" title="type iroh_relay::dns::BoxIter">BoxIter</a><<a class="struct" href="https://doc.rust-lang.org/nightly/core/net/ip_addr/struct.Ipv6Addr.html" title="struct core::net::ip_addr::Ipv6Addr">Ipv6Addr</a>>, <a class="enum" href="enum.DnsError.html" title="enum iroh_relay::dns::DnsError">DnsError</a>>></h4></section></summary><div class="docblock"><p>Looks up an IPv6 address.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.lookup_txt" class="method"><a class="src rightside" href="../../src/iroh_relay/dns.rs.html#44">Source</a><h4 class="code-header">fn <a href="#tymethod.lookup_txt" class="fn">lookup_txt</a>(
|
||||
&self,
|
||||
host: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>,
|
||||
) -> BoxFuture<<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="type" href="type.BoxIter.html" title="type iroh_relay::dns::BoxIter">BoxIter</a><<a class="struct" href="struct.TxtRecordData.html" title="struct iroh_relay::dns::TxtRecordData">TxtRecordData</a>>, <a class="enum" href="enum.DnsError.html" title="enum iroh_relay::dns::DnsError">DnsError</a>>></h4></section></summary><div class="docblock"><p>Looks up TXT records.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.clear_cache" class="method"><a class="src rightside" href="../../src/iroh_relay/dns.rs.html#47">Source</a><h4 class="code-header">fn <a href="#tymethod.clear_cache" class="fn">clear_cache</a>(&self)</h4></section></summary><div class="docblock"><p>Clears the internal cache.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.reset" class="method"><a class="src rightside" href="../../src/iroh_relay/dns.rs.html#53">Source</a><h4 class="code-header">fn <a href="#tymethod.reset" class="fn">reset</a>(&mut self)</h4></section></summary><div class="docblock"><p>Completely resets the DNS resolver.</p>
|
||||
<p>This is called when the host’s network changes majorly. Implementations should rebind all sockets
|
||||
and refresh the nameserver configuration if read from the host system.</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_relay/dns/trait.Resolver.js" async></script></section></div></main></body></html>
|
||||
@@ -0,0 +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="Boxed iterator alias."><title>BoxIter in iroh_relay::dns - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-6c3ea77c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh_relay" data-themes="" data-resource-suffix="" data-rustdoc-version="1.87.0-nightly (f280acf4c 2025-02-19)" data-channel="nightly" data-search-js="search-f7327375.js" data-settings-js="settings-6dad6058.js" ><script src="../../static.files/storage-3a5871a4.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5332ae0c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc 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_relay/index.html">iroh_<wbr>relay</a><span class="version">0.92.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">BoxIter</a></h2><h3><a href="#aliased-type">Aliased Type</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In iroh_<wbr>relay::<wbr>dns</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">iroh_relay</a>::<wbr><a href="index.html">dns</a></div><h1>Type Alias <span class="type">BoxIter</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/iroh_relay/dns.rs.html#57">Source</a> </span></div><pre class="rust item-decl"><code>pub type BoxIter<T> = <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a><Item = T> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'static>;</code></pre><span class="item-info"><div class="stab portability">Available on <strong>non-<code>wasm_browser</code></strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Boxed iterator alias.</p>
|
||||
</div></details><h2 id="aliased-type" class="section-header">Aliased Type<a href="#aliased-type" class="anchor">§</a></h2><pre class="rust item-decl"><code>struct BoxIter<T>(<span class="comment">/* private fields */</span>);</code></pre><script src="../../type.impl/alloc/boxed/struct.Box.js" data-self-path="iroh_relay::dns::BoxIter" async></script></section></div></main></body></html>
|
||||
@@ -27,4 +27,4 @@ QAD support and expose metrics.</p>
|
||||
</ul>
|
||||
</div></details><h2 id="reexports" class="section-header">Re-exports<a href="#reexports" class="anchor">§</a></h2><dl class="item-table reexports"><dt id="reexport.MAX_PACKET_SIZE"><code>pub use protos::relay::<a class="constant" href="protos/relay/constant.MAX_PACKET_SIZE.html" title="constant iroh_relay::protos::relay::MAX_PACKET_SIZE">MAX_PACKET_SIZE</a>;</code></dt></dl><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><dl class="item-table"><dt><a class="mod" href="client/index.html" title="mod iroh_relay::client">client</a></dt><dd>Exposes <a href="client/struct.Client.html" title="struct iroh_relay::client::Client"><code>Client</code></a>, which allows to establish connections to a relay server.</dd><dt><a class="mod" href="defaults/index.html" title="mod iroh_relay::defaults">defaults</a></dt><dd>Default values used in the relay.</dd><dt><a class="mod" href="dns/index.html" title="mod iroh_relay::dns">dns</a><wbr><span class="stab portability" title="Available on non-`wasm_browser` only">Non-<code>wasm_browser</code></span></dt><dd>DNS resolver</dd><dt><a class="mod" href="http/index.html" title="mod iroh_relay::http">http</a></dt><dd>HTTP-specific constants for the relay server and client.</dd><dt><a class="mod" href="node_info/index.html" title="mod iroh_relay::node_info">node_<wbr>info</a></dt><dd>Support for handling DNS resource records for dialing by <a href="../iroh_base/key/type.NodeId.html" title="type iroh_base::key::NodeId"><code>NodeId</code></a>.</dd><dt><a class="mod" href="protos/index.html" title="mod iroh_relay::protos">protos</a></dt><dd>Protocols used by the iroh-relay</dd><dt><a class="mod" href="quic/index.html" title="mod iroh_relay::quic">quic</a></dt><dd>Create a QUIC server that accepts connections
|
||||
for QUIC address discovery.</dd><dt><a class="mod" href="server/index.html" title="mod iroh_relay::server">server</a><wbr><span class="stab portability" title="Available on crate feature `server` only"><code>server</code></span></dt><dd>A fully-fledged iroh-relay server over HTTP or HTTPS.</dd></dl><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.PingTracker.html" title="struct iroh_relay::PingTracker">Ping<wbr>Tracker</a></dt><dd>Tracks pings on a single relay connection.</dd><dt><a class="struct" href="struct.RelayMap.html" title="struct iroh_relay::RelayMap">Relay<wbr>Map</a></dt><dd>Configuration of all the relay servers that can be used.</dd><dt><a class="struct" href="struct.RelayNode.html" title="struct iroh_relay::RelayNode">Relay<wbr>Node</a></dt><dd>Information on a specific relay server.</dd><dt><a class="struct" href="struct.RelayQuicConfig.html" title="struct iroh_relay::RelayQuicConfig">Relay<wbr>Quic<wbr>Config</a></dt><dd>Configuration for speaking to the QUIC endpoint on the relay
|
||||
server to do QUIC address discovery.</dd></dl></section></div></main></body></html>
|
||||
server to do QUIC address discovery.</dd></dl><script type="text/json" id="notable-traits-data">{"&[u8]":"<h3>Notable traits for <code>&[<a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.u8.html\">u8</a>]</code></h3><pre><code><div class=\"where\">impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/io/trait.Read.html\" title=\"trait std::io::Read\">Read</a> for &[<a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.u8.html\">u8</a>]</div>"}</script></section></div></main></body></html>
|
||||
@@ -1,2 +1,2 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="The DNS name for the iroh TXT record."><title>IROH_TXT_NAME in iroh_relay::node_info - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-6c3ea77c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh_relay" data-themes="" data-resource-suffix="" data-rustdoc-version="1.87.0-nightly (f280acf4c 2025-02-19)" data-channel="nightly" data-search-js="search-f7327375.js" data-settings-js="settings-6dad6058.js" ><script src="../../static.files/storage-3a5871a4.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5332ae0c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../iroh_relay/index.html">iroh_<wbr>relay</a><span class="version">0.92.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In iroh_<wbr>relay::<wbr>node_<wbr>info</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">iroh_relay</a>::<wbr><a href="index.html">node_info</a></div><h1>Constant <span class="constant">IROH_TXT_NAME</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/iroh_relay/node_info.rs.html#59">Source</a> </span></div><pre class="rust item-decl"><code>pub const IROH_TXT_NAME: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a> = "_iroh";</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The DNS name for the iroh TXT record.</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 DNS name for the iroh TXT record."><title>IROH_TXT_NAME in iroh_relay::node_info - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-6c3ea77c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh_relay" data-themes="" data-resource-suffix="" data-rustdoc-version="1.87.0-nightly (f280acf4c 2025-02-19)" data-channel="nightly" data-search-js="search-f7327375.js" data-settings-js="settings-6dad6058.js" ><script src="../../static.files/storage-3a5871a4.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5332ae0c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../iroh_relay/index.html">iroh_<wbr>relay</a><span class="version">0.92.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In iroh_<wbr>relay::<wbr>node_<wbr>info</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">iroh_relay</a>::<wbr><a href="index.html">node_info</a></div><h1>Constant <span class="constant">IROH_TXT_NAME</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/iroh_relay/node_info.rs.html#49">Source</a> </span></div><pre class="rust item-decl"><code>pub const IROH_TXT_NAME: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a> = "_iroh";</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The DNS name for the iroh TXT record.</p>
|
||||
</div></details></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
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="Support for handling DNS resource records for dialing by `NodeId`."><title>iroh_relay::node_info - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-6c3ea77c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh_relay" data-themes="" data-resource-suffix="" data-rustdoc-version="1.87.0-nightly (f280acf4c 2025-02-19)" data-channel="nightly" data-search-js="search-f7327375.js" data-settings-js="settings-6dad6058.js" ><script src="../../static.files/storage-3a5871a4.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-5332ae0c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../iroh_relay/index.html">iroh_<wbr>relay</a><span class="version">0.92.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module node_<wbr>info</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#enums" title="Enums">Enums</a></li><li><a href="#constants" title="Constants">Constants</a></li><li><a href="#traits" title="Traits">Traits</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate iroh_<wbr>relay</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">iroh_relay</a></div><h1>Module <span>node_info</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/iroh_relay/node_info.rs.html#1-865">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Support for handling DNS resource records for dialing by <a href="../../iroh_base/key/type.NodeId.html" title="type iroh_base::key::NodeId"><code>NodeId</code></a>.</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="Support for handling DNS resource records for dialing by `NodeId`."><title>iroh_relay::node_info - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-6c3ea77c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh_relay" data-themes="" data-resource-suffix="" data-rustdoc-version="1.87.0-nightly (f280acf4c 2025-02-19)" data-channel="nightly" data-search-js="search-f7327375.js" data-settings-js="settings-6dad6058.js" ><script src="../../static.files/storage-3a5871a4.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-5332ae0c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../iroh_relay/index.html">iroh_<wbr>relay</a><span class="version">0.92.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module node_<wbr>info</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#enums" title="Enums">Enums</a></li><li><a href="#constants" title="Constants">Constants</a></li><li><a href="#traits" title="Traits">Traits</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate iroh_<wbr>relay</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">iroh_relay</a></div><h1>Module <span>node_info</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/iroh_relay/node_info.rs.html#1-767">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Support for handling DNS resource records for dialing by <a href="../../iroh_base/key/type.NodeId.html" title="type iroh_base::key::NodeId"><code>NodeId</code></a>.</p>
|
||||
<p>Dialing by <a href="../../iroh_base/key/type.NodeId.html" title="type iroh_base::key::NodeId"><code>NodeId</code></a> is supported by iroh nodes publishing <a href="https://app.pkarr.org">Pkarr</a> records to DNS
|
||||
servers or the Mainline DHT. This module supports creating and parsing these records.</p>
|
||||
<p>DNS records are published under the following names:</p>
|
||||
@@ -30,5 +30,5 @@ in <a href="https://www.rfc-editor.org/rfc/rfc1464">RFC1464</a>. The following
|
||||
Each address is an IPv4 or IPv6 address with a port.</p>
|
||||
</li>
|
||||
</ul>
|
||||
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.MaxLengthExceededError.html" title="struct iroh_relay::node_info::MaxLengthExceededError">MaxLength<wbr>Exceeded<wbr>Error</a></dt><dd>Error returned when an input value is too long for <a href="struct.UserData.html" title="struct iroh_relay::node_info::UserData"><code>UserData</code></a>.</dd><dt><a class="struct" href="struct.NodeData.html" title="struct iroh_relay::node_info::NodeData">Node<wbr>Data</a></dt><dd>Data about a node that may be published to and resolved from discovery services.</dd><dt><a class="struct" href="struct.NodeInfo.html" title="struct iroh_relay::node_info::NodeInfo">Node<wbr>Info</a></dt><dd>Information about a node that may be published to and resolved from discovery services.</dd><dt><a class="struct" href="struct.UserData.html" title="struct iroh_relay::node_info::UserData">User<wbr>Data</a></dt><dd>Under the hood this is a UTF-8 String is no longer than <a href="struct.UserData.html#associatedconstant.MAX_LENGTH" title="associated constant iroh_relay::node_info::UserData::MAX_LENGTH"><code>UserData::MAX_LENGTH</code></a> bytes.</dd></dl><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><dl class="item-table"><dt><a class="enum" href="enum.DecodingError.html" title="enum iroh_relay::node_info::DecodingError">Decoding<wbr>Error</a></dt><dt><a class="enum" href="enum.EncodingError.html" title="enum iroh_relay::node_info::EncodingError">Encoding<wbr>Error</a></dt><dt><a class="enum" href="enum.LookupError.html" title="enum iroh_relay::node_info::LookupError">Lookup<wbr>Error</a><wbr><span class="stab portability" title="Available on non-`wasm_browser` only">Non-<code>wasm_browser</code></span></dt><dt><a class="enum" href="enum.ParseError.html" title="enum iroh_relay::node_info::ParseError">Parse<wbr>Error</a></dt></dl><h2 id="constants" class="section-header">Constants<a href="#constants" class="anchor">§</a></h2><dl class="item-table"><dt><a class="constant" href="constant.IROH_TXT_NAME.html" title="constant iroh_relay::node_info::IROH_TXT_NAME">IROH_<wbr>TXT_<wbr>NAME</a></dt><dd>The DNS name for the iroh TXT record.</dd></dl><h2 id="traits" class="section-header">Traits<a href="#traits" class="anchor">§</a></h2><dl class="item-table"><dt><a class="trait" href="trait.NodeIdExt.html" title="trait iroh_relay::node_info::NodeIdExt">Node<wbr>IdExt</a></dt><dd>Extension methods for <a href="../../iroh_base/key/type.NodeId.html" title="type iroh_base::key::NodeId"><code>NodeId</code></a> to encode to and decode from [<code>z32</code>],
|
||||
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.MaxLengthExceededError.html" title="struct iroh_relay::node_info::MaxLengthExceededError">MaxLength<wbr>Exceeded<wbr>Error</a></dt><dd>Error returned when an input value is too long for <a href="struct.UserData.html" title="struct iroh_relay::node_info::UserData"><code>UserData</code></a>.</dd><dt><a class="struct" href="struct.NodeData.html" title="struct iroh_relay::node_info::NodeData">Node<wbr>Data</a></dt><dd>Data about a node that may be published to and resolved from discovery services.</dd><dt><a class="struct" href="struct.NodeInfo.html" title="struct iroh_relay::node_info::NodeInfo">Node<wbr>Info</a></dt><dd>Information about a node that may be published to and resolved from discovery services.</dd><dt><a class="struct" href="struct.UserData.html" title="struct iroh_relay::node_info::UserData">User<wbr>Data</a></dt><dd>Under the hood this is a UTF-8 String is no longer than <a href="struct.UserData.html#associatedconstant.MAX_LENGTH" title="associated constant iroh_relay::node_info::UserData::MAX_LENGTH"><code>UserData::MAX_LENGTH</code></a> bytes.</dd></dl><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><dl class="item-table"><dt><a class="enum" href="enum.DecodingError.html" title="enum iroh_relay::node_info::DecodingError">Decoding<wbr>Error</a></dt><dt><a class="enum" href="enum.EncodingError.html" title="enum iroh_relay::node_info::EncodingError">Encoding<wbr>Error</a></dt><dt><a class="enum" href="enum.ParseError.html" title="enum iroh_relay::node_info::ParseError">Parse<wbr>Error</a></dt></dl><h2 id="constants" class="section-header">Constants<a href="#constants" class="anchor">§</a></h2><dl class="item-table"><dt><a class="constant" href="constant.IROH_TXT_NAME.html" title="constant iroh_relay::node_info::IROH_TXT_NAME">IROH_<wbr>TXT_<wbr>NAME</a></dt><dd>The DNS name for the iroh TXT record.</dd></dl><h2 id="traits" class="section-header">Traits<a href="#traits" class="anchor">§</a></h2><dl class="item-table"><dt><a class="trait" href="trait.NodeIdExt.html" title="trait iroh_relay::node_info::NodeIdExt">Node<wbr>IdExt</a></dt><dd>Extension methods for <a href="../../iroh_base/key/type.NodeId.html" title="type iroh_base::key::NodeId"><code>NodeId</code></a> to encode to and decode from [<code>z32</code>],
|
||||
which is the encoding used in [<code>pkarr</code>] domain names.</dd></dl></section></div></main></body></html>
|
||||
@@ -1 +1 @@
|
||||
window.SIDEBAR_ITEMS = {"constant":["IROH_TXT_NAME"],"enum":["DecodingError","EncodingError","LookupError","ParseError"],"struct":["MaxLengthExceededError","NodeData","NodeInfo","UserData"],"trait":["NodeIdExt"]};
|
||||
window.SIDEBAR_ITEMS = {"constant":["IROH_TXT_NAME"],"enum":["DecodingError","EncodingError","ParseError"],"struct":["MaxLengthExceededError","NodeData","NodeInfo","UserData"],"trait":["NodeIdExt"]};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,9 +1,9 @@
|
||||
<!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="Extension methods for `NodeId` to encode to and decode from `z32`, which is the encoding used in `pkarr` domain names."><title>NodeIdExt in iroh_relay::node_info - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-6c3ea77c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh_relay" data-themes="" data-resource-suffix="" data-rustdoc-version="1.87.0-nightly (f280acf4c 2025-02-19)" data-channel="nightly" data-search-js="search-f7327375.js" data-settings-js="settings-6dad6058.js" ><script src="../../static.files/storage-3a5871a4.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5332ae0c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc 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_relay/index.html">iroh_<wbr>relay</a><span class="version">0.92.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Node<wbr>IdExt</a></h2><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.from_z32" title="from_z32">from_z32</a></li><li><a href="#tymethod.to_z32" title="to_z32">to_z32</a></li></ul><h3><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul class="block"><li><a href="#impl-NodeIdExt-for-PublicKey" title="NodeId">NodeId</a></li></ul><h3><a href="#dyn-compatibility">Dyn Compatibility</a></h3><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In iroh_<wbr>relay::<wbr>node_<wbr>info</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">iroh_relay</a>::<wbr><a href="index.html">node_info</a></div><h1>Trait <span class="trait">NodeIdExt</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/iroh_relay/node_info.rs.html#99-109">Source</a> </span></div><pre class="rust item-decl"><code>pub trait NodeIdExt {
|
||||
<!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="Extension methods for `NodeId` to encode to and decode from `z32`, which is the encoding used in `pkarr` domain names."><title>NodeIdExt in iroh_relay::node_info - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-6c3ea77c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh_relay" data-themes="" data-resource-suffix="" data-rustdoc-version="1.87.0-nightly (f280acf4c 2025-02-19)" data-channel="nightly" data-search-js="search-f7327375.js" data-settings-js="settings-6dad6058.js" ><script src="../../static.files/storage-3a5871a4.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5332ae0c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc 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_relay/index.html">iroh_<wbr>relay</a><span class="version">0.92.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Node<wbr>IdExt</a></h2><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.from_z32" title="from_z32">from_z32</a></li><li><a href="#tymethod.to_z32" title="to_z32">to_z32</a></li></ul><h3><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul class="block"><li><a href="#impl-NodeIdExt-for-PublicKey" title="NodeId">NodeId</a></li></ul><h3><a href="#dyn-compatibility">Dyn Compatibility</a></h3><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In iroh_<wbr>relay::<wbr>node_<wbr>info</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">iroh_relay</a>::<wbr><a href="index.html">node_info</a></div><h1>Trait <span class="trait">NodeIdExt</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/iroh_relay/node_info.rs.html#89-99">Source</a> </span></div><pre class="rust item-decl"><code>pub trait NodeIdExt {
|
||||
// Required methods
|
||||
fn <a href="#tymethod.to_z32" class="fn">to_z32</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="#tymethod.from_z32" class="fn">from_z32</a>(s: &<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><<a class="type" href="../../iroh_base/key/type.NodeId.html" title="type iroh_base::key::NodeId">NodeId</a>, <a class="enum" href="enum.DecodingError.html" title="enum iroh_relay::node_info::DecodingError">DecodingError</a>>;
|
||||
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Extension methods for <a href="../../iroh_base/key/type.NodeId.html" title="type iroh_base::key::NodeId"><code>NodeId</code></a> to encode to and decode from [<code>z32</code>],
|
||||
which is the encoding used in [<code>pkarr</code>] domain names.</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.to_z32" class="method"><a class="src rightside" href="../../src/iroh_relay/node_info.rs.html#103">Source</a><h4 class="code-header">fn <a href="#tymethod.to_z32" class="fn">to_z32</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>Encodes a <a href="../../iroh_base/key/type.NodeId.html" title="type iroh_base::key::NodeId"><code>NodeId</code></a> in [<code>z-base-32</code>] encoding.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.from_z32" class="method"><a class="src rightside" href="../../src/iroh_relay/node_info.rs.html#108">Source</a><h4 class="code-header">fn <a href="#tymethod.from_z32" class="fn">from_z32</a>(s: &<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><<a class="type" href="../../iroh_base/key/type.NodeId.html" title="type iroh_base::key::NodeId">NodeId</a>, <a class="enum" href="enum.DecodingError.html" title="enum iroh_relay::node_info::DecodingError">DecodingError</a>></h4></section></summary><div class="docblock"><p>Parses a <a href="../../iroh_base/key/type.NodeId.html" title="type iroh_base::key::NodeId"><code>NodeId</code></a> from [<code>z-base-32</code>] encoding.</p>
|
||||
</div></details></div><h2 id="dyn-compatibility" class="section-header">Dyn Compatibility<a href="#dyn-compatibility" class="anchor">§</a></h2><div class="dyn-compatibility-info"><p>This trait is <b>not</b> <a href="https://doc.rust-lang.org/nightly/reference/items/traits.html#dyn-compatibility">dyn compatible</a>.</p><p><i>In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.</i></p></div><h2 id="foreign-impls" class="section-header">Implementations on Foreign Types<a href="#foreign-impls" class="anchor">§</a></h2><details class="toggle implementors-toggle"><summary><section id="impl-NodeIdExt-for-PublicKey" class="impl"><a class="src rightside" href="../../src/iroh_relay/node_info.rs.html#111-124">Source</a><a href="#impl-NodeIdExt-for-PublicKey" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.NodeIdExt.html" title="trait iroh_relay::node_info::NodeIdExt">NodeIdExt</a> for <a class="type" href="../../iroh_base/key/type.NodeId.html" title="type iroh_base::key::NodeId">NodeId</a></h3></section></summary><div class="impl-items"><section id="method.to_z32" class="method trait-impl"><a class="src rightside" href="../../src/iroh_relay/node_info.rs.html#112-114">Source</a><a href="#method.to_z32" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.to_z32" class="fn">to_z32</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><section id="method.from_z32" class="method trait-impl"><a class="src rightside" href="../../src/iroh_relay/node_info.rs.html#116-123">Source</a><a href="#method.from_z32" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.from_z32" class="fn">from_z32</a>(s: &<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><<a class="type" href="../../iroh_base/key/type.NodeId.html" title="type iroh_base::key::NodeId">NodeId</a>, <a class="enum" href="enum.DecodingError.html" title="enum iroh_relay::node_info::DecodingError">DecodingError</a>></h4></section></div></details><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"></div><script src="../../trait.impl/iroh_relay/node_info/trait.NodeIdExt.js" data-ignore-extern-crates="iroh_base" async></script></section></div></main></body></html>
|
||||
</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.to_z32" class="method"><a class="src rightside" href="../../src/iroh_relay/node_info.rs.html#93">Source</a><h4 class="code-header">fn <a href="#tymethod.to_z32" class="fn">to_z32</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>Encodes a <a href="../../iroh_base/key/type.NodeId.html" title="type iroh_base::key::NodeId"><code>NodeId</code></a> in [<code>z-base-32</code>] encoding.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.from_z32" class="method"><a class="src rightside" href="../../src/iroh_relay/node_info.rs.html#98">Source</a><h4 class="code-header">fn <a href="#tymethod.from_z32" class="fn">from_z32</a>(s: &<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><<a class="type" href="../../iroh_base/key/type.NodeId.html" title="type iroh_base::key::NodeId">NodeId</a>, <a class="enum" href="enum.DecodingError.html" title="enum iroh_relay::node_info::DecodingError">DecodingError</a>></h4></section></summary><div class="docblock"><p>Parses a <a href="../../iroh_base/key/type.NodeId.html" title="type iroh_base::key::NodeId"><code>NodeId</code></a> from [<code>z-base-32</code>] encoding.</p>
|
||||
</div></details></div><h2 id="dyn-compatibility" class="section-header">Dyn Compatibility<a href="#dyn-compatibility" class="anchor">§</a></h2><div class="dyn-compatibility-info"><p>This trait is <b>not</b> <a href="https://doc.rust-lang.org/nightly/reference/items/traits.html#dyn-compatibility">dyn compatible</a>.</p><p><i>In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.</i></p></div><h2 id="foreign-impls" class="section-header">Implementations on Foreign Types<a href="#foreign-impls" class="anchor">§</a></h2><details class="toggle implementors-toggle"><summary><section id="impl-NodeIdExt-for-PublicKey" class="impl"><a class="src rightside" href="../../src/iroh_relay/node_info.rs.html#101-114">Source</a><a href="#impl-NodeIdExt-for-PublicKey" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.NodeIdExt.html" title="trait iroh_relay::node_info::NodeIdExt">NodeIdExt</a> for <a class="type" href="../../iroh_base/key/type.NodeId.html" title="type iroh_base::key::NodeId">NodeId</a></h3></section></summary><div class="impl-items"><section id="method.to_z32" class="method trait-impl"><a class="src rightside" href="../../src/iroh_relay/node_info.rs.html#102-104">Source</a><a href="#method.to_z32" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.to_z32" class="fn">to_z32</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><section id="method.from_z32" class="method trait-impl"><a class="src rightside" href="../../src/iroh_relay/node_info.rs.html#106-113">Source</a><a href="#method.from_z32" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.from_z32" class="fn">from_z32</a>(s: &<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><<a class="type" href="../../iroh_base/key/type.NodeId.html" title="type iroh_base::key::NodeId">NodeId</a>, <a class="enum" href="enum.DecodingError.html" title="enum iroh_relay::node_info::DecodingError">DecodingError</a>></h4></section></div></details><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"></div><script src="../../trait.impl/iroh_relay/node_info/trait.NodeIdExt.js" data-ignore-extern-crates="iroh_base" async></script></section></div></main></body></html>
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -272,238 +272,243 @@
|
||||
<a href=#272 id=272 data-nosnippet>272</a> )
|
||||
<a href=#273 id=273 data-nosnippet>273</a> })<span class="question-mark">?</span>;
|
||||
<a href=#274 id=274 data-nosnippet>274</a> }
|
||||
<a href=#275 id=275 data-nosnippet>275</a> <span class="kw">let </span>db = Database::builder()
|
||||
<a href=#275 id=275 data-nosnippet>275</a> <span class="kw">let </span><span class="kw-2">mut </span>db = Database::builder()
|
||||
<a href=#276 id=276 data-nosnippet>276</a> .create(path)
|
||||
<a href=#277 id=277 data-nosnippet>277</a> .context(<span class="string">"failed to open packet database"</span>)<span class="question-mark">?</span>;
|
||||
<a href=#278 id=278 data-nosnippet>278</a> <span class="self">Self</span>::open(db, options, metrics)
|
||||
<a href=#279 id=279 data-nosnippet>279</a> }
|
||||
<a href=#280 id=280 data-nosnippet>280</a>
|
||||
<a href=#281 id=281 data-nosnippet>281</a> <span class="kw">pub fn </span>in_memory(options: Options, metrics: Arc<Metrics>) -> <span class="prelude-ty">Result</span><<span class="self">Self</span>> {
|
||||
<a href=#282 id=282 data-nosnippet>282</a> <span class="macro">info!</span>(<span class="string">"using in-memory packet database"</span>);
|
||||
<a href=#283 id=283 data-nosnippet>283</a> <span class="kw">let </span>db = Database::builder()
|
||||
<a href=#284 id=284 data-nosnippet>284</a> .create_with_backend(InMemoryBackend::new())
|
||||
<a href=#285 id=285 data-nosnippet>285</a> .e()<span class="question-mark">?</span>;
|
||||
<a href=#286 id=286 data-nosnippet>286</a> <span class="self">Self</span>::open(db, options, metrics)
|
||||
<a href=#287 id=287 data-nosnippet>287</a> }
|
||||
<a href=#288 id=288 data-nosnippet>288</a>
|
||||
<a href=#289 id=289 data-nosnippet>289</a> <span class="kw">pub fn </span>open(db: Database, options: Options, metrics: Arc<Metrics>) -> <span class="prelude-ty">Result</span><<span class="self">Self</span>> {
|
||||
<a href=#290 id=290 data-nosnippet>290</a> <span class="comment">// create tables
|
||||
<a href=#291 id=291 data-nosnippet>291</a> </span><span class="kw">let </span>write_tx = db.begin_write().e()<span class="question-mark">?</span>;
|
||||
<a href=#292 id=292 data-nosnippet>292</a> <span class="kw">let _ </span>= Tables::new(<span class="kw-2">&</span>write_tx).e()<span class="question-mark">?</span>;
|
||||
<a href=#293 id=293 data-nosnippet>293</a> write_tx.commit().e()<span class="question-mark">?</span>;
|
||||
<a href=#294 id=294 data-nosnippet>294</a> <span class="kw">let </span>(send, recv) = mpsc::channel(<span class="number">1024</span>);
|
||||
<a href=#295 id=295 data-nosnippet>295</a> <span class="kw">let </span>send2 = send.clone();
|
||||
<a href=#296 id=296 data-nosnippet>296</a> <span class="kw">let </span>cancel = CancellationToken::new();
|
||||
<a href=#297 id=297 data-nosnippet>297</a> <span class="kw">let </span>cancel2 = cancel.clone();
|
||||
<a href=#298 id=298 data-nosnippet>298</a> <span class="kw">let </span>cancel3 = cancel.clone();
|
||||
<a href=#299 id=299 data-nosnippet>299</a> <span class="kw">let </span>actor = Actor {
|
||||
<a href=#300 id=300 data-nosnippet>300</a> db,
|
||||
<a href=#301 id=301 data-nosnippet>301</a> recv: PeekableReceiver::new(recv),
|
||||
<a href=#302 id=302 data-nosnippet>302</a> cancel: cancel2,
|
||||
<a href=#303 id=303 data-nosnippet>303</a> options,
|
||||
<a href=#304 id=304 data-nosnippet>304</a> metrics,
|
||||
<a href=#305 id=305 data-nosnippet>305</a> };
|
||||
<a href=#306 id=306 data-nosnippet>306</a> <span class="comment">// start an io thread and donate it to the tokio runtime so we can do blocking IO
|
||||
<a href=#307 id=307 data-nosnippet>307</a> // inside the thread despite being in a tokio runtime
|
||||
<a href=#308 id=308 data-nosnippet>308</a> </span><span class="kw">let </span>_write_thread = IoThread::new(<span class="string">"packet-store-actor"</span>, <span class="kw">move </span>|| actor.run())<span class="question-mark">?</span>;
|
||||
<a href=#309 id=309 data-nosnippet>309</a> <span class="kw">let </span>_evict_thread = IoThread::new(<span class="string">"packet-store-evict"</span>, <span class="kw">move </span>|| {
|
||||
<a href=#310 id=310 data-nosnippet>310</a> evict_task(send2, options, cancel3)
|
||||
<a href=#311 id=311 data-nosnippet>311</a> })<span class="question-mark">?</span>;
|
||||
<a href=#312 id=312 data-nosnippet>312</a> <span class="prelude-val">Ok</span>(<span class="self">Self </span>{
|
||||
<a href=#313 id=313 data-nosnippet>313</a> send,
|
||||
<a href=#314 id=314 data-nosnippet>314</a> cancel,
|
||||
<a href=#315 id=315 data-nosnippet>315</a> _write_thread,
|
||||
<a href=#316 id=316 data-nosnippet>316</a> _evict_thread,
|
||||
<a href=#317 id=317 data-nosnippet>317</a> })
|
||||
<a href=#318 id=318 data-nosnippet>318</a> }
|
||||
<a href=#319 id=319 data-nosnippet>319</a>
|
||||
<a href=#320 id=320 data-nosnippet>320</a> <span class="kw">pub async fn </span>upsert(<span class="kw-2">&</span><span class="self">self</span>, packet: SignedPacket) -> <span class="prelude-ty">Result</span><bool> {
|
||||
<a href=#321 id=321 data-nosnippet>321</a> <span class="kw">let </span>(tx, rx) = oneshot::channel();
|
||||
<a href=#322 id=322 data-nosnippet>322</a> <span class="self">self</span>.send
|
||||
<a href=#323 id=323 data-nosnippet>323</a> .send(Message::Upsert { packet, res: tx })
|
||||
<a href=#324 id=324 data-nosnippet>324</a> .<span class="kw">await
|
||||
<a href=#325 id=325 data-nosnippet>325</a> </span>.e()<span class="question-mark">?</span>;
|
||||
<a href=#326 id=326 data-nosnippet>326</a> rx.<span class="kw">await</span>.e()
|
||||
<a href=#327 id=327 data-nosnippet>327</a> }
|
||||
<a href=#328 id=328 data-nosnippet>328</a>
|
||||
<a href=#329 id=329 data-nosnippet>329</a> <span class="kw">pub async fn </span>get(<span class="kw-2">&</span><span class="self">self</span>, key: <span class="kw-2">&</span>PublicKeyBytes) -> <span class="prelude-ty">Result</span><<span class="prelude-ty">Option</span><SignedPacket>> {
|
||||
<a href=#330 id=330 data-nosnippet>330</a> <span class="kw">let </span>(tx, rx) = oneshot::channel();
|
||||
<a href=#331 id=331 data-nosnippet>331</a> <span class="self">self</span>.send
|
||||
<a href=#332 id=332 data-nosnippet>332</a> .send(Message::Get { key: <span class="kw-2">*</span>key, res: tx })
|
||||
<a href=#333 id=333 data-nosnippet>333</a> .<span class="kw">await
|
||||
<a href=#334 id=334 data-nosnippet>334</a> </span>.e()<span class="question-mark">?</span>;
|
||||
<a href=#335 id=335 data-nosnippet>335</a> rx.<span class="kw">await</span>.e()
|
||||
<a href=#336 id=336 data-nosnippet>336</a> }
|
||||
<a href=#337 id=337 data-nosnippet>337</a>
|
||||
<a href=#338 id=338 data-nosnippet>338</a> <span class="kw">pub async fn </span>remove(<span class="kw-2">&</span><span class="self">self</span>, key: <span class="kw-2">&</span>PublicKeyBytes) -> <span class="prelude-ty">Result</span><bool> {
|
||||
<a href=#339 id=339 data-nosnippet>339</a> <span class="kw">let </span>(tx, rx) = oneshot::channel();
|
||||
<a href=#340 id=340 data-nosnippet>340</a> <span class="self">self</span>.send
|
||||
<a href=#341 id=341 data-nosnippet>341</a> .send(Message::Remove { key: <span class="kw-2">*</span>key, res: tx })
|
||||
<a href=#342 id=342 data-nosnippet>342</a> .<span class="kw">await
|
||||
<a href=#343 id=343 data-nosnippet>343</a> </span>.e()<span class="question-mark">?</span>;
|
||||
<a href=#344 id=344 data-nosnippet>344</a> rx.<span class="kw">await</span>.e()
|
||||
<a href=#345 id=345 data-nosnippet>345</a> }
|
||||
<a href=#346 id=346 data-nosnippet>346</a>}
|
||||
<a href=#347 id=347 data-nosnippet>347</a>
|
||||
<a href=#348 id=348 data-nosnippet>348</a><span class="kw">fn </span>get_packet(
|
||||
<a href=#349 id=349 data-nosnippet>349</a> table: <span class="kw-2">&</span><span class="kw">impl </span>ReadableTable<<span class="kw-2">&</span><span class="lifetime">'static </span>SignedPacketsKey, <span class="kw-2">&</span><span class="lifetime">'static </span>[u8]>,
|
||||
<a href=#350 id=350 data-nosnippet>350</a> key: <span class="kw-2">&</span>PublicKeyBytes,
|
||||
<a href=#351 id=351 data-nosnippet>351</a>) -> <span class="prelude-ty">Result</span><<span class="prelude-ty">Option</span><SignedPacket>> {
|
||||
<a href=#352 id=352 data-nosnippet>352</a> <span class="kw">let </span><span class="prelude-val">Some</span>(row) = table.get(key.as_ref()).context(<span class="string">"database fetch failed"</span>)<span class="question-mark">? </span><span class="kw">else </span>{
|
||||
<a href=#353 id=353 data-nosnippet>353</a> <span class="kw">return </span><span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>);
|
||||
<a href=#354 id=354 data-nosnippet>354</a> };
|
||||
<a href=#355 id=355 data-nosnippet>355</a> <span class="kw">match </span>SignedPacket::deserialize(row.value()) {
|
||||
<a href=#356 id=356 data-nosnippet>356</a> <span class="prelude-val">Ok</span>(packet) => <span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>(packet)),
|
||||
<a href=#357 id=357 data-nosnippet>357</a> <span class="prelude-val">Err</span>(err) => {
|
||||
<a href=#358 id=358 data-nosnippet>358</a> <span class="comment">// Prior to iroh-dns-server v0.35, we stored packets in the default `SignedPacket::as_bytes` serialization from pkarr v2,
|
||||
<a href=#359 id=359 data-nosnippet>359</a> // which did not include the `last_seen` timestamp added as a prefix in `SignedPacket::serialize` from pkarr v3.
|
||||
<a href=#360 id=360 data-nosnippet>360</a> // If decoding the packet as a serialized pkarr v3 packet fails, we assume it was stored with iroh-dns-server before v0.35,
|
||||
<a href=#361 id=361 data-nosnippet>361</a> // and prepend an empty timestamp.
|
||||
<a href=#362 id=362 data-nosnippet>362</a> </span><span class="kw">let </span>data = row.value();
|
||||
<a href=#363 id=363 data-nosnippet>363</a> <span class="kw">let </span><span class="kw-2">mut </span>buf = Vec::with_capacity(data.len() + <span class="number">8</span>);
|
||||
<a href=#364 id=364 data-nosnippet>364</a> buf.extend(<span class="kw-2">&</span>[<span class="number">0u8</span>; <span class="number">8</span>]);
|
||||
<a href=#365 id=365 data-nosnippet>365</a> buf.extend(data);
|
||||
<a href=#366 id=366 data-nosnippet>366</a> <span class="kw">match </span>SignedPacket::deserialize(<span class="kw-2">&</span>buf) {
|
||||
<a href=#367 id=367 data-nosnippet>367</a> <span class="prelude-val">Ok</span>(packet) => <span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>(packet)),
|
||||
<a href=#368 id=368 data-nosnippet>368</a> <span class="prelude-val">Err</span>(err2) => <span class="prelude-val">Err</span>(<span class="macro">format_err!</span>(
|
||||
<a href=#369 id=369 data-nosnippet>369</a> <span class="string">"Failed to decode as pkarr v3: {err:#}. Also failed to decode as pkarr v2: {err2:#}"
|
||||
<a href=#370 id=370 data-nosnippet>370</a> </span>)),
|
||||
<a href=#371 id=371 data-nosnippet>371</a> }
|
||||
<a href=#372 id=372 data-nosnippet>372</a> }
|
||||
<a href=#373 id=373 data-nosnippet>373</a> }
|
||||
<a href=#374 id=374 data-nosnippet>374</a>}
|
||||
<a href=#375 id=375 data-nosnippet>375</a>
|
||||
<a href=#376 id=376 data-nosnippet>376</a><span class="kw">async fn </span>evict_task(send: mpsc::Sender<Message>, options: Options, cancel: CancellationToken) {
|
||||
<a href=#377 id=377 data-nosnippet>377</a> <span class="kw">let </span>cancel2 = cancel.clone();
|
||||
<a href=#378 id=378 data-nosnippet>378</a> <span class="kw">let _ </span>= cancel2
|
||||
<a href=#379 id=379 data-nosnippet>379</a> .run_until_cancelled(<span class="kw">async move </span>{
|
||||
<a href=#380 id=380 data-nosnippet>380</a> <span class="macro">info!</span>(<span class="string">"starting evict task"</span>);
|
||||
<a href=#381 id=381 data-nosnippet>381</a> <span class="kw">if let </span><span class="prelude-val">Err</span>(cause) = evict_task_inner(send, options).<span class="kw">await </span>{
|
||||
<a href=#382 id=382 data-nosnippet>382</a> <span class="macro">error!</span>(<span class="string">"evict task failed: {:?}"</span>, cause);
|
||||
<a href=#383 id=383 data-nosnippet>383</a> }
|
||||
<a href=#384 id=384 data-nosnippet>384</a> <span class="comment">// when we are done for whatever reason we want to shut down the actor
|
||||
<a href=#385 id=385 data-nosnippet>385</a> </span>cancel.cancel();
|
||||
<a href=#386 id=386 data-nosnippet>386</a> })
|
||||
<a href=#387 id=387 data-nosnippet>387</a> .<span class="kw">await</span>;
|
||||
<a href=#388 id=388 data-nosnippet>388</a>}
|
||||
<a href=#389 id=389 data-nosnippet>389</a>
|
||||
<a href=#390 id=390 data-nosnippet>390</a><span class="doccomment">/// Periodically check for expired packets and remove them.
|
||||
<a href=#391 id=391 data-nosnippet>391</a></span><span class="kw">async fn </span>evict_task_inner(send: mpsc::Sender<Message>, options: Options) -> <span class="prelude-ty">Result</span><()> {
|
||||
<a href=#392 id=392 data-nosnippet>392</a> <span class="kw">let </span>expiry_us = options.eviction.as_micros() <span class="kw">as </span>u64;
|
||||
<a href=#393 id=393 data-nosnippet>393</a> <span class="kw">loop </span>{
|
||||
<a href=#394 id=394 data-nosnippet>394</a> <span class="kw">let </span>(tx, rx) = oneshot::channel();
|
||||
<a href=#395 id=395 data-nosnippet>395</a> <span class="kw">let _ </span>= send.send(Message::Snapshot { res: tx }).<span class="kw">await</span>.ok();
|
||||
<a href=#396 id=396 data-nosnippet>396</a> <span class="comment">// if we can't get the snapshot we exit the loop, main actor dead
|
||||
<a href=#397 id=397 data-nosnippet>397</a> </span><span class="kw">let </span>snapshot = rx.<span class="kw">await</span>.context(<span class="string">"failed to get snapshot"</span>)<span class="question-mark">?</span>;
|
||||
<a href=#398 id=398 data-nosnippet>398</a>
|
||||
<a href=#399 id=399 data-nosnippet>399</a> <span class="kw">let </span>expired = Timestamp::now() - expiry_us;
|
||||
<a href=#400 id=400 data-nosnippet>400</a> <span class="macro">trace!</span>(<span class="string">"evicting packets older than {}"</span>, fmt_time(expired));
|
||||
<a href=#401 id=401 data-nosnippet>401</a> <span class="comment">// if getting the range fails we exit the loop and shut down
|
||||
<a href=#402 id=402 data-nosnippet>402</a> // if individual reads fail we log the error and limp on
|
||||
<a href=#403 id=403 data-nosnippet>403</a> </span><span class="kw">for </span>item <span class="kw">in </span>snapshot.update_time.range(..expired.to_bytes()).e()<span class="question-mark">? </span>{
|
||||
<a href=#404 id=404 data-nosnippet>404</a> <span class="kw">let </span>(time, keys) = <span class="kw">match </span>item {
|
||||
<a href=#405 id=405 data-nosnippet>405</a> <span class="prelude-val">Ok</span>(v) => v,
|
||||
<a href=#406 id=406 data-nosnippet>406</a> <span class="prelude-val">Err</span>(e) => {
|
||||
<a href=#407 id=407 data-nosnippet>407</a> <span class="macro">error!</span>(<span class="string">"failed to read update_time row {:?}"</span>, e);
|
||||
<a href=#408 id=408 data-nosnippet>408</a> <span class="kw">continue</span>;
|
||||
<a href=#409 id=409 data-nosnippet>409</a> }
|
||||
<a href=#410 id=410 data-nosnippet>410</a> };
|
||||
<a href=#411 id=411 data-nosnippet>411</a> <span class="kw">let </span>time = Timestamp::from(time.value());
|
||||
<a href=#412 id=412 data-nosnippet>412</a> <span class="macro">trace!</span>(<span class="string">"evicting expired packets at {}"</span>, fmt_time(time));
|
||||
<a href=#413 id=413 data-nosnippet>413</a> <span class="kw">for </span>item <span class="kw">in </span>keys {
|
||||
<a href=#414 id=414 data-nosnippet>414</a> <span class="kw">let </span>key = <span class="kw">match </span>item {
|
||||
<a href=#415 id=415 data-nosnippet>415</a> <span class="prelude-val">Ok</span>(v) => v,
|
||||
<a href=#416 id=416 data-nosnippet>416</a> <span class="prelude-val">Err</span>(e) => {
|
||||
<a href=#417 id=417 data-nosnippet>417</a> <span class="macro">error!</span>(
|
||||
<a href=#418 id=418 data-nosnippet>418</a> <span class="string">"failed to read update_time item at {}: {:?}"</span>,
|
||||
<a href=#419 id=419 data-nosnippet>419</a> fmt_time(time),
|
||||
<a href=#420 id=420 data-nosnippet>420</a> e
|
||||
<a href=#421 id=421 data-nosnippet>421</a> );
|
||||
<a href=#422 id=422 data-nosnippet>422</a> <span class="kw">continue</span>;
|
||||
<a href=#423 id=423 data-nosnippet>423</a> }
|
||||
<a href=#424 id=424 data-nosnippet>424</a> };
|
||||
<a href=#425 id=425 data-nosnippet>425</a> <span class="kw">let </span>key = PublicKeyBytes::new(key.value());
|
||||
<a href=#426 id=426 data-nosnippet>426</a>
|
||||
<a href=#427 id=427 data-nosnippet>427</a> <span class="macro">debug!</span>(<span class="string">"evicting expired packet {} {}"</span>, fmt_time(time), key);
|
||||
<a href=#428 id=428 data-nosnippet>428</a> send.send(Message::CheckExpired { time, key }).<span class="kw">await</span>.e()<span class="question-mark">?</span>;
|
||||
<a href=#429 id=429 data-nosnippet>429</a> }
|
||||
<a href=#430 id=430 data-nosnippet>430</a> }
|
||||
<a href=#431 id=431 data-nosnippet>431</a> <span class="comment">// sleep for the eviction interval so we don't constantly check
|
||||
<a href=#432 id=432 data-nosnippet>432</a> </span>tokio::time::sleep(options.eviction_interval).<span class="kw">await</span>;
|
||||
<a href=#433 id=433 data-nosnippet>433</a> }
|
||||
<a href=#434 id=434 data-nosnippet>434</a>}
|
||||
<a href=#435 id=435 data-nosnippet>435</a>
|
||||
<a href=#436 id=436 data-nosnippet>436</a><span class="doccomment">/// An io thread that drives a future to completion on the current tokio runtime
|
||||
<a href=#437 id=437 data-nosnippet>437</a>///
|
||||
<a href=#438 id=438 data-nosnippet>438</a>/// Inside the future, blocking IO can be done without blocking one of the tokio
|
||||
<a href=#439 id=439 data-nosnippet>439</a>/// pool threads.
|
||||
<a href=#440 id=440 data-nosnippet>440</a></span><span class="attr">#[derive(Debug)]
|
||||
<a href=#441 id=441 data-nosnippet>441</a></span><span class="kw">struct </span>IoThread {
|
||||
<a href=#442 id=442 data-nosnippet>442</a> handle: <span class="prelude-ty">Option</span><std::thread::JoinHandle<()>>,
|
||||
<a href=#443 id=443 data-nosnippet>443</a>}
|
||||
<a href=#444 id=444 data-nosnippet>444</a>
|
||||
<a href=#445 id=445 data-nosnippet>445</a><span class="kw">impl </span>IoThread {
|
||||
<a href=#446 id=446 data-nosnippet>446</a> <span class="doccomment">/// Spawn a new io thread.
|
||||
<a href=#447 id=447 data-nosnippet>447</a> ///
|
||||
<a href=#448 id=448 data-nosnippet>448</a> /// Calling this function requires that the current thread is running in a
|
||||
<a href=#449 id=449 data-nosnippet>449</a> /// tokio runtime. It is up to the caller to make sure the future exits,
|
||||
<a href=#450 id=450 data-nosnippet>450</a> /// e.g. by using a cancellation token. Otherwise, drop will block.
|
||||
<a href=#451 id=451 data-nosnippet>451</a> </span><span class="kw">fn </span>new<F, Fut>(name: <span class="kw-2">&</span>str, f: F) -> <span class="prelude-ty">Result</span><<span class="self">Self</span>>
|
||||
<a href=#452 id=452 data-nosnippet>452</a> <span class="kw">where
|
||||
<a href=#453 id=453 data-nosnippet>453</a> </span>F: FnOnce() -> Fut + Send + <span class="lifetime">'static</span>,
|
||||
<a href=#454 id=454 data-nosnippet>454</a> Fut: Future<Output = ()>,
|
||||
<a href=#455 id=455 data-nosnippet>455</a> {
|
||||
<a href=#456 id=456 data-nosnippet>456</a> <span class="kw">let </span>rt = tokio::runtime::Handle::try_current().context(<span class="string">"get tokio handle"</span>)<span class="question-mark">?</span>;
|
||||
<a href=#457 id=457 data-nosnippet>457</a> <span class="kw">let </span>handle = std::thread::Builder::new()
|
||||
<a href=#458 id=458 data-nosnippet>458</a> .name(name.into())
|
||||
<a href=#459 id=459 data-nosnippet>459</a> .spawn(<span class="kw">move </span>|| rt.block_on(f()))
|
||||
<a href=#460 id=460 data-nosnippet>460</a> .context(<span class="string">"failed to spawn thread"</span>)<span class="question-mark">?</span>;
|
||||
<a href=#461 id=461 data-nosnippet>461</a> <span class="prelude-val">Ok</span>(<span class="self">Self </span>{
|
||||
<a href=#462 id=462 data-nosnippet>462</a> handle: <span class="prelude-val">Some</span>(handle),
|
||||
<a href=#463 id=463 data-nosnippet>463</a> })
|
||||
<a href=#464 id=464 data-nosnippet>464</a> }
|
||||
<a href=#465 id=465 data-nosnippet>465</a>}
|
||||
<a href=#466 id=466 data-nosnippet>466</a>
|
||||
<a href=#467 id=467 data-nosnippet>467</a><span class="kw">impl </span>Drop <span class="kw">for </span>IoThread {
|
||||
<a href=#468 id=468 data-nosnippet>468</a> <span class="kw">fn </span>drop(<span class="kw-2">&mut </span><span class="self">self</span>) {
|
||||
<a href=#469 id=469 data-nosnippet>469</a> <span class="kw">if let </span><span class="prelude-val">Some</span>(handle) = <span class="self">self</span>.handle.take() {
|
||||
<a href=#470 id=470 data-nosnippet>470</a> <span class="kw">let _ </span>= handle.join();
|
||||
<a href=#471 id=471 data-nosnippet>471</a> }
|
||||
<a href=#472 id=472 data-nosnippet>472</a> }
|
||||
<a href=#473 id=473 data-nosnippet>473</a>}
|
||||
<a href=#474 id=474 data-nosnippet>474</a>
|
||||
<a href=#475 id=475 data-nosnippet>475</a><span class="doccomment">/// A wrapper for a tokio mpsc receiver that allows peeking at the next message.
|
||||
<a href=#476 id=476 data-nosnippet>476</a></span><span class="attr">#[derive(Debug)]
|
||||
<a href=#477 id=477 data-nosnippet>477</a></span><span class="kw">pub</span>(<span class="kw">super</span>) <span class="kw">struct </span>PeekableReceiver<T> {
|
||||
<a href=#478 id=478 data-nosnippet>478</a> msg: <span class="prelude-ty">Option</span><T>,
|
||||
<a href=#479 id=479 data-nosnippet>479</a> recv: tokio::sync::mpsc::Receiver<T>,
|
||||
<a href=#480 id=480 data-nosnippet>480</a>}
|
||||
<a href=#481 id=481 data-nosnippet>481</a>
|
||||
<a href=#482 id=482 data-nosnippet>482</a><span class="attr">#[allow(dead_code)]
|
||||
<a href=#483 id=483 data-nosnippet>483</a></span><span class="kw">impl</span><T> PeekableReceiver<T> {
|
||||
<a href=#484 id=484 data-nosnippet>484</a> <span class="kw">pub fn </span>new(recv: tokio::sync::mpsc::Receiver<T>) -> <span class="self">Self </span>{
|
||||
<a href=#485 id=485 data-nosnippet>485</a> <span class="self">Self </span>{ msg: <span class="prelude-val">None</span>, recv }
|
||||
<a href=#486 id=486 data-nosnippet>486</a> }
|
||||
<a href=#487 id=487 data-nosnippet>487</a>
|
||||
<a href=#488 id=488 data-nosnippet>488</a> <span class="doccomment">/// Receive the next message.
|
||||
<a href=#489 id=489 data-nosnippet>489</a> ///
|
||||
<a href=#490 id=490 data-nosnippet>490</a> /// Will block if there are no messages.
|
||||
<a href=#491 id=491 data-nosnippet>491</a> /// Returns None only if there are no more messages (sender is dropped).
|
||||
<a href=#492 id=492 data-nosnippet>492</a> </span><span class="kw">pub async fn </span>recv(<span class="kw-2">&mut </span><span class="self">self</span>) -> <span class="prelude-ty">Option</span><T> {
|
||||
<a href=#493 id=493 data-nosnippet>493</a> <span class="kw">if let </span><span class="prelude-val">Some</span>(msg) = <span class="self">self</span>.msg.take() {
|
||||
<a href=#494 id=494 data-nosnippet>494</a> <span class="kw">return </span><span class="prelude-val">Some</span>(msg);
|
||||
<a href=#495 id=495 data-nosnippet>495</a> }
|
||||
<a href=#496 id=496 data-nosnippet>496</a> <span class="self">self</span>.recv.recv().<span class="kw">await
|
||||
<a href=#497 id=497 data-nosnippet>497</a> </span>}
|
||||
<a href=#498 id=498 data-nosnippet>498</a>
|
||||
<a href=#499 id=499 data-nosnippet>499</a> <span class="doccomment">/// Push back a message. This will only work if there is room for it.
|
||||
<a href=#500 id=500 data-nosnippet>500</a> /// Otherwise, it will fail and return the message.
|
||||
<a href=#501 id=501 data-nosnippet>501</a> </span><span class="kw">pub fn </span>push_back(<span class="kw-2">&mut </span><span class="self">self</span>, msg: T) -> std::result::Result<(), T> {
|
||||
<a href=#502 id=502 data-nosnippet>502</a> <span class="kw">if </span><span class="self">self</span>.msg.is_none() {
|
||||
<a href=#503 id=503 data-nosnippet>503</a> <span class="self">self</span>.msg = <span class="prelude-val">Some</span>(msg);
|
||||
<a href=#504 id=504 data-nosnippet>504</a> <span class="prelude-val">Ok</span>(())
|
||||
<a href=#505 id=505 data-nosnippet>505</a> } <span class="kw">else </span>{
|
||||
<a href=#506 id=506 data-nosnippet>506</a> <span class="prelude-val">Err</span>(msg)
|
||||
<a href=#507 id=507 data-nosnippet>507</a> }
|
||||
<a href=#508 id=508 data-nosnippet>508</a> }
|
||||
<a href=#509 id=509 data-nosnippet>509</a>}</code></pre></div></section></main></body></html>
|
||||
<a href=#278 id=278 data-nosnippet>278</a> <span class="kw">match </span>db.upgrade() {
|
||||
<a href=#279 id=279 data-nosnippet>279</a> <span class="prelude-val">Ok</span>(<span class="bool-val">true</span>) => <span class="macro">info!</span>(<span class="string">"Database was upgraded to redb v3 compatible format"</span>),
|
||||
<a href=#280 id=280 data-nosnippet>280</a> <span class="prelude-val">Ok</span>(<span class="bool-val">false</span>) => {}
|
||||
<a href=#281 id=281 data-nosnippet>281</a> <span class="prelude-val">Err</span>(err) => <span class="macro">warn!</span>(<span class="string">"Database upgrade to redb v3 compatible format failed: {err:#}"</span>),
|
||||
<a href=#282 id=282 data-nosnippet>282</a> }
|
||||
<a href=#283 id=283 data-nosnippet>283</a> <span class="self">Self</span>::open(db, options, metrics)
|
||||
<a href=#284 id=284 data-nosnippet>284</a> }
|
||||
<a href=#285 id=285 data-nosnippet>285</a>
|
||||
<a href=#286 id=286 data-nosnippet>286</a> <span class="kw">pub fn </span>in_memory(options: Options, metrics: Arc<Metrics>) -> <span class="prelude-ty">Result</span><<span class="self">Self</span>> {
|
||||
<a href=#287 id=287 data-nosnippet>287</a> <span class="macro">info!</span>(<span class="string">"using in-memory packet database"</span>);
|
||||
<a href=#288 id=288 data-nosnippet>288</a> <span class="kw">let </span>db = Database::builder()
|
||||
<a href=#289 id=289 data-nosnippet>289</a> .create_with_backend(InMemoryBackend::new())
|
||||
<a href=#290 id=290 data-nosnippet>290</a> .e()<span class="question-mark">?</span>;
|
||||
<a href=#291 id=291 data-nosnippet>291</a> <span class="self">Self</span>::open(db, options, metrics)
|
||||
<a href=#292 id=292 data-nosnippet>292</a> }
|
||||
<a href=#293 id=293 data-nosnippet>293</a>
|
||||
<a href=#294 id=294 data-nosnippet>294</a> <span class="kw">pub fn </span>open(db: Database, options: Options, metrics: Arc<Metrics>) -> <span class="prelude-ty">Result</span><<span class="self">Self</span>> {
|
||||
<a href=#295 id=295 data-nosnippet>295</a> <span class="comment">// create tables
|
||||
<a href=#296 id=296 data-nosnippet>296</a> </span><span class="kw">let </span>write_tx = db.begin_write().e()<span class="question-mark">?</span>;
|
||||
<a href=#297 id=297 data-nosnippet>297</a> <span class="kw">let _ </span>= Tables::new(<span class="kw-2">&</span>write_tx).e()<span class="question-mark">?</span>;
|
||||
<a href=#298 id=298 data-nosnippet>298</a> write_tx.commit().e()<span class="question-mark">?</span>;
|
||||
<a href=#299 id=299 data-nosnippet>299</a> <span class="kw">let </span>(send, recv) = mpsc::channel(<span class="number">1024</span>);
|
||||
<a href=#300 id=300 data-nosnippet>300</a> <span class="kw">let </span>send2 = send.clone();
|
||||
<a href=#301 id=301 data-nosnippet>301</a> <span class="kw">let </span>cancel = CancellationToken::new();
|
||||
<a href=#302 id=302 data-nosnippet>302</a> <span class="kw">let </span>cancel2 = cancel.clone();
|
||||
<a href=#303 id=303 data-nosnippet>303</a> <span class="kw">let </span>cancel3 = cancel.clone();
|
||||
<a href=#304 id=304 data-nosnippet>304</a> <span class="kw">let </span>actor = Actor {
|
||||
<a href=#305 id=305 data-nosnippet>305</a> db,
|
||||
<a href=#306 id=306 data-nosnippet>306</a> recv: PeekableReceiver::new(recv),
|
||||
<a href=#307 id=307 data-nosnippet>307</a> cancel: cancel2,
|
||||
<a href=#308 id=308 data-nosnippet>308</a> options,
|
||||
<a href=#309 id=309 data-nosnippet>309</a> metrics,
|
||||
<a href=#310 id=310 data-nosnippet>310</a> };
|
||||
<a href=#311 id=311 data-nosnippet>311</a> <span class="comment">// start an io thread and donate it to the tokio runtime so we can do blocking IO
|
||||
<a href=#312 id=312 data-nosnippet>312</a> // inside the thread despite being in a tokio runtime
|
||||
<a href=#313 id=313 data-nosnippet>313</a> </span><span class="kw">let </span>_write_thread = IoThread::new(<span class="string">"packet-store-actor"</span>, <span class="kw">move </span>|| actor.run())<span class="question-mark">?</span>;
|
||||
<a href=#314 id=314 data-nosnippet>314</a> <span class="kw">let </span>_evict_thread = IoThread::new(<span class="string">"packet-store-evict"</span>, <span class="kw">move </span>|| {
|
||||
<a href=#315 id=315 data-nosnippet>315</a> evict_task(send2, options, cancel3)
|
||||
<a href=#316 id=316 data-nosnippet>316</a> })<span class="question-mark">?</span>;
|
||||
<a href=#317 id=317 data-nosnippet>317</a> <span class="prelude-val">Ok</span>(<span class="self">Self </span>{
|
||||
<a href=#318 id=318 data-nosnippet>318</a> send,
|
||||
<a href=#319 id=319 data-nosnippet>319</a> cancel,
|
||||
<a href=#320 id=320 data-nosnippet>320</a> _write_thread,
|
||||
<a href=#321 id=321 data-nosnippet>321</a> _evict_thread,
|
||||
<a href=#322 id=322 data-nosnippet>322</a> })
|
||||
<a href=#323 id=323 data-nosnippet>323</a> }
|
||||
<a href=#324 id=324 data-nosnippet>324</a>
|
||||
<a href=#325 id=325 data-nosnippet>325</a> <span class="kw">pub async fn </span>upsert(<span class="kw-2">&</span><span class="self">self</span>, packet: SignedPacket) -> <span class="prelude-ty">Result</span><bool> {
|
||||
<a href=#326 id=326 data-nosnippet>326</a> <span class="kw">let </span>(tx, rx) = oneshot::channel();
|
||||
<a href=#327 id=327 data-nosnippet>327</a> <span class="self">self</span>.send
|
||||
<a href=#328 id=328 data-nosnippet>328</a> .send(Message::Upsert { packet, res: tx })
|
||||
<a href=#329 id=329 data-nosnippet>329</a> .<span class="kw">await
|
||||
<a href=#330 id=330 data-nosnippet>330</a> </span>.e()<span class="question-mark">?</span>;
|
||||
<a href=#331 id=331 data-nosnippet>331</a> rx.<span class="kw">await</span>.e()
|
||||
<a href=#332 id=332 data-nosnippet>332</a> }
|
||||
<a href=#333 id=333 data-nosnippet>333</a>
|
||||
<a href=#334 id=334 data-nosnippet>334</a> <span class="kw">pub async fn </span>get(<span class="kw-2">&</span><span class="self">self</span>, key: <span class="kw-2">&</span>PublicKeyBytes) -> <span class="prelude-ty">Result</span><<span class="prelude-ty">Option</span><SignedPacket>> {
|
||||
<a href=#335 id=335 data-nosnippet>335</a> <span class="kw">let </span>(tx, rx) = oneshot::channel();
|
||||
<a href=#336 id=336 data-nosnippet>336</a> <span class="self">self</span>.send
|
||||
<a href=#337 id=337 data-nosnippet>337</a> .send(Message::Get { key: <span class="kw-2">*</span>key, res: tx })
|
||||
<a href=#338 id=338 data-nosnippet>338</a> .<span class="kw">await
|
||||
<a href=#339 id=339 data-nosnippet>339</a> </span>.e()<span class="question-mark">?</span>;
|
||||
<a href=#340 id=340 data-nosnippet>340</a> rx.<span class="kw">await</span>.e()
|
||||
<a href=#341 id=341 data-nosnippet>341</a> }
|
||||
<a href=#342 id=342 data-nosnippet>342</a>
|
||||
<a href=#343 id=343 data-nosnippet>343</a> <span class="kw">pub async fn </span>remove(<span class="kw-2">&</span><span class="self">self</span>, key: <span class="kw-2">&</span>PublicKeyBytes) -> <span class="prelude-ty">Result</span><bool> {
|
||||
<a href=#344 id=344 data-nosnippet>344</a> <span class="kw">let </span>(tx, rx) = oneshot::channel();
|
||||
<a href=#345 id=345 data-nosnippet>345</a> <span class="self">self</span>.send
|
||||
<a href=#346 id=346 data-nosnippet>346</a> .send(Message::Remove { key: <span class="kw-2">*</span>key, res: tx })
|
||||
<a href=#347 id=347 data-nosnippet>347</a> .<span class="kw">await
|
||||
<a href=#348 id=348 data-nosnippet>348</a> </span>.e()<span class="question-mark">?</span>;
|
||||
<a href=#349 id=349 data-nosnippet>349</a> rx.<span class="kw">await</span>.e()
|
||||
<a href=#350 id=350 data-nosnippet>350</a> }
|
||||
<a href=#351 id=351 data-nosnippet>351</a>}
|
||||
<a href=#352 id=352 data-nosnippet>352</a>
|
||||
<a href=#353 id=353 data-nosnippet>353</a><span class="kw">fn </span>get_packet(
|
||||
<a href=#354 id=354 data-nosnippet>354</a> table: <span class="kw-2">&</span><span class="kw">impl </span>ReadableTable<<span class="kw-2">&</span><span class="lifetime">'static </span>SignedPacketsKey, <span class="kw-2">&</span><span class="lifetime">'static </span>[u8]>,
|
||||
<a href=#355 id=355 data-nosnippet>355</a> key: <span class="kw-2">&</span>PublicKeyBytes,
|
||||
<a href=#356 id=356 data-nosnippet>356</a>) -> <span class="prelude-ty">Result</span><<span class="prelude-ty">Option</span><SignedPacket>> {
|
||||
<a href=#357 id=357 data-nosnippet>357</a> <span class="kw">let </span><span class="prelude-val">Some</span>(row) = table.get(key.as_ref()).context(<span class="string">"database fetch failed"</span>)<span class="question-mark">? </span><span class="kw">else </span>{
|
||||
<a href=#358 id=358 data-nosnippet>358</a> <span class="kw">return </span><span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>);
|
||||
<a href=#359 id=359 data-nosnippet>359</a> };
|
||||
<a href=#360 id=360 data-nosnippet>360</a> <span class="kw">match </span>SignedPacket::deserialize(row.value()) {
|
||||
<a href=#361 id=361 data-nosnippet>361</a> <span class="prelude-val">Ok</span>(packet) => <span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>(packet)),
|
||||
<a href=#362 id=362 data-nosnippet>362</a> <span class="prelude-val">Err</span>(err) => {
|
||||
<a href=#363 id=363 data-nosnippet>363</a> <span class="comment">// Prior to iroh-dns-server v0.35, we stored packets in the default `SignedPacket::as_bytes` serialization from pkarr v2,
|
||||
<a href=#364 id=364 data-nosnippet>364</a> // which did not include the `last_seen` timestamp added as a prefix in `SignedPacket::serialize` from pkarr v3.
|
||||
<a href=#365 id=365 data-nosnippet>365</a> // If decoding the packet as a serialized pkarr v3 packet fails, we assume it was stored with iroh-dns-server before v0.35,
|
||||
<a href=#366 id=366 data-nosnippet>366</a> // and prepend an empty timestamp.
|
||||
<a href=#367 id=367 data-nosnippet>367</a> </span><span class="kw">let </span>data = row.value();
|
||||
<a href=#368 id=368 data-nosnippet>368</a> <span class="kw">let </span><span class="kw-2">mut </span>buf = Vec::with_capacity(data.len() + <span class="number">8</span>);
|
||||
<a href=#369 id=369 data-nosnippet>369</a> buf.extend(<span class="kw-2">&</span>[<span class="number">0u8</span>; <span class="number">8</span>]);
|
||||
<a href=#370 id=370 data-nosnippet>370</a> buf.extend(data);
|
||||
<a href=#371 id=371 data-nosnippet>371</a> <span class="kw">match </span>SignedPacket::deserialize(<span class="kw-2">&</span>buf) {
|
||||
<a href=#372 id=372 data-nosnippet>372</a> <span class="prelude-val">Ok</span>(packet) => <span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>(packet)),
|
||||
<a href=#373 id=373 data-nosnippet>373</a> <span class="prelude-val">Err</span>(err2) => <span class="prelude-val">Err</span>(<span class="macro">format_err!</span>(
|
||||
<a href=#374 id=374 data-nosnippet>374</a> <span class="string">"Failed to decode as pkarr v3: {err:#}. Also failed to decode as pkarr v2: {err2:#}"
|
||||
<a href=#375 id=375 data-nosnippet>375</a> </span>)),
|
||||
<a href=#376 id=376 data-nosnippet>376</a> }
|
||||
<a href=#377 id=377 data-nosnippet>377</a> }
|
||||
<a href=#378 id=378 data-nosnippet>378</a> }
|
||||
<a href=#379 id=379 data-nosnippet>379</a>}
|
||||
<a href=#380 id=380 data-nosnippet>380</a>
|
||||
<a href=#381 id=381 data-nosnippet>381</a><span class="kw">async fn </span>evict_task(send: mpsc::Sender<Message>, options: Options, cancel: CancellationToken) {
|
||||
<a href=#382 id=382 data-nosnippet>382</a> <span class="kw">let </span>cancel2 = cancel.clone();
|
||||
<a href=#383 id=383 data-nosnippet>383</a> <span class="kw">let _ </span>= cancel2
|
||||
<a href=#384 id=384 data-nosnippet>384</a> .run_until_cancelled(<span class="kw">async move </span>{
|
||||
<a href=#385 id=385 data-nosnippet>385</a> <span class="macro">info!</span>(<span class="string">"starting evict task"</span>);
|
||||
<a href=#386 id=386 data-nosnippet>386</a> <span class="kw">if let </span><span class="prelude-val">Err</span>(cause) = evict_task_inner(send, options).<span class="kw">await </span>{
|
||||
<a href=#387 id=387 data-nosnippet>387</a> <span class="macro">error!</span>(<span class="string">"evict task failed: {:?}"</span>, cause);
|
||||
<a href=#388 id=388 data-nosnippet>388</a> }
|
||||
<a href=#389 id=389 data-nosnippet>389</a> <span class="comment">// when we are done for whatever reason we want to shut down the actor
|
||||
<a href=#390 id=390 data-nosnippet>390</a> </span>cancel.cancel();
|
||||
<a href=#391 id=391 data-nosnippet>391</a> })
|
||||
<a href=#392 id=392 data-nosnippet>392</a> .<span class="kw">await</span>;
|
||||
<a href=#393 id=393 data-nosnippet>393</a>}
|
||||
<a href=#394 id=394 data-nosnippet>394</a>
|
||||
<a href=#395 id=395 data-nosnippet>395</a><span class="doccomment">/// Periodically check for expired packets and remove them.
|
||||
<a href=#396 id=396 data-nosnippet>396</a></span><span class="kw">async fn </span>evict_task_inner(send: mpsc::Sender<Message>, options: Options) -> <span class="prelude-ty">Result</span><()> {
|
||||
<a href=#397 id=397 data-nosnippet>397</a> <span class="kw">let </span>expiry_us = options.eviction.as_micros() <span class="kw">as </span>u64;
|
||||
<a href=#398 id=398 data-nosnippet>398</a> <span class="kw">loop </span>{
|
||||
<a href=#399 id=399 data-nosnippet>399</a> <span class="kw">let </span>(tx, rx) = oneshot::channel();
|
||||
<a href=#400 id=400 data-nosnippet>400</a> <span class="kw">let _ </span>= send.send(Message::Snapshot { res: tx }).<span class="kw">await</span>.ok();
|
||||
<a href=#401 id=401 data-nosnippet>401</a> <span class="comment">// if we can't get the snapshot we exit the loop, main actor dead
|
||||
<a href=#402 id=402 data-nosnippet>402</a> </span><span class="kw">let </span>snapshot = rx.<span class="kw">await</span>.context(<span class="string">"failed to get snapshot"</span>)<span class="question-mark">?</span>;
|
||||
<a href=#403 id=403 data-nosnippet>403</a>
|
||||
<a href=#404 id=404 data-nosnippet>404</a> <span class="kw">let </span>expired = Timestamp::now() - expiry_us;
|
||||
<a href=#405 id=405 data-nosnippet>405</a> <span class="macro">trace!</span>(<span class="string">"evicting packets older than {}"</span>, fmt_time(expired));
|
||||
<a href=#406 id=406 data-nosnippet>406</a> <span class="comment">// if getting the range fails we exit the loop and shut down
|
||||
<a href=#407 id=407 data-nosnippet>407</a> // if individual reads fail we log the error and limp on
|
||||
<a href=#408 id=408 data-nosnippet>408</a> </span><span class="kw">for </span>item <span class="kw">in </span>snapshot.update_time.range(..expired.to_bytes()).e()<span class="question-mark">? </span>{
|
||||
<a href=#409 id=409 data-nosnippet>409</a> <span class="kw">let </span>(time, keys) = <span class="kw">match </span>item {
|
||||
<a href=#410 id=410 data-nosnippet>410</a> <span class="prelude-val">Ok</span>(v) => v,
|
||||
<a href=#411 id=411 data-nosnippet>411</a> <span class="prelude-val">Err</span>(e) => {
|
||||
<a href=#412 id=412 data-nosnippet>412</a> <span class="macro">error!</span>(<span class="string">"failed to read update_time row {:?}"</span>, e);
|
||||
<a href=#413 id=413 data-nosnippet>413</a> <span class="kw">continue</span>;
|
||||
<a href=#414 id=414 data-nosnippet>414</a> }
|
||||
<a href=#415 id=415 data-nosnippet>415</a> };
|
||||
<a href=#416 id=416 data-nosnippet>416</a> <span class="kw">let </span>time = Timestamp::from(time.value());
|
||||
<a href=#417 id=417 data-nosnippet>417</a> <span class="macro">trace!</span>(<span class="string">"evicting expired packets at {}"</span>, fmt_time(time));
|
||||
<a href=#418 id=418 data-nosnippet>418</a> <span class="kw">for </span>item <span class="kw">in </span>keys {
|
||||
<a href=#419 id=419 data-nosnippet>419</a> <span class="kw">let </span>key = <span class="kw">match </span>item {
|
||||
<a href=#420 id=420 data-nosnippet>420</a> <span class="prelude-val">Ok</span>(v) => v,
|
||||
<a href=#421 id=421 data-nosnippet>421</a> <span class="prelude-val">Err</span>(e) => {
|
||||
<a href=#422 id=422 data-nosnippet>422</a> <span class="macro">error!</span>(
|
||||
<a href=#423 id=423 data-nosnippet>423</a> <span class="string">"failed to read update_time item at {}: {:?}"</span>,
|
||||
<a href=#424 id=424 data-nosnippet>424</a> fmt_time(time),
|
||||
<a href=#425 id=425 data-nosnippet>425</a> e
|
||||
<a href=#426 id=426 data-nosnippet>426</a> );
|
||||
<a href=#427 id=427 data-nosnippet>427</a> <span class="kw">continue</span>;
|
||||
<a href=#428 id=428 data-nosnippet>428</a> }
|
||||
<a href=#429 id=429 data-nosnippet>429</a> };
|
||||
<a href=#430 id=430 data-nosnippet>430</a> <span class="kw">let </span>key = PublicKeyBytes::new(key.value());
|
||||
<a href=#431 id=431 data-nosnippet>431</a>
|
||||
<a href=#432 id=432 data-nosnippet>432</a> <span class="macro">debug!</span>(<span class="string">"evicting expired packet {} {}"</span>, fmt_time(time), key);
|
||||
<a href=#433 id=433 data-nosnippet>433</a> send.send(Message::CheckExpired { time, key }).<span class="kw">await</span>.e()<span class="question-mark">?</span>;
|
||||
<a href=#434 id=434 data-nosnippet>434</a> }
|
||||
<a href=#435 id=435 data-nosnippet>435</a> }
|
||||
<a href=#436 id=436 data-nosnippet>436</a> <span class="comment">// sleep for the eviction interval so we don't constantly check
|
||||
<a href=#437 id=437 data-nosnippet>437</a> </span>tokio::time::sleep(options.eviction_interval).<span class="kw">await</span>;
|
||||
<a href=#438 id=438 data-nosnippet>438</a> }
|
||||
<a href=#439 id=439 data-nosnippet>439</a>}
|
||||
<a href=#440 id=440 data-nosnippet>440</a>
|
||||
<a href=#441 id=441 data-nosnippet>441</a><span class="doccomment">/// An io thread that drives a future to completion on the current tokio runtime
|
||||
<a href=#442 id=442 data-nosnippet>442</a>///
|
||||
<a href=#443 id=443 data-nosnippet>443</a>/// Inside the future, blocking IO can be done without blocking one of the tokio
|
||||
<a href=#444 id=444 data-nosnippet>444</a>/// pool threads.
|
||||
<a href=#445 id=445 data-nosnippet>445</a></span><span class="attr">#[derive(Debug)]
|
||||
<a href=#446 id=446 data-nosnippet>446</a></span><span class="kw">struct </span>IoThread {
|
||||
<a href=#447 id=447 data-nosnippet>447</a> handle: <span class="prelude-ty">Option</span><std::thread::JoinHandle<()>>,
|
||||
<a href=#448 id=448 data-nosnippet>448</a>}
|
||||
<a href=#449 id=449 data-nosnippet>449</a>
|
||||
<a href=#450 id=450 data-nosnippet>450</a><span class="kw">impl </span>IoThread {
|
||||
<a href=#451 id=451 data-nosnippet>451</a> <span class="doccomment">/// Spawn a new io thread.
|
||||
<a href=#452 id=452 data-nosnippet>452</a> ///
|
||||
<a href=#453 id=453 data-nosnippet>453</a> /// Calling this function requires that the current thread is running in a
|
||||
<a href=#454 id=454 data-nosnippet>454</a> /// tokio runtime. It is up to the caller to make sure the future exits,
|
||||
<a href=#455 id=455 data-nosnippet>455</a> /// e.g. by using a cancellation token. Otherwise, drop will block.
|
||||
<a href=#456 id=456 data-nosnippet>456</a> </span><span class="kw">fn </span>new<F, Fut>(name: <span class="kw-2">&</span>str, f: F) -> <span class="prelude-ty">Result</span><<span class="self">Self</span>>
|
||||
<a href=#457 id=457 data-nosnippet>457</a> <span class="kw">where
|
||||
<a href=#458 id=458 data-nosnippet>458</a> </span>F: FnOnce() -> Fut + Send + <span class="lifetime">'static</span>,
|
||||
<a href=#459 id=459 data-nosnippet>459</a> Fut: Future<Output = ()>,
|
||||
<a href=#460 id=460 data-nosnippet>460</a> {
|
||||
<a href=#461 id=461 data-nosnippet>461</a> <span class="kw">let </span>rt = tokio::runtime::Handle::try_current().context(<span class="string">"get tokio handle"</span>)<span class="question-mark">?</span>;
|
||||
<a href=#462 id=462 data-nosnippet>462</a> <span class="kw">let </span>handle = std::thread::Builder::new()
|
||||
<a href=#463 id=463 data-nosnippet>463</a> .name(name.into())
|
||||
<a href=#464 id=464 data-nosnippet>464</a> .spawn(<span class="kw">move </span>|| rt.block_on(f()))
|
||||
<a href=#465 id=465 data-nosnippet>465</a> .context(<span class="string">"failed to spawn thread"</span>)<span class="question-mark">?</span>;
|
||||
<a href=#466 id=466 data-nosnippet>466</a> <span class="prelude-val">Ok</span>(<span class="self">Self </span>{
|
||||
<a href=#467 id=467 data-nosnippet>467</a> handle: <span class="prelude-val">Some</span>(handle),
|
||||
<a href=#468 id=468 data-nosnippet>468</a> })
|
||||
<a href=#469 id=469 data-nosnippet>469</a> }
|
||||
<a href=#470 id=470 data-nosnippet>470</a>}
|
||||
<a href=#471 id=471 data-nosnippet>471</a>
|
||||
<a href=#472 id=472 data-nosnippet>472</a><span class="kw">impl </span>Drop <span class="kw">for </span>IoThread {
|
||||
<a href=#473 id=473 data-nosnippet>473</a> <span class="kw">fn </span>drop(<span class="kw-2">&mut </span><span class="self">self</span>) {
|
||||
<a href=#474 id=474 data-nosnippet>474</a> <span class="kw">if let </span><span class="prelude-val">Some</span>(handle) = <span class="self">self</span>.handle.take() {
|
||||
<a href=#475 id=475 data-nosnippet>475</a> <span class="kw">let _ </span>= handle.join();
|
||||
<a href=#476 id=476 data-nosnippet>476</a> }
|
||||
<a href=#477 id=477 data-nosnippet>477</a> }
|
||||
<a href=#478 id=478 data-nosnippet>478</a>}
|
||||
<a href=#479 id=479 data-nosnippet>479</a>
|
||||
<a href=#480 id=480 data-nosnippet>480</a><span class="doccomment">/// A wrapper for a tokio mpsc receiver that allows peeking at the next message.
|
||||
<a href=#481 id=481 data-nosnippet>481</a></span><span class="attr">#[derive(Debug)]
|
||||
<a href=#482 id=482 data-nosnippet>482</a></span><span class="kw">pub</span>(<span class="kw">super</span>) <span class="kw">struct </span>PeekableReceiver<T> {
|
||||
<a href=#483 id=483 data-nosnippet>483</a> msg: <span class="prelude-ty">Option</span><T>,
|
||||
<a href=#484 id=484 data-nosnippet>484</a> recv: tokio::sync::mpsc::Receiver<T>,
|
||||
<a href=#485 id=485 data-nosnippet>485</a>}
|
||||
<a href=#486 id=486 data-nosnippet>486</a>
|
||||
<a href=#487 id=487 data-nosnippet>487</a><span class="attr">#[allow(dead_code)]
|
||||
<a href=#488 id=488 data-nosnippet>488</a></span><span class="kw">impl</span><T> PeekableReceiver<T> {
|
||||
<a href=#489 id=489 data-nosnippet>489</a> <span class="kw">pub fn </span>new(recv: tokio::sync::mpsc::Receiver<T>) -> <span class="self">Self </span>{
|
||||
<a href=#490 id=490 data-nosnippet>490</a> <span class="self">Self </span>{ msg: <span class="prelude-val">None</span>, recv }
|
||||
<a href=#491 id=491 data-nosnippet>491</a> }
|
||||
<a href=#492 id=492 data-nosnippet>492</a>
|
||||
<a href=#493 id=493 data-nosnippet>493</a> <span class="doccomment">/// Receive the next message.
|
||||
<a href=#494 id=494 data-nosnippet>494</a> ///
|
||||
<a href=#495 id=495 data-nosnippet>495</a> /// Will block if there are no messages.
|
||||
<a href=#496 id=496 data-nosnippet>496</a> /// Returns None only if there are no more messages (sender is dropped).
|
||||
<a href=#497 id=497 data-nosnippet>497</a> </span><span class="kw">pub async fn </span>recv(<span class="kw-2">&mut </span><span class="self">self</span>) -> <span class="prelude-ty">Option</span><T> {
|
||||
<a href=#498 id=498 data-nosnippet>498</a> <span class="kw">if let </span><span class="prelude-val">Some</span>(msg) = <span class="self">self</span>.msg.take() {
|
||||
<a href=#499 id=499 data-nosnippet>499</a> <span class="kw">return </span><span class="prelude-val">Some</span>(msg);
|
||||
<a href=#500 id=500 data-nosnippet>500</a> }
|
||||
<a href=#501 id=501 data-nosnippet>501</a> <span class="self">self</span>.recv.recv().<span class="kw">await
|
||||
<a href=#502 id=502 data-nosnippet>502</a> </span>}
|
||||
<a href=#503 id=503 data-nosnippet>503</a>
|
||||
<a href=#504 id=504 data-nosnippet>504</a> <span class="doccomment">/// Push back a message. This will only work if there is room for it.
|
||||
<a href=#505 id=505 data-nosnippet>505</a> /// Otherwise, it will fail and return the message.
|
||||
<a href=#506 id=506 data-nosnippet>506</a> </span><span class="kw">pub fn </span>push_back(<span class="kw-2">&mut </span><span class="self">self</span>, msg: T) -> std::result::Result<(), T> {
|
||||
<a href=#507 id=507 data-nosnippet>507</a> <span class="kw">if </span><span class="self">self</span>.msg.is_none() {
|
||||
<a href=#508 id=508 data-nosnippet>508</a> <span class="self">self</span>.msg = <span class="prelude-val">Some</span>(msg);
|
||||
<a href=#509 id=509 data-nosnippet>509</a> <span class="prelude-val">Ok</span>(())
|
||||
<a href=#510 id=510 data-nosnippet>510</a> } <span class="kw">else </span>{
|
||||
<a href=#511 id=511 data-nosnippet>511</a> <span class="prelude-val">Err</span>(msg)
|
||||
<a href=#512 id=512 data-nosnippet>512</a> }
|
||||
<a href=#513 id=513 data-nosnippet>513</a> }
|
||||
<a href=#514 id=514 data-nosnippet>514</a>}</code></pre></div></section></main></body></html>
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,9 +1,9 @@
|
||||
(function() {
|
||||
var implementors = Object.fromEntries([["iroh_relay",[["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.FromIterator.html\" title=\"trait core::iter::traits::collect::FromIterator\">FromIterator</a><<a class=\"struct\" href=\"iroh_base/relay_url/struct.RelayUrl.html\" title=\"struct iroh_base::relay_url::RelayUrl\">RelayUrl</a>> for <a class=\"struct\" href=\"iroh_relay/struct.RelayMap.html\" title=\"struct iroh_relay::RelayMap\">RelayMap</a>"],["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.FromIterator.html\" title=\"trait core::iter::traits::collect::FromIterator\">FromIterator</a><<a class=\"struct\" href=\"iroh_relay/struct.RelayNode.html\" title=\"struct iroh_relay::RelayNode\">RelayNode</a>> for <a class=\"struct\" href=\"iroh_relay/struct.RelayMap.html\" title=\"struct iroh_relay::RelayMap\">RelayMap</a>"]]]]);
|
||||
var implementors = Object.fromEntries([["iroh_relay",[["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.FromIterator.html\" title=\"trait core::iter::traits::collect::FromIterator\">FromIterator</a><<a class=\"struct\" href=\"https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html\" title=\"struct alloc::boxed::Box\">Box</a><[<a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.u8.html\">u8</a>]>> for <a class=\"struct\" href=\"iroh_relay/dns/struct.TxtRecordData.html\" title=\"struct iroh_relay::dns::TxtRecordData\">TxtRecordData</a>"],["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.FromIterator.html\" title=\"trait core::iter::traits::collect::FromIterator\">FromIterator</a><<a class=\"struct\" href=\"iroh_base/relay_url/struct.RelayUrl.html\" title=\"struct iroh_base::relay_url::RelayUrl\">RelayUrl</a>> for <a class=\"struct\" href=\"iroh_relay/struct.RelayMap.html\" title=\"struct iroh_relay::RelayMap\">RelayMap</a>"],["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.FromIterator.html\" title=\"trait core::iter::traits::collect::FromIterator\">FromIterator</a><<a class=\"struct\" href=\"iroh_relay/struct.RelayNode.html\" title=\"struct iroh_relay::RelayNode\">RelayNode</a>> for <a class=\"struct\" href=\"iroh_relay/struct.RelayMap.html\" title=\"struct iroh_relay::RelayMap\">RelayMap</a>"]]]]);
|
||||
if (window.register_implementors) {
|
||||
window.register_implementors(implementors);
|
||||
} else {
|
||||
window.pending_implementors = implementors;
|
||||
}
|
||||
})()
|
||||
//{"start":57,"fragment_lengths":[898]}
|
||||
//{"start":57,"fragment_lengths":[1478]}
|
||||
@@ -1,9 +0,0 @@
|
||||
(function() {
|
||||
var implementors = Object.fromEntries([["iroh_relay",[["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html\" title=\"trait core::iter::traits::collect::IntoIterator\">IntoIterator</a> for <a class=\"struct\" href=\"iroh_relay/dns/struct.TxtLookup.html\" title=\"struct iroh_relay::dns::TxtLookup\">TxtLookup</a>"]]]]);
|
||||
if (window.register_implementors) {
|
||||
window.register_implementors(implementors);
|
||||
} else {
|
||||
window.pending_implementors = implementors;
|
||||
}
|
||||
})()
|
||||
//{"start":57,"fragment_lengths":[339]}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user