1
0
mirror of https://github.com/fafhrd91/actix-web synced 2024-11-24 00:21:08 +01:00
actix-web/awc/body/trait.MessageBody.html
2024-05-27 01:16:31 +00:00

139 lines
65 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="An interface for types that can be used as a response body."><title>MessageBody in awc::body - 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="awc" 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 trait"><!--[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="../../awc/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="../../awc/index.html"><img src="https://actix.rs/img/logo.png" alt="logo"></a><h2><a href="../../awc/index.html">awc</a><span class="version">3.5.0</span></h2></div><h2 class="location"><a href="#">MessageBody</a></h2><div class="sidebar-elems"><section><h3><a href="#required-associated-types">Required Associated Types</a></h3><ul class="block"><li><a href="#associatedtype.Error">Error</a></li></ul><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.poll_next">poll_next</a></li><li><a href="#tymethod.size">size</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.boxed">boxed</a></li><li><a href="#method.try_into_bytes">try_into_bytes</a></li></ul><h3><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul class="block"><li><a href="#impl-MessageBody-for-%26%5Bu8%5D">&amp;&#x27;static [u8]</a></li><li><a href="#impl-MessageBody-for-%26str">&amp;&#x27;static str</a></li><li><a href="#impl-MessageBody-for-%26mut+B">&amp;mut B</a></li><li><a href="#impl-MessageBody-for-()">()</a></li><li><a href="#impl-MessageBody-for-Box%3CB%3E">Box&lt;B&gt;</a></li><li><a href="#impl-MessageBody-for-ByteString">ByteString</a></li><li><a href="#impl-MessageBody-for-Bytes">Bytes</a></li><li><a href="#impl-MessageBody-for-BytesMut">BytesMut</a></li><li><a href="#impl-MessageBody-for-Cow%3C'static,+%5Bu8%5D%3E">Cow&lt;&#x27;static, [u8]&gt;</a></li><li><a href="#impl-MessageBody-for-Cow%3C'static,+str%3E">Cow&lt;&#x27;static, str&gt;</a></li><li><a href="#impl-MessageBody-for-Infallible">Infallible</a></li><li><a href="#impl-MessageBody-for-Pin%3CT%3E">Pin&lt;T&gt;</a></li><li><a href="#impl-MessageBody-for-String">String</a></li><li><a href="#impl-MessageBody-for-Vec%3Cu8%3E">Vec&lt;u8&gt;</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><h2><a href="index.html">In awc::body</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>Trait <a href="../index.html">awc</a>::<wbr><a href="index.html">body</a>::<wbr><a class="trait" href="#">MessageBody</a><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><span class="out-of-band"><button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><pre class="rust item-decl"><code>pub trait MessageBody {
type <a href="#associatedtype.Error" class="associatedtype">Error</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/error/trait.Error.html" title="trait core::error::Error">Error</a>&gt;&gt;;
// Required methods
fn <a href="#tymethod.size" class="fn">size</a>(&amp;self) -&gt; <a class="enum" href="enum.BodySize.html" title="enum awc::body::BodySize">BodySize</a>;
<span class="item-spacer"></span> fn <a href="#tymethod.poll_next" class="fn">poll_next</a>(
self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut Self</a>&gt;,
cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;
) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<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="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Bytes, Self::<a class="associatedtype" href="trait.MessageBody.html#associatedtype.Error" title="type awc::body::MessageBody::Error">Error</a>&gt;&gt;&gt;;
// Provided methods
fn <a href="#method.try_into_bytes" class="fn">try_into_bytes</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;Bytes, Self&gt;
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span> { ... }
<span class="item-spacer"></span> fn <a href="#method.boxed" class="fn">boxed</a>(self) -&gt; <a class="struct" href="struct.BoxBody.html" title="struct awc::body::BoxBody">BoxBody</a>
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'static</span> { ... }
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>An interface for types that can be used as a response body.</p>
<p>It is not usually necessary to create custom body types, this trait is already <a href="#foreign-impls">implemented for
a large number of sensible body types</a> including:</p>
<ul>
<li>Empty body: <code>()</code></li>
<li>Text-based: <code>String</code>, <code>&amp;'static str</code>, <a href="https://docs.rs/bytestring/1"><code>ByteString</code></a>.</li>
<li>Byte-based: <code>Bytes</code>, <code>BytesMut</code>, <code>Vec&lt;u8&gt;</code>, <code>&amp;'static [u8]</code>;</li>
<li>Streams: <a href="struct.BodyStream.html" title="struct awc::body::BodyStream"><code>BodyStream</code></a>, <a href="struct.SizedStream.html" title="struct awc::body::SizedStream"><code>SizedStream</code></a></li>
</ul>
<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">struct </span>Repeat {
chunk: String,
n_times: usize,
}
<span class="kw">impl </span>MessageBody <span class="kw">for </span>Repeat {
<span class="kw">type </span>Error = Infallible;
<span class="kw">fn </span>size(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; BodySize {
BodySize::Sized((<span class="self">self</span>.chunk.len() * <span class="self">self</span>.n_times) <span class="kw">as </span>u64)
}
<span class="kw">fn </span>poll_next(
<span class="self">self</span>: Pin&lt;<span class="kw-2">&amp;mut </span><span class="self">Self</span>&gt;,
_cx: <span class="kw-2">&amp;mut </span>Context&lt;<span class="lifetime">'_</span>&gt;,
) -&gt; Poll&lt;<span class="prelude-ty">Option</span>&lt;<span class="prelude-ty">Result</span>&lt;Bytes, <span class="self">Self</span>::Error&gt;&gt;&gt; {
<span class="kw">let </span>payload_string = <span class="self">self</span>.chunk.repeat(<span class="self">self</span>.n_times);
<span class="kw">let </span>payload_bytes = Bytes::from(payload_string);
Poll::Ready(<span class="prelude-val">Some</span>(<span class="prelude-val">Ok</span>(payload_bytes)))
}
}</code></pre></div>
</div></details><h2 id="required-associated-types" class="section-header">Required Associated Types<a href="#required-associated-types" class="anchor">§</a></h2><div class="methods"><details class="toggle" open><summary><section id="associatedtype.Error" class="method"><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/error/trait.Error.html" title="trait core::error::Error">Error</a>&gt;&gt;</h4></section></summary><div class="docblock"><p>The type of error that will be returned if streaming body fails.</p>
<p>Since it is not appropriate to generate a response mid-stream, it only requires <code>Error</code> for
internal use and logging.</p>
</div></details></div><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.size" class="method"><h4 class="code-header">fn <a href="#tymethod.size" class="fn">size</a>(&amp;self) -&gt; <a class="enum" href="enum.BodySize.html" title="enum awc::body::BodySize">BodySize</a></h4></section></summary><div class="docblock"><p>Body size hint.</p>
<p>If <a href="enum.BodySize.html#variant.None" title="variant awc::body::BodySize::None"><code>BodySize::None</code></a> is returned, optimizations that skip reading the body are allowed.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.poll_next" class="method"><h4 class="code-header">fn <a href="#tymethod.poll_next" class="fn">poll_next</a>(
self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut Self</a>&gt;,
cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;
) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<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="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Bytes, Self::<a class="associatedtype" href="trait.MessageBody.html#associatedtype.Error" title="type awc::body::MessageBody::Error">Error</a>&gt;&gt;&gt;</h4></section></summary><div class="docblock"><p>Attempt to pull out the next chunk of body bytes.</p>
<h5 id="return-value"><a class="doc-anchor" href="#return-value">§</a>Return Value</h5>
<p>Similar to the <code>Stream</code> interface, there are several possible return values, each indicating
a distinct state:</p>
<ul>
<li><code>Poll::Pending</code> means that this bodys next chunk is not ready yet. Implementations must
ensure that the current task will be notified when the next chunk may be ready.</li>
<li><code>Poll::Ready(Some(val))</code> means that the body has successfully produced a chunk, <code>val</code>,
and may produce further values on subsequent <code>poll_next</code> calls.</li>
<li><code>Poll::Ready(None)</code> means that the body is complete, and <code>poll_next</code> should not be
invoked again.</li>
</ul>
<h5 id="panics"><a class="doc-anchor" href="#panics">§</a>Panics</h5>
<p>Once a body is complete (i.e., <code>poll_next</code> returned <code>Ready(None)</code>), calling its <code>poll_next</code>
method again may panic, block forever, or cause other kinds of problems; this trait places
no requirements on the effects of such a call. However, as the <code>poll_next</code> method is not
marked unsafe, Rusts usual rules apply: calls must never cause UB, regardless of its state.</p>
</div></details></div><h2 id="provided-methods" class="section-header">Provided Methods<a href="#provided-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="method.try_into_bytes" class="method"><h4 class="code-header">fn <a href="#method.try_into_bytes" class="fn">try_into_bytes</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;Bytes, Self&gt;<div class="where">where
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"><p>Try to convert into the complete chunk of body bytes.</p>
<p>Override this method if the complete body can be trivially extracted. This is useful for
optimizations where <code>poll_next</code> calls can be avoided.</p>
<p>Body types with <a href="enum.BodySize.html#variant.None" title="variant awc::body::BodySize::None"><code>BodySize::None</code></a> are allowed to return empty <code>Bytes</code>. Although, if calling
this method, it is recommended to check <code>size</code> first and return early.</p>
<h5 id="errors"><a class="doc-anchor" href="#errors">§</a>Errors</h5>
<p>The default implementation will error and return the original type back to the caller for
further use.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.boxed" class="method"><h4 class="code-header">fn <a href="#method.boxed" class="fn">boxed</a>(self) -&gt; <a class="struct" href="struct.BoxBody.html" title="struct awc::body::BoxBody">BoxBody</a><div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'static,</div></h4></section></summary><div class="docblock"><p>Wraps this body into a <code>BoxBody</code>.</p>
<p>No-op when called on a <code>BoxBody</code>, meaning there is no risk of double boxing when calling
this on a generic <code>MessageBody</code>. Prefer this over <a href="struct.BoxBody.html#method.new" title="associated function awc::body::BoxBody::new"><code>BoxBody::new</code></a> when a boxed body
is required.</p>
</div></details></div><h2 id="foreign-impls" class="section-header">Implementations on Foreign Types<a href="#foreign-impls" class="anchor">§</a></h2><details class="toggle implementors-toggle"><summary><section id="impl-MessageBody-for-%26str" class="impl"><a href="#impl-MessageBody-for-%26str" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.MessageBody.html" title="trait awc::body::MessageBody">MessageBody</a> for &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></h3></section></summary><div class="impl-items"><section id="associatedtype.Error-1" class="associatedtype trait-impl"><a href="#associatedtype.Error-1" class="anchor">§</a><h4 class="code-header">type <a href="#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><section id="method.size" class="method trait-impl"><a href="#method.size" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.size" class="fn">size</a>(&amp;self) -&gt; <a class="enum" href="enum.BodySize.html" title="enum awc::body::BodySize">BodySize</a></h4></section><section id="method.poll_next" class="method trait-impl"><a href="#method.poll_next" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.poll_next" class="fn">poll_next</a>(
self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;&amp;mut &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>&gt;,
_cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;
) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<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="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Bytes, &lt;&amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a> as <a class="trait" href="trait.MessageBody.html" title="trait awc::body::MessageBody">MessageBody</a>&gt;::<a class="associatedtype" href="trait.MessageBody.html#associatedtype.Error" title="type awc::body::MessageBody::Error">Error</a>&gt;&gt;&gt;</h4></section><section id="method.try_into_bytes-1" class="method trait-impl"><a href="#method.try_into_bytes-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_into_bytes" class="fn">try_into_bytes</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;Bytes, &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-MessageBody-for-%26%5Bu8%5D" class="impl"><a href="#impl-MessageBody-for-%26%5Bu8%5D" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.MessageBody.html" title="trait awc::body::MessageBody">MessageBody</a> for &amp;'static [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]</h3></section></summary><div class="impl-items"><section id="associatedtype.Error-2" class="associatedtype trait-impl"><a href="#associatedtype.Error-2" class="anchor">§</a><h4 class="code-header">type <a href="#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><section id="method.size-1" class="method trait-impl"><a href="#method.size-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.size" class="fn">size</a>(&amp;self) -&gt; <a class="enum" href="enum.BodySize.html" title="enum awc::body::BodySize">BodySize</a></h4></section><section id="method.poll_next-1" class="method trait-impl"><a href="#method.poll_next-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.poll_next" class="fn">poll_next</a>(
self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;&amp;mut &amp;'static [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]&gt;,
_cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;
) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<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="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Bytes, &lt;&amp;'static [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>] as <a class="trait" href="trait.MessageBody.html" title="trait awc::body::MessageBody">MessageBody</a>&gt;::<a class="associatedtype" href="trait.MessageBody.html#associatedtype.Error" title="type awc::body::MessageBody::Error">Error</a>&gt;&gt;&gt;</h4></section><section id="method.try_into_bytes-2" class="method trait-impl"><a href="#method.try_into_bytes-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_into_bytes" class="fn">try_into_bytes</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;Bytes, &amp;'static [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-MessageBody-for-Cow%3C'static,+str%3E" class="impl"><a href="#impl-MessageBody-for-Cow%3C'static,+str%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.MessageBody.html" title="trait awc::body::MessageBody">MessageBody</a> for <a class="enum" href="https://doc.rust-lang.org/nightly/alloc/borrow/enum.Cow.html" title="enum alloc::borrow::Cow">Cow</a>&lt;'static, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>&gt;</h3></section></summary><div class="impl-items"><section id="associatedtype.Error-3" class="associatedtype trait-impl"><a href="#associatedtype.Error-3" class="anchor">§</a><h4 class="code-header">type <a href="#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><section id="method.size-2" class="method trait-impl"><a href="#method.size-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.size" class="fn">size</a>(&amp;self) -&gt; <a class="enum" href="enum.BodySize.html" title="enum awc::body::BodySize">BodySize</a></h4></section><section id="method.poll_next-2" class="method trait-impl"><a href="#method.poll_next-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.poll_next" class="fn">poll_next</a>(
self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;&amp;mut <a class="enum" href="https://doc.rust-lang.org/nightly/alloc/borrow/enum.Cow.html" title="enum alloc::borrow::Cow">Cow</a>&lt;'static, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>&gt;&gt;,
_cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;
) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<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="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Bytes, &lt;<a class="enum" href="https://doc.rust-lang.org/nightly/alloc/borrow/enum.Cow.html" title="enum alloc::borrow::Cow">Cow</a>&lt;'static, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>&gt; as <a class="trait" href="trait.MessageBody.html" title="trait awc::body::MessageBody">MessageBody</a>&gt;::<a class="associatedtype" href="trait.MessageBody.html#associatedtype.Error" title="type awc::body::MessageBody::Error">Error</a>&gt;&gt;&gt;</h4></section><section id="method.try_into_bytes-3" class="method trait-impl"><a href="#method.try_into_bytes-3" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_into_bytes" class="fn">try_into_bytes</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;Bytes, <a class="enum" href="https://doc.rust-lang.org/nightly/alloc/borrow/enum.Cow.html" title="enum alloc::borrow::Cow">Cow</a>&lt;'static, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>&gt;&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-MessageBody-for-Cow%3C'static,+%5Bu8%5D%3E" class="impl"><a href="#impl-MessageBody-for-Cow%3C'static,+%5Bu8%5D%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.MessageBody.html" title="trait awc::body::MessageBody">MessageBody</a> for <a class="enum" href="https://doc.rust-lang.org/nightly/alloc/borrow/enum.Cow.html" title="enum alloc::borrow::Cow">Cow</a>&lt;'static, [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]&gt;</h3></section></summary><div class="impl-items"><section id="associatedtype.Error-4" class="associatedtype trait-impl"><a href="#associatedtype.Error-4" class="anchor">§</a><h4 class="code-header">type <a href="#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><section id="method.size-3" class="method trait-impl"><a href="#method.size-3" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.size" class="fn">size</a>(&amp;self) -&gt; <a class="enum" href="enum.BodySize.html" title="enum awc::body::BodySize">BodySize</a></h4></section><section id="method.poll_next-3" class="method trait-impl"><a href="#method.poll_next-3" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.poll_next" class="fn">poll_next</a>(
self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;&amp;mut <a class="enum" href="https://doc.rust-lang.org/nightly/alloc/borrow/enum.Cow.html" title="enum alloc::borrow::Cow">Cow</a>&lt;'static, [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]&gt;&gt;,
_cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;
) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<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="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Bytes, &lt;<a class="enum" href="https://doc.rust-lang.org/nightly/alloc/borrow/enum.Cow.html" title="enum alloc::borrow::Cow">Cow</a>&lt;'static, [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]&gt; as <a class="trait" href="trait.MessageBody.html" title="trait awc::body::MessageBody">MessageBody</a>&gt;::<a class="associatedtype" href="trait.MessageBody.html#associatedtype.Error" title="type awc::body::MessageBody::Error">Error</a>&gt;&gt;&gt;</h4></section><section id="method.try_into_bytes-4" class="method trait-impl"><a href="#method.try_into_bytes-4" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_into_bytes" class="fn">try_into_bytes</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;Bytes, <a class="enum" href="https://doc.rust-lang.org/nightly/alloc/borrow/enum.Cow.html" title="enum alloc::borrow::Cow">Cow</a>&lt;'static, [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]&gt;&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-MessageBody-for-Infallible" class="impl"><a href="#impl-MessageBody-for-Infallible" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.MessageBody.html" title="trait awc::body::MessageBody">MessageBody</a> for <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h3></section></summary><div class="impl-items"><section id="associatedtype.Error-5" class="associatedtype trait-impl"><a href="#associatedtype.Error-5" class="anchor">§</a><h4 class="code-header">type <a href="#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><section id="method.size-4" class="method trait-impl"><a href="#method.size-4" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.size" class="fn">size</a>(&amp;self) -&gt; <a class="enum" href="enum.BodySize.html" title="enum awc::body::BodySize">BodySize</a></h4></section><section id="method.poll_next-4" class="method trait-impl"><a href="#method.poll_next-4" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.poll_next" class="fn">poll_next</a>(
self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;&amp;mut <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a>&gt;,
_cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;
) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<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="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Bytes, &lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a> as <a class="trait" href="trait.MessageBody.html" title="trait awc::body::MessageBody">MessageBody</a>&gt;::<a class="associatedtype" href="trait.MessageBody.html#associatedtype.Error" title="type awc::body::MessageBody::Error">Error</a>&gt;&gt;&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-MessageBody-for-()" class="impl"><a href="#impl-MessageBody-for-()" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.MessageBody.html" title="trait awc::body::MessageBody">MessageBody</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a></h3></section></summary><div class="impl-items"><section id="associatedtype.Error-6" class="associatedtype trait-impl"><a href="#associatedtype.Error-6" class="anchor">§</a><h4 class="code-header">type <a href="#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><section id="method.size-5" class="method trait-impl"><a href="#method.size-5" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.size" class="fn">size</a>(&amp;self) -&gt; <a class="enum" href="enum.BodySize.html" title="enum awc::body::BodySize">BodySize</a></h4></section><section id="method.poll_next-5" class="method trait-impl"><a href="#method.poll_next-5" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.poll_next" class="fn">poll_next</a>(
self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;&amp;mut <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;,
_cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;
) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<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="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Bytes, &lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a> as <a class="trait" href="trait.MessageBody.html" title="trait awc::body::MessageBody">MessageBody</a>&gt;::<a class="associatedtype" href="trait.MessageBody.html#associatedtype.Error" title="type awc::body::MessageBody::Error">Error</a>&gt;&gt;&gt;</h4></section><section id="method.try_into_bytes-5" class="method trait-impl"><a href="#method.try_into_bytes-5" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_into_bytes" class="fn">try_into_bytes</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;Bytes, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-MessageBody-for-String" class="impl"><a href="#impl-MessageBody-for-String" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.MessageBody.html" title="trait awc::body::MessageBody">MessageBody</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></h3></section></summary><div class="impl-items"><section id="associatedtype.Error-7" class="associatedtype trait-impl"><a href="#associatedtype.Error-7" class="anchor">§</a><h4 class="code-header">type <a href="#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><section id="method.size-6" class="method trait-impl"><a href="#method.size-6" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.size" class="fn">size</a>(&amp;self) -&gt; <a class="enum" href="enum.BodySize.html" title="enum awc::body::BodySize">BodySize</a></h4></section><section id="method.poll_next-6" class="method trait-impl"><a href="#method.poll_next-6" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.poll_next" class="fn">poll_next</a>(
self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;&amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>&gt;,
_cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;
) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<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="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Bytes, &lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a> as <a class="trait" href="trait.MessageBody.html" title="trait awc::body::MessageBody">MessageBody</a>&gt;::<a class="associatedtype" href="trait.MessageBody.html#associatedtype.Error" title="type awc::body::MessageBody::Error">Error</a>&gt;&gt;&gt;</h4></section><section id="method.try_into_bytes-6" class="method trait-impl"><a href="#method.try_into_bytes-6" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_into_bytes" class="fn">try_into_bytes</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;Bytes, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-MessageBody-for-Vec%3Cu8%3E" class="impl"><a href="#impl-MessageBody-for-Vec%3Cu8%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.MessageBody.html" title="trait awc::body::MessageBody">MessageBody</a> for <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;</h3></section></summary><div class="impl-items"><section id="associatedtype.Error-8" class="associatedtype trait-impl"><a href="#associatedtype.Error-8" class="anchor">§</a><h4 class="code-header">type <a href="#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><section id="method.size-7" class="method trait-impl"><a href="#method.size-7" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.size" class="fn">size</a>(&amp;self) -&gt; <a class="enum" href="enum.BodySize.html" title="enum awc::body::BodySize">BodySize</a></h4></section><section id="method.poll_next-7" class="method trait-impl"><a href="#method.poll_next-7" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.poll_next" class="fn">poll_next</a>(
self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;&amp;mut <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;,
_cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;
) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<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="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Bytes, &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; as <a class="trait" href="trait.MessageBody.html" title="trait awc::body::MessageBody">MessageBody</a>&gt;::<a class="associatedtype" href="trait.MessageBody.html#associatedtype.Error" title="type awc::body::MessageBody::Error">Error</a>&gt;&gt;&gt;</h4></section><section id="method.try_into_bytes-7" class="method trait-impl"><a href="#method.try_into_bytes-7" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_into_bytes" class="fn">try_into_bytes</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;Bytes, <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;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-MessageBody-for-ByteString" class="impl"><a href="#impl-MessageBody-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.MessageBody.html" title="trait awc::body::MessageBody">MessageBody</a> for ByteString</h3></section></summary><div class="impl-items"><section id="associatedtype.Error-9" class="associatedtype trait-impl"><a href="#associatedtype.Error-9" class="anchor">§</a><h4 class="code-header">type <a href="#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><section id="method.size-8" class="method trait-impl"><a href="#method.size-8" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.size" class="fn">size</a>(&amp;self) -&gt; <a class="enum" href="enum.BodySize.html" title="enum awc::body::BodySize">BodySize</a></h4></section><section id="method.poll_next-8" class="method trait-impl"><a href="#method.poll_next-8" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.poll_next" class="fn">poll_next</a>(
self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;&amp;mut ByteString&gt;,
_cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;
) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<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="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Bytes, &lt;ByteString as <a class="trait" href="trait.MessageBody.html" title="trait awc::body::MessageBody">MessageBody</a>&gt;::<a class="associatedtype" href="trait.MessageBody.html#associatedtype.Error" title="type awc::body::MessageBody::Error">Error</a>&gt;&gt;&gt;</h4></section><section id="method.try_into_bytes-8" class="method trait-impl"><a href="#method.try_into_bytes-8" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_into_bytes" class="fn">try_into_bytes</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;Bytes, ByteString&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-MessageBody-for-Bytes" class="impl"><a href="#impl-MessageBody-for-Bytes" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.MessageBody.html" title="trait awc::body::MessageBody">MessageBody</a> for Bytes</h3></section></summary><div class="impl-items"><section id="associatedtype.Error-10" class="associatedtype trait-impl"><a href="#associatedtype.Error-10" class="anchor">§</a><h4 class="code-header">type <a href="#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><section id="method.size-9" class="method trait-impl"><a href="#method.size-9" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.size" class="fn">size</a>(&amp;self) -&gt; <a class="enum" href="enum.BodySize.html" title="enum awc::body::BodySize">BodySize</a></h4></section><section id="method.poll_next-9" class="method trait-impl"><a href="#method.poll_next-9" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.poll_next" class="fn">poll_next</a>(
self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;&amp;mut Bytes&gt;,
_cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;
) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<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="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Bytes, &lt;Bytes as <a class="trait" href="trait.MessageBody.html" title="trait awc::body::MessageBody">MessageBody</a>&gt;::<a class="associatedtype" href="trait.MessageBody.html#associatedtype.Error" title="type awc::body::MessageBody::Error">Error</a>&gt;&gt;&gt;</h4></section><section id="method.try_into_bytes-9" class="method trait-impl"><a href="#method.try_into_bytes-9" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_into_bytes" class="fn">try_into_bytes</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;Bytes, Bytes&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-MessageBody-for-BytesMut" class="impl"><a href="#impl-MessageBody-for-BytesMut" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.MessageBody.html" title="trait awc::body::MessageBody">MessageBody</a> for BytesMut</h3></section></summary><div class="impl-items"><section id="associatedtype.Error-11" class="associatedtype trait-impl"><a href="#associatedtype.Error-11" class="anchor">§</a><h4 class="code-header">type <a href="#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><section id="method.size-10" class="method trait-impl"><a href="#method.size-10" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.size" class="fn">size</a>(&amp;self) -&gt; <a class="enum" href="enum.BodySize.html" title="enum awc::body::BodySize">BodySize</a></h4></section><section id="method.poll_next-10" class="method trait-impl"><a href="#method.poll_next-10" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.poll_next" class="fn">poll_next</a>(
self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;&amp;mut BytesMut&gt;,
_cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;
) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<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="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Bytes, &lt;BytesMut as <a class="trait" href="trait.MessageBody.html" title="trait awc::body::MessageBody">MessageBody</a>&gt;::<a class="associatedtype" href="trait.MessageBody.html#associatedtype.Error" title="type awc::body::MessageBody::Error">Error</a>&gt;&gt;&gt;</h4></section><section id="method.try_into_bytes-10" class="method trait-impl"><a href="#method.try_into_bytes-10" class="anchor">§</a><h4 class="code-header">fn <a href="#method.try_into_bytes" class="fn">try_into_bytes</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;Bytes, BytesMut&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-MessageBody-for-%26mut+B" class="impl"><a href="#impl-MessageBody-for-%26mut+B" class="anchor">§</a><h3 class="code-header">impl&lt;B&gt; <a class="trait" href="trait.MessageBody.html" title="trait awc::body::MessageBody">MessageBody</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut B</a><div class="where">where
B: <a class="trait" href="trait.MessageBody.html" title="trait awc::body::MessageBody">MessageBody</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</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"><section id="associatedtype.Error-12" class="associatedtype trait-impl"><a href="#associatedtype.Error-12" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a> = &lt;B as <a class="trait" href="trait.MessageBody.html" title="trait awc::body::MessageBody">MessageBody</a>&gt;::<a class="associatedtype" href="trait.MessageBody.html#associatedtype.Error" title="type awc::body::MessageBody::Error">Error</a></h4></section><section id="method.size-11" class="method trait-impl"><a href="#method.size-11" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.size" class="fn">size</a>(&amp;self) -&gt; <a class="enum" href="enum.BodySize.html" title="enum awc::body::BodySize">BodySize</a></h4></section><section id="method.poll_next-11" class="method trait-impl"><a href="#method.poll_next-11" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.poll_next" class="fn">poll_next</a>(
self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;&amp;mut <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut B</a>&gt;,
cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;
) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<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="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Bytes, &lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut B</a> as <a class="trait" href="trait.MessageBody.html" title="trait awc::body::MessageBody">MessageBody</a>&gt;::<a class="associatedtype" href="trait.MessageBody.html#associatedtype.Error" title="type awc::body::MessageBody::Error">Error</a>&gt;&gt;&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-MessageBody-for-Box%3CB%3E" class="impl"><a href="#impl-MessageBody-for-Box%3CB%3E" class="anchor">§</a><h3 class="code-header">impl&lt;B&gt; <a class="trait" href="trait.MessageBody.html" title="trait awc::body::MessageBody">MessageBody</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;B&gt;<div class="where">where
B: <a class="trait" href="trait.MessageBody.html" title="trait awc::body::MessageBody">MessageBody</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</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"><section id="associatedtype.Error-13" class="associatedtype trait-impl"><a href="#associatedtype.Error-13" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a> = &lt;B as <a class="trait" href="trait.MessageBody.html" title="trait awc::body::MessageBody">MessageBody</a>&gt;::<a class="associatedtype" href="trait.MessageBody.html#associatedtype.Error" title="type awc::body::MessageBody::Error">Error</a></h4></section><section id="method.size-12" class="method trait-impl"><a href="#method.size-12" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.size" class="fn">size</a>(&amp;self) -&gt; <a class="enum" href="enum.BodySize.html" title="enum awc::body::BodySize">BodySize</a></h4></section><section id="method.poll_next-12" class="method trait-impl"><a href="#method.poll_next-12" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.poll_next" class="fn">poll_next</a>(
self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;&amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;B&gt;&gt;,
cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;
) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<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="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Bytes, &lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;B&gt; as <a class="trait" href="trait.MessageBody.html" title="trait awc::body::MessageBody">MessageBody</a>&gt;::<a class="associatedtype" href="trait.MessageBody.html#associatedtype.Error" title="type awc::body::MessageBody::Error">Error</a>&gt;&gt;&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-MessageBody-for-Pin%3CT%3E" class="impl"><a href="#impl-MessageBody-for-Pin%3CT%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T, B&gt; <a class="trait" href="trait.MessageBody.html" title="trait awc::body::MessageBody">MessageBody</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;T&gt;<div class="where">where
T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.DerefMut.html" title="trait core::ops::deref::DerefMut">DerefMut</a>&lt;Target = B&gt; + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,
B: <a class="trait" href="trait.MessageBody.html" title="trait awc::body::MessageBody">MessageBody</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"><section id="associatedtype.Error-14" class="associatedtype trait-impl"><a href="#associatedtype.Error-14" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a> = &lt;B as <a class="trait" href="trait.MessageBody.html" title="trait awc::body::MessageBody">MessageBody</a>&gt;::<a class="associatedtype" href="trait.MessageBody.html#associatedtype.Error" title="type awc::body::MessageBody::Error">Error</a></h4></section><section id="method.size-13" class="method trait-impl"><a href="#method.size-13" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.size" class="fn">size</a>(&amp;self) -&gt; <a class="enum" href="enum.BodySize.html" title="enum awc::body::BodySize">BodySize</a></h4></section><section id="method.poll_next-13" class="method trait-impl"><a href="#method.poll_next-13" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.poll_next" class="fn">poll_next</a>(
self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;&amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;T&gt;&gt;,
cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;
) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<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="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Bytes, &lt;<a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;T&gt; as <a class="trait" href="trait.MessageBody.html" title="trait awc::body::MessageBody">MessageBody</a>&gt;::<a class="associatedtype" href="trait.MessageBody.html#associatedtype.Error" title="type awc::body::MessageBody::Error">Error</a>&gt;&gt;&gt;</h4></section></div></details><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><details class="toggle implementors-toggle"><summary><section id="impl-MessageBody-for-BoxBody" class="impl"><a href="#impl-MessageBody-for-BoxBody" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.MessageBody.html" title="trait awc::body::MessageBody">MessageBody</a> for <a class="struct" href="struct.BoxBody.html" title="struct awc::body::BoxBody">BoxBody</a></h3></section></summary><div class="impl-items"><section id="associatedtype.Error-15" class="associatedtype trait-impl"><a href="#associatedtype.Error-15" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/error/trait.Error.html" title="trait core::error::Error">Error</a>&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-MessageBody-for-None" class="impl"><a href="#impl-MessageBody-for-None" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.MessageBody.html" title="trait awc::body::MessageBody">MessageBody</a> for <a class="struct" href="struct.None.html" title="struct awc::body::None">None</a></h3></section></summary><div class="impl-items"><section id="associatedtype.Error-16" class="associatedtype trait-impl"><a href="#associatedtype.Error-16" class="anchor">§</a><h4 class="code-header">type <a href="#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></div></details><details class="toggle implementors-toggle"><summary><section id="impl-MessageBody-for-Encoder%3CB%3E" class="impl"><a href="#impl-MessageBody-for-Encoder%3CB%3E" class="anchor">§</a><h3 class="code-header">impl&lt;B&gt; <a class="trait" href="trait.MessageBody.html" title="trait awc::body::MessageBody">MessageBody</a> for Encoder&lt;B&gt;<div class="where">where
B: <a class="trait" href="trait.MessageBody.html" title="trait awc::body::MessageBody">MessageBody</a>,</div></h3></section></summary><div class="impl-items"><section id="associatedtype.Error-17" class="associatedtype trait-impl"><a href="#associatedtype.Error-17" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a> = EncoderError</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-MessageBody-for-EitherBody%3CL,+R%3E" class="impl"><a href="#impl-MessageBody-for-EitherBody%3CL,+R%3E" class="anchor">§</a><h3 class="code-header">impl&lt;L, R&gt; <a class="trait" href="trait.MessageBody.html" title="trait awc::body::MessageBody">MessageBody</a> for <a class="enum" href="enum.EitherBody.html" title="enum awc::body::EitherBody">EitherBody</a>&lt;L, R&gt;<div class="where">where
L: <a class="trait" href="trait.MessageBody.html" title="trait awc::body::MessageBody">MessageBody</a> + 'static,
R: <a class="trait" href="trait.MessageBody.html" title="trait awc::body::MessageBody">MessageBody</a> + 'static,</div></h3></section></summary><div class="impl-items"><section id="associatedtype.Error-18" class="associatedtype trait-impl"><a href="#associatedtype.Error-18" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="../http/struct.Error.html" title="struct awc::http::Error">Error</a></h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-MessageBody-for-BodyStream%3CS%3E" class="impl"><a href="#impl-MessageBody-for-BodyStream%3CS%3E" class="anchor">§</a><h3 class="code-header">impl&lt;S, E&gt; <a class="trait" href="trait.MessageBody.html" title="trait awc::body::MessageBody">MessageBody</a> for <a class="struct" href="struct.BodyStream.html" title="struct awc::body::BodyStream">BodyStream</a>&lt;S&gt;<div class="where">where
S: Stream&lt;Item = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Bytes, E&gt;&gt;,
E: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/error/trait.Error.html" title="trait core::error::Error">Error</a>&gt;&gt; + 'static,</div></h3></section></summary><div class="impl-items"><section id="associatedtype.Error-19" class="associatedtype trait-impl"><a href="#associatedtype.Error-19" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a> = E</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-MessageBody-for-SizedStream%3CS%3E" class="impl"><a href="#impl-MessageBody-for-SizedStream%3CS%3E" class="anchor">§</a><h3 class="code-header">impl&lt;S, E&gt; <a class="trait" href="trait.MessageBody.html" title="trait awc::body::MessageBody">MessageBody</a> for <a class="struct" href="struct.SizedStream.html" title="struct awc::body::SizedStream">SizedStream</a>&lt;S&gt;<div class="where">where
S: Stream&lt;Item = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Bytes, E&gt;&gt;,
E: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/error/trait.Error.html" title="trait core::error::Error">Error</a>&gt;&gt; + 'static,</div></h3></section></summary><div class="impl-items"><section id="associatedtype.Error-20" class="associatedtype trait-impl"><a href="#associatedtype.Error-20" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a> = E</h4></section></div></details></div><script src="../../trait.impl/actix_http/body/message_body/trait.MessageBody.js" data-ignore-extern-crates="alloc,core,bytes,actix_http,bytestring,std" async></script></section></div></main></body></html>