juniper/iron/request/struct.Request.html
Juniper Documentation Builder 95d942c9d4 Update documentation for Juniper
2016-09-11 18:41:24 +00:00

167 lines
No EOL
17 KiB
HTML
Raw 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="API documentation for the Rust `Request` struct in crate `iron`.">
<meta name="keywords" content="rust, rustlang, rust-lang, Request">
<title>iron::request::Request - Rust</title>
<link rel="stylesheet" type="text/css" href="../../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../../main.css">
<link rel="shortcut icon" href="https://avatars0.githubusercontent.com/u/7853871?s=256">
</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">
<a href='../../iron/index.html'><img src='https://avatars0.githubusercontent.com/u/7853871?s=128' alt='logo' width='100'></a>
<p class='location'><a href='../index.html'>iron</a>::<wbr><a href='index.html'>request</a></p><script>window.sidebarCurrent = {name: 'Request', 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'>iron</a>::<wbr><a href='index.html'>request</a>::<wbr><a class='struct' href=''>Request</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-447' class='srclink' href='../../src/iron/request/mod.rs.html#28-49' title='goto source code'>[src]</a></span></h1>
<pre class='rust struct'>pub struct Request&lt;'a,&nbsp;'b: 'a&gt; {
pub url: <a class='struct' href='../../iron/struct.Url.html' title='iron::Url'>Url</a>,
pub remote_addr: <a class='enum' href='https://doc.rust-lang.org/nightly/std/net/addr/enum.SocketAddr.html' title='std::net::addr::SocketAddr'>SocketAddr</a>,
pub local_addr: <a class='enum' href='https://doc.rust-lang.org/nightly/std/net/addr/enum.SocketAddr.html' title='std::net::addr::SocketAddr'>SocketAddr</a>,
pub headers: <a class='struct' href='../../iron/struct.Headers.html' title='iron::Headers'>Headers</a>,
pub body: <a class='struct' href='../../iron/request/struct.Body.html' title='iron::request::Body'>Body</a>&lt;'a,&nbsp;'b&gt;,
pub method: <a class='enum' href='../../iron/method/enum.Method.html' title='iron::method::Method'>Method</a>,
pub extensions: <a class='struct' href='../../iron/typemap/struct.TypeMap.html' title='iron::typemap::TypeMap'>TypeMap</a>,
}</pre><div class='docblock'><p>The <code>Request</code> given to all <code>Middleware</code>.</p>
<p>Stores all the properties of the client&#39;s request plus
an <code>TypeMap</code> for data communication between middleware.</p>
</div><h2 class='fields'>Fields</h2><span id='structfield.url' class='structfield'><code>url: <a class='struct' href='../../iron/struct.Url.html' title='iron::Url'>Url</a></code>
</span><span class='stab '></span><div class='docblock'><p>The requested URL.</p>
</div><span id='structfield.remote_addr' class='structfield'><code>remote_addr: <a class='enum' href='https://doc.rust-lang.org/nightly/std/net/addr/enum.SocketAddr.html' title='std::net::addr::SocketAddr'>SocketAddr</a></code>
</span><span class='stab '></span><div class='docblock'><p>The originating address of the request.</p>
</div><span id='structfield.local_addr' class='structfield'><code>local_addr: <a class='enum' href='https://doc.rust-lang.org/nightly/std/net/addr/enum.SocketAddr.html' title='std::net::addr::SocketAddr'>SocketAddr</a></code>
</span><span class='stab '></span><div class='docblock'><p>The local address of the request.</p>
</div><span id='structfield.headers' class='structfield'><code>headers: <a class='struct' href='../../iron/struct.Headers.html' title='iron::Headers'>Headers</a></code>
</span><span class='stab '></span><div class='docblock'><p>The request headers.</p>
</div><span id='structfield.body' class='structfield'><code>body: <a class='struct' href='../../iron/request/struct.Body.html' title='iron::request::Body'>Body</a>&lt;'a,&nbsp;'b&gt;</code>
</span><span class='stab '></span><div class='docblock'><p>The request body as a reader.</p>
</div><span id='structfield.method' class='structfield'><code>method: <a class='enum' href='../../iron/method/enum.Method.html' title='iron::method::Method'>Method</a></code>
</span><span class='stab '></span><div class='docblock'><p>The request method.</p>
</div><span id='structfield.extensions' class='structfield'><code>extensions: <a class='struct' href='../../iron/typemap/struct.TypeMap.html' title='iron::typemap::TypeMap'>TypeMap</a></code>
</span><span class='stab '></span><div class='docblock'><p>Extensible storage for data passed between middleware.</p>
</div><h2 id='methods'>Methods</h2><h3 class='impl'><span class='in-band'><code>impl&lt;'a,&nbsp;'b&gt; <a class='struct' href='../../iron/request/struct.Request.html' title='iron::request::Request'>Request</a>&lt;'a,&nbsp;'b&gt;</code></span><span class='out-of-band'><div class='ghost'></div><a id='src-485' class='srclink' href='../../src/iron/request/mod.rs.html#65-109' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.from_http' class='method'><code>fn <a href='#method.from_http' class='fnname'>from_http</a>(req: <a class='struct' href='../../iron/request/struct.HttpRequest.html' title='iron::request::HttpRequest'>HttpRequest</a>&lt;'a,&nbsp;'b&gt;, local_addr: <a class='enum' href='https://doc.rust-lang.org/nightly/std/net/addr/enum.SocketAddr.html' title='std::net::addr::SocketAddr'>SocketAddr</a>, protocol: &amp;<a class='enum' href='../../iron/enum.Protocol.html' title='iron::Protocol'>Protocol</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='../../iron/request/struct.Request.html' title='iron::request::Request'>Request</a>&lt;'a,&nbsp;'b&gt;,&nbsp;<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>Create a request from an HttpRequest.</p>
<p>This constructor consumes the HttpRequest.</p>
</div></div><h2 id='implementations'>Trait Implementations</h2><h3 class='impl'><span class='in-band'><code>impl&lt;'a,&nbsp;'b&gt; <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='../../iron/request/struct.Request.html' title='iron::request::Request'>Request</a>&lt;'a,&nbsp;'b&gt;</code></span><span class='out-of-band'><div class='ghost'></div><a id='src-457' class='srclink' href='../../src/iron/request/mod.rs.html#51-63' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.fmt' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, f: &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='type' href='https://doc.rust-lang.org/nightly/core/fmt/type.Result.html' title='core::fmt::Result'>Result</a></code></h4>
<div class='docblock'><p>Formats the value using the given formatter.</p>
</div></div><h3 class='impl'><span class='in-band'><code>impl&lt;'a,&nbsp;'b&gt; <a class='trait' href='../../plugin/trait.Extensible.html' title='plugin::Extensible'>Extensible</a> for <a class='struct' href='../../iron/request/struct.Request.html' title='iron::request::Request'>Request</a>&lt;'a,&nbsp;'b&gt;</code></span><span class='out-of-band'><div class='ghost'></div><a id='src-530' class='srclink' href='../../src/iron/request/mod.rs.html#128-136' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.extensions' class='method'><code>fn <a href='../../plugin/trait.Extensible.html#tymethod.extensions' class='fnname'>extensions</a>(&amp;self) -&gt; &amp;<a class='struct' href='../../iron/typemap/struct.TypeMap.html' title='iron::typemap::TypeMap'>TypeMap</a></code></h4>
<div class='docblock'><p>Get a reference to the type&#39;s extension storage.</p>
</div><h4 id='method.extensions_mut' class='method'><code>fn <a href='../../plugin/trait.Extensible.html#tymethod.extensions_mut' class='fnname'>extensions_mut</a>(&amp;mut self) -&gt; &amp;mut <a class='struct' href='../../iron/typemap/struct.TypeMap.html' title='iron::typemap::TypeMap'>TypeMap</a></code></h4>
<div class='docblock'><p>Get a mutable reference to the type&#39;s extension storage.</p>
</div></div><h3 class='impl'><span class='in-band'><code>impl&lt;'a,&nbsp;'b&gt; <a class='trait' href='../../iron/prelude/trait.Pluggable.html' title='iron::prelude::Pluggable'>Plugin</a> for <a class='struct' href='../../iron/request/struct.Request.html' title='iron::request::Request'>Request</a>&lt;'a,&nbsp;'b&gt;</code></span><span class='out-of-band'><div class='ghost'></div><a id='src-537' class='srclink' href='../../src/iron/request/mod.rs.html#138' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.get' class='method'><code>fn <a href='../../iron/prelude/trait.Pluggable.html#method.get' class='fnname'>get</a>&lt;P&gt;(&amp;mut self) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/result/enum.Result.html' title='core::result::Result'>Result</a>&lt;P::<a class='trait' href='../../iron/typemap/trait.Key.html' title='iron::typemap::Key'>Value</a>,&nbsp;P::<a class='trait' href='../../plugin/trait.Plugin.html' title='plugin::Plugin'>Error</a>&gt; <span class='where'>where P: <a class='trait' href='../../plugin/trait.Plugin.html' title='plugin::Plugin'>Plugin</a>&lt;Self&gt;, Self: <a class='trait' href='../../plugin/trait.Extensible.html' title='plugin::Extensible'>Extensible</a>, P::<a class='trait' href='../../iron/typemap/trait.Key.html' title='iron::typemap::Key'>Value</a>: <a class='trait' href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html' title='core::clone::Clone'>Clone</a>, P::<a class='trait' href='../../iron/typemap/trait.Key.html' title='iron::typemap::Key'>Value</a>: <a class='trait' href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html' title='core::any::Any'>Any</a></span></code></h4>
<div class='docblock'><p>Return a copy of the plugin&#39;s produced value. <a href="../../iron/prelude/trait.Pluggable.html#method.get">Read more</a></p>
</div><h4 id='method.get_ref' class='method'><code>fn <a href='../../iron/prelude/trait.Pluggable.html#method.get_ref' class='fnname'>get_ref</a>&lt;P&gt;(&amp;mut self) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/result/enum.Result.html' title='core::result::Result'>Result</a>&lt;&amp;P::<a class='trait' href='../../iron/typemap/trait.Key.html' title='iron::typemap::Key'>Value</a>,&nbsp;P::<a class='trait' href='../../plugin/trait.Plugin.html' title='plugin::Plugin'>Error</a>&gt; <span class='where'>where P: <a class='trait' href='../../plugin/trait.Plugin.html' title='plugin::Plugin'>Plugin</a>&lt;Self&gt;, Self: <a class='trait' href='../../plugin/trait.Extensible.html' title='plugin::Extensible'>Extensible</a>, P::<a class='trait' href='../../iron/typemap/trait.Key.html' title='iron::typemap::Key'>Value</a>: <a class='trait' href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html' title='core::any::Any'>Any</a></span></code></h4>
<div class='docblock'><p>Return a reference to the plugin&#39;s produced value. <a href="../../iron/prelude/trait.Pluggable.html#method.get_ref">Read more</a></p>
</div><h4 id='method.get_mut' class='method'><code>fn <a href='../../iron/prelude/trait.Pluggable.html#method.get_mut' class='fnname'>get_mut</a>&lt;P&gt;(&amp;mut self) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/result/enum.Result.html' title='core::result::Result'>Result</a>&lt;&amp;mut P::<a class='trait' href='../../iron/typemap/trait.Key.html' title='iron::typemap::Key'>Value</a>,&nbsp;P::<a class='trait' href='../../plugin/trait.Plugin.html' title='plugin::Plugin'>Error</a>&gt; <span class='where'>where P: <a class='trait' href='../../plugin/trait.Plugin.html' title='plugin::Plugin'>Plugin</a>&lt;Self&gt;, Self: <a class='trait' href='../../plugin/trait.Extensible.html' title='plugin::Extensible'>Extensible</a>, P::<a class='trait' href='../../iron/typemap/trait.Key.html' title='iron::typemap::Key'>Value</a>: <a class='trait' href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html' title='core::any::Any'>Any</a></span></code></h4>
<div class='docblock'><p>Return a mutable reference to the plugin&#39;s produced value. <a href="../../iron/prelude/trait.Pluggable.html#method.get_mut">Read more</a></p>
</div><h4 id='method.compute' class='method'><code>fn <a href='../../iron/prelude/trait.Pluggable.html#method.compute' class='fnname'>compute</a>&lt;P&gt;(&amp;mut self) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/result/enum.Result.html' title='core::result::Result'>Result</a>&lt;P::<a class='trait' href='../../iron/typemap/trait.Key.html' title='iron::typemap::Key'>Value</a>,&nbsp;P::<a class='trait' href='../../plugin/trait.Plugin.html' title='plugin::Plugin'>Error</a>&gt; <span class='where'>where P: <a class='trait' href='../../plugin/trait.Plugin.html' title='plugin::Plugin'>Plugin</a>&lt;Self&gt;</span></code></h4>
<div class='docblock'><p>Create and evaluate a once-off instance of a plugin.</p>
</div></div><h3 class='impl'><span class='in-band'><code>impl&lt;'a,&nbsp;'b&gt; <a class='trait' href='../../iron/prelude/trait.Set.html' title='iron::prelude::Set'>Set</a> for <a class='struct' href='../../iron/request/struct.Request.html' title='iron::request::Request'>Request</a>&lt;'a,&nbsp;'b&gt;</code></span><span class='out-of-band'><div class='ghost'></div><a id='src-540' class='srclink' href='../../src/iron/request/mod.rs.html#139' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.set' class='method'><code>fn <a href='../../iron/prelude/trait.Set.html#method.set' class='fnname'>set</a>&lt;M&gt;(self, modifier: M) -&gt; Self <span class='where'>where M: <a class='trait' href='../../modifier/trait.Modifier.html' title='modifier::Modifier'>Modifier</a>&lt;Self&gt;</span></code></h4>
<div class='docblock'><p>Modify self using the provided modifier.</p>
</div><h4 id='method.set_mut' class='method'><code>fn <a href='../../iron/prelude/trait.Set.html#method.set_mut' class='fnname'>set_mut</a>&lt;M&gt;(&amp;mut self, modifier: M) -&gt; &amp;mut Self <span class='where'>where M: <a class='trait' href='../../modifier/trait.Modifier.html' title='modifier::Modifier'>Modifier</a>&lt;Self&gt;</span></code></h4>
<div class='docblock'><p>Modify self through a mutable reference with the provided modifier.</p>
</div></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>
<dt>+</dt>
<dd>Collapse/expand all sections</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> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../../";
window.currentCrate = "iron";
window.playgroundUrl = "";
</script>
<script src="../../jquery.js"></script>
<script src="../../main.js"></script>
<script defer src="../../search-index.js"></script>
</body>
</html>