1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-05-20 09:18:26 +00:00
actix-web/actix_http/body/trait.MessageBody.html
2024-04-15 01:24:42 +00:00

139 lines
68 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="An interface for types that can be used as a response body."><title>MessageBody in actix_http::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-2c208a72533b4dd0.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="actix_http" data-themes="" data-resource-suffix="" data-rustdoc-version="1.79.0-nightly (0d8b3346a 2024-04-14)" data-channel="nightly" data-search-js="search-ffac13a0df2b1870.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../static.files/storage-e32f0c247825364d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-c97aec732c613ca4.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-09095024cf37855e.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="../../actix_http/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="../../actix_http/index.html"><img src="https://actix.rs/img/logo.png" alt="logo"></a><h2><a href="../../actix_http/index.html">actix_http</a><span class="version">3.6.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 actix_http::body</a></h2></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><div id="sidebar-button" tabindex="-1"><a href="../../actix_http/all.html" title="show sidebar"></a></div><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" tabindex="-1"><a href="../../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings">Settings</a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Trait <a href="../index.html">actix_http</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"><a class="src" href="../../src/actix_http/body/message_body.rs.html#55-120">source</a> · <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">StdError</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 actix_http::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 actix_http::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 actix_http::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 actix_http::body::BodyStream"><code>BodyStream</code></a>, <a href="struct.SizedStream.html" title="struct actix_http::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"><a class="src rightside" href="../../src/actix_http/body/message_body.rs.html#60">source</a><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">StdError</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"><a class="src rightside" href="../../src/actix_http/body/message_body.rs.html#65">source</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 actix_http::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 actix_http::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"><a class="src rightside" href="../../src/actix_http/body/message_body.rs.html#84-87">source</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;<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 actix_http::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"><a class="src rightside" href="../../src/actix_http/body/message_body.rs.html#101-106">source</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, 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 actix_http::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"><a class="src rightside" href="../../src/actix_http/body/message_body.rs.html#114-119">source</a><h4 class="code-header">fn <a href="#method.boxed" class="fn">boxed</a>(self) -&gt; <a class="struct" href="struct.BoxBody.html" title="struct actix_http::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 actix_http::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 class="src rightside" href="../../src/actix_http/body/message_body.rs.html#360-386">source</a><a href="#impl-MessageBody-for-%26str" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.MessageBody.html" title="trait actix_http::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 class="src rightside" href="../../src/actix_http/body/message_body.rs.html#364-366">source</a><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 actix_http::body::BodySize">BodySize</a></h4></section><section id="method.poll_next" class="method trait-impl"><a class="src rightside" href="../../src/actix_http/body/message_body.rs.html#369-380">source</a><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;<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 actix_http::body::MessageBody::Error">Error</a>&gt;&gt;&gt;</h4></section><section id="method.try_into_bytes-1" class="method trait-impl"><a class="src rightside" href="../../src/actix_http/body/message_body.rs.html#383-385">source</a><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, Self&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-MessageBody-for-%26%5Bu8%5D" class="impl"><a class="src rightside" href="../../src/actix_http/body/message_body.rs.html#223-247">source</a><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 actix_http::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 class="src rightside" href="../../src/actix_http/body/message_body.rs.html#227-229">source</a><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 actix_http::body::BodySize">BodySize</a></h4></section><section id="method.poll_next-1" class="method trait-impl"><a class="src rightside" href="../../src/actix_http/body/message_body.rs.html#232-241">source</a><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;<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 actix_http::body::MessageBody::Error">Error</a>&gt;&gt;&gt;</h4></section><section id="method.try_into_bytes-2" class="method trait-impl"><a class="src rightside" href="../../src/actix_http/body/message_body.rs.html#244-246">source</a><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, Self&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-MessageBody-for-Cow%3C'static,+str%3E" class="impl"><a class="src rightside" href="../../src/actix_http/body/message_body.rs.html#415-446">source</a><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 actix_http::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 class="src rightside" href="../../src/actix_http/body/message_body.rs.html#419-421">source</a><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 actix_http::body::BodySize">BodySize</a></h4></section><section id="method.poll_next-2" class="method trait-impl"><a class="src rightside" href="../../src/actix_http/body/message_body.rs.html#424-437">source</a><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;<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 actix_http::body::MessageBody::Error">Error</a>&gt;&gt;&gt;</h4></section><section id="method.try_into_bytes-3" class="method trait-impl"><a class="src rightside" href="../../src/actix_http/body/message_body.rs.html#440-445">source</a><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, Self&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 class="src rightside" href="../../src/actix_http/body/message_body.rs.html#327-358">source</a><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 actix_http::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 class="src rightside" href="../../src/actix_http/body/message_body.rs.html#331-333">source</a><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 actix_http::body::BodySize">BodySize</a></h4></section><section id="method.poll_next-3" class="method trait-impl"><a class="src rightside" href="../../src/actix_http/body/message_body.rs.html#336-349">source</a><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;<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 actix_http::body::MessageBody::Error">Error</a>&gt;&gt;&gt;</h4></section><section id="method.try_into_bytes-4" class="method trait-impl"><a class="src rightside" href="../../src/actix_http/body/message_body.rs.html#352-357">source</a><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, Self&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-MessageBody-for-Infallible" class="impl"><a class="src rightside" href="../../src/actix_http/body/message_body.rs.html#145-158">source</a><a href="#impl-MessageBody-for-Infallible" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.MessageBody.html" title="trait actix_http::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 class="src rightside" href="../../src/actix_http/body/message_body.rs.html#148-150">source</a><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 actix_http::body::BodySize">BodySize</a></h4></section><section id="method.poll_next-4" class="method trait-impl"><a class="src rightside" href="../../src/actix_http/body/message_body.rs.html#152-157">source</a><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;<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 actix_http::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 class="src rightside" href="../../src/actix_http/body/message_body.rs.html#160-180">source</a><a href="#impl-MessageBody-for-()" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.MessageBody.html" title="trait actix_http::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 class="src rightside" href="../../src/actix_http/body/message_body.rs.html#164-166">source</a><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 actix_http::body::BodySize">BodySize</a></h4></section><section id="method.poll_next-5" class="method trait-impl"><a class="src rightside" href="../../src/actix_http/body/message_body.rs.html#169-174">source</a><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;<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 actix_http::body::MessageBody::Error">Error</a>&gt;&gt;&gt;</h4></section><section id="method.try_into_bytes-5" class="method trait-impl"><a class="src rightside" href="../../src/actix_http/body/message_body.rs.html#177-179">source</a><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, Self&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-MessageBody-for-String" class="impl"><a class="src rightside" href="../../src/actix_http/body/message_body.rs.html#388-413">source</a><a href="#impl-MessageBody-for-String" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.MessageBody.html" title="trait actix_http::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 class="src rightside" href="../../src/actix_http/body/message_body.rs.html#392-394">source</a><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 actix_http::body::BodySize">BodySize</a></h4></section><section id="method.poll_next-6" class="method trait-impl"><a class="src rightside" href="../../src/actix_http/body/message_body.rs.html#397-407">source</a><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;<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 actix_http::body::MessageBody::Error">Error</a>&gt;&gt;&gt;</h4></section><section id="method.try_into_bytes-6" class="method trait-impl"><a class="src rightside" href="../../src/actix_http/body/message_body.rs.html#410-412">source</a><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, Self&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-MessageBody-for-Vec%3Cu8%3E" class="impl"><a class="src rightside" href="../../src/actix_http/body/message_body.rs.html#301-325">source</a><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 actix_http::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 class="src rightside" href="../../src/actix_http/body/message_body.rs.html#305-307">source</a><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 actix_http::body::BodySize">BodySize</a></h4></section><section id="method.poll_next-7" class="method trait-impl"><a class="src rightside" href="../../src/actix_http/body/message_body.rs.html#310-319">source</a><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;<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 actix_http::body::MessageBody::Error">Error</a>&gt;&gt;&gt;</h4></section><section id="method.try_into_bytes-7" class="method trait-impl"><a class="src rightside" href="../../src/actix_http/body/message_body.rs.html#322-324">source</a><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, Self&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-MessageBody-for-ByteString" class="impl"><a class="src rightside" href="../../src/actix_http/body/message_body.rs.html#448-469">source</a><a href="#impl-MessageBody-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.MessageBody.html" title="trait actix_http::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 class="src rightside" href="../../src/actix_http/body/message_body.rs.html#452-454">source</a><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 actix_http::body::BodySize">BodySize</a></h4></section><section id="method.poll_next-8" class="method trait-impl"><a class="src rightside" href="../../src/actix_http/body/message_body.rs.html#457-463">source</a><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;<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 actix_http::body::MessageBody::Error">Error</a>&gt;&gt;&gt;</h4></section><section id="method.try_into_bytes-8" class="method trait-impl"><a class="src rightside" href="../../src/actix_http/body/message_body.rs.html#466-468">source</a><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, Self&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-MessageBody-for-Bytes" class="impl"><a class="src rightside" href="../../src/actix_http/body/message_body.rs.html#249-273">source</a><a href="#impl-MessageBody-for-Bytes" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.MessageBody.html" title="trait actix_http::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 class="src rightside" href="../../src/actix_http/body/message_body.rs.html#253-255">source</a><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 actix_http::body::BodySize">BodySize</a></h4></section><section id="method.poll_next-9" class="method trait-impl"><a class="src rightside" href="../../src/actix_http/body/message_body.rs.html#258-267">source</a><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;<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 actix_http::body::MessageBody::Error">Error</a>&gt;&gt;&gt;</h4></section><section id="method.try_into_bytes-9" class="method trait-impl"><a class="src rightside" href="../../src/actix_http/body/message_body.rs.html#270-272">source</a><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, Self&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-MessageBody-for-BytesMut" class="impl"><a class="src rightside" href="../../src/actix_http/body/message_body.rs.html#275-299">source</a><a href="#impl-MessageBody-for-BytesMut" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.MessageBody.html" title="trait actix_http::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 class="src rightside" href="../../src/actix_http/body/message_body.rs.html#279-281">source</a><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 actix_http::body::BodySize">BodySize</a></h4></section><section id="method.poll_next-10" class="method trait-impl"><a class="src rightside" href="../../src/actix_http/body/message_body.rs.html#284-293">source</a><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;<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 actix_http::body::MessageBody::Error">Error</a>&gt;&gt;&gt;</h4></section><section id="method.try_into_bytes-10" class="method trait-impl"><a class="src rightside" href="../../src/actix_http/body/message_body.rs.html#296-298">source</a><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, Self&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-MessageBody-for-%26mut+B" class="impl"><a class="src rightside" href="../../src/actix_http/body/message_body.rs.html#127-143">source</a><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 actix_http::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 actix_http::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 actix_http::body::MessageBody">MessageBody</a>&gt;::<a class="associatedtype" href="trait.MessageBody.html#associatedtype.Error" title="type actix_http::body::MessageBody::Error">Error</a></h4></section><section id="method.size-11" class="method trait-impl"><a class="src rightside" href="../../src/actix_http/body/message_body.rs.html#133-135">source</a><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 actix_http::body::BodySize">BodySize</a></h4></section><section id="method.poll_next-11" class="method trait-impl"><a class="src rightside" href="../../src/actix_http/body/message_body.rs.html#137-142">source</a><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;<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 actix_http::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 class="src rightside" href="../../src/actix_http/body/message_body.rs.html#182-200">source</a><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 actix_http::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 actix_http::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 actix_http::body::MessageBody">MessageBody</a>&gt;::<a class="associatedtype" href="trait.MessageBody.html#associatedtype.Error" title="type actix_http::body::MessageBody::Error">Error</a></h4></section><section id="method.size-12" class="method trait-impl"><a class="src rightside" href="../../src/actix_http/body/message_body.rs.html#189-191">source</a><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 actix_http::body::BodySize">BodySize</a></h4></section><section id="method.poll_next-12" class="method trait-impl"><a class="src rightside" href="../../src/actix_http/body/message_body.rs.html#194-199">source</a><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;<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 actix_http::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 class="src rightside" href="../../src/actix_http/body/message_body.rs.html#202-221">source</a><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 actix_http::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 actix_http::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 actix_http::body::MessageBody">MessageBody</a>&gt;::<a class="associatedtype" href="trait.MessageBody.html#associatedtype.Error" title="type actix_http::body::MessageBody::Error">Error</a></h4></section><section id="method.size-13" class="method trait-impl"><a class="src rightside" href="../../src/actix_http/body/message_body.rs.html#210-212">source</a><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 actix_http::body::BodySize">BodySize</a></h4></section><section id="method.poll_next-13" class="method trait-impl"><a class="src rightside" href="../../src/actix_http/body/message_body.rs.html#215-220">source</a><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;<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 actix_http::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 class="src rightside" href="../../src/actix_http/body/boxed.rs.html#62-99">source</a><a href="#impl-MessageBody-for-BoxBody" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.MessageBody.html" title="trait actix_http::body::MessageBody">MessageBody</a> for <a class="struct" href="struct.BoxBody.html" title="struct actix_http::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 class="src rightside" href="../../src/actix_http/body/none.rs.html#31-51">source</a><a href="#impl-MessageBody-for-None" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.MessageBody.html" title="trait actix_http::body::MessageBody">MessageBody</a> for <a class="struct" href="struct.None.html" title="struct actix_http::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 class="src rightside" href="../../src/actix_http/encoding/encoder.rs.html#157-263">source</a><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 actix_http::body::MessageBody">MessageBody</a> for <a class="struct" href="../encoding/struct.Encoder.html" title="struct actix_http::encoding::Encoder">Encoder</a>&lt;B&gt;<div class="where">where
B: <a class="trait" href="trait.MessageBody.html" title="trait actix_http::body::MessageBody">MessageBody</a>,</div></h3><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>__compress</code></strong> only.</div></span></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 class="src rightside" href="../../src/actix_http/body/either.rs.html#60-109">source</a><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 actix_http::body::MessageBody">MessageBody</a> for <a class="enum" href="enum.EitherBody.html" title="enum actix_http::body::EitherBody">EitherBody</a>&lt;L, R&gt;<div class="where">where
L: <a class="trait" href="trait.MessageBody.html" title="trait actix_http::body::MessageBody">MessageBody</a> + 'static,
R: <a class="trait" href="trait.MessageBody.html" title="trait actix_http::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="../error/struct.Error.html" title="struct actix_http::error::Error">Error</a></h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-MessageBody-for-BodyStream%3CS%3E" class="impl"><a class="src rightside" href="../../src/actix_http/body/body_stream.rs.html#36-67">source</a><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 actix_http::body::MessageBody">MessageBody</a> for <a class="struct" href="struct.BodyStream.html" title="struct actix_http::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">StdError</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 class="src rightside" href="../../src/actix_http/body/sized_stream.rs.html#38-70">source</a><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 actix_http::body::MessageBody">MessageBody</a> for <a class="struct" href="struct.SizedStream.html" title="struct actix_http::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">StdError</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,bytestring,std,bytes" async></script></section></div></main></body></html>