mirror of
https://github.com/n0-computer/iroh.git
synced 2026-11-28 16:01:09 +00:00
470 lines
117 KiB
HTML
470 lines
117 KiB
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="A URL identifying a relay server."><title>RelayUrl in iroh_base - 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"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="iroh_base" data-themes="" data-resource-suffix="" data-rustdoc-version="1.92.0-nightly (b6f0945e4 2025-10-08)" data-channel="nightly" data-search-js="search-8d3311b9.js" data-stringdex-js="stringdex-828709d0.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-ce535bd0.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">RelayUrl</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../iroh_base/index.html">iroh_<wbr>base</a><span class="version">1.4.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Relay<wbr>Url</a></h2><h3><a href="#deref-methods-Url">Methods from Deref<<wbr>Target=<wbr>Url></a></h3><ul class="block deref-methods"><li><a href="#method.as_str" title="as_str">as_str</a></li><li><a href="#method.authority" title="authority">authority</a></li><li><a href="#method.cannot_be_a_base" title="cannot_be_a_base">cannot_be_a_base</a></li><li><a href="#method.domain" title="domain">domain</a></li><li><a href="#method.fragment" title="fragment">fragment</a></li><li><a href="#method.has_authority" title="has_authority">has_authority</a></li><li><a href="#method.has_host" title="has_host">has_host</a></li><li><a href="#method.host" title="host">host</a></li><li><a href="#method.host_str" title="host_str">host_str</a></li><li><a href="#method.is_special" title="is_special">is_special</a></li><li><a href="#method.join" title="join">join</a></li><li><a href="#method.make_relative" title="make_relative">make_relative</a></li><li><a href="#method.origin" title="origin">origin</a></li><li><a href="#method.password" title="password">password</a></li><li><a href="#method.path" title="path">path</a></li><li><a href="#method.path_segments" title="path_segments">path_segments</a></li><li><a href="#method.port" title="port">port</a></li><li><a href="#method.port_or_known_default" title="port_or_known_default">port_or_known_default</a></li><li><a href="#method.query" title="query">query</a></li><li><a href="#method.query_pairs" title="query_pairs">query_pairs</a></li><li><a href="#method.scheme" title="scheme">scheme</a></li><li><a href="#method.serialize_internal" title="serialize_internal">serialize_internal</a></li><li><a href="#method.socket_addrs" title="socket_addrs">socket_addrs</a></li><li><a href="#method.to_file_path" title="to_file_path">to_file_path</a></li><li><a href="#method.username" title="username">username</a></li></ul><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block trait-implementation"><li><a href="#impl-Clone-for-RelayUrl" title="Clone">Clone</a></li><li><a href="#impl-Debug-for-RelayUrl" title="Debug">Debug</a></li><li><a href="#impl-Deref-for-RelayUrl" title="Deref">Deref</a></li><li><a href="#impl-Deserialize%3C'de%3E-for-RelayUrl" title="Deserialize<'de>">Deserialize<'de></a></li><li><a href="#impl-Display-for-RelayUrl" title="Display">Display</a></li><li><a href="#impl-Eq-for-RelayUrl" title="Eq">Eq</a></li><li><a href="#impl-From%3CRelayUrl%3E-for-Url" title="From<RelayUrl>">From<RelayUrl></a></li><li><a href="#impl-From%3CUrl%3E-for-RelayUrl" title="From<Url>">From<Url></a></li><li><a href="#impl-FromStr-for-RelayUrl" title="FromStr">FromStr</a></li><li><a href="#impl-Hash-for-RelayUrl" title="Hash">Hash</a></li><li><a href="#impl-Ord-for-RelayUrl" title="Ord">Ord</a></li><li><a href="#impl-PartialEq-for-RelayUrl" title="PartialEq">PartialEq</a></li><li><a href="#impl-PartialOrd-for-RelayUrl" title="PartialOrd">PartialOrd</a></li><li><a href="#impl-Serialize-for-RelayUrl" title="Serialize">Serialize</a></li><li><a href="#impl-StructuralPartialEq-for-RelayUrl" title="StructuralPartialEq">StructuralPartialEq</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block synthetic-implementation"><li><a href="#impl-Freeze-for-RelayUrl" title="Freeze">Freeze</a></li><li><a href="#impl-RefUnwindSafe-for-RelayUrl" title="RefUnwindSafe">RefUnwindSafe</a></li><li><a href="#impl-Send-for-RelayUrl" title="Send">Send</a></li><li><a href="#impl-Sync-for-RelayUrl" title="Sync">Sync</a></li><li><a href="#impl-Unpin-for-RelayUrl" title="Unpin">Unpin</a></li><li><a href="#impl-UnwindSafe-for-RelayUrl" title="UnwindSafe">UnwindSafe</a></li></ul><h3><a href="#blanket-implementations">Blanket Implementations</a></h3><ul class="block blanket-implementation"><li><a href="#impl-Any-for-T" title="Any">Any</a></li><li><a href="#impl-Borrow%3CT%3E-for-T" title="Borrow<T>">Borrow<T></a></li><li><a href="#impl-BorrowMut%3CT%3E-for-T" title="BorrowMut<T>">BorrowMut<T></a></li><li><a href="#impl-CloneToUninit-for-T" title="CloneToUninit">CloneToUninit</a></li><li><a href="#impl-DeserializeOwned-for-T" title="DeserializeOwned">DeserializeOwned</a></li><li><a href="#impl-From%3CT%3E-for-T" title="From<T>">From<T></a></li><li><a href="#impl-Instrument-for-T" title="Instrument">Instrument</a></li><li><a href="#impl-Into%3CU%3E-for-T" title="Into<U>">Into<U></a></li><li><a href="#impl-Receiver-for-P" title="Receiver">Receiver</a></li><li><a href="#impl-Same-for-T" title="Same">Same</a></li><li><a href="#impl-ToOwned-for-T" title="ToOwned">ToOwned</a></li><li><a href="#impl-ToString-for-T" title="ToString">ToString</a></li><li><a href="#impl-TryFrom%3CU%3E-for-T" title="TryFrom<U>">TryFrom<U></a></li><li><a href="#impl-TryInto%3CU%3E-for-T" title="TryInto<U>">TryInto<U></a></li><li><a href="#impl-WithSubscriber-for-T" title="WithSubscriber">WithSubscriber</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate iroh_<wbr>base</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">iroh_base</a></div><h1>Struct <span class="struct">Relay<wbr>Url</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_base/relay_url.rs.html#24">Source</a> </span></div><pre class="rust item-decl"><code>pub struct RelayUrl(<span class="comment">/* private fields */</span>);</code></pre><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>relay</code></strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A URL identifying a relay server.</p>
|
||
<p>It is cheaply clonable, as the underlying type is wrapped into an <code>Arc</code>. The main type
|
||
under the hood though is <a href="https://docs.rs/url/2.5.7/url/struct.Url.html" title="struct url::Url"><code>Url</code></a>.</p>
|
||
<p>To create a <a href="struct.RelayUrl.html" title="struct iroh_base::RelayUrl"><code>RelayUrl</code></a> use the <code>From<Url></code> implementation. It adds a trailing <code>/</code> to
|
||
a path that lacks one, so the relay’s own paths are joined under it: <code>https://example.com/prefix</code>
|
||
becomes <code>https://example.com/prefix/</code>. Deserialising goes through it too.</p>
|
||
<p>It is encouraged to use a fully-qualified DNS domain name in the URL. Meaning a DNS
|
||
name which ends in a <code>.</code>, e.g, in <code>relay.example.com.</code>. Otherwise the DNS resolution of
|
||
your local host or network could interpret the DNS name as relative and in some
|
||
configurations might cause additional delays or even connection problems.</p>
|
||
</div></details><details class="toggle big-toggle" open><summary><h2 id="deref-methods-Url" class="section-header"><span>Methods from <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a><Target = <a class="struct" href="https://docs.rs/url/2.5.7/url/struct.Url.html" title="struct url::Url">Url</a>></span><a href="#deref-methods-Url" class="anchor">§</a></h2></summary><div id="deref-methods-Url-1" class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.join" class="method"><a class="src rightside" href="https://docs.rs/url/2.5.7/src/url/lib.rs.html#471">Source</a><h4 class="code-header">pub fn <a href="#method.join" class="fn">join</a>(&self, input: &<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="https://docs.rs/url/2.5.7/url/struct.Url.html" title="struct url::Url">Url</a>, <a class="enum" href="https://docs.rs/url/2.5.7/url/parser/enum.ParseError.html" title="enum url::parser::ParseError">ParseError</a>></h4></section></summary><div class="docblock"><p>Parse a string as an URL, with this URL as the base URL.</p>
|
||
<p>The inverse of this is <a href="#method.make_relative"><code>make_relative</code></a>.</p>
|
||
<h5 id="notes"><a class="doc-anchor" href="#notes">§</a>Notes</h5>
|
||
<ul>
|
||
<li>A trailing slash is significant.
|
||
Without it, the last path component is considered to be a “file” name
|
||
to be removed to get at the “directory” that is used as the base.</li>
|
||
<li>A <a href="https://url.spec.whatwg.org/#scheme-relative-special-url-string">scheme relative special URL</a>
|
||
as input replaces everything in the base URL after the scheme.</li>
|
||
<li>An absolute URL (with a scheme) as input replaces the whole base URL (even the scheme).</li>
|
||
</ul>
|
||
<h5 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="comment">// Base without a trailing slash
|
||
</span><span class="kw">let </span>base = Url::parse(<span class="string">"https://example.net/a/b.html"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span>url = base.join(<span class="string">"c.png"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.as_str(), <span class="string">"https://example.net/a/c.png"</span>); <span class="comment">// Not /a/b.html/c.png
|
||
|
||
// Base with a trailing slash
|
||
</span><span class="kw">let </span>base = Url::parse(<span class="string">"https://example.net/a/b/"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span>url = base.join(<span class="string">"c.png"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.as_str(), <span class="string">"https://example.net/a/b/c.png"</span>);
|
||
|
||
<span class="comment">// Input as scheme relative special URL
|
||
</span><span class="kw">let </span>base = Url::parse(<span class="string">"https://alice.com/a"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span>url = base.join(<span class="string">"//eve.com/b"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.as_str(), <span class="string">"https://eve.com/b"</span>);
|
||
|
||
<span class="comment">// Input as base url relative special URL
|
||
</span><span class="kw">let </span>base = Url::parse(<span class="string">"https://alice.com/a"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span>url = base.join(<span class="string">"/v1/meta"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.as_str(), <span class="string">"https://alice.com/v1/meta"</span>);
|
||
|
||
<span class="comment">// Input as absolute URL
|
||
</span><span class="kw">let </span>base = Url::parse(<span class="string">"https://alice.com/a"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span>url = base.join(<span class="string">"http://eve.com/b"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.as_str(), <span class="string">"http://eve.com/b"</span>); <span class="comment">// http instead of https
|
||
</span></code></pre></div><h5 id="errors"><a class="doc-anchor" href="#errors">§</a>Errors</h5>
|
||
<p>If the function can not parse an URL from the given string
|
||
with this URL as the base URL, a <a href="enum.ParseError.html"><code>ParseError</code></a> variant will be returned.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.make_relative" class="method"><a class="src rightside" href="https://docs.rs/url/2.5.7/src/url/lib.rs.html#516">Source</a><h4 class="code-header">pub fn <a href="#method.make_relative" class="fn">make_relative</a>(&self, url: &<a class="struct" href="https://docs.rs/url/2.5.7/url/struct.Url.html" title="struct url::Url">Url</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>></h4></section></summary><div class="docblock"><p>Creates a relative URL if possible, with this URL as the base URL.</p>
|
||
<p>This is the inverse of <a href="#method.join"><code>join</code></a>.</p>
|
||
<h5 id="examples-1"><a class="doc-anchor" href="#examples-1">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span>base = Url::parse(<span class="string">"https://example.net/a/b.html"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://example.net/a/c.png"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span>relative = base.make_relative(<span class="kw-2">&</span>url);
|
||
<span class="macro">assert_eq!</span>(relative.as_ref().map(|s| s.as_str()), <span class="prelude-val">Some</span>(<span class="string">"c.png"</span>));
|
||
|
||
<span class="kw">let </span>base = Url::parse(<span class="string">"https://example.net/a/b/"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://example.net/a/b/c.png"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span>relative = base.make_relative(<span class="kw-2">&</span>url);
|
||
<span class="macro">assert_eq!</span>(relative.as_ref().map(|s| s.as_str()), <span class="prelude-val">Some</span>(<span class="string">"c.png"</span>));
|
||
|
||
<span class="kw">let </span>base = Url::parse(<span class="string">"https://example.net/a/b/"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://example.net/a/d/c.png"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span>relative = base.make_relative(<span class="kw-2">&</span>url);
|
||
<span class="macro">assert_eq!</span>(relative.as_ref().map(|s| s.as_str()), <span class="prelude-val">Some</span>(<span class="string">"../d/c.png"</span>));
|
||
|
||
<span class="kw">let </span>base = Url::parse(<span class="string">"https://example.net/a/b.html?c=d"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://example.net/a/b.html?e=f"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span>relative = base.make_relative(<span class="kw-2">&</span>url);
|
||
<span class="macro">assert_eq!</span>(relative.as_ref().map(|s| s.as_str()), <span class="prelude-val">Some</span>(<span class="string">"?e=f"</span>));</code></pre></div><h5 id="errors-1"><a class="doc-anchor" href="#errors-1">§</a>Errors</h5>
|
||
<p>If this URL can’t be a base for the given URL, <code>None</code> is returned.
|
||
This is for example the case if the scheme, host or port are not the same.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.as_str" class="method"><a class="src rightside" href="https://docs.rs/url/2.5.7/src/url/lib.rs.html#653">Source</a><h4 class="code-header">pub fn <a href="#method.as_str" class="fn">as_str</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></h4></section></summary><div class="docblock"><p>Return the serialization of this URL.</p>
|
||
<p>This is fast since that serialization is already stored in the <code>Url</code> struct.</p>
|
||
<h5 id="examples-2"><a class="doc-anchor" href="#examples-2">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span>url_str = <span class="string">"https://example.net/"</span>;
|
||
<span class="kw">let </span>url = Url::parse(url_str)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.as_str(), url_str);</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.origin" class="method"><a class="src rightside" href="https://docs.rs/url/2.5.7/src/url/lib.rs.html#883">Source</a><h4 class="code-header">pub fn <a href="#method.origin" class="fn">origin</a>(&self) -> <a class="enum" href="https://docs.rs/url/2.5.7/url/origin/enum.Origin.html" title="enum url::origin::Origin">Origin</a></h4></section></summary><div class="docblock"><p>Return the origin of this URL (<a href="https://url.spec.whatwg.org/#origin">https://url.spec.whatwg.org/#origin</a>)</p>
|
||
<p>Note: this returns an opaque origin for <code>file:</code> URLs, which causes
|
||
<code>url.origin() != url.origin()</code>.</p>
|
||
<h5 id="examples-3"><a class="doc-anchor" href="#examples-3">§</a>Examples</h5>
|
||
<p>URL with <code>ftp</code> scheme:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::{Host, Origin, Url};
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"ftp://example.com/foo"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.origin(),
|
||
Origin::Tuple(<span class="string">"ftp"</span>.into(),
|
||
Host::Domain(<span class="string">"example.com"</span>.into()),
|
||
<span class="number">21</span>));</code></pre></div>
|
||
<p>URL with <code>blob</code> scheme:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::{Host, Origin, Url};
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"blob:https://example.com/foo"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.origin(),
|
||
Origin::Tuple(<span class="string">"https"</span>.into(),
|
||
Host::Domain(<span class="string">"example.com"</span>.into()),
|
||
<span class="number">443</span>));</code></pre></div>
|
||
<p>URL with <code>file</code> scheme:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::{Host, Origin, Url};
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"file:///tmp/foo"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert!</span>(!url.origin().is_tuple());
|
||
|
||
<span class="kw">let </span>other_url = Url::parse(<span class="string">"file:///tmp/foo"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert!</span>(url.origin() != other_url.origin());</code></pre></div>
|
||
<p>URL with other scheme:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::{Host, Origin, Url};
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"foo:bar"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert!</span>(!url.origin().is_tuple());</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.scheme" class="method"><a class="src rightside" href="https://docs.rs/url/2.5.7/src/url/lib.rs.html#903">Source</a><h4 class="code-header">pub fn <a href="#method.scheme" class="fn">scheme</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></h4></section></summary><div class="docblock"><p>Return the scheme of this URL, lower-cased, as an ASCII string without the ‘:’ delimiter.</p>
|
||
<h5 id="examples-4"><a class="doc-anchor" href="#examples-4">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"file:///tmp/foo"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.scheme(), <span class="string">"file"</span>);</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.is_special" class="method"><a class="src rightside" href="https://docs.rs/url/2.5.7/src/url/lib.rs.html#923">Source</a><h4 class="code-header">pub fn <a href="#method.is_special" class="fn">is_special</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Return whether the URL is special (has a special scheme)</p>
|
||
<h5 id="examples-5"><a class="doc-anchor" href="#examples-5">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="macro">assert!</span>(Url::parse(<span class="string">"http:///tmp/foo"</span>)<span class="question-mark">?</span>.is_special());
|
||
<span class="macro">assert!</span>(Url::parse(<span class="string">"file:///tmp/foo"</span>)<span class="question-mark">?</span>.is_special());
|
||
<span class="macro">assert!</span>(!Url::parse(<span class="string">"moz:///tmp/foo"</span>)<span class="question-mark">?</span>.is_special());</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.has_authority" class="method"><a class="src rightside" href="https://docs.rs/url/2.5.7/src/url/lib.rs.html#956">Source</a><h4 class="code-header">pub fn <a href="#method.has_authority" class="fn">has_authority</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Return whether the URL has an ‘authority’,
|
||
which can contain a username, password, host, and port number.</p>
|
||
<p>URLs that do <em>not</em> are either path-only like <code>unix:/run/foo.socket</code>
|
||
or cannot-be-a-base like <code>data:text/plain,Stuff</code>.</p>
|
||
<p>See also the <code>authority</code> method.</p>
|
||
<h5 id="examples-6"><a class="doc-anchor" href="#examples-6">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"ftp://rms@example.com"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert!</span>(url.has_authority());
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"unix:/run/foo.socket"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert!</span>(!url.has_authority());
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"data:text/plain,Stuff"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert!</span>(!url.has_authority());</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.authority" class="method"><a class="src rightside" href="https://docs.rs/url/2.5.7/src/url/lib.rs.html#993">Source</a><h4 class="code-header">pub fn <a href="#method.authority" class="fn">authority</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></h4></section></summary><div class="docblock"><p>Return the authority of this URL as an ASCII string.</p>
|
||
<p>Non-ASCII domains are punycode-encoded per IDNA if this is the host
|
||
of a special URL, or percent encoded for non-special URLs.
|
||
IPv6 addresses are given between <code>[</code> and <code>]</code> brackets.
|
||
Ports are omitted if they match the well known port of a special URL.</p>
|
||
<p>Username and password are percent-encoded.</p>
|
||
<p>See also the <code>has_authority</code> method.</p>
|
||
<h5 id="examples-7"><a class="doc-anchor" href="#examples-7">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"unix:/run/foo.socket"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.authority(), <span class="string">""</span>);
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"file:///tmp/foo"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.authority(), <span class="string">""</span>);
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://user:password@example.com/tmp/foo"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.authority(), <span class="string">"user:password@example.com"</span>);
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"irc://àlex.рф.example.com:6667/foo"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.authority(), <span class="string">"%C3%A0lex.%D1%80%D1%84.example.com:6667"</span>);
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"http://àlex.рф.example.com:80/foo"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.authority(), <span class="string">"xn--lex-8ka.xn--p1ai.example.com"</span>);</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.cannot_be_a_base" class="method"><a class="src rightside" href="https://docs.rs/url/2.5.7/src/url/lib.rs.html#1028">Source</a><h4 class="code-header">pub fn <a href="#method.cannot_be_a_base" class="fn">cannot_be_a_base</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Return whether this URL is a cannot-be-a-base URL,
|
||
meaning that parsing a relative URL string with this URL as the base will return an error.</p>
|
||
<p>This is the case if the scheme and <code>:</code> delimiter are not followed by a <code>/</code> slash,
|
||
as is typically the case of <code>data:</code> and <code>mailto:</code> URLs.</p>
|
||
<h5 id="examples-8"><a class="doc-anchor" href="#examples-8">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"ftp://rms@example.com"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert!</span>(!url.cannot_be_a_base());
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"unix:/run/foo.socket"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert!</span>(!url.cannot_be_a_base());
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"data:text/plain,Stuff"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert!</span>(url.cannot_be_a_base());</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.username" class="method"><a class="src rightside" href="https://docs.rs/url/2.5.7/src/url/lib.rs.html#1054">Source</a><h4 class="code-header">pub fn <a href="#method.username" class="fn">username</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></h4></section></summary><div class="docblock"><p>Return the username for this URL (typically the empty string)
|
||
as a percent-encoded ASCII string.</p>
|
||
<h5 id="examples-9"><a class="doc-anchor" href="#examples-9">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"ftp://rms@example.com"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.username(), <span class="string">"rms"</span>);
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"ftp://:secret123@example.com"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.username(), <span class="string">""</span>);
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://example.com"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.username(), <span class="string">""</span>);</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.password" class="method"><a class="src rightside" href="https://docs.rs/url/2.5.7/src/url/lib.rs.html#1087">Source</a><h4 class="code-header">pub fn <a href="#method.password" class="fn">password</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>></h4></section></summary><div class="docblock"><p>Return the password for this URL, if any, as a percent-encoded ASCII string.</p>
|
||
<h5 id="examples-10"><a class="doc-anchor" href="#examples-10">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"ftp://rms:secret123@example.com"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.password(), <span class="prelude-val">Some</span>(<span class="string">"secret123"</span>));
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"ftp://:secret123@example.com"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.password(), <span class="prelude-val">Some</span>(<span class="string">"secret123"</span>));
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"ftp://rms@example.com"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.password(), <span class="prelude-val">None</span>);
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://example.com"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.password(), <span class="prelude-val">None</span>);</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.has_host" class="method"><a class="src rightside" href="https://docs.rs/url/2.5.7/src/url/lib.rs.html#1122">Source</a><h4 class="code-header">pub fn <a href="#method.has_host" class="fn">has_host</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Equivalent to <code>url.host().is_some()</code>.</p>
|
||
<h5 id="examples-11"><a class="doc-anchor" href="#examples-11">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"ftp://rms@example.com"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert!</span>(url.has_host());
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"unix:/run/foo.socket"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert!</span>(!url.has_host());
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"data:text/plain,Stuff"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert!</span>(!url.has_host());</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.host_str" class="method"><a class="src rightside" href="https://docs.rs/url/2.5.7/src/url/lib.rs.html#1162">Source</a><h4 class="code-header">pub fn <a href="#method.host_str" class="fn">host_str</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>></h4></section></summary><div class="docblock"><p>Return the string representation of the host (domain or IP address) for this URL, if any.</p>
|
||
<p>Non-ASCII domains are punycode-encoded per IDNA if this is the host
|
||
of a special URL, or percent encoded for non-special URLs.
|
||
IPv6 addresses are given between <code>[</code> and <code>]</code> brackets.</p>
|
||
<p>Cannot-be-a-base URLs (typical of <code>data:</code> and <code>mailto:</code>) and some <code>file:</code> URLs
|
||
don’t have a host.</p>
|
||
<p>See also the <code>host</code> method.</p>
|
||
<h5 id="examples-12"><a class="doc-anchor" href="#examples-12">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://127.0.0.1/index.html"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.host_str(), <span class="prelude-val">Some</span>(<span class="string">"127.0.0.1"</span>));
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://subdomain.example.com"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.host_str(), <span class="prelude-val">Some</span>(<span class="string">"subdomain.example.com"</span>));
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"ftp://rms@example.com"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.host_str(), <span class="prelude-val">Some</span>(<span class="string">"example.com"</span>));
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"unix:/run/foo.socket"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.host_str(), <span class="prelude-val">None</span>);
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"data:text/plain,Stuff"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.host_str(), <span class="prelude-val">None</span>);</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.host" class="method"><a class="src rightside" href="https://docs.rs/url/2.5.7/src/url/lib.rs.html#1201">Source</a><h4 class="code-header">pub fn <a href="#method.host" class="fn">host</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="https://docs.rs/url/2.5.7/url/host/enum.Host.html" title="enum url::host::Host">Host</a><&<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>>></h4></section></summary><div class="docblock"><p>Return the parsed representation of the host for this URL.
|
||
Non-ASCII domain labels are punycode-encoded per IDNA if this is the host
|
||
of a special URL, or percent encoded for non-special URLs.</p>
|
||
<p>Cannot-be-a-base URLs (typical of <code>data:</code> and <code>mailto:</code>) and some <code>file:</code> URLs
|
||
don’t have a host.</p>
|
||
<p>See also the <code>host_str</code> method.</p>
|
||
<h5 id="examples-13"><a class="doc-anchor" href="#examples-13">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://127.0.0.1/index.html"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert!</span>(url.host().is_some());
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"ftp://rms@example.com"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert!</span>(url.host().is_some());
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"unix:/run/foo.socket"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert!</span>(url.host().is_none());
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"data:text/plain,Stuff"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert!</span>(url.host().is_none());</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.domain" class="method"><a class="src rightside" href="https://docs.rs/url/2.5.7/src/url/lib.rs.html#1237">Source</a><h4 class="code-header">pub fn <a href="#method.domain" class="fn">domain</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>></h4></section></summary><div class="docblock"><p>If this URL has a host and it is a domain name (not an IP address), return it.
|
||
Non-ASCII domains are punycode-encoded per IDNA if this is the host
|
||
of a special URL, or percent encoded for non-special URLs.</p>
|
||
<h5 id="examples-14"><a class="doc-anchor" href="#examples-14">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://127.0.0.1/"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.domain(), <span class="prelude-val">None</span>);
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"mailto:rms@example.net"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.domain(), <span class="prelude-val">None</span>);
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://example.com/"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.domain(), <span class="prelude-val">Some</span>(<span class="string">"example.com"</span>));
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://subdomain.example.com/"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.domain(), <span class="prelude-val">Some</span>(<span class="string">"subdomain.example.com"</span>));
|
||
</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.port" class="method"><a class="src rightside" href="https://docs.rs/url/2.5.7/src/url/lib.rs.html#1269">Source</a><h4 class="code-header">pub fn <a href="#method.port" class="fn">port</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u16.html">u16</a>></h4></section></summary><div class="docblock"><p>Return the port number for this URL, if any.</p>
|
||
<p>Note that default port numbers are never reflected by the serialization,
|
||
use the <code>port_or_known_default()</code> method if you want a default port number returned.</p>
|
||
<h5 id="examples-15"><a class="doc-anchor" href="#examples-15">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://example.com"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.port(), <span class="prelude-val">None</span>);
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://example.com:443/"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.port(), <span class="prelude-val">None</span>);
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"ssh://example.com:22"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.port(), <span class="prelude-val">Some</span>(<span class="number">22</span>));</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.port_or_known_default" class="method"><a class="src rightside" href="https://docs.rs/url/2.5.7/src/url/lib.rs.html#1301">Source</a><h4 class="code-header">pub fn <a href="#method.port_or_known_default" class="fn">port_or_known_default</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u16.html">u16</a>></h4></section></summary><div class="docblock"><p>Return the port number for this URL, or the default port number if it is known.</p>
|
||
<p>This method only knows the default port number
|
||
of the <code>http</code>, <code>https</code>, <code>ws</code>, <code>wss</code> and <code>ftp</code> schemes.</p>
|
||
<p>For URLs in these schemes, this method always returns <code>Some(_)</code>.
|
||
For other schemes, it is the same as <code>Url::port()</code>.</p>
|
||
<h5 id="examples-16"><a class="doc-anchor" href="#examples-16">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"foo://example.com"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.port_or_known_default(), <span class="prelude-val">None</span>);
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"foo://example.com:1456"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.port_or_known_default(), <span class="prelude-val">Some</span>(<span class="number">1456</span>));
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://example.com"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.port_or_known_default(), <span class="prelude-val">Some</span>(<span class="number">443</span>));</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.socket_addrs" class="method"><a class="src rightside" href="https://docs.rs/url/2.5.7/src/url/lib.rs.html#1340-1343">Source</a><h4 class="code-header">pub fn <a href="#method.socket_addrs" class="fn">socket_addrs</a>(
|
||
&self,
|
||
default_port_number: impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>() -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u16.html">u16</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="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/net/socket_addr/enum.SocketAddr.html" title="enum core::net::socket_addr::SocketAddr">SocketAddr</a>>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>></h4></section></summary><div class="docblock"><p>Resolve a URL’s host and port number to <code>SocketAddr</code>.</p>
|
||
<p>If the URL has the default port number of a scheme that is unknown to this library,
|
||
<code>default_port_number</code> provides an opportunity to provide the actual port number.
|
||
In non-example code this should be implemented either simply as <code>|| None</code>,
|
||
or by matching on the URL’s <code>.scheme()</code>.</p>
|
||
<p>If the host is a domain, it is resolved using the standard library’s DNS support.</p>
|
||
<h5 id="examples-17"><a class="doc-anchor" href="#examples-17">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>url = url::Url::parse(<span class="string">"https://example.net/"</span>).unwrap();
|
||
<span class="kw">let </span>addrs = url.socket_addrs(|| <span class="prelude-val">None</span>).unwrap();
|
||
std::net::TcpStream::connect(<span class="kw-2">&*</span>addrs)</code></pre></div>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="doccomment">/// With application-specific known default port numbers
|
||
</span><span class="kw">fn </span>socket_addrs(url: url::Url) -> std::io::Result<Vec<std::net::SocketAddr>> {
|
||
url.socket_addrs(|| <span class="kw">match </span>url.scheme() {
|
||
<span class="string">"socks5" </span>| <span class="string">"socks5h" </span>=> <span class="prelude-val">Some</span>(<span class="number">1080</span>),
|
||
<span class="kw">_ </span>=> <span class="prelude-val">None</span>,
|
||
})
|
||
}</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.path" class="method"><a class="src rightside" href="https://docs.rs/url/2.5.7/src/url/lib.rs.html#1391">Source</a><h4 class="code-header">pub fn <a href="#method.path" class="fn">path</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></h4></section></summary><div class="docblock"><p>Return the path for this URL, as a percent-encoded ASCII string.
|
||
For cannot-be-a-base URLs, this is an arbitrary string that doesn’t start with ‘/’.
|
||
For other URLs, this starts with a ‘/’ slash
|
||
and continues with slash-separated path segments.</p>
|
||
<h5 id="examples-18"><a class="doc-anchor" href="#examples-18">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::{Url, ParseError};
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://example.com/api/versions?page=2"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.path(), <span class="string">"/api/versions"</span>);
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://example.com"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.path(), <span class="string">"/"</span>);
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://example.com/countries/việt nam"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.path(), <span class="string">"/countries/vi%E1%BB%87t%20nam"</span>);</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.path_segments" class="method"><a class="src rightside" href="https://docs.rs/url/2.5.7/src/url/lib.rs.html#1442">Source</a><h4 class="code-header">pub fn <a href="#method.path_segments" class="fn">path_segments</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/core/str/iter/struct.Split.html" title="struct core::str::iter::Split">Split</a><'_, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.char.html">char</a>>></h4></section></summary><div class="docblock"><p>Unless this URL is cannot-be-a-base,
|
||
return an iterator of ‘/’ slash-separated path segments,
|
||
each as a percent-encoded ASCII string.</p>
|
||
<p>Return <code>None</code> for cannot-be-a-base URLs.</p>
|
||
<p>When <code>Some</code> is returned, the iterator always contains at least one string
|
||
(which may be empty).</p>
|
||
<h5 id="examples-19"><a class="doc-anchor" href="#examples-19">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://example.com/foo/bar"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span><span class="kw-2">mut </span>path_segments = url.path_segments().ok_or_else(|| <span class="string">"cannot be base"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(path_segments.next(), <span class="prelude-val">Some</span>(<span class="string">"foo"</span>));
|
||
<span class="macro">assert_eq!</span>(path_segments.next(), <span class="prelude-val">Some</span>(<span class="string">"bar"</span>));
|
||
<span class="macro">assert_eq!</span>(path_segments.next(), <span class="prelude-val">None</span>);
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://example.com"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span><span class="kw-2">mut </span>path_segments = url.path_segments().ok_or_else(|| <span class="string">"cannot be base"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(path_segments.next(), <span class="prelude-val">Some</span>(<span class="string">""</span>));
|
||
<span class="macro">assert_eq!</span>(path_segments.next(), <span class="prelude-val">None</span>);
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"data:text/plain,HelloWorld"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert!</span>(url.path_segments().is_none());
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://example.com/countries/việt nam"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span><span class="kw-2">mut </span>path_segments = url.path_segments().ok_or_else(|| <span class="string">"cannot be base"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(path_segments.next(), <span class="prelude-val">Some</span>(<span class="string">"countries"</span>));
|
||
<span class="macro">assert_eq!</span>(path_segments.next(), <span class="prelude-val">Some</span>(<span class="string">"vi%E1%BB%87t%20nam"</span>));</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.query" class="method"><a class="src rightside" href="https://docs.rs/url/2.5.7/src/url/lib.rs.html#1471">Source</a><h4 class="code-header">pub fn <a href="#method.query" class="fn">query</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>></h4></section></summary><div class="docblock"><p>Return this URL’s query string, if any, as a percent-encoded ASCII string.</p>
|
||
<h5 id="examples-20"><a class="doc-anchor" href="#examples-20">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">fn </span>run() -> <span class="prelude-ty">Result</span><(), ParseError> {
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://example.com/products?page=2"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span>query = url.query();
|
||
<span class="macro">assert_eq!</span>(query, <span class="prelude-val">Some</span>(<span class="string">"page=2"</span>));
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://example.com/products"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span>query = url.query();
|
||
<span class="macro">assert!</span>(query.is_none());
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://example.com/?country=español"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span>query = url.query();
|
||
<span class="macro">assert_eq!</span>(query, <span class="prelude-val">Some</span>(<span class="string">"country=espa%C3%B1ol"</span>));</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.query_pairs" class="method"><a class="src rightside" href="https://docs.rs/url/2.5.7/src/url/lib.rs.html#1509">Source</a><h4 class="code-header">pub fn <a href="#method.query_pairs" class="fn">query_pairs</a>(&self) -> Parse<'_></h4></section></summary><div class="docblock"><p>Parse the URL’s query string, if any, as <code>application/x-www-form-urlencoded</code>
|
||
and return an iterator of (key, value) pairs.</p>
|
||
<h5 id="examples-21"><a class="doc-anchor" href="#examples-21">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::borrow::Cow;
|
||
|
||
<span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://example.com/products?page=2&sort=desc"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span><span class="kw-2">mut </span>pairs = url.query_pairs();
|
||
|
||
<span class="macro">assert_eq!</span>(pairs.count(), <span class="number">2</span>);
|
||
|
||
<span class="macro">assert_eq!</span>(pairs.next(), <span class="prelude-val">Some</span>((Cow::Borrowed(<span class="string">"page"</span>), Cow::Borrowed(<span class="string">"2"</span>))));
|
||
<span class="macro">assert_eq!</span>(pairs.next(), <span class="prelude-val">Some</span>((Cow::Borrowed(<span class="string">"sort"</span>), Cow::Borrowed(<span class="string">"desc"</span>))));</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.fragment" class="method"><a class="src rightside" href="https://docs.rs/url/2.5.7/src/url/lib.rs.html#1545">Source</a><h4 class="code-header">pub fn <a href="#method.fragment" class="fn">fragment</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>></h4></section></summary><div class="docblock"><p>Return this URL’s fragment identifier, if any.</p>
|
||
<p>A fragment is the part of the URL after the <code>#</code> symbol.
|
||
The fragment is optional and, if present, contains a fragment identifier
|
||
that identifies a secondary resource, such as a section heading
|
||
of a document.</p>
|
||
<p>In HTML, the fragment identifier is usually the id attribute of a an element
|
||
that is scrolled to on load. Browsers typically will not send the fragment portion
|
||
of a URL to the server.</p>
|
||
<p><strong>Note:</strong> the parser did <em>not</em> percent-encode this component,
|
||
but the input may have been percent-encoded already.</p>
|
||
<h5 id="examples-22"><a class="doc-anchor" href="#examples-22">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://example.com/data.csv#row=4"</span>)<span class="question-mark">?</span>;
|
||
|
||
<span class="macro">assert_eq!</span>(url.fragment(), <span class="prelude-val">Some</span>(<span class="string">"row=4"</span>));
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://example.com/data.csv#cell=4,1-6,2"</span>)<span class="question-mark">?</span>;
|
||
|
||
<span class="macro">assert_eq!</span>(url.fragment(), <span class="prelude-val">Some</span>(<span class="string">"cell=4,1-6,2"</span>));</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.serialize_internal" class="method"><a class="src rightside" href="https://docs.rs/url/2.5.7/src/url/lib.rs.html#2617-2619">Source</a><h4 class="code-header">pub fn <a href="#method.serialize_internal" class="fn">serialize_internal</a><S>(
|
||
&self,
|
||
serializer: S,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<S as <a class="trait" href="https://docs.rs/serde_core/1.0.229/serde_core/ser/trait.Serializer.html" title="trait serde_core::ser::Serializer">Serializer</a>>::<a class="associatedtype" href="https://docs.rs/serde_core/1.0.229/serde_core/ser/trait.Serializer.html#associatedtype.Ok" title="type serde_core::ser::Serializer::Ok">Ok</a>, <S as <a class="trait" href="https://docs.rs/serde_core/1.0.229/serde_core/ser/trait.Serializer.html" title="trait serde_core::ser::Serializer">Serializer</a>>::<a class="associatedtype" href="https://docs.rs/serde_core/1.0.229/serde_core/ser/trait.Serializer.html#associatedtype.Error" title="type serde_core::ser::Serializer::Error">Error</a>><div class="where">where
|
||
S: <a class="trait" href="https://docs.rs/serde_core/1.0.229/serde_core/ser/trait.Serializer.html" title="trait serde_core::ser::Serializer">Serializer</a>,</div></h4></section></summary><div class="docblock"><p>Serialize with Serde using the internal representation of the <code>Url</code> struct.</p>
|
||
<p>The corresponding <code>deserialize_internal</code> method sacrifices some invariant-checking
|
||
for speed, compared to the <code>Deserialize</code> trait impl.</p>
|
||
<p>This method is only available if the <code>serde</code> Cargo feature is enabled.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.to_file_path" class="method"><a class="src rightside" href="https://docs.rs/url/2.5.7/src/url/lib.rs.html#2726">Source</a><h4 class="code-header">pub fn <a href="#method.to_file_path" class="fn">to_file_path</a>(&self) -> <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="https://doc.rust-lang.org/nightly/std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></h4></section></summary><div class="docblock"><p>Assuming the URL is in the <code>file</code> scheme or similar,
|
||
convert its path to an absolute <code>std::path::Path</code>.</p>
|
||
<p><strong>Note:</strong> This does not actually check the URL’s <code>scheme</code>,
|
||
and may give nonsensical results for other schemes.
|
||
It is the user’s responsibility to check the URL’s scheme before calling this.</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>path = url.to_file_path();</code></pre></div>
|
||
<p>Returns <code>Err</code> if the host is neither empty nor <code>"localhost"</code> (except on Windows, where
|
||
<code>file:</code> URLs may have a non-local host),
|
||
or if <code>Path::new_opt()</code> returns <code>None</code>.
|
||
(That is, if the percent-decoded path contains a NUL byte or,
|
||
for a Windows path, is not UTF-8.)</p>
|
||
<p>This method is only available if the <code>std</code> Cargo feature is enabled.</p>
|
||
</div></details></div></details><h2 id="trait-implementations" class="section-header">Trait Implementations<a href="#trait-implementations" class="anchor">§</a></h2><div id="trait-implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-Clone-for-RelayUrl" class="impl"><a class="src rightside" href="../src/iroh_base/relay_url.rs.html#21">Source</a><a href="#impl-Clone-for-RelayUrl" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="struct.RelayUrl.html" title="struct iroh_base::RelayUrl">RelayUrl</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.clone" class="method trait-impl"><a class="src rightside" href="../src/iroh_base/relay_url.rs.html#21">Source</a><a href="#method.clone" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone" class="fn">clone</a>(&self) -> <a class="struct" href="struct.RelayUrl.html" title="struct iroh_base::RelayUrl">RelayUrl</a></h4></section></summary><div class='docblock'>Returns a duplicate of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.clone_from" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/clone.rs.html#245-247">Source</a></span><a href="#method.clone_from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from" class="fn">clone_from</a>(&mut self, source: &Self)</h4></section></summary><div class='docblock'>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Debug-for-RelayUrl" class="impl"><a class="src rightside" href="../src/iroh_base/relay_url.rs.html#75-81">Source</a><a href="#impl-Debug-for-RelayUrl" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="struct.RelayUrl.html" title="struct iroh_base::RelayUrl">RelayUrl</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.fmt-1" class="method trait-impl"><a class="src rightside" href="../src/iroh_base/relay_url.rs.html#76-80">Source</a><a href="#method.fmt-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt" class="fn">fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a><'_>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4></section></summary><div class='docblock'>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Deref-for-RelayUrl" class="impl"><a class="src rightside" href="../src/iroh_base/relay_url.rs.html#67-73">Source</a><a href="#impl-Deref-for-RelayUrl" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a> for <a class="struct" href="struct.RelayUrl.html" title="struct iroh_base::RelayUrl">RelayUrl</a></h3><div class="docblock"><p>Dereferences to the wrapped <a href="https://docs.rs/url/2.5.7/url/struct.Url.html" title="struct url::Url"><code>Url</code></a>.</p>
|
||
</div></section></summary><div class="docblock"><p>Note that <a href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.DerefMut.html" title="trait core::ops::deref::DerefMut"><code>DerefMut</code></a> is not implemented on purpose, so this type has more flexibility
|
||
to change the inner later.</p>
|
||
</div><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Target" class="associatedtype trait-impl"><a class="src rightside" href="../src/iroh_base/relay_url.rs.html#68">Source</a><a href="#associatedtype.Target" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target" class="associatedtype">Target</a> = <a class="struct" href="https://docs.rs/url/2.5.7/url/struct.Url.html" title="struct url::Url">Url</a></h4></section></summary><div class='docblock'>The resulting type after dereferencing.</div></details><details class="toggle method-toggle" open><summary><section id="method.deref" class="method trait-impl"><a class="src rightside" href="../src/iroh_base/relay_url.rs.html#70-72">Source</a><a href="#method.deref" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#tymethod.deref" class="fn">deref</a>(&self) -> &Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target" title="type core::ops::deref::Deref::Target">Target</a></h4></section></summary><div class='docblock'>Dereferences the value.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Deserialize%3C'de%3E-for-RelayUrl" class="impl"><a class="src rightside" href="../src/iroh_base/relay_url.rs.html#21">Source</a><a href="#impl-Deserialize%3C'de%3E-for-RelayUrl" class="anchor">§</a><h3 class="code-header">impl<'de> <a class="trait" href="https://docs.rs/serde_core/1.0.229/serde_core/de/trait.Deserialize.html" title="trait serde_core::de::Deserialize">Deserialize</a><'de> for <a class="struct" href="struct.RelayUrl.html" title="struct iroh_base::RelayUrl">RelayUrl</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.deserialize" class="method trait-impl"><a class="src rightside" href="../src/iroh_base/relay_url.rs.html#21">Source</a><a href="#method.deserialize" class="anchor">§</a><h4 class="code-header">fn <a href="https://docs.rs/serde_core/1.0.229/serde_core/de/trait.Deserialize.html#tymethod.deserialize" class="fn">deserialize</a><__D>(__deserializer: __D) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, __D::<a class="associatedtype" href="https://docs.rs/serde_core/1.0.229/serde_core/de/trait.Deserializer.html#associatedtype.Error" title="type serde_core::de::Deserializer::Error">Error</a>><div class="where">where
|
||
__D: <a class="trait" href="https://docs.rs/serde_core/1.0.229/serde_core/de/trait.Deserializer.html" title="trait serde_core::de::Deserializer">Deserializer</a><'de>,</div></h4></section></summary><div class='docblock'>Deserialize this value from the given Serde deserializer. <a href="https://docs.rs/serde_core/1.0.229/serde_core/de/trait.Deserialize.html#tymethod.deserialize">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Display-for-RelayUrl" class="impl"><a class="src rightside" href="../src/iroh_base/relay_url.rs.html#21">Source</a><a href="#impl-Display-for-RelayUrl" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="struct" href="struct.RelayUrl.html" title="struct iroh_base::RelayUrl">RelayUrl</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.fmt" class="method trait-impl"><a class="src rightside" href="../src/iroh_base/relay_url.rs.html#21">Source</a><a href="#method.fmt" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt" class="fn">fmt</a>(&self, __derive_more_f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a><'_>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4></section></summary><div class='docblock'>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-From%3CRelayUrl%3E-for-Url" class="impl"><a class="src rightside" href="../src/iroh_base/relay_url.rs.html#55-59">Source</a><a href="#impl-From%3CRelayUrl%3E-for-Url" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="struct" href="struct.RelayUrl.html" title="struct iroh_base::RelayUrl">RelayUrl</a>> for <a class="struct" href="https://docs.rs/url/2.5.7/url/struct.Url.html" title="struct url::Url">Url</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from-1" class="method trait-impl"><a class="src rightside" href="../src/iroh_base/relay_url.rs.html#56-58">Source</a><a href="#method.from-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fn">from</a>(value: <a class="struct" href="struct.RelayUrl.html" title="struct iroh_base::RelayUrl">RelayUrl</a>) -> Self</h4></section></summary><div class='docblock'>Converts to this type from the input type.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-From%3CUrl%3E-for-RelayUrl" class="impl"><a class="src rightside" href="../src/iroh_base/relay_url.rs.html#26-35">Source</a><a href="#impl-From%3CUrl%3E-for-RelayUrl" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="struct" href="https://docs.rs/url/2.5.7/url/struct.Url.html" title="struct url::Url">Url</a>> for <a class="struct" href="struct.RelayUrl.html" title="struct iroh_base::RelayUrl">RelayUrl</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from" class="method trait-impl"><a class="src rightside" href="../src/iroh_base/relay_url.rs.html#27-34">Source</a><a href="#method.from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fn">from</a>(url: <a class="struct" href="https://docs.rs/url/2.5.7/url/struct.Url.html" title="struct url::Url">Url</a>) -> Self</h4></section></summary><div class='docblock'>Converts to this type from the input type.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-FromStr-for-RelayUrl" class="impl"><a class="src rightside" href="../src/iroh_base/relay_url.rs.html#46-53">Source</a><a href="#impl-FromStr-for-RelayUrl" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html" title="trait core::str::traits::FromStr">FromStr</a> for <a class="struct" href="struct.RelayUrl.html" title="struct iroh_base::RelayUrl">RelayUrl</a></h3><div class="docblock"><p>Support for parsing strings directly.</p>
|
||
</div></section></summary><div class="docblock"><p>If you need more control over the error first create a <a href="https://docs.rs/url/2.5.7/url/struct.Url.html" title="struct url::Url"><code>Url</code></a> and use <a href="struct.RelayUrl.html#method.from" title="associated function iroh_base::RelayUrl::from"><code>RelayUrl::from</code></a>
|
||
instead.</p>
|
||
</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/relay_url.rs.html#47">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="struct" href="struct.RelayUrlParseError.html" title="struct iroh_base::RelayUrlParseError">RelayUrlParseError</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/relay_url.rs.html#49-52">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><Self, Self::<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-RelayUrl" class="impl"><a class="src rightside" href="../src/iroh_base/relay_url.rs.html#21">Source</a><a href="#impl-Hash-for-RelayUrl" 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.RelayUrl.html" title="struct iroh_base::RelayUrl">RelayUrl</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/relay_url.rs.html#21">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: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>>(&self, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut __H</a>)</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-Ord-for-RelayUrl" class="impl"><a class="src rightside" href="../src/iroh_base/relay_url.rs.html#21">Source</a><a href="#impl-Ord-for-RelayUrl" 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.RelayUrl.html" title="struct iroh_base::RelayUrl">RelayUrl</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/relay_url.rs.html#21">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.RelayUrl.html" title="struct iroh_base::RelayUrl">RelayUrl</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#1021-1023">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#1060-1062">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#1086-1088">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-RelayUrl" class="impl"><a class="src rightside" href="../src/iroh_base/relay_url.rs.html#21">Source</a><a href="#impl-PartialEq-for-RelayUrl" 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.RelayUrl.html" title="struct iroh_base::RelayUrl">RelayUrl</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/relay_url.rs.html#21">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.RelayUrl.html" title="struct iroh_base::RelayUrl">RelayUrl</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#264">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,
|
||
and should not be overridden without very good reason.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-PartialOrd-for-RelayUrl" class="impl"><a class="src rightside" href="../src/iroh_base/relay_url.rs.html#21">Source</a><a href="#impl-PartialOrd-for-RelayUrl" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a> for <a class="struct" href="struct.RelayUrl.html" title="struct iroh_base::RelayUrl">RelayUrl</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.partial_cmp" class="method trait-impl"><a class="src rightside" href="../src/iroh_base/relay_url.rs.html#21">Source</a><a href="#method.partial_cmp" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp" class="fn">partial_cmp</a>(&self, other: &<a class="struct" href="struct.RelayUrl.html" title="struct iroh_base::RelayUrl">RelayUrl</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</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 ordering between <code>self</code> and <code>other</code> values if one exists. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.lt" 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#1398">Source</a></span><a href="#method.lt" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt" class="fn">lt</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 less than (for <code>self</code> and <code>other</code>) and is used by the <code><</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.le" 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#1416">Source</a></span><a href="#method.le" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le" class="fn">le</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 less than or equal to (for <code>self</code> and <code>other</code>) and is used by the
|
||
<code><=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.gt" 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#1434">Source</a></span><a href="#method.gt" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt" class="fn">gt</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 greater than (for <code>self</code> and <code>other</code>) and is used by the <code>></code>
|
||
operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.ge" 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#1452">Source</a></span><a href="#method.ge" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge" class="fn">ge</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 greater than or equal to (for <code>self</code> and <code>other</code>) and is used by
|
||
the <code>>=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Serialize-for-RelayUrl" class="impl"><a class="src rightside" href="../src/iroh_base/relay_url.rs.html#21">Source</a><a href="#impl-Serialize-for-RelayUrl" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://docs.rs/serde_core/1.0.229/serde_core/ser/trait.Serialize.html" title="trait serde_core::ser::Serialize">Serialize</a> for <a class="struct" href="struct.RelayUrl.html" title="struct iroh_base::RelayUrl">RelayUrl</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.serialize" class="method trait-impl"><a class="src rightside" href="../src/iroh_base/relay_url.rs.html#21">Source</a><a href="#method.serialize" class="anchor">§</a><h4 class="code-header">fn <a href="https://docs.rs/serde_core/1.0.229/serde_core/ser/trait.Serialize.html#tymethod.serialize" class="fn">serialize</a><__S>(&self, __serializer: __S) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><__S::<a class="associatedtype" href="https://docs.rs/serde_core/1.0.229/serde_core/ser/trait.Serializer.html#associatedtype.Ok" title="type serde_core::ser::Serializer::Ok">Ok</a>, __S::<a class="associatedtype" href="https://docs.rs/serde_core/1.0.229/serde_core/ser/trait.Serializer.html#associatedtype.Error" title="type serde_core::ser::Serializer::Error">Error</a>><div class="where">where
|
||
__S: <a class="trait" href="https://docs.rs/serde_core/1.0.229/serde_core/ser/trait.Serializer.html" title="trait serde_core::ser::Serializer">Serializer</a>,</div></h4></section></summary><div class='docblock'>Serialize this value into the given Serde serializer. <a href="https://docs.rs/serde_core/1.0.229/serde_core/ser/trait.Serialize.html#tymethod.serialize">Read more</a></div></details></div></details><section id="impl-Eq-for-RelayUrl" class="impl"><a class="src rightside" href="../src/iroh_base/relay_url.rs.html#21">Source</a><a href="#impl-Eq-for-RelayUrl" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="struct" href="struct.RelayUrl.html" title="struct iroh_base::RelayUrl">RelayUrl</a></h3></section><section id="impl-StructuralPartialEq-for-RelayUrl" class="impl"><a class="src rightside" href="../src/iroh_base/relay_url.rs.html#21">Source</a><a href="#impl-StructuralPartialEq-for-RelayUrl" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="struct" href="struct.RelayUrl.html" title="struct iroh_base::RelayUrl">RelayUrl</a></h3></section></div><h2 id="synthetic-implementations" class="section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor">§</a></h2><div id="synthetic-implementations-list"><section id="impl-Freeze-for-RelayUrl" class="impl"><a href="#impl-Freeze-for-RelayUrl" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Freeze.html" title="trait core::marker::Freeze">Freeze</a> for <a class="struct" href="struct.RelayUrl.html" title="struct iroh_base::RelayUrl">RelayUrl</a></h3></section><section id="impl-RefUnwindSafe-for-RelayUrl" class="impl"><a href="#impl-RefUnwindSafe-for-RelayUrl" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.RelayUrl.html" title="struct iroh_base::RelayUrl">RelayUrl</a></h3></section><section id="impl-Send-for-RelayUrl" class="impl"><a href="#impl-Send-for-RelayUrl" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.RelayUrl.html" title="struct iroh_base::RelayUrl">RelayUrl</a></h3></section><section id="impl-Sync-for-RelayUrl" class="impl"><a href="#impl-Sync-for-RelayUrl" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.RelayUrl.html" title="struct iroh_base::RelayUrl">RelayUrl</a></h3></section><section id="impl-Unpin-for-RelayUrl" class="impl"><a href="#impl-Unpin-for-RelayUrl" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.RelayUrl.html" title="struct iroh_base::RelayUrl">RelayUrl</a></h3></section><section id="impl-UnwindSafe-for-RelayUrl" class="impl"><a href="#impl-UnwindSafe-for-RelayUrl" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.RelayUrl.html" title="struct iroh_base::RelayUrl">RelayUrl</a></h3></section></div><h2 id="blanket-implementations" class="section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor">§</a></h2><div id="blanket-implementations-list"><details class="toggle implementors-toggle"><summary><section id="impl-Any-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#138">Source</a><a href="#impl-Any-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T<div class="where">where
|
||
T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#139">Source</a><a href="#method.type_id" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fn">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></section></summary><div class='docblock'>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#212">Source</a><a href="#impl-Borrow%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T<div class="where">where
|
||
T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214">Source</a><a href="#method.borrow" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fn">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&T</a></h4></section></summary><div class='docblock'>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221">Source</a><a href="#impl-BorrowMut%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T<div class="where">where
|
||
T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#222">Source</a><a href="#method.borrow_mut" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fn">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut T</a></h4></section></summary><div class='docblock'>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-CloneToUninit-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/clone.rs.html#515">Source</a><a href="#impl-CloneToUninit-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.CloneToUninit.html" title="trait core::clone::CloneToUninit">CloneToUninit</a> for T<div class="where">where
|
||
T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.clone_to_uninit" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/clone.rs.html#517">Source</a><a href="#method.clone_to_uninit" class="anchor">§</a><h4 class="code-header">unsafe fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.CloneToUninit.html#tymethod.clone_to_uninit" class="fn">clone_to_uninit</a>(&self, dest: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*mut </a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>)</h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>clone_to_uninit</code>)</span></div></span><div class='docblock'>Performs copy-assignment from <code>self</code> to <code>dest</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.CloneToUninit.html#tymethod.clone_to_uninit">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-From%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#785">Source</a><a href="#impl-From%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from-2" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#788">Source</a><a href="#method.from-2" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fn">from</a>(t: T) -> T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Instrument-for-T" class="impl"><a href="#impl-Instrument-for-T" class="anchor">§</a><h3 class="code-header">impl<T> Instrument for T</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.instrument" class="method trait-impl"><a href="#method.instrument" class="anchor">§</a><h4 class="code-header">fn <a class="fn">instrument</a>(self, span: Span) -> Instrumented<Self></h4></section></summary><div class='docblock'>Instruments this type with the provided [<code>Span</code>], returning an
|
||
<code>Instrumented</code> wrapper. <a>Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.in_current_span" class="method trait-impl"><a href="#method.in_current_span" class="anchor">§</a><h4 class="code-header">fn <a class="fn">in_current_span</a>(self) -> Instrumented<Self></h4></section></summary><div class='docblock'>Instruments this type with the <a href="super::Span::current()">current</a> <a href="crate::Span"><code>Span</code></a>, returning an
|
||
<code>Instrumented</code> wrapper. <a>Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#767-769">Source</a><a href="#impl-Into%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T<div class="where">where
|
||
U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#777">Source</a><a href="#method.into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into" class="fn">into</a>(self) -> U</h4></section></summary><div class="docblock"><p>Calls <code>U::from(self)</code>.</p>
|
||
<p>That is, this conversion is whatever the implementation of
|
||
<code><a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for U</code> chooses to do.</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Receiver-for-P" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/ops/deref.rs.html#378-380">Source</a><a href="#impl-Receiver-for-P" class="anchor">§</a><h3 class="code-header">impl<P, T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Receiver.html" title="trait core::ops::deref::Receiver">Receiver</a> for P<div class="where">where
|
||
P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a><Target = T> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
|
||
T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Target-1" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/ops/deref.rs.html#382">Source</a><a href="#associatedtype.Target-1" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Receiver.html#associatedtype.Target" class="associatedtype">Target</a> = T</h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>arbitrary_self_types</code>)</span></div></span><div class='docblock'>The target type on which the method may be called.</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Same-for-T" class="impl"><a class="src rightside" href="https://docs.rs/typenum/1.20.1/src/typenum/type_operators.rs.html#34">Source</a><a href="#impl-Same-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://docs.rs/typenum/1.20.1/typenum/type_operators/trait.Same.html" title="trait typenum::type_operators::Same">Same</a> for T</h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Output" class="associatedtype trait-impl"><a class="src rightside" href="https://docs.rs/typenum/1.20.1/src/typenum/type_operators.rs.html#35">Source</a><a href="#associatedtype.Output" class="anchor">§</a><h4 class="code-header">type <a href="https://docs.rs/typenum/1.20.1/typenum/type_operators/trait.Same.html#associatedtype.Output" class="associatedtype">Output</a> = T</h4></section></summary><div class='docblock'>Should always be <code>Self</code></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-ToOwned-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#84-86">Source</a><a href="#impl-ToOwned-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T<div class="where">where
|
||
T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Owned" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#88">Source</a><a href="#associatedtype.Owned" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned" class="associatedtype">Owned</a> = T</h4></section></summary><div class='docblock'>The resulting type after obtaining ownership.</div></details><details class="toggle method-toggle" open><summary><section id="method.to_owned" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89">Source</a><a href="#method.to_owned" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned" class="fn">to_owned</a>(&self) -> T</h4></section></summary><div class='docblock'>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.clone_into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#93">Source</a><a href="#method.clone_into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into" class="fn">clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut T</a>)</h4></section></summary><div class='docblock'>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-ToString-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2783">Source</a><a href="#impl-ToString-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a> for T<div class="where">where
|
||
T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.to_string" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2785">Source</a><a href="#method.to_string" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string" class="fn">to_string</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'>Converts the given value to a <code>String</code>. <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#827-829">Source</a><a href="#impl-TryFrom%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T<div class="where">where
|
||
U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-1" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#831">Source</a><a href="#associatedtype.Error-1" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#834">Source</a><a href="#method.try_from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#811-813">Source</a><a href="#impl-TryInto%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T<div class="where">where
|
||
U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#815">Source</a><a href="#associatedtype.Error" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error" class="associatedtype">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#818">Source</a><a href="#method.try_into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into" class="fn">try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-WithSubscriber-for-T" class="impl"><a href="#impl-WithSubscriber-for-T" class="anchor">§</a><h3 class="code-header">impl<T> WithSubscriber for T</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.with_subscriber" class="method trait-impl"><a href="#method.with_subscriber" class="anchor">§</a><h4 class="code-header">fn <a class="fn">with_subscriber</a><S>(self, subscriber: S) -> WithDispatch<Self><div class="where">where
|
||
S: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><Dispatch>,</div></h4></section></summary><div class='docblock'>Attaches the provided <a href="super::Subscriber"><code>Subscriber</code></a> to this type, returning a
|
||
[<code>WithDispatch</code>] wrapper. <a>Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.with_current_subscriber" class="method trait-impl"><a href="#method.with_current_subscriber" class="anchor">§</a><h4 class="code-header">fn <a class="fn">with_current_subscriber</a>(self) -> WithDispatch<Self></h4></section></summary><div class='docblock'>Attaches the current <a href="dispatcher#setting-the-default-subscriber">default</a> <a href="super::Subscriber"><code>Subscriber</code></a> to this type, returning a
|
||
[<code>WithDispatch</code>] wrapper. <a>Read more</a></div></details></div></details><section id="impl-DeserializeOwned-for-T" class="impl"><a class="src rightside" href="https://docs.rs/serde_core/1.0.229/src/serde_core/de/mod.rs.html#633">Source</a><a href="#impl-DeserializeOwned-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://docs.rs/serde_core/1.0.229/serde_core/de/trait.DeserializeOwned.html" title="trait serde_core::de::DeserializeOwned">DeserializeOwned</a> for T<div class="where">where
|
||
T: for<'de> <a class="trait" href="https://docs.rs/serde_core/1.0.229/serde_core/de/trait.Deserialize.html" title="trait serde_core::de::Deserialize">Deserialize</a><'de>,</div></h3></section></div></section></div></main></body></html> |