1
0
mirror of https://github.com/fafhrd91/actix-web synced 2024-11-30 10:42:55 +01:00
actix-web/actix_web/http/struct.Uri.html
2024-05-27 01:16:31 +00:00

293 lines
110 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="The URI component of a request."><title>Uri in actix_web::http - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-dd39b87e5fcfba68.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="actix_web" data-themes="" data-resource-suffix="" data-rustdoc-version="1.80.0-nightly (bdbbb6c6a 2024-05-26)" data-channel="nightly" data-search-js="search-d52510db62a78183.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../static.files/storage-118b08c4c78b968e.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-20a3ad099b048cf2.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-df360f571f6edeae.css"></noscript><link rel="icon" href="https://actix.rs/favicon.ico"></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]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button><a class="logo-container" href="../../actix_web/index.html"><img src="https://actix.rs/img/logo.png" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../../actix_web/index.html"><img src="https://actix.rs/img/logo.png" alt="logo"></a><h2><a href="../../actix_web/index.html">actix_web</a><span class="version">4.6.0</span></h2></div><h2 class="location"><a href="#">Uri</a></h2><div class="sidebar-elems"><section><h3><a href="#implementations">Methods</a></h3><ul class="block method"><li><a href="#method.authority">authority</a></li><li><a href="#method.builder">builder</a></li><li><a href="#method.from_maybe_shared">from_maybe_shared</a></li><li><a href="#method.from_parts">from_parts</a></li><li><a href="#method.from_static">from_static</a></li><li><a href="#method.host">host</a></li><li><a href="#method.into_parts">into_parts</a></li><li><a href="#method.path">path</a></li><li><a href="#method.path_and_query">path_and_query</a></li><li><a href="#method.port">port</a></li><li><a href="#method.port_u16">port_u16</a></li><li><a href="#method.query">query</a></li><li><a href="#method.scheme">scheme</a></li><li><a href="#method.scheme_str">scheme_str</a></li></ul><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block trait-implementation"><li><a href="#impl-Clone-for-Uri">Clone</a></li><li><a href="#impl-Debug-for-Uri">Debug</a></li><li><a href="#impl-Default-for-Uri">Default</a></li><li><a href="#impl-Display-for-Uri">Display</a></li><li><a href="#impl-Eq-for-Uri">Eq</a></li><li><a href="#impl-From%3CAuthority%3E-for-Uri">From&lt;Authority&gt;</a></li><li><a href="#impl-From%3CPathAndQuery%3E-for-Uri">From&lt;PathAndQuery&gt;</a></li><li><a href="#impl-From%3CUri%3E-for-Parts">From&lt;Uri&gt;</a></li><li><a href="#impl-FromRequest-for-Uri">FromRequest</a></li><li><a href="#impl-FromStr-for-Uri">FromStr</a></li><li><a href="#impl-Hash-for-Uri">Hash</a></li><li><a href="#impl-Host-for-Uri">Host</a></li><li><a href="#impl-PartialEq-for-Uri">PartialEq</a></li><li><a href="#impl-PartialEq%3C%26str%3E-for-Uri">PartialEq&lt;&amp;&#x27;a str&gt;</a></li><li><a href="#impl-PartialEq%3CUri%3E-for-%26str">PartialEq&lt;Uri&gt;</a></li><li><a href="#impl-PartialEq%3CUri%3E-for-str">PartialEq&lt;Uri&gt;</a></li><li><a href="#impl-PartialEq%3Cstr%3E-for-Uri">PartialEq&lt;str&gt;</a></li><li><a href="#impl-ResourcePath-for-Uri">ResourcePath</a></li><li><a href="#impl-TryFrom%3C%26String%3E-for-Uri">TryFrom&lt;&amp;&#x27;a String&gt;</a></li><li><a href="#impl-TryFrom%3C%26Uri%3E-for-Uri">TryFrom&lt;&amp;&#x27;a Uri&gt;</a></li><li><a href="#impl-TryFrom%3C%26%5Bu8%5D%3E-for-Uri">TryFrom&lt;&amp;&#x27;a [u8]&gt;</a></li><li><a href="#impl-TryFrom%3C%26str%3E-for-Uri">TryFrom&lt;&amp;&#x27;a str&gt;</a></li><li><a href="#impl-TryFrom%3CParts%3E-for-Uri">TryFrom&lt;Parts&gt;</a></li><li><a href="#impl-TryFrom%3CString%3E-for-Uri">TryFrom&lt;String&gt;</a></li><li><a href="#impl-TryFrom%3CVec%3Cu8%3E%3E-for-Uri">TryFrom&lt;Vec&lt;u8&gt;&gt;</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block synthetic-implementation"><li><a href="#impl-Freeze-for-Uri">!Freeze</a></li><li><a href="#impl-RefUnwindSafe-for-Uri">RefUnwindSafe</a></li><li><a href="#impl-Send-for-Uri">Send</a></li><li><a href="#impl-Sync-for-Uri">Sync</a></li><li><a href="#impl-Unpin-for-Uri">Unpin</a></li><li><a href="#impl-UnwindSafe-for-Uri">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">Any</a></li><li><a href="#impl-Borrow%3CT%3E-for-T">Borrow&lt;T&gt;</a></li><li><a href="#impl-BorrowMut%3CT%3E-for-T">BorrowMut&lt;T&gt;</a></li><li><a href="#impl-Equivalent%3CK%3E-for-Q">Equivalent&lt;K&gt;</a></li><li><a href="#impl-Equivalent%3CK%3E-for-Q-1">Equivalent&lt;K&gt;</a></li><li><a href="#impl-From%3CT%3E-for-T">From&lt;T&gt;</a></li><li><a href="#impl-Instrument-for-T">Instrument</a></li><li><a href="#impl-Into%3CU%3E-for-T">Into&lt;U&gt;</a></li><li><a href="#impl-Same-for-T">Same</a></li><li><a href="#impl-ToOwned-for-T">ToOwned</a></li><li><a href="#impl-ToString-for-T">ToString</a></li><li><a href="#impl-TryFrom%3CU%3E-for-T">TryFrom&lt;U&gt;</a></li><li><a href="#impl-TryInto%3CU%3E-for-T">TryInto&lt;U&gt;</a></li><li><a href="#impl-VZip%3CV%3E-for-T">VZip&lt;V&gt;</a></li><li><a href="#impl-WithSubscriber-for-T">WithSubscriber</a></li></ul></section><h2><a href="index.html">In actix_web::http</a></h2></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><h1>Struct <a href="../index.html">actix_web</a>::<wbr><a href="index.html">http</a>::<wbr><a class="struct" href="#">Uri</a><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><span class="out-of-band"><a class="src" href="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#96">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><pre class="rust item-decl"><code>pub struct Uri { <span class="comment">/* private fields */</span> }</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The URI component of a request.</p>
<p>For HTTP 1, this is included as part of the request line. From Section 5.3,
Request Target:</p>
<blockquote>
<p>Once an inbound connection is obtained, the client sends an HTTP
request message (Section 3) with a request-target derived from the
target URI. There are four distinct formats for the request-target,
depending on both the method being requested and whether the request
is to a proxy.</p>
<div class="example-wrap"><pre class="language-notrust"><code>request-target = origin-form
/ absolute-form
/ authority-form
/ asterisk-form
</code></pre></div></blockquote>
<p>The URI is structured as follows:</p>
<div class="example-wrap"><pre class="language-notrust"><code>abc://username:password@example.com:123/path/data?key=value&amp;key2=value2#fragid1
|-| |-------------------------------||--------| |-------------------| |-----|
| | | | |
scheme authority path query fragment
</code></pre></div>
<p>For HTTP 2.0, the URI is encoded using pseudoheaders.</p>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>http::Uri;
<span class="kw">let </span>uri = <span class="string">"/foo/bar?baz"</span>.parse::&lt;Uri&gt;().unwrap();
<span class="macro">assert_eq!</span>(uri.path(), <span class="string">"/foo/bar"</span>);
<span class="macro">assert_eq!</span>(uri.query(), <span class="prelude-val">Some</span>(<span class="string">"baz"</span>));
<span class="macro">assert_eq!</span>(uri.host(), <span class="prelude-val">None</span>);
<span class="kw">let </span>uri = <span class="string">"https://www.rust-lang.org/install.html"</span>.parse::&lt;Uri&gt;().unwrap();
<span class="macro">assert_eq!</span>(uri.scheme_str(), <span class="prelude-val">Some</span>(<span class="string">"https"</span>));
<span class="macro">assert_eq!</span>(uri.host(), <span class="prelude-val">Some</span>(<span class="string">"www.rust-lang.org"</span>));
<span class="macro">assert_eq!</span>(uri.path(), <span class="string">"/install.html"</span>);</code></pre></div>
</div></details><h2 id="implementations" class="section-header">Implementations<a href="#implementations" class="anchor">§</a></h2><div id="implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-Uri" class="impl"><a class="src rightside" href="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#182">source</a><a href="#impl-Uri" class="anchor">§</a><h3 class="code-header">impl <a class="struct" href="struct.Uri.html" title="struct actix_web::http::Uri">Uri</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.builder" class="method"><a class="src rightside" href="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#200">source</a><h4 class="code-header">pub fn <a href="#method.builder" class="fn">builder</a>() -&gt; <a class="struct" href="uri/struct.Builder.html" title="struct actix_web::http::uri::Builder">Builder</a></h4></section></summary><div class="docblock"><p>Creates a new builder-style object to manufacture a <code>Uri</code>.</p>
<p>This method returns an instance of <code>Builder</code> which can be usd to
create a <code>Uri</code>.</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>http::Uri;
<span class="kw">let </span>uri = Uri::builder()
.scheme(<span class="string">"https"</span>)
.authority(<span class="string">"hyper.rs"</span>)
.path_and_query(<span class="string">"/"</span>)
.build()
.unwrap();</code></pre></div>
</div></details><details class="toggle method-toggle" open><summary><section id="method.from_parts" class="method"><a class="src rightside" href="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#238">source</a><h4 class="code-header">pub fn <a href="#method.from_parts" class="fn">from_parts</a>(src: <a class="struct" href="uri/struct.Parts.html" title="struct actix_web::http::uri::Parts">Parts</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="struct.Uri.html" title="struct actix_web::http::Uri">Uri</a>, <a class="struct" href="uri/struct.InvalidUriParts.html" title="struct actix_web::http::uri::InvalidUriParts">InvalidUriParts</a>&gt;</h4></section></summary><div class="docblock"><p>Attempt to convert a <code>Parts</code> into a <code>Uri</code>.</p>
<h5 id="examples-2"><a class="doc-anchor" href="#examples-2">§</a>Examples</h5>
<p>Relative URI</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span><span class="kw-2">mut </span>parts = Parts::default();
parts.path_and_query = <span class="prelude-val">Some</span>(<span class="string">"/foo"</span>.parse().unwrap());
<span class="kw">let </span>uri = Uri::from_parts(parts).unwrap();
<span class="macro">assert_eq!</span>(uri.path(), <span class="string">"/foo"</span>);
<span class="macro">assert!</span>(uri.scheme().is_none());
<span class="macro">assert!</span>(uri.authority().is_none());</code></pre></div>
<p>Absolute URI</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span><span class="kw-2">mut </span>parts = Parts::default();
parts.scheme = <span class="prelude-val">Some</span>(<span class="string">"http"</span>.parse().unwrap());
parts.authority = <span class="prelude-val">Some</span>(<span class="string">"foo.com"</span>.parse().unwrap());
parts.path_and_query = <span class="prelude-val">Some</span>(<span class="string">"/foo"</span>.parse().unwrap());
<span class="kw">let </span>uri = Uri::from_parts(parts).unwrap();
<span class="macro">assert_eq!</span>(uri.scheme().unwrap().as_str(), <span class="string">"http"</span>);
<span class="macro">assert_eq!</span>(uri.authority().unwrap(), <span class="string">"foo.com"</span>);
<span class="macro">assert_eq!</span>(uri.path(), <span class="string">"/foo"</span>);</code></pre></div>
</div></details><details class="toggle method-toggle" open><summary><section id="method.from_maybe_shared" class="method"><a class="src rightside" href="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#281-283">source</a><h4 class="code-header">pub fn <a href="#method.from_maybe_shared" class="fn">from_maybe_shared</a>&lt;T&gt;(src: T) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="struct.Uri.html" title="struct actix_web::http::Uri">Uri</a>, <a class="struct" href="uri/struct.InvalidUri.html" title="struct actix_web::http::uri::InvalidUri">InvalidUri</a>&gt;<div class="where">where
T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]&gt; + 'static,</div></h4></section></summary><div class="docblock"><p>Attempt to convert a <code>Bytes</code> buffer to a <code>Uri</code>.</p>
<p>This will try to prevent a copy if the type passed is the type used
internally, and will copy the data if it is not.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.from_static" class="method"><a class="src rightside" href="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#361">source</a><h4 class="code-header">pub fn <a href="#method.from_static" class="fn">from_static</a>(src: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="struct" href="struct.Uri.html" title="struct actix_web::http::Uri">Uri</a></h4></section></summary><div class="docblock"><p>Convert a <code>Uri</code> from a static string.</p>
<p>This function will not perform any copying, however the string is
checked to ensure that it is valid.</p>
<h5 id="panics"><a class="doc-anchor" href="#panics">§</a>Panics</h5>
<p>This function panics if the argument is an invalid URI.</p>
<h5 id="examples-3"><a class="doc-anchor" href="#examples-3">§</a>Examples</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>uri = Uri::from_static(<span class="string">"http://example.com/foo"</span>);
<span class="macro">assert_eq!</span>(uri.host().unwrap(), <span class="string">"example.com"</span>);
<span class="macro">assert_eq!</span>(uri.path(), <span class="string">"/foo"</span>);</code></pre></div>
</div></details><details class="toggle method-toggle" open><summary><section id="method.into_parts" class="method"><a class="src rightside" href="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#390">source</a><h4 class="code-header">pub fn <a href="#method.into_parts" class="fn">into_parts</a>(self) -&gt; <a class="struct" href="uri/struct.Parts.html" title="struct actix_web::http::uri::Parts">Parts</a></h4></section></summary><div class="docblock"><p>Convert a <code>Uri</code> into <code>Parts</code>.</p>
<h5 id="note"><a class="doc-anchor" href="#note">§</a>Note</h5>
<p>This is just an inherent method providing the same functionality as
<code>let parts: Parts = uri.into()</code></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">let </span>uri: Uri = <span class="string">"/foo"</span>.parse().unwrap();
<span class="kw">let </span>parts = uri.into_parts();
<span class="macro">assert_eq!</span>(parts.path_and_query.unwrap(), <span class="string">"/foo"</span>);
<span class="macro">assert!</span>(parts.scheme.is_none());
<span class="macro">assert!</span>(parts.authority.is_none());</code></pre></div>
</div></details><details class="toggle method-toggle" open><summary><section id="method.path_and_query" class="method"><a class="src rightside" href="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#396">source</a><h4 class="code-header">pub fn <a href="#method.path_and_query" class="fn">path_and_query</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;<a class="struct" href="uri/struct.PathAndQuery.html" title="struct actix_web::http::uri::PathAndQuery">PathAndQuery</a>&gt;</h4></section></summary><div class="docblock"><p>Returns the path &amp; query components of the Uri</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.path" class="method"><a class="src rightside" href="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#439">source</a><h4 class="code-header">pub fn <a href="#method.path" class="fn">path</a>(&amp;self) -&gt; &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></h4></section></summary><div class="docblock"><p>Get the path of this <code>Uri</code>.</p>
<p>Both relative and absolute URIs contain a path component, though it
might be the empty string. The path component is <strong>case sensitive</strong>.</p>
<div class="example-wrap"><pre class="language-notrust"><code>abc://username:password@example.com:123/path/data?key=value&amp;key2=value2#fragid1
|--------|
|
path
</code></pre></div>
<p>If the URI is <code>*</code> then the path component is equal to <code>*</code>.</p>
<h5 id="examples-5"><a class="doc-anchor" href="#examples-5">§</a>Examples</h5>
<p>A relative URI</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code>
<span class="kw">let </span>uri: Uri = <span class="string">"/hello/world"</span>.parse().unwrap();
<span class="macro">assert_eq!</span>(uri.path(), <span class="string">"/hello/world"</span>);</code></pre></div>
<p>An absolute URI</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>uri: Uri = <span class="string">"http://example.org/hello/world"</span>.parse().unwrap();
<span class="macro">assert_eq!</span>(uri.path(), <span class="string">"/hello/world"</span>);</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/http/0.2.11/src/http/uri/mod.rs.html#483">source</a><h4 class="code-header">pub fn <a href="#method.scheme" class="fn">scheme</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;<a class="struct" href="uri/struct.Scheme.html" title="struct actix_web::http::uri::Scheme">Scheme</a>&gt;</h4></section></summary><div class="docblock"><p>Get the scheme of this <code>Uri</code>.</p>
<p>The URI scheme refers to a specification for assigning identifiers
within that scheme. Only absolute URIs contain a scheme component, but
not all absolute URIs will contain a scheme component. Although scheme
names are case-insensitive, the canonical form is lowercase.</p>
<div class="example-wrap"><pre class="language-notrust"><code>abc://username:password@example.com:123/path/data?key=value&amp;key2=value2#fragid1
|-|
|
scheme
</code></pre></div><h5 id="examples-6"><a class="doc-anchor" href="#examples-6">§</a>Examples</h5>
<p>Absolute URI</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>http::uri::{Scheme, Uri};
<span class="kw">let </span>uri: Uri = <span class="string">"http://example.org/hello/world"</span>.parse().unwrap();
<span class="macro">assert_eq!</span>(uri.scheme(), <span class="prelude-val">Some</span>(<span class="kw-2">&amp;</span>Scheme::HTTP));</code></pre></div>
<p>Relative URI</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>uri: Uri = <span class="string">"/hello/world"</span>.parse().unwrap();
<span class="macro">assert!</span>(uri.scheme().is_none());</code></pre></div>
</div></details><details class="toggle method-toggle" open><summary><section id="method.scheme_str" class="method"><a class="src rightside" href="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#502">source</a><h4 class="code-header">pub fn <a href="#method.scheme_str" class="fn">scheme_str</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>&gt;</h4></section></summary><div class="docblock"><p>Get the scheme of this <code>Uri</code> as a <code>&amp;str</code>.</p>
<h5 id="example"><a class="doc-anchor" href="#example">§</a>Example</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>uri: Uri = <span class="string">"http://example.org/hello/world"</span>.parse().unwrap();
<span class="macro">assert_eq!</span>(uri.scheme_str(), <span class="prelude-val">Some</span>(<span class="string">"http"</span>));</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/http/0.2.11/src/http/uri/mod.rs.html#548">source</a><h4 class="code-header">pub fn <a href="#method.authority" class="fn">authority</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;<a class="struct" href="uri/struct.Authority.html" title="struct actix_web::http::uri::Authority">Authority</a>&gt;</h4></section></summary><div class="docblock"><p>Get the authority of this <code>Uri</code>.</p>
<p>The authority is a hierarchical element for naming authority such that
the remainder of the URI is delegated to that authority. For HTTP, the
authority consists of the host and port. The host portion of the
authority is <strong>case-insensitive</strong>.</p>
<p>The authority also includes a <code>username:password</code> component, however
the use of this is deprecated and should be avoided.</p>
<div class="example-wrap"><pre class="language-notrust"><code>abc://username:password@example.com:123/path/data?key=value&amp;key2=value2#fragid1
|-------------------------------|
|
authority
</code></pre></div><h5 id="examples-7"><a class="doc-anchor" href="#examples-7">§</a>Examples</h5>
<p>Absolute URI</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>uri: Uri = <span class="string">"http://example.org:80/hello/world"</span>.parse().unwrap();
<span class="macro">assert_eq!</span>(uri.authority().map(|a| a.as_str()), <span class="prelude-val">Some</span>(<span class="string">"example.org:80"</span>));</code></pre></div>
<p>Relative URI</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>uri: Uri = <span class="string">"/hello/world"</span>.parse().unwrap();
<span class="macro">assert!</span>(uri.authority().is_none());</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/http/0.2.11/src/http/uri/mod.rs.html#590">source</a><h4 class="code-header">pub fn <a href="#method.host" class="fn">host</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>&gt;</h4></section></summary><div class="docblock"><p>Get the host of this <code>Uri</code>.</p>
<p>The host subcomponent of authority is identified by an IP literal
encapsulated within square brackets, an IPv4 address in dotted- decimal
form, or a registered name. The host subcomponent is <strong>case-insensitive</strong>.</p>
<div class="example-wrap"><pre class="language-notrust"><code>abc://username:password@example.com:123/path/data?key=value&amp;key2=value2#fragid1
|---------|
|
host
</code></pre></div><h5 id="examples-8"><a class="doc-anchor" href="#examples-8">§</a>Examples</h5>
<p>Absolute URI</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>uri: Uri = <span class="string">"http://example.org:80/hello/world"</span>.parse().unwrap();
<span class="macro">assert_eq!</span>(uri.host(), <span class="prelude-val">Some</span>(<span class="string">"example.org"</span>));</code></pre></div>
<p>Relative URI</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>uri: Uri = <span class="string">"/hello/world"</span>.parse().unwrap();
<span class="macro">assert!</span>(uri.host().is_none());</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/http/0.2.11/src/http/uri/mod.rs.html#637">source</a><h4 class="code-header">pub fn <a href="#method.port" class="fn">port</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="uri/struct.Port.html" title="struct actix_web::http::uri::Port">Port</a>&lt;&amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>&gt;&gt;</h4></section></summary><div class="docblock"><p>Get the port part of this <code>Uri</code>.</p>
<p>The port subcomponent of authority is designated by an optional port
number following the host and delimited from it by a single colon (“:”)
character. It can be turned into a decimal port number with the <code>as_u16</code>
method or as a <code>str</code> with the <code>as_str</code> method.</p>
<div class="example-wrap"><pre class="language-notrust"><code>abc://username:password@example.com:123/path/data?key=value&amp;key2=value2#fragid1
|-|
|
port
</code></pre></div><h5 id="examples-9"><a class="doc-anchor" href="#examples-9">§</a>Examples</h5>
<p>Absolute URI with port</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>uri: Uri = <span class="string">"http://example.org:80/hello/world"</span>.parse().unwrap();
<span class="kw">let </span>port = uri.port().unwrap();
<span class="macro">assert_eq!</span>(port.as_u16(), <span class="number">80</span>);</code></pre></div>
<p>Absolute URI without port</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>uri: Uri = <span class="string">"http://example.org/hello/world"</span>.parse().unwrap();
<span class="macro">assert!</span>(uri.port().is_none());</code></pre></div>
<p>Relative URI</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>uri: Uri = <span class="string">"/hello/world"</span>.parse().unwrap();
<span class="macro">assert!</span>(uri.port().is_none());</code></pre></div>
</div></details><details class="toggle method-toggle" open><summary><section id="method.port_u16" class="method"><a class="src rightside" href="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#652">source</a><h4 class="code-header">pub fn <a href="#method.port_u16" class="fn">port_u16</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u16.html">u16</a>&gt;</h4></section></summary><div class="docblock"><p>Get the port of this <code>Uri</code> as a <code>u16</code>.</p>
<h5 id="example-1"><a class="doc-anchor" href="#example-1">§</a>Example</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>uri: Uri = <span class="string">"http://example.org:80/hello/world"</span>.parse().unwrap();
<span class="macro">assert_eq!</span>(uri.port_u16(), <span class="prelude-val">Some</span>(<span class="number">80</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/http/0.2.11/src/http/uri/mod.rs.html#700">source</a><h4 class="code-header">pub fn <a href="#method.query" class="fn">query</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>&gt;</h4></section></summary><div class="docblock"><p>Get the query string of this <code>Uri</code>, starting after the <code>?</code>.</p>
<p>The query component contains non-hierarchical data that, along with data
in the path component, serves to identify a resource within the scope of
the URIs scheme and naming authority (if any). The query component is
indicated by the first question mark (“?”) character and terminated by a
number sign (“#”) character or by the end of the URI.</p>
<div class="example-wrap"><pre class="language-notrust"><code>abc://username:password@example.com:123/path/data?key=value&amp;key2=value2#fragid1
|-------------------|
|
query
</code></pre></div><h5 id="examples-10"><a class="doc-anchor" href="#examples-10">§</a>Examples</h5>
<p>Absolute URI</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>uri: Uri = <span class="string">"http://example.org/hello/world?key=value"</span>.parse().unwrap();
<span class="macro">assert_eq!</span>(uri.query(), <span class="prelude-val">Some</span>(<span class="string">"key=value"</span>));</code></pre></div>
<p>Relative URI with a query string component</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>uri: Uri = <span class="string">"/hello/world?key=value&amp;foo=bar"</span>.parse().unwrap();
<span class="macro">assert_eq!</span>(uri.query(), <span class="prelude-val">Some</span>(<span class="string">"key=value&amp;foo=bar"</span>));</code></pre></div>
<p>Relative URI without a query string component</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>uri: Uri = <span class="string">"/hello/world"</span>.parse().unwrap();
<span class="macro">assert!</span>(uri.query().is_none());</code></pre></div>
</div></details></div></details></div><h2 id="trait-implementations" class="section-header">Trait Implementations<a href="#trait-implementations" class="anchor">§</a></h2><div id="trait-implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-Clone-for-Uri" class="impl"><a class="src rightside" href="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#95">source</a><a href="#impl-Clone-for-Uri" 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.Uri.html" title="struct actix_web::http::Uri">Uri</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="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#95">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>(&amp;self) -&gt; <a class="struct" href="struct.Uri.html" title="struct actix_web::http::Uri">Uri</a></h4></section></summary><div class='docblock'>Returns a copy 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#169">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>(&amp;mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;Self</a>)</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-Uri" class="impl"><a class="src rightside" href="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#1045">source</a><a href="#impl-Debug-for-Uri" 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.Uri.html" title="struct actix_web::http::Uri">Uri</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="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#1046">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>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Error.html" title="struct core::fmt::Error">Error</a>&gt;</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-Default-for-Uri" class="impl"><a class="src rightside" href="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#1014">source</a><a href="#impl-Default-for-Uri" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="struct.Uri.html" title="struct actix_web::http::Uri">Uri</a></h3></section></summary><div class="docblock"><p>Returns a <code>Uri</code> representing <code>/</code></p>
</div><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.default" class="method trait-impl"><a class="src rightside" href="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#1016">source</a><a href="#method.default" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default" class="fn">default</a>() -&gt; <a class="struct" href="struct.Uri.html" title="struct actix_web::http::Uri">Uri</a></h4></section></summary><div class='docblock'>Returns the “default value” for a type. <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Display-for-Uri" class="impl"><a class="src rightside" href="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#1025">source</a><a href="#impl-Display-for-Uri" 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.Uri.html" title="struct actix_web::http::Uri">Uri</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="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#1026">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>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Error.html" title="struct core::fmt::Error">Error</a>&gt;</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%3CAuthority%3E-for-Uri" class="impl"><a class="src rightside" href="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#773">source</a><a href="#impl-From%3CAuthority%3E-for-Uri" 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>&lt;<a class="struct" href="uri/struct.Authority.html" title="struct actix_web::http::uri::Authority">Authority</a>&gt; for <a class="struct" href="struct.Uri.html" title="struct actix_web::http::Uri">Uri</a></h3></section></summary><div class="docblock"><p>Convert an <code>Authority</code> into a <code>Uri</code>.</p>
</div><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://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#774">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>(authority: <a class="struct" href="uri/struct.Authority.html" title="struct actix_web::http::uri::Authority">Authority</a>) -&gt; <a class="struct" href="struct.Uri.html" title="struct actix_web::http::Uri">Uri</a></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%3CPathAndQuery%3E-for-Uri" class="impl"><a class="src rightside" href="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#784">source</a><a href="#impl-From%3CPathAndQuery%3E-for-Uri" 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>&lt;<a class="struct" href="uri/struct.PathAndQuery.html" title="struct actix_web::http::uri::PathAndQuery">PathAndQuery</a>&gt; for <a class="struct" href="struct.Uri.html" title="struct actix_web::http::Uri">Uri</a></h3></section></summary><div class="docblock"><p>Convert a <code>PathAndQuery</code> into a <code>Uri</code>.</p>
</div><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from" class="method trait-impl"><a class="src rightside" href="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#785">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>(path_and_query: <a class="struct" href="uri/struct.PathAndQuery.html" title="struct actix_web::http::uri::PathAndQuery">PathAndQuery</a>) -&gt; <a class="struct" href="struct.Uri.html" title="struct actix_web::http::Uri">Uri</a></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%3CUri%3E-for-Parts" class="impl"><a class="src rightside" href="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#795">source</a><a href="#impl-From%3CUri%3E-for-Parts" 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>&lt;<a class="struct" href="struct.Uri.html" title="struct actix_web::http::Uri">Uri</a>&gt; for <a class="struct" href="uri/struct.Parts.html" title="struct actix_web::http::uri::Parts">Parts</a></h3></section></summary><div class="docblock"><p>Convert a <code>Uri</code> into <code>Parts</code></p>
</div><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="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#796">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>(src: <a class="struct" href="struct.Uri.html" title="struct actix_web::http::Uri">Uri</a>) -&gt; <a class="struct" href="uri/struct.Parts.html" title="struct actix_web::http::uri::Parts">Parts</a></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-FromRequest-for-Uri" class="impl"><a class="src rightside" href="../../src/actix_web/extract.rs.html#280-287">source</a><a href="#impl-FromRequest-for-Uri" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a> for <a class="struct" href="struct.Uri.html" title="struct actix_web::http::Uri">Uri</a></h3></section></summary><div class="docblock"><p>Extract the requests URI.</p>
<h4 id="examples-11"><a class="doc-anchor" href="#examples-11">§</a>Examples</h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>actix_web::{http::Uri, web, App, Responder};
<span class="kw">async fn </span>handler(uri: Uri) -&gt; <span class="kw">impl </span>Responder {
<span class="macro">format!</span>(<span class="string">"Requested path: {}"</span>, uri.path())
}
<span class="kw">let </span>app = App::new().default_service(web::to(handler));</code></pre></div>
</div><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-7" class="associatedtype trait-impl"><a href="#associatedtype.Error-7" class="anchor">§</a><h4 class="code-header">type <a href="../trait.FromRequest.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 associated error which can be returned.</div></details><details class="toggle" open><summary><section id="associatedtype.Future" class="associatedtype trait-impl"><a href="#associatedtype.Future" class="anchor">§</a><h4 class="code-header">type <a href="../trait.FromRequest.html#associatedtype.Future" class="associatedtype">Future</a> = Ready&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="struct.Uri.html" title="struct actix_web::http::Uri">Uri</a>, &lt;<a class="struct" href="struct.Uri.html" title="struct actix_web::http::Uri">Uri</a> as <a class="trait" href="../trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&gt;::<a class="associatedtype" href="../trait.FromRequest.html#associatedtype.Error" title="type actix_web::FromRequest::Error">Error</a>&gt;&gt;</h4></section></summary><div class='docblock'>Future that resolves to a <code>Self</code>. <a href="../trait.FromRequest.html#associatedtype.Future">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.from_request" class="method trait-impl"><a class="src rightside" href="../../src/actix_web/extract.rs.html#284-286">source</a><a href="#method.from_request" class="anchor">§</a><h4 class="code-header">fn <a href="../trait.FromRequest.html#tymethod.from_request" class="fn">from_request</a>(req: &amp;<a class="struct" href="../struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>, _: &amp;mut <a class="enum" href="../dev/enum.Payload.html" title="enum actix_web::dev::Payload">Payload</a>) -&gt; Self::<a class="associatedtype" href="../trait.FromRequest.html#associatedtype.Future" title="type actix_web::FromRequest::Future">Future</a></h4></section></summary><div class='docblock'>Create a <code>Self</code> from request parts asynchronously.</div></details><details class="toggle method-toggle" open><summary><section id="method.extract" class="method trait-impl"><a class="src rightside" href="../../src/actix_web/extract.rs.html#94-96">source</a><a href="#method.extract" class="anchor">§</a><h4 class="code-header">fn <a href="../trait.FromRequest.html#method.extract" class="fn">extract</a>(req: &amp;<a class="struct" href="../struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>) -&gt; Self::<a class="associatedtype" href="../trait.FromRequest.html#associatedtype.Future" title="type actix_web::FromRequest::Future">Future</a></h4></section></summary><div class='docblock'>Create a <code>Self</code> from request head asynchronously. <a href="../trait.FromRequest.html#method.extract">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-FromStr-for-Uri" class="impl"><a class="src rightside" href="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#883">source</a><a href="#impl-FromStr-for-Uri" 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.Uri.html" title="struct actix_web::http::Uri">Uri</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Err" class="associatedtype trait-impl"><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="uri/struct.InvalidUri.html" title="struct actix_web::http::uri::InvalidUri">InvalidUri</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="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#887">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: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="struct.Uri.html" title="struct actix_web::http::Uri">Uri</a>, <a class="struct" href="uri/struct.InvalidUri.html" title="struct actix_web::http::uri::InvalidUri">InvalidUri</a>&gt;</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-Uri" class="impl"><a class="src rightside" href="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#1097">source</a><a href="#impl-Hash-for-Uri" 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.Uri.html" title="struct actix_web::http::Uri">Uri</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="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#1098-1100">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>&lt;H&gt;(&amp;self, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut H</a>)<div class="where">where
H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>,</div></h4></section></summary><div class='docblock'>Feeds this value into the given <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher"><code>Hasher</code></a>. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.hash_slice" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.3.0">1.3.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/hash/mod.rs.html#238-240">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>&lt;H&gt;(data: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[Self]</a>, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;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-Host-for-Uri" class="impl"><a href="#impl-Host-for-Uri" class="anchor">§</a><h3 class="code-header">impl Host for <a class="struct" href="struct.Uri.html" title="struct actix_web::http::Uri">Uri</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.hostname" class="method trait-impl"><a href="#method.hostname" class="anchor">§</a><h4 class="code-header">fn <a class="fn">hostname</a>(&amp;self) -&gt; &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></h4></section></summary><div class='docblock'>Extract hostname.</div></details><details class="toggle method-toggle" open><summary><section id="method.port-1" class="method trait-impl"><a href="#method.port-1" class="anchor">§</a><h4 class="code-header">fn <a class="fn">port</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u16.html">u16</a>&gt;</h4></section></summary><div class='docblock'>Extract optional port.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-PartialEq%3C%26str%3E-for-Uri" class="impl"><a class="src rightside" href="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#999">source</a><a href="#impl-PartialEq%3C%26str%3E-for-Uri" class="anchor">§</a><h3 class="code-header">impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a>&lt;&amp;'a <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>&gt; for <a class="struct" href="struct.Uri.html" title="struct actix_web::http::Uri">Uri</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.eq-4" class="method trait-impl"><a class="src rightside" href="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#1000">source</a><a href="#method.eq-4" 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>(&amp;self, other: &amp;&amp;'a <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>This method 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-4" 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#263">source</a></span><a href="#method.ne-4" 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>(&amp;self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;Rhs</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>This method 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-PartialEq%3CUri%3E-for-%26str" class="impl"><a class="src rightside" href="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#1005">source</a><a href="#impl-PartialEq%3CUri%3E-for-%26str" class="anchor">§</a><h3 class="code-header">impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a>&lt;<a class="struct" href="struct.Uri.html" title="struct actix_web::http::Uri">Uri</a>&gt; for &amp;'a <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.eq-2" class="method trait-impl"><a class="src rightside" href="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#1006">source</a><a href="#method.eq-2" 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>(&amp;self, uri: &amp;<a class="struct" href="struct.Uri.html" title="struct actix_web::http::Uri">Uri</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>This method 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-2" 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#263">source</a></span><a href="#method.ne-2" 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>(&amp;self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;Rhs</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>This method 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-PartialEq%3CUri%3E-for-str" class="impl"><a class="src rightside" href="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#993">source</a><a href="#impl-PartialEq%3CUri%3E-for-str" 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>&lt;<a class="struct" href="struct.Uri.html" title="struct actix_web::http::Uri">Uri</a>&gt; for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.eq-1" class="method trait-impl"><a class="src rightside" href="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#994">source</a><a href="#method.eq-1" 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>(&amp;self, uri: &amp;<a class="struct" href="struct.Uri.html" title="struct actix_web::http::Uri">Uri</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>This method 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-1" 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#263">source</a></span><a href="#method.ne-1" 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>(&amp;self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;Rhs</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>This method 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-PartialEq%3Cstr%3E-for-Uri" class="impl"><a class="src rightside" href="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#914">source</a><a href="#impl-PartialEq%3Cstr%3E-for-Uri" 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>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>&gt; for <a class="struct" href="struct.Uri.html" title="struct actix_web::http::Uri">Uri</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.eq-3" class="method trait-impl"><a class="src rightside" href="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#915">source</a><a href="#method.eq-3" 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>(&amp;self, other: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>This method 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-3" 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#263">source</a></span><a href="#method.ne-3" 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>(&amp;self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;Rhs</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>This method 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-PartialEq-for-Uri" class="impl"><a class="src rightside" href="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#892">source</a><a href="#impl-PartialEq-for-Uri" 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.Uri.html" title="struct actix_web::http::Uri">Uri</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="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#893">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>(&amp;self, other: &amp;<a class="struct" href="struct.Uri.html" title="struct actix_web::http::Uri">Uri</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>This method 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#263">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>(&amp;self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;Rhs</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>This method 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-ResourcePath-for-Uri" class="impl"><a class="src rightside" href="../../src/actix_router/resource_path.rs.html#35">source</a><a href="#impl-ResourcePath-for-Uri" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../dev/trait.ResourcePath.html" title="trait actix_web::dev::ResourcePath">ResourcePath</a> for <a class="struct" href="struct.Uri.html" title="struct actix_web::http::Uri">Uri</a></h3><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>http</code></strong> only.</div></span></section></summary><div class="impl-items"><section id="method.path-1" class="method trait-impl"><a class="src rightside" href="../../src/actix_router/resource_path.rs.html#36">source</a><a href="#method.path-1" class="anchor">§</a><h4 class="code-header">fn <a href="../dev/trait.ResourcePath.html#tymethod.path" class="fn">path</a>(&amp;self) -&gt; &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></h4></section></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%26%5Bu8%5D%3E-for-Uri" class="impl"><a class="src rightside" href="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#709">source</a><a href="#impl-TryFrom%3C%26%5Bu8%5D%3E-for-Uri" class="anchor">§</a><h3 class="code-header">impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;&amp;'a [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]&gt; for <a class="struct" href="struct.Uri.html" title="struct actix_web::http::Uri">Uri</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-6" class="associatedtype trait-impl"><a href="#associatedtype.Error-6" 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="struct" href="uri/struct.InvalidUri.html" title="struct actix_web::http::uri::InvalidUri">InvalidUri</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-6" class="method trait-impl"><a class="src rightside" href="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#713">source</a><a href="#method.try_from-6" 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>(t: &amp;'a [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="struct.Uri.html" title="struct actix_web::http::Uri">Uri</a>, &lt;<a class="struct" href="struct.Uri.html" title="struct actix_web::http::Uri">Uri</a> as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;&amp;'a [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]&gt;&gt;::<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>&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%26String%3E-for-Uri" class="impl"><a class="src rightside" href="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#727">source</a><a href="#impl-TryFrom%3C%26String%3E-for-Uri" class="anchor">§</a><h3 class="code-header">impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;&amp;'a <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>&gt; for <a class="struct" href="struct.Uri.html" title="struct actix_web::http::Uri">Uri</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-5" class="associatedtype trait-impl"><a href="#associatedtype.Error-5" 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="struct" href="uri/struct.InvalidUri.html" title="struct actix_web::http::uri::InvalidUri">InvalidUri</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-5" class="method trait-impl"><a class="src rightside" href="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#731">source</a><a href="#method.try_from-5" 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>(t: &amp;'a <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="struct.Uri.html" title="struct actix_web::http::Uri">Uri</a>, &lt;<a class="struct" href="struct.Uri.html" title="struct actix_web::http::Uri">Uri</a> as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;&amp;'a <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>&gt;&gt;::<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>&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%26Uri%3E-for-Uri" class="impl"><a class="src rightside" href="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#763">source</a><a href="#impl-TryFrom%3C%26Uri%3E-for-Uri" class="anchor">§</a><h3 class="code-header">impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;&amp;'a <a class="struct" href="struct.Uri.html" title="struct actix_web::http::Uri">Uri</a>&gt; for <a class="struct" href="struct.Uri.html" title="struct actix_web::http::Uri">Uri</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-4" class="associatedtype trait-impl"><a href="#associatedtype.Error-4" 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="struct" href="../error/struct.HttpError.html" title="struct actix_web::error::HttpError">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_from-4" class="method trait-impl"><a class="src rightside" href="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#767">source</a><a href="#method.try_from-4" 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>(src: &amp;'a <a class="struct" href="struct.Uri.html" title="struct actix_web::http::Uri">Uri</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="struct.Uri.html" title="struct actix_web::http::Uri">Uri</a>, &lt;<a class="struct" href="struct.Uri.html" title="struct actix_web::http::Uri">Uri</a> as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;&amp;'a <a class="struct" href="struct.Uri.html" title="struct actix_web::http::Uri">Uri</a>&gt;&gt;::<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>&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%26str%3E-for-Uri" class="impl"><a class="src rightside" href="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#718">source</a><a href="#impl-TryFrom%3C%26str%3E-for-Uri" class="anchor">§</a><h3 class="code-header">impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;&amp;'a <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>&gt; for <a class="struct" href="struct.Uri.html" title="struct actix_web::http::Uri">Uri</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error" class="associatedtype trait-impl"><a href="#associatedtype.Error" 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="struct" href="uri/struct.InvalidUri.html" title="struct actix_web::http::uri::InvalidUri">InvalidUri</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://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#722">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>(t: &amp;'a <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="struct.Uri.html" title="struct actix_web::http::Uri">Uri</a>, &lt;<a class="struct" href="struct.Uri.html" title="struct actix_web::http::Uri">Uri</a> as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;&amp;'a <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>&gt;&gt;::<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>&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3CParts%3E-for-Uri" class="impl"><a class="src rightside" href="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#754">source</a><a href="#impl-TryFrom%3CParts%3E-for-Uri" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;<a class="struct" href="uri/struct.Parts.html" title="struct actix_web::http::uri::Parts">Parts</a>&gt; for <a class="struct" href="struct.Uri.html" title="struct actix_web::http::Uri">Uri</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-3" class="associatedtype trait-impl"><a href="#associatedtype.Error-3" 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="struct" href="uri/struct.InvalidUriParts.html" title="struct actix_web::http::uri::InvalidUriParts">InvalidUriParts</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-3" class="method trait-impl"><a class="src rightside" href="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#758">source</a><a href="#method.try_from-3" 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>(src: <a class="struct" href="uri/struct.Parts.html" title="struct actix_web::http::uri::Parts">Parts</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="struct.Uri.html" title="struct actix_web::http::Uri">Uri</a>, &lt;<a class="struct" href="struct.Uri.html" title="struct actix_web::http::Uri">Uri</a> as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;<a class="struct" href="uri/struct.Parts.html" title="struct actix_web::http::uri::Parts">Parts</a>&gt;&gt;::<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>&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3CString%3E-for-Uri" class="impl"><a class="src rightside" href="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#736">source</a><a href="#impl-TryFrom%3CString%3E-for-Uri" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>&gt; for <a class="struct" href="struct.Uri.html" title="struct actix_web::http::Uri">Uri</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-2" class="associatedtype trait-impl"><a href="#associatedtype.Error-2" 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="struct" href="uri/struct.InvalidUri.html" title="struct actix_web::http::uri::InvalidUri">InvalidUri</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-2" class="method trait-impl"><a class="src rightside" href="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#740">source</a><a href="#method.try_from-2" 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>(t: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="struct.Uri.html" title="struct actix_web::http::Uri">Uri</a>, &lt;<a class="struct" href="struct.Uri.html" title="struct actix_web::http::Uri">Uri</a> as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>&gt;&gt;::<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>&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3CVec%3Cu8%3E%3E-for-Uri" class="impl"><a class="src rightside" href="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#745">source</a><a href="#impl-TryFrom%3CVec%3Cu8%3E%3E-for-Uri" class="anchor">§</a><h3 class="code-header">impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>&gt;&gt; for <a class="struct" href="struct.Uri.html" title="struct actix_web::http::Uri">Uri</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-1" class="associatedtype trait-impl"><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="struct" href="uri/struct.InvalidUri.html" title="struct actix_web::http::uri::InvalidUri">InvalidUri</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-1" class="method trait-impl"><a class="src rightside" href="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#749">source</a><a href="#method.try_from-1" 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>(vec: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>&gt;) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="struct.Uri.html" title="struct actix_web::http::Uri">Uri</a>, &lt;<a class="struct" href="struct.Uri.html" title="struct actix_web::http::Uri">Uri</a> as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>&gt;&gt;&gt;::<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>&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><section id="impl-Eq-for-Uri" class="impl"><a class="src rightside" href="https://docs.rs/http/0.2.11/src/http/uri/mod.rs.html#1011">source</a><a href="#impl-Eq-for-Uri" 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.Uri.html" title="struct actix_web::http::Uri">Uri</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-Uri" class="impl"><a href="#impl-Freeze-for-Uri" 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.Uri.html" title="struct actix_web::http::Uri">Uri</a></h3></section><section id="impl-RefUnwindSafe-for-Uri" class="impl"><a href="#impl-RefUnwindSafe-for-Uri" 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.Uri.html" title="struct actix_web::http::Uri">Uri</a></h3></section><section id="impl-Send-for-Uri" class="impl"><a href="#impl-Send-for-Uri" 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.Uri.html" title="struct actix_web::http::Uri">Uri</a></h3></section><section id="impl-Sync-for-Uri" class="impl"><a href="#impl-Sync-for-Uri" 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.Uri.html" title="struct actix_web::http::Uri">Uri</a></h3></section><section id="impl-Unpin-for-Uri" class="impl"><a href="#impl-Unpin-for-Uri" 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.Uri.html" title="struct actix_web::http::Uri">Uri</a></h3></section><section id="impl-UnwindSafe-for-Uri" class="impl"><a href="#impl-UnwindSafe-for-Uri" 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.Uri.html" title="struct actix_web::http::Uri">Uri</a></h3></section></div><h2 id="blanket-implementations" class="section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor">§</a></h2><div id="blanket-implementations-list"><details class="toggle implementors-toggle"><summary><section id="impl-Any-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#140">source</a><a href="#impl-Any-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T<div class="where">where
T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#141">source</a><a href="#method.type_id" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fn">type_id</a>(&amp;self) -&gt; <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#208">source</a><a href="#impl-Borrow%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; 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#210">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>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;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#216">source</a><a href="#impl-BorrowMut%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; 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#217">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>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;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-Equivalent%3CK%3E-for-Q" class="impl"><a href="#impl-Equivalent%3CK%3E-for-Q" class="anchor">§</a><h3 class="code-header">impl&lt;Q, K&gt; Equivalent&lt;K&gt; for Q<div class="where">where
Q: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
K: <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;Q&gt; + ?<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.equivalent" class="method trait-impl"><a href="#method.equivalent" class="anchor">§</a><h4 class="code-header">fn <a class="fn">equivalent</a>(&amp;self, key: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;K</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Checks if this value is equivalent to the given key. <a>Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Equivalent%3CK%3E-for-Q-1" class="impl"><a href="#impl-Equivalent%3CK%3E-for-Q-1" class="anchor">§</a><h3 class="code-header">impl&lt;Q, K&gt; Equivalent&lt;K&gt; for Q<div class="where">where
Q: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
K: <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;Q&gt; + ?<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.equivalent-1" class="method trait-impl"><a href="#method.equivalent-1" class="anchor">§</a><h4 class="code-header">fn <a class="fn">equivalent</a>(&amp;self, key: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;K</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Compare self to <code>key</code> and return <code>true</code> if they are equal.</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#765">source</a><a href="#impl-From%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from-3" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#768">source</a><a href="#method.from-3" 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) -&gt; 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&lt;T&gt; 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) -&gt; Instrumented&lt;Self&gt;</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) -&gt; Instrumented&lt;Self&gt;</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#748-750">source</a><a href="#impl-Into%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; 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>&lt;T&gt;,</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#758">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) -&gt; 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>&lt;T&gt; for U</code> chooses to do.</p>
</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.17.0/src/typenum/type_operators.rs.html#34">source</a><a href="#impl-Same-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://docs.rs/typenum/1.17.0/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 href="#associatedtype.Output" class="anchor">§</a><h4 class="code-header">type <a href="https://docs.rs/typenum/1.17.0/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#83-85">source</a><a href="#impl-ToOwned-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <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 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#88">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>(&amp;self) -&gt; 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#92">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>(&amp;self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;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#2552">source</a><a href="#impl-ToString-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <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#2558">source</a><a href="#method.to_string" class="anchor">§</a><h4 class="code-header">default fn <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string" class="fn">to_string</a>(&amp;self) -&gt; <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#805-807">source</a><a href="#impl-TryFrom%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; 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>&lt;T&gt;,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-9" class="associatedtype trait-impl"><a href="#associatedtype.Error-9" 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-7" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#812">source</a><a href="#method.try_from-7" 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) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<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>&gt;</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#790-792">source</a><a href="#impl-TryInto%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; 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>&lt;T&gt;,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-8" class="associatedtype trait-impl"><a href="#associatedtype.Error-8" 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> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<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#797">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) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;U, &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<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>&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-VZip%3CV%3E-for-T" class="impl"><a href="#impl-VZip%3CV%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;V, T&gt; VZip&lt;V&gt; for T<div class="where">where
V: MultiLane&lt;T&gt;,</div></h3></section></summary><div class="impl-items"><section id="method.vzip" class="method trait-impl"><a href="#method.vzip" class="anchor">§</a><h4 class="code-header">fn <a class="fn">vzip</a>(self) -&gt; V</h4></section></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&lt;T&gt; 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>&lt;S&gt;(self, subscriber: S) -&gt; WithDispatch&lt;Self&gt;<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>&lt;Dispatch&gt;,</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) -&gt; WithDispatch&lt;Self&gt;</h4></section></summary><div class='docblock'>Attaches the current <a href="crate::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></div></section></div></main></body></html>