pencil 0.1.2

A micro web framework for Rust.
<!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="API documentation for the Rust `Url` struct in crate `hyper`.">
    <meta name="keywords" content="rust, rustlang, rust-lang, Url">

    <title>hyper::Url - Rust</title>

    <link rel="stylesheet" type="text/css" href="../rustdoc.css">
    <link rel="stylesheet" type="text/css" href="../main.css">

    
    
</head>
<body class="rustdoc">
    <!--[if lte IE 8]>
    <div class="warning">
        This old browser is unsupported and will most likely display funky
        things.
    </div>
    <![endif]-->

    

    <nav class="sidebar">
        
        <p class='location'><a href='index.html'>hyper</a></p><script>window.sidebarCurrent = {name: 'Url', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script>
    </nav>

    <nav class="sub">
        <form class="search-form js-only">
            <div class="search-container">
                <input class="search-input" name="search"
                       autocomplete="off"
                       placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
                       type="search">
            </div>
        </form>
    </nav>

    <section id='main' class="content struct">
<h1 class='fqn'><span class='in-band'>Struct <a href='index.html'>hyper</a>::<wbr><a class='struct' href=''>Url</a></span><span class='out-of-band'><span id='render-detail'>
            <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
                [<span class='inner'>&#x2212;</span>]
            </a>
        </span><a id='src-1290' class='srclink' href='../url/struct.Url.html?gotosrc=1290' title='goto source code'>[src]</a></span></h1>
<pre class='rust struct'>pub struct Url {
    pub scheme: <a class='struct' href='https://doc.rust-lang.org/nightly/collections/string/struct.String.html' title='collections::string::String'>String</a>,
    pub scheme_data: <a class='enum' href='../url/enum.SchemeData.html' title='url::SchemeData'>SchemeData</a>,
    pub query: <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;<a class='struct' href='https://doc.rust-lang.org/nightly/collections/string/struct.String.html' title='collections::string::String'>String</a>&gt;,
    pub fragment: <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;<a class='struct' href='https://doc.rust-lang.org/nightly/collections/string/struct.String.html' title='collections::string::String'>String</a>&gt;,
}</pre><div class='docblock'><p>The parsed representation of an absolute URL.</p>
</div><h2 class='fields'>Fields</h2>
<table><tr class='stab '>
                                  <td id='structfield.scheme'><code>scheme</code></td><td><div class='docblock'><p>The scheme (a.k.a. protocol) of the URL, in ASCII lower case.</p>
</div></td></tr><tr class='stab '>
                                  <td id='structfield.scheme_data'><code>scheme_data</code></td><td><div class='docblock'><p>The components of the URL whose representation depends on where the scheme is <em>relative</em>.</p>
</div></td></tr><tr class='stab '>
                                  <td id='structfield.query'><code>query</code></td><td><div class='docblock'><p>The query string of the URL.</p>

<p><code>None</code> if the <code>?</code> delimiter character was not part of the parsed input,
otherwise a possibly empty, percent-encoded string.</p>

<p>Percent encoded strings are within the ASCII range.</p>

<p>See also the <code>query_pairs</code>, <code>set_query_from_pairs</code>,
and <code>lossy_percent_decode_query</code> methods.</p>
</div></td></tr><tr class='stab '>
                                  <td id='structfield.fragment'><code>fragment</code></td><td><div class='docblock'><p>The fragment identifier of the URL.</p>

<p><code>None</code> if the <code>#</code> delimiter character was not part of the parsed input,
otherwise a possibly empty, percent-encoded string.</p>

<p>Percent encoded strings are within the ASCII range.</p>

<p>See also the <code>lossy_percent_decode_fragment</code> method.</p>
</div></td></tr></table><h2 id='methods'>Methods</h2><h3 class='impl'><code>impl <a class='struct' href='../hyper/struct.Url.html' title='hyper::Url'>Url</a></code></h3><div class='impl-items'><h4 id='method.parse' class='method'><code>fn <a href='#method.parse' class='fnname'>parse</a>(input: &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='core::result::Result'>Result</a>&lt;<a class='struct' href='../hyper/struct.Url.html' title='hyper::Url'>Url</a>, <a class='enum' href='../url/parser/enum.ParseError.html' title='url::parser::ParseError'>ParseError</a>&gt;</code></h4>
<div class='docblock'><p>Parse an URL with the default <code>UrlParser</code> parameters.</p>

<p>In particular, relative URL references are parse errors since no base URL is provided.</p>
</div><h4 id='method.from_file_path' class='method'><code>fn <a href='#method.from_file_path' class='fnname'>from_file_path</a>&lt;P&gt;(path: P) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/result/enum.Result.html' title='core::result::Result'>Result</a>&lt;<a class='struct' href='../hyper/struct.Url.html' title='hyper::Url'>Url</a>, <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>()</a>&gt; <span class='where'>where P: <a class='trait' href='https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html' title='core::convert::AsRef'>AsRef</a>&lt;<a class='struct' href='https://doc.rust-lang.org/nightly/std/path/struct.Path.html' title='std::path::Path'>Path</a>&gt;</span></code></h4>
<div class='docblock'><p>Convert a file name as <code>std::path::Path</code> into an URL in the <code>file</code> scheme.</p>

<p>This returns <code>Err</code> if the given path is not absolute
or, with a Windows path, if the prefix is not a disk prefix (e.g. <code>C:</code>).</p>
</div><h4 id='method.from_directory_path' class='method'><code>fn <a href='#method.from_directory_path' class='fnname'>from_directory_path</a>&lt;P&gt;(path: P) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/result/enum.Result.html' title='core::result::Result'>Result</a>&lt;<a class='struct' href='../hyper/struct.Url.html' title='hyper::Url'>Url</a>, <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>()</a>&gt; <span class='where'>where P: <a class='trait' href='https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html' title='core::convert::AsRef'>AsRef</a>&lt;<a class='struct' href='https://doc.rust-lang.org/nightly/std/path/struct.Path.html' title='std::path::Path'>Path</a>&gt;</span></code></h4>
<div class='docblock'><p>Convert a directory name as <code>std::path::Path</code> into an URL in the <code>file</code> scheme.</p>

<p>This returns <code>Err</code> if the given path is not absolute
or, with a Windows path, if the prefix is not a disk prefix (e.g. <code>C:</code>).</p>

<p>Compared to <code>from_file_path</code>, this adds an empty component to the path
(or, in terms of URL syntax, adds a trailing slash)
so that the entire path is considered when using this URL as a base URL.</p>

<p>For example:</p>

<ul>
<li><code>&quot;index.html&quot;</code> parsed with <code>Url::from_directory_path(Path::new(&quot;/var/www&quot;))</code>
as the base URL is <code>file:///var/www/index.html</code></li>
<li><code>&quot;index.html&quot;</code> parsed with <code>Url::from_file_path(Path::new(&quot;/var/www/&quot;))</code>
as the base URL is <code>file:///var/index.html</code>, which might not be what was intended.</li>
</ul>

<p>(Note that <code>Path::new</code> removes any trailing slash.)</p>
</div><h4 id='method.to_file_path' class='method'><code>fn <a href='#method.to_file_path' class='fnname'>to_file_path</a>(&amp;self) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/result/enum.Result.html' title='core::result::Result'>Result</a>&lt;<a class='struct' href='https://doc.rust-lang.org/nightly/std/path/struct.PathBuf.html' title='std::path::PathBuf'>PathBuf</a>, <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>()</a>&gt;</code></h4>
<div class='docblock'><p>Assuming the URL is in the <code>file</code> scheme or similar,
convert its path to an absolute <code>std::path::Path</code>.</p>

<p><strong>Note:</strong> This does not actually check the URL’s <code>scheme</code>,
and may give nonsensical results for other schemes.
It is the user’s responsibility to check the URL’s scheme before calling this.</p>
<pre class='rust rust-example-rendered'>
<span class='kw'>let</span> <span class='ident'>path</span> <span class='op'>=</span> <span class='ident'>url</span>.<span class='ident'>to_file_path</span>();</pre>

<p>Returns <code>Err</code> if the host is neither empty nor <code>&quot;localhost&quot;</code>,
or if <code>Path::new_opt()</code> returns <code>None</code>.
(That is, if the percent-decoded path contains a NUL byte or,
for a Windows path, is not UTF-8.)</p>
</div><h4 id='method.serialize' class='method'><code>fn <a href='#method.serialize' class='fnname'>serialize</a>(&amp;self) -&gt; <a class='struct' href='https://doc.rust-lang.org/nightly/collections/string/struct.String.html' title='collections::string::String'>String</a></code></h4>
<div class='docblock'><p>Return the serialization of this URL as a string.</p>
</div><h4 id='method.origin' class='method'><code>fn <a href='#method.origin' class='fnname'>origin</a>(&amp;self) -&gt; <a class='enum' href='../url/enum.Origin.html' title='url::Origin'>Origin</a></code></h4>
<div class='docblock'><p>Return the origin of this URL (<a href="https://url.spec.whatwg.org/#origin">https://url.spec.whatwg.org/#origin</a>)</p>
</div><h4 id='method.serialize_no_fragment' class='method'><code>fn <a href='#method.serialize_no_fragment' class='fnname'>serialize_no_fragment</a>(&amp;self) -&gt; <a class='struct' href='https://doc.rust-lang.org/nightly/collections/string/struct.String.html' title='collections::string::String'>String</a></code></h4>
<div class='docblock'><p>Return the serialization of this URL, without the fragment identifier, as a string</p>
</div><h4 id='method.non_relative_scheme_data' class='method'><code>fn <a href='#method.non_relative_scheme_data' class='fnname'>non_relative_scheme_data</a>(&amp;self) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;&amp;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a>&gt;</code></h4>
<div class='docblock'><p>If the URL is <em>non-relative</em>, return the string scheme data.</p>
</div><h4 id='method.non_relative_scheme_data_mut' class='method'><code>fn <a href='#method.non_relative_scheme_data_mut' class='fnname'>non_relative_scheme_data_mut</a>(&amp;mut self) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;&amp;mut <a class='struct' href='https://doc.rust-lang.org/nightly/collections/string/struct.String.html' title='collections::string::String'>String</a>&gt;</code></h4>
<div class='docblock'><p>If the URL is <em>non-relative</em>, return a mutable reference to the string scheme data.</p>
</div><h4 id='method.relative_scheme_data' class='method'><code>fn <a href='#method.relative_scheme_data' class='fnname'>relative_scheme_data</a>(&amp;self) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;&amp;<a class='struct' href='../url/struct.RelativeSchemeData.html' title='url::RelativeSchemeData'>RelativeSchemeData</a>&gt;</code></h4>
<div class='docblock'><p>If the URL is in a <em>relative scheme</em>, return the structured scheme data.</p>
</div><h4 id='method.relative_scheme_data_mut' class='method'><code>fn <a href='#method.relative_scheme_data_mut' class='fnname'>relative_scheme_data_mut</a>(&amp;mut self) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;&amp;mut <a class='struct' href='../url/struct.RelativeSchemeData.html' title='url::RelativeSchemeData'>RelativeSchemeData</a>&gt;</code></h4>
<div class='docblock'><p>If the URL is in a <em>relative scheme</em>,
return a mutable reference to the structured scheme data.</p>
</div><h4 id='method.username' class='method'><code>fn <a href='#method.username' class='fnname'>username</a>(&amp;self) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;&amp;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a>&gt;</code></h4>
<div class='docblock'><p>If the URL is in a <em>relative scheme</em>, return its username.</p>
</div><h4 id='method.username_mut' class='method'><code>fn <a href='#method.username_mut' class='fnname'>username_mut</a>(&amp;mut self) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;&amp;mut <a class='struct' href='https://doc.rust-lang.org/nightly/collections/string/struct.String.html' title='collections::string::String'>String</a>&gt;</code></h4>
<div class='docblock'><p>If the URL is in a <em>relative scheme</em>, return a mutable reference to its username.</p>
</div><h4 id='method.lossy_percent_decode_username' class='method'><code>fn <a href='#method.lossy_percent_decode_username' class='fnname'>lossy_percent_decode_username</a>(&amp;self) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;<a class='struct' href='https://doc.rust-lang.org/nightly/collections/string/struct.String.html' title='collections::string::String'>String</a>&gt;</code></h4>
<div class='docblock'><p>Percent-decode the URL’s username, if any.</p>

<p>This is “lossy”: invalid UTF-8 percent-encoded byte sequences
will be replaced � U+FFFD, the replacement character.</p>
</div><h4 id='method.password' class='method'><code>fn <a href='#method.password' class='fnname'>password</a>(&amp;self) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;&amp;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a>&gt;</code></h4>
<div class='docblock'><p>If the URL is in a <em>relative scheme</em>, return its password, if any.</p>
</div><h4 id='method.password_mut' class='method'><code>fn <a href='#method.password_mut' class='fnname'>password_mut</a>(&amp;mut self) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;&amp;mut <a class='struct' href='https://doc.rust-lang.org/nightly/collections/string/struct.String.html' title='collections::string::String'>String</a>&gt;</code></h4>
<div class='docblock'><p>If the URL is in a <em>relative scheme</em>, return a mutable reference to its password, if any.</p>
</div><h4 id='method.lossy_percent_decode_password' class='method'><code>fn <a href='#method.lossy_percent_decode_password' class='fnname'>lossy_percent_decode_password</a>(&amp;self) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;<a class='struct' href='https://doc.rust-lang.org/nightly/collections/string/struct.String.html' title='collections::string::String'>String</a>&gt;</code></h4>
<div class='docblock'><p>Percent-decode the URL’s password, if any.</p>

<p>This is “lossy”: invalid UTF-8 percent-encoded byte sequences
will be replaced � U+FFFD, the replacement character.</p>
</div><h4 id='method.serialize_userinfo' class='method'><code>fn <a href='#method.serialize_userinfo' class='fnname'>serialize_userinfo</a>(&amp;mut self) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;<a class='struct' href='https://doc.rust-lang.org/nightly/collections/string/struct.String.html' title='collections::string::String'>String</a>&gt;</code></h4>
<div class='docblock'><p>Serialize the URL&#39;s username and password, if any.</p>

<p>Format: &quot;<username>:<password>@&quot;</p>
</div><h4 id='method.host' class='method'><code>fn <a href='#method.host' class='fnname'>host</a>(&amp;self) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;&amp;<a class='enum' href='../url/host/enum.Host.html' title='url::host::Host'>Host</a>&gt;</code></h4>
<div class='docblock'><p>If the URL is in a <em>relative scheme</em>, return its structured host.</p>
</div><h4 id='method.host_mut' class='method'><code>fn <a href='#method.host_mut' class='fnname'>host_mut</a>(&amp;mut self) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;&amp;mut <a class='enum' href='../url/host/enum.Host.html' title='url::host::Host'>Host</a>&gt;</code></h4>
<div class='docblock'><p>If the URL is in a <em>relative scheme</em>, return a mutable reference to its structured host.</p>
</div><h4 id='method.domain' class='method'><code>fn <a href='#method.domain' class='fnname'>domain</a>(&amp;self) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;&amp;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a>&gt;</code></h4>
<div class='docblock'><p>If the URL is in a <em>relative scheme</em> and its host is a domain,
return the domain as a string.</p>
</div><h4 id='method.domain_mut' class='method'><code>fn <a href='#method.domain_mut' class='fnname'>domain_mut</a>(&amp;mut self) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;&amp;mut <a class='struct' href='https://doc.rust-lang.org/nightly/collections/string/struct.String.html' title='collections::string::String'>String</a>&gt;</code></h4>
<div class='docblock'><p>If the URL is in a <em>relative scheme</em> and its host is a domain,
return a mutable reference to the domain string.</p>
</div><h4 id='method.serialize_host' class='method'><code>fn <a href='#method.serialize_host' class='fnname'>serialize_host</a>(&amp;self) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;<a class='struct' href='https://doc.rust-lang.org/nightly/collections/string/struct.String.html' title='collections::string::String'>String</a>&gt;</code></h4>
<div class='docblock'><p>If the URL is in a <em>relative scheme</em>, serialize its host as a string.</p>

<p>A domain a returned as-is, an IPv6 address between [] square brackets.</p>
</div><h4 id='method.port' class='method'><code>fn <a href='#method.port' class='fnname'>port</a>(&amp;self) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u16.html'>u16</a>&gt;</code></h4>
<div class='docblock'><p>If the URL is in a <em>relative scheme</em> and has a port number, return it.</p>
</div><h4 id='method.port_mut' class='method'><code>fn <a href='#method.port_mut' class='fnname'>port_mut</a>(&amp;mut self) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;&amp;mut <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u16.html'>u16</a>&gt;&gt;</code></h4>
<div class='docblock'><p>If the URL is in a <em>relative scheme</em>, return a mutable reference to its port.</p>
</div><h4 id='method.port_or_default' class='method'><code>fn <a href='#method.port_or_default' class='fnname'>port_or_default</a>(&amp;self) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u16.html'>u16</a>&gt;</code></h4>
<div class='docblock'><p>If the URL is in a <em>relative scheme</em> that is not a file-like,
return its port number, even if it is the default.</p>
</div><h4 id='method.path' class='method'><code>fn <a href='#method.path' class='fnname'>path</a>(&amp;self) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.slice.html'>&amp;[</a><a class='struct' href='https://doc.rust-lang.org/nightly/collections/string/struct.String.html' title='collections::string::String'>String</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.slice.html'>]</a>&gt;</code></h4>
<div class='docblock'><p>If the URL is in a <em>relative scheme</em>, return its path components.</p>
</div><h4 id='method.path_mut' class='method'><code>fn <a href='#method.path_mut' class='fnname'>path_mut</a>(&amp;mut self) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;&amp;mut <a class='struct' href='https://doc.rust-lang.org/nightly/collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a>&lt;<a class='struct' href='https://doc.rust-lang.org/nightly/collections/string/struct.String.html' title='collections::string::String'>String</a>&gt;&gt;</code></h4>
<div class='docblock'><p>If the URL is in a <em>relative scheme</em>, return a mutable reference to its path components.</p>
</div><h4 id='method.serialize_path' class='method'><code>fn <a href='#method.serialize_path' class='fnname'>serialize_path</a>(&amp;self) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;<a class='struct' href='https://doc.rust-lang.org/nightly/collections/string/struct.String.html' title='collections::string::String'>String</a>&gt;</code></h4>
<div class='docblock'><p>If the URL is in a <em>relative scheme</em>, serialize its path as a string.</p>

<p>The returned string starts with a &quot;/&quot; slash, and components are separated by slashes.
A trailing slash represents an empty last component.</p>
</div><h4 id='method.query_pairs' class='method'><code>fn <a href='#method.query_pairs' class='fnname'>query_pairs</a>(&amp;self) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;<a class='struct' href='https://doc.rust-lang.org/nightly/collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>(<a class='struct' href='https://doc.rust-lang.org/nightly/collections/string/struct.String.html' title='collections::string::String'>String</a>, <a class='struct' href='https://doc.rust-lang.org/nightly/collections/string/struct.String.html' title='collections::string::String'>String</a>)</a>&gt;&gt;</code></h4>
<div class='docblock'><p>Parse the URL’s query string, if any, as <code>application/x-www-form-urlencoded</code>
and return a vector of (key, value) pairs.</p>
</div><h4 id='method.set_query_from_pairs' class='method'><code>fn <a href='#method.set_query_from_pairs' class='fnname'>set_query_from_pairs</a>&lt;I, K, V&gt;(&amp;mut self, pairs: I) <span class='where'>where I: <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/trait.IntoIterator.html' title='core::iter::IntoIterator'>IntoIterator</a>, V: <a class='trait' href='https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html' title='core::convert::AsRef'>AsRef</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a>&gt;, K: <a class='trait' href='https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html' title='core::convert::AsRef'>AsRef</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a>&gt;, I::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/trait.IntoIterator.html' title='core::iter::IntoIterator'>Item</a>: <a class='trait' href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html' title='core::borrow::Borrow'>Borrow</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>(K, V)</a>&gt;</span></code></h4>
<div class='docblock'><p>Serialize an iterator of (key, value) pairs as <code>application/x-www-form-urlencoded</code>
and set it as the URL’s query string.</p>
</div><h4 id='method.lossy_percent_decode_query' class='method'><code>fn <a href='#method.lossy_percent_decode_query' class='fnname'>lossy_percent_decode_query</a>(&amp;self) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;<a class='struct' href='https://doc.rust-lang.org/nightly/collections/string/struct.String.html' title='collections::string::String'>String</a>&gt;</code></h4>
<div class='docblock'><p>Percent-decode the URL’s query string, if any.</p>

<p>This is “lossy”: invalid UTF-8 percent-encoded byte sequences
will be replaced � U+FFFD, the replacement character.</p>
</div><h4 id='method.lossy_percent_decode_fragment' class='method'><code>fn <a href='#method.lossy_percent_decode_fragment' class='fnname'>lossy_percent_decode_fragment</a>(&amp;self) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;<a class='struct' href='https://doc.rust-lang.org/nightly/collections/string/struct.String.html' title='collections::string::String'>String</a>&gt;</code></h4>
<div class='docblock'><p>Percent-decode the URL’s fragment identifier, if any.</p>

<p>This is “lossy”: invalid UTF-8 percent-encoded byte sequences
will be replaced � U+FFFD, the replacement character.</p>
</div><h4 id='method.join' class='method'><code>fn <a href='#method.join' class='fnname'>join</a>(&amp;self, input: &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='core::result::Result'>Result</a>&lt;<a class='struct' href='../hyper/struct.Url.html' title='hyper::Url'>Url</a>, <a class='enum' href='../url/parser/enum.ParseError.html' title='url::parser::ParseError'>ParseError</a>&gt;</code></h4>
<div class='docblock'><p>Join a path with a base URL.</p>

<p>Corresponds to the basic URL parser where <code>self</code> is the given base URL.</p>
</div></div><h2 id='implementations'>Trait Implementations</h2><h3 class='impl'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html' title='core::str::FromStr'>FromStr</a> for <a class='struct' href='../hyper/struct.Url.html' title='hyper::Url'>Url</a></code></h3><div class='impl-items'><h4 id='assoc_type.Err' class='type'><code>type Err = <a class='enum' href='../url/parser/enum.ParseError.html' title='url::parser::ParseError'>ParseError</a></code></h4>
<h4 id='method.from_str' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#method.from_str' class='fnname'>from_str</a>(url: &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='core::result::Result'>Result</a>&lt;<a class='struct' href='../hyper/struct.Url.html' title='hyper::Url'>Url</a>, <a class='enum' href='../url/parser/enum.ParseError.html' title='url::parser::ParseError'>ParseError</a>&gt;</code></h4>
</div><h3 class='impl'><code>impl <a class='trait' href='../rustc_serialize/serialize/trait.Encodable.html' title='rustc_serialize::serialize::Encodable'>Encodable</a> for <a class='struct' href='../hyper/struct.Url.html' title='hyper::Url'>Url</a></code></h3><div class='impl-items'><h4 id='method.encode' class='method'><code>fn <a href='../rustc_serialize/serialize/trait.Encodable.html#method.encode' class='fnname'>encode</a>&lt;S&gt;(&amp;self, encoder: &amp;mut S) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/result/enum.Result.html' title='core::result::Result'>Result</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>()</a>, S::<a class='trait' href='../rustc_serialize/serialize/trait.Encoder.html' title='rustc_serialize::serialize::Encoder'>Error</a>&gt; <span class='where'>where S: <a class='trait' href='../rustc_serialize/serialize/trait.Encoder.html' title='rustc_serialize::serialize::Encoder'>Encoder</a></span></code></h4>
</div><h3 class='impl'><code>impl <a class='trait' href='../rustc_serialize/serialize/trait.Decodable.html' title='rustc_serialize::serialize::Decodable'>Decodable</a> for <a class='struct' href='../hyper/struct.Url.html' title='hyper::Url'>Url</a></code></h3><div class='impl-items'><h4 id='method.decode' class='method'><code>fn <a href='../rustc_serialize/serialize/trait.Decodable.html#method.decode' class='fnname'>decode</a>&lt;D&gt;(decoder: &amp;mut D) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/result/enum.Result.html' title='core::result::Result'>Result</a>&lt;<a class='struct' href='../hyper/struct.Url.html' title='hyper::Url'>Url</a>, D::<a class='trait' href='../rustc_serialize/serialize/trait.Decoder.html' title='rustc_serialize::serialize::Decoder'>Error</a>&gt; <span class='where'>where D: <a class='trait' href='../rustc_serialize/serialize/trait.Decoder.html' title='rustc_serialize::serialize::Decoder'>Decoder</a></span></code></h4>
</div><h3 class='impl'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html' title='core::fmt::Display'>Display</a> for <a class='struct' href='../hyper/struct.Url.html' title='hyper::Url'>Url</a></code></h3><div class='impl-items'><h4 id='method.fmt' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#method.fmt' class='fnname'>fmt</a>(&amp;self, formatter: &amp;mut <a class='struct' href='https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html' title='core::fmt::Formatter'>Formatter</a>) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/result/enum.Result.html' title='core::result::Result'>Result</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>()</a>, <a class='struct' href='https://doc.rust-lang.org/nightly/core/fmt/struct.Error.html' title='core::fmt::Error'>Error</a>&gt;</code></h4>
</div><h3 class='impl'><code>impl <a class='trait' href='../hyper/client/trait.IntoUrl.html' title='hyper::client::IntoUrl'>IntoUrl</a> for <a class='struct' href='../hyper/struct.Url.html' title='hyper::Url'>Url</a></code></h3><div class='impl-items'><h4 id='method.into_url' class='method'><code>fn <a href='../hyper/client/trait.IntoUrl.html#method.into_url' class='fnname'>into_url</a>(self) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/result/enum.Result.html' title='core::result::Result'>Result</a>&lt;<a class='struct' href='../hyper/struct.Url.html' title='hyper::Url'>Url</a>, <a class='enum' href='../url/parser/enum.ParseError.html' title='url::parser::ParseError'>UrlError</a>&gt;</code></h4>
</div><h3 id='derived_implementations'>Derived Implementations </h3><h3 class='impl'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html' title='core::cmp::Ord'>Ord</a> for <a class='struct' href='../hyper/struct.Url.html' title='hyper::Url'>Url</a></code></h3><div class='impl-items'><h4 id='method.cmp' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.cmp' class='fnname'>cmp</a>(&amp;self, __arg_0: &amp;<a class='struct' href='../hyper/struct.Url.html' title='hyper::Url'>Url</a>) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html' title='core::cmp::Ordering'>Ordering</a></code></h4>
</div><h3 class='impl'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html' title='core::cmp::PartialOrd'>PartialOrd</a>&lt;<a class='struct' href='../hyper/struct.Url.html' title='hyper::Url'>Url</a>&gt; for <a class='struct' href='../hyper/struct.Url.html' title='hyper::Url'>Url</a></code></h3><div class='impl-items'><h4 id='method.partial_cmp' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.partial_cmp' class='fnname'>partial_cmp</a>(&amp;self, __arg_0: &amp;<a class='struct' href='../hyper/struct.Url.html' title='hyper::Url'>Url</a>) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;<a class='enum' href='https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html' title='core::cmp::Ordering'>Ordering</a>&gt;</code></h4>
<h4 id='method.lt' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&amp;self, __arg_0: &amp;<a class='struct' href='../hyper/struct.Url.html' title='hyper::Url'>Url</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4>
<h4 id='method.le' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&amp;self, __arg_0: &amp;<a class='struct' href='../hyper/struct.Url.html' title='hyper::Url'>Url</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4>
<h4 id='method.gt' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&amp;self, __arg_0: &amp;<a class='struct' href='../hyper/struct.Url.html' title='hyper::Url'>Url</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4>
<h4 id='method.ge' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&amp;self, __arg_0: &amp;<a class='struct' href='../hyper/struct.Url.html' title='hyper::Url'>Url</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4>
</div><h3 class='impl'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html' title='core::hash::Hash'>Hash</a> for <a class='struct' href='../hyper/struct.Url.html' title='hyper::Url'>Url</a></code></h3><div class='impl-items'><h4 id='method.hash' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash' class='fnname'>hash</a>&lt;__H&gt;(&amp;self, __arg_0: &amp;mut __H) <span class='where'>where __H: <a class='trait' href='https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html' title='core::hash::Hasher'>Hasher</a></span></code></h4>
<h4 id='method.hash_slice' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice' class='fnname'>hash_slice</a>&lt;H&gt;(data: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.slice.html'>&amp;[Self]</a>, state: &amp;mut H) <span class='where'>where H: <a class='trait' href='https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html' title='core::hash::Hasher'>Hasher</a></span></code></h4>
</div><h3 class='impl'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html' title='core::fmt::Debug'>Debug</a> for <a class='struct' href='../hyper/struct.Url.html' title='hyper::Url'>Url</a></code></h3><div class='impl-items'><h4 id='method.fmt-1' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#method.fmt' class='fnname'>fmt</a>(&amp;self, __arg_0: &amp;mut <a class='struct' href='https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html' title='core::fmt::Formatter'>Formatter</a>) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/result/enum.Result.html' title='core::result::Result'>Result</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>()</a>, <a class='struct' href='https://doc.rust-lang.org/nightly/core/fmt/struct.Error.html' title='core::fmt::Error'>Error</a>&gt;</code></h4>
</div><h3 class='impl'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html' title='core::clone::Clone'>Clone</a> for <a class='struct' href='../hyper/struct.Url.html' title='hyper::Url'>Url</a></code></h3><div class='impl-items'><h4 id='method.clone' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone' class='fnname'>clone</a>(&amp;self) -&gt; <a class='struct' href='../hyper/struct.Url.html' title='hyper::Url'>Url</a></code></h4>
<h4 id='method.clone_from' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&amp;mut self, source: &amp;Self)</code></h4>
</div><h3 class='impl'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html' title='core::cmp::Eq'>Eq</a> for <a class='struct' href='../hyper/struct.Url.html' title='hyper::Url'>Url</a></code></h3><div class='impl-items'></div><h3 class='impl'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a>&lt;<a class='struct' href='../hyper/struct.Url.html' title='hyper::Url'>Url</a>&gt; for <a class='struct' href='../hyper/struct.Url.html' title='hyper::Url'>Url</a></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&amp;self, __arg_0: &amp;<a class='struct' href='../hyper/struct.Url.html' title='hyper::Url'>Url</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4>
<h4 id='method.ne' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&amp;self, __arg_0: &amp;<a class='struct' href='../hyper/struct.Url.html' title='hyper::Url'>Url</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4>
</div></section>
    <section id='search' class="content hidden"></section>

    <section class="footer"></section>

    <aside id="help" class="hidden">
        <div>
            <h1 class="hidden">Help</h1>

            <div class="shortcuts">
                <h2>Keyboard Shortcuts</h2>

                <dl>
                    <dt>?</dt>
                    <dd>Show this help dialog</dd>
                    <dt>S</dt>
                    <dd>Focus the search field</dd>
                    <dt>&larrb;</dt>
                    <dd>Move up in search results</dd>
                    <dt>&rarrb;</dt>
                    <dd>Move down in search results</dd>
                    <dt>&#9166;</dt>
                    <dd>Go to active search result</dd>
                </dl>
            </div>

            <div class="infos">
                <h2>Search Tricks</h2>

                <p>
                    Prefix searches with a type followed by a colon (e.g.
                    <code>fn:</code>) to restrict the search to a given type.
                </p>

                <p>
                    Accepted types are: <code>fn</code>, <code>mod</code>,
                    <code>struct</code>, <code>enum</code>,
                    <code>trait</code>, <code>type</code>, <code>macro</code>,
                    and <code>const</code>.
                </p>

                <p>
                    Search functions by type signature (e.g.
                    <code>vec -> usize</code>)
                </p>
            </div>
        </div>
    </aside>

    

    <script>
        window.rootPath = "../";
        window.currentCrate = "hyper";
        window.playgroundUrl = "";
    </script>
    <script src="../jquery.js"></script>
    <script src="../main.js"></script>
    
    <script defer src="../search-index.js"></script>
</body>
</html>