1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-30 16:34:26 +02:00

Deploying to gh-pages from @ actix/actix-web@26efa64278 🚀

This commit is contained in:
github-merge-queue[bot]
2024-05-27 01:16:31 +00:00
commit a33fe13cd1
1715 changed files with 215638 additions and 0 deletions

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../actix_web/middleware/struct.Compat.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../actix_web/middleware/struct.Compat.html">../../../actix_web/middleware/struct.Compat.html</a>...</p>
<script>location.replace("../../../actix_web/middleware/struct.Compat.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../actix_web/middleware/struct.Compress.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../actix_web/middleware/struct.Compress.html">../../../actix_web/middleware/struct.Compress.html</a>...</p>
<script>location.replace("../../../actix_web/middleware/struct.Compress.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../actix_web/middleware/struct.Condition.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../actix_web/middleware/struct.Condition.html">../../../actix_web/middleware/struct.Condition.html</a>...</p>
<script>location.replace("../../../actix_web/middleware/struct.Condition.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../actix_web/middleware/struct.DefaultHeaders.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../actix_web/middleware/struct.DefaultHeaders.html">../../../actix_web/middleware/struct.DefaultHeaders.html</a>...</p>
<script>location.replace("../../../actix_web/middleware/struct.DefaultHeaders.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,24 @@
<!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="Return type for `ErrorHandlers` custom handlers."><title>ErrorHandlerResponse in actix_web::middleware - 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="actix_web" 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 enum"><!--[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_web/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_web/index.html"><img src="https://actix.rs/img/logo.png" alt="logo"></a><h2><a href="../../actix_web/index.html">actix_web</a><span class="version">4.6.0</span></h2></div><h2 class="location"><a href="#">ErrorHandlerResponse</a></h2><div class="sidebar-elems"><section><h3><a href="#variants">Variants</a></h3><ul class="block variant"><li><a href="#variant.Future">Future</a></li><li><a href="#variant.Response">Response</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block synthetic-implementation"><li><a href="#impl-Freeze-for-ErrorHandlerResponse%3CB%3E">!Freeze</a></li><li><a href="#impl-RefUnwindSafe-for-ErrorHandlerResponse%3CB%3E">!RefUnwindSafe</a></li><li><a href="#impl-Send-for-ErrorHandlerResponse%3CB%3E">!Send</a></li><li><a href="#impl-Sync-for-ErrorHandlerResponse%3CB%3E">!Sync</a></li><li><a href="#impl-UnwindSafe-for-ErrorHandlerResponse%3CB%3E">!UnwindSafe</a></li><li><a href="#impl-Unpin-for-ErrorHandlerResponse%3CB%3E">Unpin</a></li></ul><h3><a href="#blanket-implementations">Blanket Implementations</a></h3><ul class="block blanket-implementation"><li><a href="#impl-Any-for-T">Any</a></li><li><a href="#impl-Borrow%3CT%3E-for-T">Borrow&lt;T&gt;</a></li><li><a href="#impl-BorrowMut%3CT%3E-for-T">BorrowMut&lt;T&gt;</a></li><li><a href="#impl-From%3CT%3E-for-T">From&lt;T&gt;</a></li><li><a href="#impl-Instrument-for-T">Instrument</a></li><li><a href="#impl-Into%3CU%3E-for-T">Into&lt;U&gt;</a></li><li><a href="#impl-Same-for-T">Same</a></li><li><a href="#impl-TryFrom%3CU%3E-for-T">TryFrom&lt;U&gt;</a></li><li><a href="#impl-TryInto%3CU%3E-for-T">TryInto&lt;U&gt;</a></li><li><a href="#impl-VZip%3CV%3E-for-T">VZip&lt;V&gt;</a></li><li><a href="#impl-WithSubscriber-for-T">WithSubscriber</a></li></ul></section><h2><a href="index.html">In actix_web::middleware</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>Enum <a href="../index.html">actix_web</a>::<wbr><a href="index.html">middleware</a>::<wbr><a class="enum" href="#">ErrorHandlerResponse</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_web/middleware/err_handlers.rs.html#23-29">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><pre class="rust item-decl"><code>pub enum ErrorHandlerResponse&lt;B&gt; {
Response(<a class="struct" href="../dev/struct.ServiceResponse.html" title="struct actix_web::dev::ServiceResponse">ServiceResponse</a>&lt;<a class="enum" href="../body/enum.EitherBody.html" title="enum actix_web::body::EitherBody">EitherBody</a>&lt;B&gt;&gt;),
Future(LocalBoxFuture&lt;'static, <a class="type" href="../type.Result.html" title="type actix_web::Result">Result</a>&lt;<a class="struct" href="../dev/struct.ServiceResponse.html" title="struct actix_web::dev::ServiceResponse">ServiceResponse</a>&lt;<a class="enum" href="../body/enum.EitherBody.html" title="enum actix_web::body::EitherBody">EitherBody</a>&lt;B&gt;&gt;, <a class="struct" href="../error/struct.Error.html" title="struct actix_web::error::Error">Error</a>&gt;&gt;),
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Return type for <a href="struct.ErrorHandlers.html" title="struct actix_web::middleware::ErrorHandlers"><code>ErrorHandlers</code></a> custom handlers.</p>
</div></details><h2 id="variants" class="variants section-header">Variants<a href="#variants" class="anchor">§</a></h2><div class="variants"><section id="variant.Response" class="variant"><a href="#variant.Response" class="anchor">§</a><h3 class="code-header">Response(<a class="struct" href="../dev/struct.ServiceResponse.html" title="struct actix_web::dev::ServiceResponse">ServiceResponse</a>&lt;<a class="enum" href="../body/enum.EitherBody.html" title="enum actix_web::body::EitherBody">EitherBody</a>&lt;B&gt;&gt;)</h3></section><div class="docblock"><p>Immediate HTTP response.</p>
</div><section id="variant.Future" class="variant"><a href="#variant.Future" class="anchor">§</a><h3 class="code-header">Future(LocalBoxFuture&lt;'static, <a class="type" href="../type.Result.html" title="type actix_web::Result">Result</a>&lt;<a class="struct" href="../dev/struct.ServiceResponse.html" title="struct actix_web::dev::ServiceResponse">ServiceResponse</a>&lt;<a class="enum" href="../body/enum.EitherBody.html" title="enum actix_web::body::EitherBody">EitherBody</a>&lt;B&gt;&gt;, <a class="struct" href="../error/struct.Error.html" title="struct actix_web::error::Error">Error</a>&gt;&gt;)</h3></section><div class="docblock"><p>A future that resolves to an HTTP response.</p>
</div></div><h2 id="synthetic-implementations" class="section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor">§</a></h2><div id="synthetic-implementations-list"><section id="impl-Freeze-for-ErrorHandlerResponse%3CB%3E" class="impl"><a href="#impl-Freeze-for-ErrorHandlerResponse%3CB%3E" class="anchor">§</a><h3 class="code-header">impl&lt;B&gt; !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Freeze.html" title="trait core::marker::Freeze">Freeze</a> for <a class="enum" href="enum.ErrorHandlerResponse.html" title="enum actix_web::middleware::ErrorHandlerResponse">ErrorHandlerResponse</a>&lt;B&gt;</h3></section><section id="impl-RefUnwindSafe-for-ErrorHandlerResponse%3CB%3E" class="impl"><a href="#impl-RefUnwindSafe-for-ErrorHandlerResponse%3CB%3E" class="anchor">§</a><h3 class="code-header">impl&lt;B&gt; !<a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="enum.ErrorHandlerResponse.html" title="enum actix_web::middleware::ErrorHandlerResponse">ErrorHandlerResponse</a>&lt;B&gt;</h3></section><section id="impl-Send-for-ErrorHandlerResponse%3CB%3E" class="impl"><a href="#impl-Send-for-ErrorHandlerResponse%3CB%3E" class="anchor">§</a><h3 class="code-header">impl&lt;B&gt; !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="enum.ErrorHandlerResponse.html" title="enum actix_web::middleware::ErrorHandlerResponse">ErrorHandlerResponse</a>&lt;B&gt;</h3></section><section id="impl-Sync-for-ErrorHandlerResponse%3CB%3E" class="impl"><a href="#impl-Sync-for-ErrorHandlerResponse%3CB%3E" class="anchor">§</a><h3 class="code-header">impl&lt;B&gt; !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="enum.ErrorHandlerResponse.html" title="enum actix_web::middleware::ErrorHandlerResponse">ErrorHandlerResponse</a>&lt;B&gt;</h3></section><section id="impl-Unpin-for-ErrorHandlerResponse%3CB%3E" class="impl"><a href="#impl-Unpin-for-ErrorHandlerResponse%3CB%3E" class="anchor">§</a><h3 class="code-header">impl&lt;B&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="enum.ErrorHandlerResponse.html" title="enum actix_web::middleware::ErrorHandlerResponse">ErrorHandlerResponse</a>&lt;B&gt;<div class="where">where
B: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h3></section><section id="impl-UnwindSafe-for-ErrorHandlerResponse%3CB%3E" class="impl"><a href="#impl-UnwindSafe-for-ErrorHandlerResponse%3CB%3E" class="anchor">§</a><h3 class="code-header">impl&lt;B&gt; !<a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="enum" href="enum.ErrorHandlerResponse.html" title="enum actix_web::middleware::ErrorHandlerResponse">ErrorHandlerResponse</a>&lt;B&gt;</h3></section></div><h2 id="blanket-implementations" class="section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor">§</a></h2><div id="blanket-implementations-list"><details class="toggle implementors-toggle"><summary><section id="impl-Any-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#140">source</a><a href="#impl-Any-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T<div class="where">where
T: 'static + ?<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"><details class="toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#141">source</a><a href="#method.type_id" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fn">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></section></summary><div class='docblock'>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#208">source</a><a href="#impl-Borrow%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T<div class="where">where
T: ?<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"><details class="toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#210">source</a><a href="#method.borrow" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fn">borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;T</a></h4></section></summary><div class='docblock'>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#216">source</a><a href="#impl-BorrowMut%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T<div class="where">where
T: ?<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"><details class="toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#217">source</a><a href="#method.borrow_mut" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fn">borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut T</a></h4></section></summary><div class='docblock'>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-From%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#765">source</a><a href="#impl-From%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#768">source</a><a href="#method.from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fn">from</a>(t: T) -&gt; T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Instrument-for-T" class="impl"><a href="#impl-Instrument-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; Instrument for T</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.instrument" class="method trait-impl"><a href="#method.instrument" class="anchor">§</a><h4 class="code-header">fn <a class="fn">instrument</a>(self, span: Span) -&gt; Instrumented&lt;Self&gt;</h4></section></summary><div class='docblock'>Instruments this type with the provided [<code>Span</code>], returning an
<code>Instrumented</code> wrapper. <a>Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.in_current_span" class="method trait-impl"><a href="#method.in_current_span" class="anchor">§</a><h4 class="code-header">fn <a class="fn">in_current_span</a>(self) -&gt; Instrumented&lt;Self&gt;</h4></section></summary><div class='docblock'>Instruments this type with the <a href="super::Span::current()">current</a> <a href="crate::Span"><code>Span</code></a>, returning an
<code>Instrumented</code> wrapper. <a>Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#748-750">source</a><a href="#impl-Into%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T<div class="where">where
U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#758">source</a><a href="#method.into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into" class="fn">into</a>(self) -&gt; U</h4></section></summary><div class="docblock"><p>Calls <code>U::from(self)</code>.</p>
<p>That is, this conversion is whatever the implementation of
<code><a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for U</code> chooses to do.</p>
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Same-for-T" class="impl"><a class="src rightside" href="https://docs.rs/typenum/1.17.0/src/typenum/type_operators.rs.html#34">source</a><a href="#impl-Same-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://docs.rs/typenum/1.17.0/typenum/type_operators/trait.Same.html" title="trait typenum::type_operators::Same">Same</a> for T</h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Output" class="associatedtype trait-impl"><a href="#associatedtype.Output" class="anchor">§</a><h4 class="code-header">type <a href="https://docs.rs/typenum/1.17.0/typenum/type_operators/trait.Same.html#associatedtype.Output" class="associatedtype">Output</a> = T</h4></section></summary><div class='docblock'>Should always be <code>Self</code></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#805-807">source</a><a href="#impl-TryFrom%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T<div class="where">where
U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-1" class="associatedtype trait-impl"><a href="#associatedtype.Error-1" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#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></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#812">source</a><a href="#method.try_from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#790-792">source</a><a href="#impl-TryInto%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T<div class="where">where
U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error" class="associatedtype trait-impl"><a href="#associatedtype.Error" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error" class="associatedtype">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#797">source</a><a href="#method.try_into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into" class="fn">try_into</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;U, &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-VZip%3CV%3E-for-T" class="impl"><a href="#impl-VZip%3CV%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;V, T&gt; VZip&lt;V&gt; for T<div class="where">where
V: MultiLane&lt;T&gt;,</div></h3></section></summary><div class="impl-items"><section id="method.vzip" class="method trait-impl"><a href="#method.vzip" class="anchor">§</a><h4 class="code-header">fn <a class="fn">vzip</a>(self) -&gt; V</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-WithSubscriber-for-T" class="impl"><a href="#impl-WithSubscriber-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; WithSubscriber for T</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.with_subscriber" class="method trait-impl"><a href="#method.with_subscriber" class="anchor">§</a><h4 class="code-header">fn <a class="fn">with_subscriber</a>&lt;S&gt;(self, subscriber: S) -&gt; WithDispatch&lt;Self&gt;<div class="where">where
S: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;Dispatch&gt;,</div></h4></section></summary><div class='docblock'>Attaches the provided <a href="super::Subscriber"><code>Subscriber</code></a> to this type, returning a
[<code>WithDispatch</code>] wrapper. <a>Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.with_current_subscriber" class="method trait-impl"><a href="#method.with_current_subscriber" class="anchor">§</a><h4 class="code-header">fn <a class="fn">with_current_subscriber</a>(self) -&gt; WithDispatch&lt;Self&gt;</h4></section></summary><div class='docblock'>Attaches the current <a href="crate::dispatcher#setting-the-default-subscriber">default</a> <a href="super::Subscriber"><code>Subscriber</code></a> to this type, returning a
[<code>WithDispatch</code>] wrapper. <a>Read more</a></div></details></div></details></div></section></div></main></body></html>

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../actix_web/middleware/enum.ErrorHandlerResponse.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../actix_web/middleware/enum.ErrorHandlerResponse.html">../../../actix_web/middleware/enum.ErrorHandlerResponse.html</a>...</p>
<script>location.replace("../../../actix_web/middleware/enum.ErrorHandlerResponse.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../actix_web/middleware/struct.ErrorHandlers.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../actix_web/middleware/struct.ErrorHandlers.html">../../../actix_web/middleware/struct.ErrorHandlers.html</a>...</p>
<script>location.replace("../../../actix_web/middleware/struct.ErrorHandlers.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,165 @@
<!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="A collection of common middleware."><title>actix_web::middleware - 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="actix_web" 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 mod"><!--[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_web/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_web/index.html"><img src="https://actix.rs/img/logo.png" alt="logo"></a><h2><a href="../../actix_web/index.html">actix_web</a><span class="version">4.6.0</span></h2></div><h2 class="location"><a href="#">Module middleware</a></h2><div class="sidebar-elems"><section><ul class="block"><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li></ul></section><h2><a href="../index.html">In crate actix_web</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>Module <a href="../index.html">actix_web</a>::<wbr><a class="mod" href="#">middleware</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_web/middleware/mod.rs.html#1-283">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A collection of common middleware.</p>
<h2 id="what-is-middleware"><a class="doc-anchor" href="#what-is-middleware">§</a>What Is Middleware?</h2>
<p>Actix Webs middleware system allows us to add additional behavior to request/response
processing. Middleware can hook into incoming request and outgoing response processes, enabling
us to modify requests and responses as well as halt request processing to return a response
early.</p>
<p>Typically, middleware is involved in the following actions:</p>
<ul>
<li>Pre-process the request (e.g., <a href="struct.NormalizePath.html" title="struct actix_web::middleware::NormalizePath">normalizing paths</a>)</li>
<li>Post-process a response (e.g., <a href="struct.Logger.html" title="struct actix_web::middleware::Logger">logging</a>)</li>
<li>Modify application state (through <a href="../dev/struct.ServiceRequest.html" title="struct actix_web::dev::ServiceRequest"><code>ServiceRequest</code></a>)</li>
<li>Access external services (e.g., <a href="https://docs.rs/actix-session">sessions</a>, etc.)</li>
</ul>
<p>Middleware is registered for each <a href="../struct.App.html" title="struct actix_web::App"><code>App</code></a>, <a href="../struct.Scope.html" title="struct actix_web::Scope"><code>Scope</code></a>, or
<a href="../struct.Resource.html" title="struct actix_web::Resource"><code>Resource</code></a> and executed in opposite order as registration. In general, a
middleware is a pair of types that implements the <a href="../dev/trait.Service.html" title="trait actix_web::dev::Service"><code>Service</code></a> trait and <a href="../dev/trait.Transform.html" title="trait actix_web::dev::Transform"><code>Transform</code></a> trait,
respectively. The <a href="../dev/trait.Transform.html#tymethod.new_transform" title="method actix_web::dev::Transform::new_transform"><code>new_transform</code></a> and <a href="../dev/trait.Service.html#tymethod.call" title="method actix_web::dev::Service::call"><code>call</code></a> methods must return a <a href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future"><code>Future</code></a>, though it
can often be <a href="actix_utils::future::Ready">an immediately-ready one</a>.</p>
<h2 id="ordering"><a class="doc-anchor" href="#ordering">§</a>Ordering</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attr">#[get(<span class="string">"/"</span>)]
</span><span class="kw">async fn </span>service(a: ExtractorA, b: ExtractorB) -&gt; <span class="kw">impl </span>Responder { <span class="string">"Hello, World!" </span>}
<span class="kw">let </span>app = App::new()
.wrap(MiddlewareA::default())
.wrap(MiddlewareB::default())
.wrap(MiddlewareC::default())
.service(service);</code></pre></div>
<div class="example-wrap"><pre class="language-plain"><code> Request
╭────────────────────┼────╮
│ MiddlewareC │ │
│ ╭──────────────────┼───╮│
│ │ MiddlewareB │ ││
│ │ ╭────────────────┼──╮││
│ │ │ MiddlewareA │ │││
│ │ │ ╭──────────────┼─╮│││
│ │ │ │ ExtractorA │ ││││
│ │ │ ├┈┈┈┈┈┈┈┈┈┈┈┈┈┈┼┈┤│││
│ │ │ │ ExtractorB │ ││││
│ │ │ ├┈┈┈┈┈┈┈┈┈┈┈┈┈┈┼┈┤│││
│ │ │ │ service │ ││││
│ │ │ ╰──────────────┼─╯│││
│ │ ╰────────────────┼──╯││
│ ╰──────────────────┼───╯│
╰────────────────────┼────╯
Response
</code></pre></div>
<p>The request <em>first</em> gets processed by the middleware specified <em>last</em> - <code>MiddlewareC</code>. It passes
the request (modified a modified one) to the next middleware - <code>MiddlewareB</code> - <em>or</em> directly
responds to the request (e.g. when the request was invalid or an error occurred). <code>MiddlewareB</code>
processes the request as well and passes it to <code>MiddlewareA</code>, which then passes it to the
<a href="../dev/trait.Service.html" title="trait actix_web::dev::Service"><code>Service</code></a>. In the <a href="../dev/trait.Service.html" title="trait actix_web::dev::Service"><code>Service</code></a>, the extractors will run first. They dont pass the request on,
but only view it (see <a href="../trait.FromRequest.html" title="trait actix_web::FromRequest"><code>FromRequest</code></a>). After the <a href="../dev/trait.Service.html" title="trait actix_web::dev::Service"><code>Service</code></a> responds to the request, the
response is passed back through <code>MiddlewareA</code>, <code>MiddlewareB</code>, and <code>MiddlewareC</code>.</p>
<p>As you register middleware using <a href="../struct.App.html#method.wrap" title="method actix_web::App::wrap"><code>wrap</code></a> and <a href="../struct.App.html#method.wrap_fn" title="method actix_web::App::wrap_fn"><code>wrap_fn</code></a>
in the <a href="../struct.App.html" title="struct actix_web::App"><code>App</code></a> builder, imagine wrapping layers around an inner <a href="../struct.App.html" title="struct actix_web::App"><code>App</code></a>. The first middleware
layer exposed to a Request is the outermost layer (i.e., the <em>last</em> registered in the builder
chain, in the example above: <code>MiddlewareC</code>). Consequently, the <em>first</em> middleware registered in
the builder chain is the <em>last</em> to start executing during request processing (<code>MiddlewareA</code>).
Ordering is less obvious when wrapped services also have middleware applied. In this case,
middleware are run in reverse order for <a href="../struct.App.html" title="struct actix_web::App"><code>App</code></a> <em>and then</em> in reverse order for the wrapped
service.</p>
<h2 id="middleware-traits"><a class="doc-anchor" href="#middleware-traits">§</a>Middleware Traits</h2><h3 id="transforms-req"><a class="doc-anchor" href="#transforms-req">§</a><code>Transform&lt;S, Req&gt;</code></h3>
<p>The <a href="../dev/trait.Transform.html" title="trait actix_web::dev::Transform"><code>Transform</code></a> trait is the builder for the actual <a href="../dev/trait.Service.html" title="trait actix_web::dev::Service"><code>Service</code></a>s that handle the requests. All
the middleware you pass to the <code>wrap</code> methods implement this trait. During construction, each
thread assembles a chain of <a href="../dev/trait.Service.html" title="trait actix_web::dev::Service"><code>Service</code></a>s by calling <a href="../dev/trait.Transform.html#tymethod.new_transform" title="method actix_web::dev::Transform::new_transform"><code>new_transform</code></a> and passing the next
<a href="../dev/trait.Service.html" title="trait actix_web::dev::Service"><code>Service</code></a> (<code>S</code>) in the chain. The created <a href="../dev/trait.Service.html" title="trait actix_web::dev::Service"><code>Service</code></a> handles requests of type <code>Req</code>.</p>
<p>In the example from the <a href="#ordering">ordering</a> section, the chain would be:</p>
<div class="example-wrap"><pre class="language-plain"><code>MiddlewareCService {
next: MiddlewareBService {
next: MiddlewareAService { ... }
}
}
</code></pre></div><h3 id="servicereq"><a class="doc-anchor" href="#servicereq">§</a><code>Service&lt;Req&gt;</code></h3>
<p>A <a href="../dev/trait.Service.html" title="trait actix_web::dev::Service"><code>Service</code></a> <code>S</code> represents an asynchronous operation that turns a request of type <code>Req</code> into a
response of type <a href="../dev/trait.Service.html#associatedtype.Response" title="associated type actix_web::dev::Service::Response"><code>S::Response</code></a> or an error of type
<a href="../dev/trait.Service.html#associatedtype.Error" title="associated type actix_web::dev::Service::Error"><code>S::Error</code></a>. You can think of the service of being roughly:</p>
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested"></a><pre class="rust rust-example-rendered"><code><span class="kw">async fn</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, req: Req) -&gt; <span class="prelude-ty">Result</span>&lt;S::Response, S::Error&gt;</code></pre></div>
<p>In most cases the <a href="../dev/trait.Service.html" title="trait actix_web::dev::Service"><code>Service</code></a> implementation will, at some point, call the wrapped <a href="../dev/trait.Service.html" title="trait actix_web::dev::Service"><code>Service</code></a>
in its <a href="../dev/trait.Service.html#tymethod.call" title="method actix_web::dev::Service::call"><code>call</code></a> implementation.</p>
<p>Note that the <a href="../dev/trait.Service.html" title="trait actix_web::dev::Service"><code>Service</code></a>s created by <a href="../dev/trait.Transform.html#tymethod.new_transform" title="method actix_web::dev::Transform::new_transform"><code>new_transform</code></a> dont need to be <a href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send"><code>Send</code></a> or <a href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync"><code>Sync</code></a>.</p>
<h2 id="example"><a class="doc-anchor" href="#example">§</a>Example</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::{future::{ready, Ready, Future}, pin::Pin};
<span class="kw">use </span>actix_web::{
dev::{forward_ready, Service, ServiceRequest, ServiceResponse, Transform},
web, Error,
};
<span class="kw">pub struct </span>SayHi;
<span class="comment">// `S` - type of the next service
// `B` - type of response's body
</span><span class="kw">impl</span>&lt;S, B&gt; Transform&lt;S, ServiceRequest&gt; <span class="kw">for </span>SayHi
<span class="kw">where
</span>S: Service&lt;ServiceRequest, Response = ServiceResponse&lt;B&gt;, Error = Error&gt;,
S::Future: <span class="lifetime">'static</span>,
B: <span class="lifetime">'static</span>,
{
<span class="kw">type </span>Response = ServiceResponse&lt;B&gt;;
<span class="kw">type </span>Error = Error;
<span class="kw">type </span>InitError = ();
<span class="kw">type </span>Transform = SayHiMiddleware&lt;S&gt;;
<span class="kw">type </span>Future = Ready&lt;<span class="prelude-ty">Result</span>&lt;<span class="self">Self</span>::Transform, <span class="self">Self</span>::InitError&gt;&gt;;
<span class="kw">fn </span>new_transform(<span class="kw-2">&amp;</span><span class="self">self</span>, service: S) -&gt; <span class="self">Self</span>::Future {
ready(<span class="prelude-val">Ok</span>(SayHiMiddleware { service }))
}
}
<span class="kw">pub struct </span>SayHiMiddleware&lt;S&gt; {
<span class="doccomment">/// The next service to call
</span>service: S,
}
<span class="comment">// This future doesn't have the requirement of being `Send`.
// See: futures_util::future::LocalBoxFuture
</span><span class="kw">type </span>LocalBoxFuture&lt;T&gt; = Pin&lt;Box&lt;<span class="kw">dyn </span>Future&lt;Output = T&gt; + <span class="lifetime">'static</span>&gt;&gt;;
<span class="comment">// `S`: type of the wrapped service
// `B`: type of the body - try to be generic over the body where possible
</span><span class="kw">impl</span>&lt;S, B&gt; Service&lt;ServiceRequest&gt; <span class="kw">for </span>SayHiMiddleware&lt;S&gt;
<span class="kw">where
</span>S: Service&lt;ServiceRequest, Response = ServiceResponse&lt;B&gt;, Error = Error&gt;,
S::Future: <span class="lifetime">'static</span>,
B: <span class="lifetime">'static</span>,
{
<span class="kw">type </span>Response = ServiceResponse&lt;B&gt;;
<span class="kw">type </span>Error = Error;
<span class="kw">type </span>Future = LocalBoxFuture&lt;<span class="prelude-ty">Result</span>&lt;<span class="self">Self</span>::Response, <span class="self">Self</span>::Error&gt;&gt;;
<span class="comment">// This service is ready when its next service is ready
</span><span class="macro">forward_ready!</span>(service);
<span class="kw">fn </span>call(<span class="kw-2">&amp;</span><span class="self">self</span>, req: ServiceRequest) -&gt; <span class="self">Self</span>::Future {
<span class="macro">println!</span>(<span class="string">"Hi from start. You requested: {}"</span>, req.path());
<span class="comment">// A more complex middleware, could return an error or an early response here.
</span><span class="kw">let </span>fut = <span class="self">self</span>.service.call(req);
Box::pin(<span class="kw">async move </span>{
<span class="kw">let </span>res = fut.<span class="kw">await</span><span class="question-mark">?</span>;
<span class="macro">println!</span>(<span class="string">"Hi from response"</span>);
<span class="prelude-val">Ok</span>(res)
})
}
}
<span class="kw">let </span>app = App::new()
.wrap(SayHi)
.route(<span class="string">"/"</span>, web::get().to(|| <span class="kw">async </span>{ <span class="string">"Hello, middleware!" </span>}));</code></pre></div>
<h2 id="simpler-middleware"><a class="doc-anchor" href="#simpler-middleware">§</a>Simpler Middleware</h2>
<p>In many cases, you <em>can</em> actually use an async function via a helper that will provide a more
natural flow for your behavior.</p>
<p>The experimental <code>actix_web_lab</code> crate provides a <a href="https://docs.rs/actix-web-lab/latest/actix_web_lab/middleware/fn.from_fn.html"><code>from_fn</code></a> utility which allows
an async fn to be wrapped and used in the same way as other middleware. See the
<a href="https://docs.rs/actix-web-lab/latest/actix_web_lab/middleware/fn.from_fn.html"><code>from_fn</code></a> docs for more info and examples of its use.</p>
<p>While <a href="https://docs.rs/actix-web-lab/latest/actix_web_lab/middleware/fn.from_fn.html"><code>from_fn</code></a> is experimental currently, its likely this helper will graduate
to Actix Web in some form, so feedback is appreciated.</p>
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="struct" href="struct.Compat.html" title="struct actix_web::middleware::Compat">Compat</a></div><div class="desc docblock-short">Middleware for enabling any middleware to be used in <a href="../struct.Resource.html#method.wrap" title="method actix_web::Resource::wrap"><code>Resource::wrap</code></a>,
and <a href="struct.Condition.html" title="struct actix_web::middleware::Condition"><code>Condition</code></a>.</div></li><li><div class="item-name"><a class="struct" href="struct.Compress.html" title="struct actix_web::middleware::Compress">Compress</a><span class="stab portability" title="Available on crate feature `__compress` only"><code>__compress</code></span></div><div class="desc docblock-short">Middleware for compressing response payloads.</div></li><li><div class="item-name"><a class="struct" href="struct.Condition.html" title="struct actix_web::middleware::Condition">Condition</a></div><div class="desc docblock-short">Middleware for conditionally enabling other middleware.</div></li><li><div class="item-name"><a class="struct" href="struct.DefaultHeaders.html" title="struct actix_web::middleware::DefaultHeaders">DefaultHeaders</a></div><div class="desc docblock-short">Middleware for setting default response headers.</div></li><li><div class="item-name"><a class="struct" href="struct.ErrorHandlers.html" title="struct actix_web::middleware::ErrorHandlers">ErrorHandlers</a></div><div class="desc docblock-short">Middleware for registering custom status code based error handlers.</div></li><li><div class="item-name"><a class="struct" href="struct.Logger.html" title="struct actix_web::middleware::Logger">Logger</a></div><div class="desc docblock-short">Middleware for logging request and response summaries to the terminal.</div></li><li><div class="item-name"><a class="struct" href="struct.NormalizePath.html" title="struct actix_web::middleware::NormalizePath">NormalizePath</a></div><div class="desc docblock-short">Middleware for normalizing a requests path so that routes can be matched more flexibly.</div></li></ul><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="enum" href="enum.ErrorHandlerResponse.html" title="enum actix_web::middleware::ErrorHandlerResponse">ErrorHandlerResponse</a></div><div class="desc docblock-short">Return type for <a href="struct.ErrorHandlers.html" title="struct actix_web::middleware::ErrorHandlers"><code>ErrorHandlers</code></a> custom handlers.</div></li><li><div class="item-name"><a class="enum" href="enum.TrailingSlash.html" title="enum actix_web::middleware::TrailingSlash">TrailingSlash</a></div><div class="desc docblock-short">Determines the behavior of the <a href="struct.NormalizePath.html" title="struct actix_web::middleware::NormalizePath"><code>NormalizePath</code></a> middleware.</div></li></ul></section></div></main></body></html>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../actix_web/middleware/struct.Logger.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../actix_web/middleware/struct.Logger.html">../../../actix_web/middleware/struct.Logger.html</a>...</p>
<script>location.replace("../../../actix_web/middleware/struct.Logger.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../actix_web/middleware/enum.TrailingSlash.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../actix_web/middleware/enum.TrailingSlash.html">../../../actix_web/middleware/enum.TrailingSlash.html</a>...</p>
<script>location.replace("../../../actix_web/middleware/enum.TrailingSlash.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../actix_web/middleware/struct.NormalizePath.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../actix_web/middleware/struct.NormalizePath.html">../../../actix_web/middleware/struct.NormalizePath.html</a>...</p>
<script>location.replace("../../../actix_web/middleware/struct.NormalizePath.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"enum":["ErrorHandlerResponse","TrailingSlash"],"struct":["Compat","Compress","Condition","DefaultHeaders","ErrorHandlers","Logger","NormalizePath"]};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long