167 lines
No EOL
17 KiB
HTML
167 lines
No EOL
17 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="en">
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
<meta name="generator" content="rustdoc">
|
||
<meta name="description" content="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'>−</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<'a, 'b: 'a> {
|
||
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><'a, 'b>,
|
||
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'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><'a, 'b></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<'a, 'b> <a class='struct' href='../../iron/request/struct.Request.html' title='iron::request::Request'>Request</a><'a, 'b></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><'a, 'b>, 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: &<a class='enum' href='../../iron/enum.Protocol.html' title='iron::Protocol'>Protocol</a>) -> <a class='enum' href='https://doc.rust-lang.org/nightly/core/result/enum.Result.html' title='core::result::Result'>Result</a><<a class='struct' href='../../iron/request/struct.Request.html' title='iron::request::Request'>Request</a><'a, 'b>, <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>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<'a, 'b> <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><'a, 'b></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>(&self, f: &mut <a class='struct' href='https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html' title='core::fmt::Formatter'>Formatter</a>) -> <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<'a, 'b> <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><'a, 'b></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>(&self) -> &<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'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>(&mut self) -> &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's extension storage.</p>
|
||
</div></div><h3 class='impl'><span class='in-band'><code>impl<'a, 'b> <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><'a, 'b></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><P>(&mut self) -> <a class='enum' href='https://doc.rust-lang.org/nightly/core/result/enum.Result.html' title='core::result::Result'>Result</a><P::<a class='trait' href='../../iron/typemap/trait.Key.html' title='iron::typemap::Key'>Value</a>, P::<a class='trait' href='../../plugin/trait.Plugin.html' title='plugin::Plugin'>Error</a>> <span class='where'>where P: <a class='trait' href='../../plugin/trait.Plugin.html' title='plugin::Plugin'>Plugin</a><Self>, 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'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><P>(&mut self) -> <a class='enum' href='https://doc.rust-lang.org/nightly/core/result/enum.Result.html' title='core::result::Result'>Result</a><&P::<a class='trait' href='../../iron/typemap/trait.Key.html' title='iron::typemap::Key'>Value</a>, P::<a class='trait' href='../../plugin/trait.Plugin.html' title='plugin::Plugin'>Error</a>> <span class='where'>where P: <a class='trait' href='../../plugin/trait.Plugin.html' title='plugin::Plugin'>Plugin</a><Self>, 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'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><P>(&mut self) -> <a class='enum' href='https://doc.rust-lang.org/nightly/core/result/enum.Result.html' title='core::result::Result'>Result</a><&mut P::<a class='trait' href='../../iron/typemap/trait.Key.html' title='iron::typemap::Key'>Value</a>, P::<a class='trait' href='../../plugin/trait.Plugin.html' title='plugin::Plugin'>Error</a>> <span class='where'>where P: <a class='trait' href='../../plugin/trait.Plugin.html' title='plugin::Plugin'>Plugin</a><Self>, 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'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><P>(&mut self) -> <a class='enum' href='https://doc.rust-lang.org/nightly/core/result/enum.Result.html' title='core::result::Result'>Result</a><P::<a class='trait' href='../../iron/typemap/trait.Key.html' title='iron::typemap::Key'>Value</a>, P::<a class='trait' href='../../plugin/trait.Plugin.html' title='plugin::Plugin'>Error</a>> <span class='where'>where P: <a class='trait' href='../../plugin/trait.Plugin.html' title='plugin::Plugin'>Plugin</a><Self></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<'a, 'b> <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><'a, 'b></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><M>(self, modifier: M) -> Self <span class='where'>where M: <a class='trait' href='../../modifier/trait.Modifier.html' title='modifier::Modifier'>Modifier</a><Self></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><M>(&mut self, modifier: M) -> &mut Self <span class='where'>where M: <a class='trait' href='../../modifier/trait.Modifier.html' title='modifier::Modifier'>Modifier</a><Self></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>⇤</dt>
|
||
<dd>Move up in search results</dd>
|
||
<dt>⇥</dt>
|
||
<dd>Move down in search results</dd>
|
||
<dt>⏎</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> |