162 lines
16 KiB
HTML
162 lines
16 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 `HttpMessage` trait in crate `hyper`.">
|
|||
|
<meta name="keywords" content="rust, rustlang, rust-lang, HttpMessage">
|
|||
|
|
|||
|
<title>hyper::http::message::HttpMessage - 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>::<wbr><a href='../index.html'>http</a>::<wbr><a href='index.html'>message</a></p><script>window.sidebarCurrent = {name: 'HttpMessage', ty: 'trait', 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 trait">
|
|||
|
<h1 class='fqn'><span class='in-band'>Trait <a href='../../index.html'>hyper</a>::<wbr><a href='../index.html'>http</a>::<wbr><a href='index.html'>message</a>::<wbr><a class='trait' href=''>HttpMessage</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-6625' class='srclink' href='../../../src/hyper/http/message.rs.html#52-78' title='goto source code'>[src]</a></span></h1>
|
|||
|
<pre class='rust trait'>pub trait HttpMessage: <a class='trait' href='https://doc.rust-lang.org/nightly/std/io/trait.Write.html' title='std::io::Write'>Write</a> + <a class='trait' href='https://doc.rust-lang.org/nightly/std/io/trait.Read.html' title='std::io::Read'>Read</a> + <a class='trait' href='https://doc.rust-lang.org/nightly/core/marker/trait.Send.html' title='core::marker::Send'>Send</a> + <a class='trait' href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html' title='core::any::Any'>Any</a> + <a class='trait' href='../../../typeable/trait.Typeable.html' title='typeable::Typeable'>Typeable</a> + <a class='trait' href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html' title='core::fmt::Debug'>Debug</a> {
|
|||
|
fn <a href='#tymethod.set_outgoing' class='fnname'>set_outgoing</a>(&mut self, head: <a class='struct' href='../../../hyper/http/message/struct.RequestHead.html' title='hyper::http::message::RequestHead'>RequestHead</a>) -> <a class='type' href='../../../hyper/error/type.Result.html' title='hyper::error::Result'>Result</a><<a class='struct' href='../../../hyper/http/message/struct.RequestHead.html' title='hyper::http::message::RequestHead'>RequestHead</a>>;
|
|||
|
fn <a href='#tymethod.get_incoming' class='fnname'>get_incoming</a>(&mut self) -> <a class='type' href='../../../hyper/error/type.Result.html' title='hyper::error::Result'>Result</a><<a class='struct' href='../../../hyper/http/message/struct.ResponseHead.html' title='hyper::http::message::ResponseHead'>ResponseHead</a>>;
|
|||
|
fn <a href='#tymethod.set_read_timeout' class='fnname'>set_read_timeout</a>(&self, dur: <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a><<a class='struct' href='https://doc.rust-lang.org/nightly/std/time/duration/struct.Duration.html' title='std::time::duration::Duration'>Duration</a>>) -> <a class='type' href='https://doc.rust-lang.org/nightly/std/io/error/type.Result.html' title='std::io::error::Result'>Result</a><<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>()</a>>;
|
|||
|
fn <a href='#tymethod.set_write_timeout' class='fnname'>set_write_timeout</a>(&self, dur: <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a><<a class='struct' href='https://doc.rust-lang.org/nightly/std/time/duration/struct.Duration.html' title='std::time::duration::Duration'>Duration</a>>) -> <a class='type' href='https://doc.rust-lang.org/nightly/std/io/error/type.Result.html' title='std::io::error::Result'>Result</a><<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>()</a>>;
|
|||
|
fn <a href='#tymethod.close_connection' class='fnname'>close_connection</a>(&mut self) -> <a class='type' href='../../../hyper/error/type.Result.html' title='hyper::error::Result'>Result</a><<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>()</a>>;
|
|||
|
fn <a href='#tymethod.has_body' class='fnname'>has_body</a>(&self) -> <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a>;
|
|||
|
|
|||
|
fn <a href='#method.set_proxied' class='fnname'>set_proxied</a>(&mut self, val: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a>) { ... }
|
|||
|
}</pre><div class='docblock'><p>The trait provides an API for sending an receiving HTTP messages.</p>
|
|||
|
</div>
|
|||
|
<h2 id='required-methods'>Required Methods</h2>
|
|||
|
<div class='methods'>
|
|||
|
<h3 id='tymethod.set_outgoing' class='method stab '><code>fn <a href='#tymethod.set_outgoing' class='fnname'>set_outgoing</a>(&mut self, head: <a class='struct' href='../../../hyper/http/message/struct.RequestHead.html' title='hyper::http::message::RequestHead'>RequestHead</a>) -> <a class='type' href='../../../hyper/error/type.Result.html' title='hyper::error::Result'>Result</a><<a class='struct' href='../../../hyper/http/message/struct.RequestHead.html' title='hyper::http::message::RequestHead'>RequestHead</a>></code></h3><div class='docblock'><p>Initiates a new outgoing request.</p>
|
|||
|
|
|||
|
<p>Only the request's head is provided (in terms of the <code>RequestHead</code> struct).</p>
|
|||
|
|
|||
|
<p>After this, the <code>HttpMessage</code> instance can be used as an <code>io::Write</code> in order to write the
|
|||
|
body of the request.</p>
|
|||
|
</div><h3 id='tymethod.get_incoming' class='method stab '><code>fn <a href='#tymethod.get_incoming' class='fnname'>get_incoming</a>(&mut self) -> <a class='type' href='../../../hyper/error/type.Result.html' title='hyper::error::Result'>Result</a><<a class='struct' href='../../../hyper/http/message/struct.ResponseHead.html' title='hyper::http::message::ResponseHead'>ResponseHead</a>></code></h3><div class='docblock'><p>Obtains the incoming response and returns its head (i.e. the <code>ResponseHead</code> struct)</p>
|
|||
|
|
|||
|
<p>After this, the <code>HttpMessage</code> instance can be used as an <code>io::Read</code> in order to read out
|
|||
|
the response body.</p>
|
|||
|
</div><h3 id='tymethod.set_read_timeout' class='method stab '><code>fn <a href='#tymethod.set_read_timeout' class='fnname'>set_read_timeout</a>(&self, dur: <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a><<a class='struct' href='https://doc.rust-lang.org/nightly/std/time/duration/struct.Duration.html' title='std::time::duration::Duration'>Duration</a>>) -> <a class='type' href='https://doc.rust-lang.org/nightly/std/io/error/type.Result.html' title='std::io::error::Result'>Result</a><<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>()</a>></code></h3><div class='docblock'><p>Set the read timeout duration for this message.</p>
|
|||
|
</div><h3 id='tymethod.set_write_timeout' class='method stab '><code>fn <a href='#tymethod.set_write_timeout' class='fnname'>set_write_timeout</a>(&self, dur: <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a><<a class='struct' href='https://doc.rust-lang.org/nightly/std/time/duration/struct.Duration.html' title='std::time::duration::Duration'>Duration</a>>) -> <a class='type' href='https://doc.rust-lang.org/nightly/std/io/error/type.Result.html' title='std::io::error::Result'>Result</a><<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>()</a>></code></h3><div class='docblock'><p>Set the write timeout duration for this message.</p>
|
|||
|
</div><h3 id='tymethod.close_connection' class='method stab '><code>fn <a href='#tymethod.close_connection' class='fnname'>close_connection</a>(&mut self) -> <a class='type' href='../../../hyper/error/type.Result.html' title='hyper::error::Result'>Result</a><<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>()</a>></code></h3><div class='docblock'><p>Closes the underlying HTTP connection.</p>
|
|||
|
</div><h3 id='tymethod.has_body' class='method stab '><code>fn <a href='#tymethod.has_body' class='fnname'>has_body</a>(&self) -> <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h3><div class='docblock'><p>Returns whether the incoming message has a body.</p>
|
|||
|
</div></div>
|
|||
|
<h2 id='provided-methods'>Provided Methods</h2>
|
|||
|
<div class='methods'>
|
|||
|
<h3 id='method.set_proxied' class='method stab '><code>fn <a href='#method.set_proxied' class='fnname'>set_proxied</a>(&mut self, val: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a>)</code></h3><div class='docblock'><p>Called when the Client wishes to use a Proxy.</p>
|
|||
|
</div></div><h2 id='methods'>Methods</h2><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='../../../hyper/http/message/trait.HttpMessage.html' title='hyper::http::message::HttpMessage'>HttpMessage</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-6659' class='srclink' href='../../../src/hyper/http/message.rs.html#95-133' title='goto source code'>[src]</a></span></h3>
|
|||
|
<div class='impl-items'><h4 id='method.is' class='method'><code>fn <a href='#method.is' class='fnname'>is</a><T: <a class='trait' href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html' title='core::any::Any'>Any</a>>(&self) -> <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4>
|
|||
|
<div class='docblock'><p>Is the underlying type in this trait object a T?</p>
|
|||
|
</div><h4 id='method.downcast_ref' class='method'><code>fn <a href='#method.downcast_ref' class='fnname'>downcast_ref</a><T: <a class='trait' href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html' title='core::any::Any'>Any</a>>(&self) -> <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a><&T></code></h4>
|
|||
|
<div class='docblock'><p>If the underlying type is T, get a reference to the contained data.</p>
|
|||
|
</div><h4 id='method.downcast_mut' class='method'><code>fn <a href='#method.downcast_mut' class='fnname'>downcast_mut</a><T: <a class='trait' href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html' title='core::any::Any'>Any</a>>(&mut self) -> <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a><&mut T></code></h4>
|
|||
|
<div class='docblock'><p>If the underlying type is T, get a mutable reference to the contained
|
|||
|
data.</p>
|
|||
|
</div><h4 id='method.downcast' class='method'><code>fn <a href='#method.downcast' class='fnname'>downcast</a><T: <a class='trait' href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html' title='core::any::Any'>Any</a>>(self: <a class='struct' href='https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html' title='alloc::boxed::Box'>Box</a><<a class='trait' href='../../../hyper/http/message/trait.HttpMessage.html' title='hyper::http::message::HttpMessage'>HttpMessage</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='https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html' title='alloc::boxed::Box'>Box</a><T>, <a class='struct' href='https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html' title='alloc::boxed::Box'>Box</a><<a class='trait' href='../../../hyper/http/message/trait.HttpMessage.html' title='hyper::http::message::HttpMessage'>HttpMessage</a>>></code></h4>
|
|||
|
<div class='docblock'><p>If the underlying type is T, extract it.</p>
|
|||
|
</div></div>
|
|||
|
<h2 id='implementors'>Implementors</h2>
|
|||
|
<ul class='item-list' id='implementors-list'>
|
|||
|
<li><code>impl HttpMessage for <a class='struct' href='../../../hyper/http/h1/struct.Http11Message.html' title='hyper::http::h1::Http11Message'>Http11Message</a></code></li>
|
|||
|
<li><code>impl<S> HttpMessage for <a class='struct' href='../../../hyper/http/h2/struct.Http2Message.html' title='hyper::http::h2::Http2Message'>Http2Message</a><S> <span class='where'>where S: <a class='trait' href='../../../hyper/http/h2/trait.CloneableStream.html' title='hyper::http::h2::CloneableStream'>CloneableStream</a></span></code></li>
|
|||
|
</ul><script type="text/javascript" async
|
|||
|
src="../../../implementors/hyper/http/message/trait.HttpMessage.js">
|
|||
|
</script></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 = "hyper";
|
|||
|
window.playgroundUrl = "";
|
|||
|
</script>
|
|||
|
<script src="../../../jquery.js"></script>
|
|||
|
<script src="../../../main.js"></script>
|
|||
|
|
|||
|
<script defer src="../../../search-index.js"></script>
|
|||
|
</body>
|
|||
|
</html>
|