1
0
mirror of https://github.com/actix/actix-website synced 2025-06-30 16:54:27 +02:00

update stable docs

This commit is contained in:
Nikolay Kim
2018-07-26 10:53:41 -07:00
parent 0c2153597f
commit 90165ac1cc
2025 changed files with 116162 additions and 2957 deletions

View File

@ -35,13 +35,13 @@ checked in a case-sensitive manner.</p>
<a href="https://www.w3.org/TR/cors/#resource-processing-model">Resource Processing Model</a>.</p>
<p>Defaults to <code>All</code>.</p>
<p>Builder panics if supplied origin is not valid uri.</p>
</div><h4 id='method.allowed_methods' class="method"><span id='allowed_methods.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.allowed_methods' class='fnname'>allowed_methods</a>&lt;U, M&gt;(&amp;mut self, methods: U) -&gt; &amp;mut <a class="struct" href="../../../actix_web/middleware/cors/struct.CorsBuilder.html" title="struct actix_web::middleware::cors::CorsBuilder">CorsBuilder</a>&lt;S&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html" title="trait core::iter::traits::IntoIterator">IntoIterator</a>&lt;Item = M&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;<a class="struct" href="../../../actix_web/http/struct.Method.html" title="struct actix_web::http::Method">Method</a>: <a class="trait" href="https://docs.rs/http/0.1.7/http/convert/trait.HttpTryFrom.html" title="trait http::convert::HttpTryFrom">HttpTryFrom</a>&lt;M&gt;,&nbsp;</span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/actix_web/middleware/cors.rs.html#576-596' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Set a list of methods which the allowed origins are allowed to access
</div><h4 id='method.allowed_methods' class="method"><span id='allowed_methods.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.allowed_methods' class='fnname'>allowed_methods</a>&lt;U, M&gt;(&amp;mut self, methods: U) -&gt; &amp;mut <a class="struct" href="../../../actix_web/middleware/cors/struct.CorsBuilder.html" title="struct actix_web::middleware::cors::CorsBuilder">CorsBuilder</a>&lt;S&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html" title="trait core::iter::traits::IntoIterator">IntoIterator</a>&lt;Item = M&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;<a class="struct" href="../../../actix_web/http/struct.Method.html" title="struct actix_web::http::Method">Method</a>: <a class="trait" href="https://docs.rs/http/0.1.8/http/convert/trait.HttpTryFrom.html" title="trait http::convert::HttpTryFrom">HttpTryFrom</a>&lt;M&gt;,&nbsp;</span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/actix_web/middleware/cors.rs.html#576-596' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Set a list of methods which the allowed origins are allowed to access
for requests.</p>
<p>This is the <code>list of methods</code> in the
<a href="https://www.w3.org/TR/cors/#resource-processing-model">Resource Processing Model</a>.</p>
<p>Defaults to <code>[GET, HEAD, POST, OPTIONS, PUT, PATCH, DELETE]</code></p>
</div><h4 id='method.allowed_header' class="method"><span id='allowed_header.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.allowed_header' class='fnname'>allowed_header</a>&lt;H&gt;(&amp;mut self, header: H) -&gt; &amp;mut <a class="struct" href="../../../actix_web/middleware/cors/struct.CorsBuilder.html" title="struct actix_web::middleware::cors::CorsBuilder">CorsBuilder</a>&lt;S&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;<a class="struct" href="../../../actix_web/http/header/struct.HeaderName.html" title="struct actix_web::http::header::HeaderName">HeaderName</a>: <a class="trait" href="https://docs.rs/http/0.1.7/http/convert/trait.HttpTryFrom.html" title="trait http::convert::HttpTryFrom">HttpTryFrom</a>&lt;H&gt;,&nbsp;</span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/actix_web/middleware/cors.rs.html#599-617' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Set an allowed header</p>
</div><h4 id='method.allowed_headers' class="method"><span id='allowed_headers.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.allowed_headers' class='fnname'>allowed_headers</a>&lt;U, H&gt;(&amp;mut self, headers: U) -&gt; &amp;mut <a class="struct" href="../../../actix_web/middleware/cors/struct.CorsBuilder.html" title="struct actix_web::middleware::cors::CorsBuilder">CorsBuilder</a>&lt;S&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html" title="trait core::iter::traits::IntoIterator">IntoIterator</a>&lt;Item = H&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;<a class="struct" href="../../../actix_web/http/header/struct.HeaderName.html" title="struct actix_web::http::header::HeaderName">HeaderName</a>: <a class="trait" href="https://docs.rs/http/0.1.7/http/convert/trait.HttpTryFrom.html" title="trait http::convert::HttpTryFrom">HttpTryFrom</a>&lt;H&gt;,&nbsp;</span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/actix_web/middleware/cors.rs.html#630-654' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Set a list of header field names which can be used when
</div><h4 id='method.allowed_header' class="method"><span id='allowed_header.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.allowed_header' class='fnname'>allowed_header</a>&lt;H&gt;(&amp;mut self, header: H) -&gt; &amp;mut <a class="struct" href="../../../actix_web/middleware/cors/struct.CorsBuilder.html" title="struct actix_web::middleware::cors::CorsBuilder">CorsBuilder</a>&lt;S&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;<a class="struct" href="../../../actix_web/http/header/struct.HeaderName.html" title="struct actix_web::http::header::HeaderName">HeaderName</a>: <a class="trait" href="https://docs.rs/http/0.1.8/http/convert/trait.HttpTryFrom.html" title="trait http::convert::HttpTryFrom">HttpTryFrom</a>&lt;H&gt;,&nbsp;</span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/actix_web/middleware/cors.rs.html#599-617' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Set an allowed header</p>
</div><h4 id='method.allowed_headers' class="method"><span id='allowed_headers.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.allowed_headers' class='fnname'>allowed_headers</a>&lt;U, H&gt;(&amp;mut self, headers: U) -&gt; &amp;mut <a class="struct" href="../../../actix_web/middleware/cors/struct.CorsBuilder.html" title="struct actix_web::middleware::cors::CorsBuilder">CorsBuilder</a>&lt;S&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html" title="trait core::iter::traits::IntoIterator">IntoIterator</a>&lt;Item = H&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;<a class="struct" href="../../../actix_web/http/header/struct.HeaderName.html" title="struct actix_web::http::header::HeaderName">HeaderName</a>: <a class="trait" href="https://docs.rs/http/0.1.8/http/convert/trait.HttpTryFrom.html" title="trait http::convert::HttpTryFrom">HttpTryFrom</a>&lt;H&gt;,&nbsp;</span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/actix_web/middleware/cors.rs.html#630-654' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Set a list of header field names which can be used when
this resource is accessed by allowed origins.</p>
<p>If <code>All</code> is set, whatever is requested by the client in
<code>Access-Control-Request-Headers</code> will be echoed back in the
@ -49,7 +49,7 @@ this resource is accessed by allowed origins.</p>
<p>This is the <code>list of headers</code> in the
<a href="https://www.w3.org/TR/cors/#resource-processing-model">Resource Processing Model</a>.</p>
<p>Defaults to <code>All</code>.</p>
</div><h4 id='method.expose_headers' class="method"><span id='expose_headers.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.expose_headers' class='fnname'>expose_headers</a>&lt;U, H&gt;(&amp;mut self, headers: U) -&gt; &amp;mut <a class="struct" href="../../../actix_web/middleware/cors/struct.CorsBuilder.html" title="struct actix_web::middleware::cors::CorsBuilder">CorsBuilder</a>&lt;S&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html" title="trait core::iter::traits::IntoIterator">IntoIterator</a>&lt;Item = H&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;<a class="struct" href="../../../actix_web/http/header/struct.HeaderName.html" title="struct actix_web::http::header::HeaderName">HeaderName</a>: <a class="trait" href="https://docs.rs/http/0.1.7/http/convert/trait.HttpTryFrom.html" title="trait http::convert::HttpTryFrom">HttpTryFrom</a>&lt;H&gt;,&nbsp;</span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/actix_web/middleware/cors.rs.html#664-681' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Set a list of headers which are safe to expose to the API of a CORS API
</div><h4 id='method.expose_headers' class="method"><span id='expose_headers.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.expose_headers' class='fnname'>expose_headers</a>&lt;U, H&gt;(&amp;mut self, headers: U) -&gt; &amp;mut <a class="struct" href="../../../actix_web/middleware/cors/struct.CorsBuilder.html" title="struct actix_web::middleware::cors::CorsBuilder">CorsBuilder</a>&lt;S&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html" title="trait core::iter::traits::IntoIterator">IntoIterator</a>&lt;Item = H&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;<a class="struct" href="../../../actix_web/http/header/struct.HeaderName.html" title="struct actix_web::http::header::HeaderName">HeaderName</a>: <a class="trait" href="https://docs.rs/http/0.1.8/http/convert/trait.HttpTryFrom.html" title="trait http::convert::HttpTryFrom">HttpTryFrom</a>&lt;H&gt;,&nbsp;</span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/actix_web/middleware/cors.rs.html#664-681' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Set a list of headers which are safe to expose to the API of a CORS API
specification. This corresponds to the
<code>Access-Control-Expose-Headers</code> response header.</p>
<p>This is the <code>list of exposed headers</code> in the

View File

@ -1,4 +1,4 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `session` mod in crate `actix_web`."><meta name="keywords" content="rust, rustlang, rust-lang, session"><title>actix_web::middleware::session - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><p class='location'>Module session</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#traits">Traits</a></li></ul></div><p class='location'><a href='../../index.html'>actix_web</a>::<wbr><a href='../index.html'>middleware</a></p><script>window.sidebarCurrent = {name: 'session', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><input class="search-input" name="search" autocomplete="off" placeholder="Click or press S to search, ? for more options…" type="search"><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='in-band'>Module <a href='../../index.html'>actix_web</a>::<wbr><a href='../index.html'>middleware</a>::<wbr><a class="mod" href=''>session</a></span><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>&#x2212;</span>]</a></span><a class='srclink' href='../../../src/actix_web/middleware/session.rs.html#1-607' title='goto source code'>[src]</a></span></h1><div class='docblock'><p>User sessions.</p>
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `session` mod in crate `actix_web`."><meta name="keywords" content="rust, rustlang, rust-lang, session"><title>actix_web::middleware::session - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><p class='location'>Module session</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#traits">Traits</a></li></ul></div><p class='location'><a href='../../index.html'>actix_web</a>::<wbr><a href='../index.html'>middleware</a></p><script>window.sidebarCurrent = {name: 'session', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><input class="search-input" name="search" autocomplete="off" placeholder="Click or press S to search, ? for more options…" type="search"><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='in-band'>Module <a href='../../index.html'>actix_web</a>::<wbr><a href='../index.html'>middleware</a>::<wbr><a class="mod" href=''>session</a></span><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>&#x2212;</span>]</a></span><a class='srclink' href='../../../src/actix_web/middleware/session.rs.html#1-615' title='goto source code'>[src]</a></span></h1><div class='docblock'><p>User sessions.</p>
<p>Actix provides a general solution for session management. The
<a href="struct.SessionStorage.html"><strong>SessionStorage</strong></a>
middleware can be used with different backend types to store session

View File

@ -1,4 +1,4 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `CookieSessionBackend` struct in crate `actix_web`."><meta name="keywords" content="rust, rustlang, rust-lang, CookieSessionBackend"><title>actix_web::middleware::session::CookieSessionBackend - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><p class='location'>Struct CookieSessionBackend</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.signed">signed</a><a href="#method.private">private</a><a href="#method.path">path</a><a href="#method.name">name</a><a href="#method.domain">domain</a><a href="#method.secure">secure</a><a href="#method.same_site">same_site</a><a href="#method.max_age">max_age</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-Send">!Send</a><a href="#impl-Sync">!Sync</a></div></div><p class='location'><a href='../../index.html'>actix_web</a>::<wbr><a href='../index.html'>middleware</a>::<wbr><a href='index.html'>session</a></p><script>window.sidebarCurrent = {name: 'CookieSessionBackend', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><input class="search-input" name="search" autocomplete="off" placeholder="Click or press S to search, ? for more options…" type="search"><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='in-band'>Struct <a href='../../index.html'>actix_web</a>::<wbr><a href='../index.html'>middleware</a>::<wbr><a href='index.html'>session</a>::<wbr><a class="struct" href=''>CookieSessionBackend</a></span><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>&#x2212;</span>]</a></span><a class='srclink' href='../../../src/actix_web/middleware/session.rs.html#485' title='goto source code'>[src]</a></span></h1><div class="docblock type-decl"><pre class='rust struct'>pub struct CookieSessionBackend(_);</pre></div><div class='docblock'><p>Use cookies for session storage.</p>
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `CookieSessionBackend` struct in crate `actix_web`."><meta name="keywords" content="rust, rustlang, rust-lang, CookieSessionBackend"><title>actix_web::middleware::session::CookieSessionBackend - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><p class='location'>Struct CookieSessionBackend</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.signed">signed</a><a href="#method.private">private</a><a href="#method.path">path</a><a href="#method.name">name</a><a href="#method.domain">domain</a><a href="#method.secure">secure</a><a href="#method.http_only">http_only</a><a href="#method.same_site">same_site</a><a href="#method.max_age">max_age</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-Send">!Send</a><a href="#impl-Sync">!Sync</a></div></div><p class='location'><a href='../../index.html'>actix_web</a>::<wbr><a href='../index.html'>middleware</a>::<wbr><a href='index.html'>session</a></p><script>window.sidebarCurrent = {name: 'CookieSessionBackend', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><input class="search-input" name="search" autocomplete="off" placeholder="Click or press S to search, ? for more options…" type="search"><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='in-band'>Struct <a href='../../index.html'>actix_web</a>::<wbr><a href='../index.html'>middleware</a>::<wbr><a href='index.html'>session</a>::<wbr><a class="struct" href=''>CookieSessionBackend</a></span><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>&#x2212;</span>]</a></span><a class='srclink' href='../../../src/actix_web/middleware/session.rs.html#487' title='goto source code'>[src]</a></span></h1><div class="docblock type-decl"><pre class='rust struct'>pub struct CookieSessionBackend(_);</pre></div><div class='docblock'><p>Use cookies for session storage.</p>
<p><code>CookieSessionBackend</code> creates sessions which are limited to storing
fewer than 4000 bytes of data (as the payload must fit into a single
cookie). An Internal Server Error is generated if the session contains more
@ -30,18 +30,19 @@ cause troubles when reading cookie, if they are not properly percent encoded.</p
<h2 id='methods' class='small-section-header'>
Methods<a href='#methods' class='anchor'></a>
</h2>
<h3 id='impl' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="struct" href="../../../actix_web/middleware/session/struct.CookieSessionBackend.html" title="struct actix_web::middleware::session::CookieSessionBackend">CookieSessionBackend</a></code><a href='#impl' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/actix_web/middleware/session.rs.html#487-546' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.signed' class="method"><span id='signed.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.signed' class='fnname'>signed</a>(key: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -&gt; <a class="struct" href="../../../actix_web/middleware/session/struct.CookieSessionBackend.html" title="struct actix_web::middleware::session::CookieSessionBackend">CookieSessionBackend</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/actix_web/middleware/session.rs.html#491-496' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Construct new <em>signed</em> <code>CookieSessionBackend</code> instance.</p>
<h3 id='impl' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="struct" href="../../../actix_web/middleware/session/struct.CookieSessionBackend.html" title="struct actix_web::middleware::session::CookieSessionBackend">CookieSessionBackend</a></code><a href='#impl' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/actix_web/middleware/session.rs.html#489-554' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.signed' class="method"><span id='signed.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.signed' class='fnname'>signed</a>(key: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -&gt; <a class="struct" href="../../../actix_web/middleware/session/struct.CookieSessionBackend.html" title="struct actix_web::middleware::session::CookieSessionBackend">CookieSessionBackend</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/actix_web/middleware/session.rs.html#493-498' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Construct new <em>signed</em> <code>CookieSessionBackend</code> instance.</p>
<p>Panics if key length is less than 32 bytes.</p>
</div><h4 id='method.private' class="method"><span id='private.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.private' class='fnname'>private</a>(key: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -&gt; <a class="struct" href="../../../actix_web/middleware/session/struct.CookieSessionBackend.html" title="struct actix_web::middleware::session::CookieSessionBackend">CookieSessionBackend</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/actix_web/middleware/session.rs.html#501-506' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Construct new <em>private</em> <code>CookieSessionBackend</code> instance.</p>
</div><h4 id='method.private' class="method"><span id='private.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.private' class='fnname'>private</a>(key: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -&gt; <a class="struct" href="../../../actix_web/middleware/session/struct.CookieSessionBackend.html" title="struct actix_web::middleware::session::CookieSessionBackend">CookieSessionBackend</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/actix_web/middleware/session.rs.html#503-508' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Construct new <em>private</em> <code>CookieSessionBackend</code> instance.</p>
<p>Panics if key length is less than 32 bytes.</p>
</div><h4 id='method.path' class="method"><span id='path.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.path' class='fnname'>path</a>&lt;S:&nbsp;<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/string/struct.String.html" title="struct alloc::string::String">String</a>&gt;&gt;(self, value: S) -&gt; <a class="struct" href="../../../actix_web/middleware/session/struct.CookieSessionBackend.html" title="struct actix_web::middleware::session::CookieSessionBackend">CookieSessionBackend</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/actix_web/middleware/session.rs.html#509-512' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Sets the <code>path</code> field in the session cookie being built.</p>
</div><h4 id='method.name' class="method"><span id='name.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.name' class='fnname'>name</a>&lt;S:&nbsp;<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/string/struct.String.html" title="struct alloc::string::String">String</a>&gt;&gt;(self, value: S) -&gt; <a class="struct" href="../../../actix_web/middleware/session/struct.CookieSessionBackend.html" title="struct actix_web::middleware::session::CookieSessionBackend">CookieSessionBackend</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/actix_web/middleware/session.rs.html#515-518' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Sets the <code>name</code> field in the session cookie being built.</p>
</div><h4 id='method.domain' class="method"><span id='domain.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.domain' class='fnname'>domain</a>&lt;S:&nbsp;<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/string/struct.String.html" title="struct alloc::string::String">String</a>&gt;&gt;(self, value: S) -&gt; <a class="struct" href="../../../actix_web/middleware/session/struct.CookieSessionBackend.html" title="struct actix_web::middleware::session::CookieSessionBackend">CookieSessionBackend</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/actix_web/middleware/session.rs.html#521-524' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Sets the <code>domain</code> field in the session cookie being built.</p>
</div><h4 id='method.secure' class="method"><span id='secure.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.secure' class='fnname'>secure</a>(self, value: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -&gt; <a class="struct" href="../../../actix_web/middleware/session/struct.CookieSessionBackend.html" title="struct actix_web::middleware::session::CookieSessionBackend">CookieSessionBackend</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/actix_web/middleware/session.rs.html#530-533' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Sets the <code>secure</code> field in the session cookie being built.</p>
</div><h4 id='method.path' class="method"><span id='path.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.path' class='fnname'>path</a>&lt;S:&nbsp;<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/string/struct.String.html" title="struct alloc::string::String">String</a>&gt;&gt;(self, value: S) -&gt; <a class="struct" href="../../../actix_web/middleware/session/struct.CookieSessionBackend.html" title="struct actix_web::middleware::session::CookieSessionBackend">CookieSessionBackend</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/actix_web/middleware/session.rs.html#511-514' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Sets the <code>path</code> field in the session cookie being built.</p>
</div><h4 id='method.name' class="method"><span id='name.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.name' class='fnname'>name</a>&lt;S:&nbsp;<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/string/struct.String.html" title="struct alloc::string::String">String</a>&gt;&gt;(self, value: S) -&gt; <a class="struct" href="../../../actix_web/middleware/session/struct.CookieSessionBackend.html" title="struct actix_web::middleware::session::CookieSessionBackend">CookieSessionBackend</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/actix_web/middleware/session.rs.html#517-520' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Sets the <code>name</code> field in the session cookie being built.</p>
</div><h4 id='method.domain' class="method"><span id='domain.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.domain' class='fnname'>domain</a>&lt;S:&nbsp;<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/string/struct.String.html" title="struct alloc::string::String">String</a>&gt;&gt;(self, value: S) -&gt; <a class="struct" href="../../../actix_web/middleware/session/struct.CookieSessionBackend.html" title="struct actix_web::middleware::session::CookieSessionBackend">CookieSessionBackend</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/actix_web/middleware/session.rs.html#523-526' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Sets the <code>domain</code> field in the session cookie being built.</p>
</div><h4 id='method.secure' class="method"><span id='secure.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.secure' class='fnname'>secure</a>(self, value: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -&gt; <a class="struct" href="../../../actix_web/middleware/session/struct.CookieSessionBackend.html" title="struct actix_web::middleware::session::CookieSessionBackend">CookieSessionBackend</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/actix_web/middleware/session.rs.html#532-535' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Sets the <code>secure</code> field in the session cookie being built.</p>
<p>If the <code>secure</code> field is set, a cookie will only be transmitted when the
connection is secure - i.e. <code>https</code></p>
</div><h4 id='method.same_site' class="method"><span id='same_site.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.same_site' class='fnname'>same_site</a>(self, value: <a class="enum" href="https://docs.rs/cookie/0.10/cookie/draft/enum.SameSite.html" title="enum cookie::draft::SameSite">SameSite</a>) -&gt; <a class="struct" href="../../../actix_web/middleware/session/struct.CookieSessionBackend.html" title="struct actix_web::middleware::session::CookieSessionBackend">CookieSessionBackend</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/actix_web/middleware/session.rs.html#536-539' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Sets the <code>same_site</code> field in the session cookie being built.</p>
</div><h4 id='method.max_age' class="method"><span id='max_age.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.max_age' class='fnname'>max_age</a>(self, value: <a class="struct" href="https://doc.rust-lang.org/time/time/duration/struct.Duration.html" title="struct time::duration::Duration">Duration</a>) -&gt; <a class="struct" href="../../../actix_web/middleware/session/struct.CookieSessionBackend.html" title="struct actix_web::middleware::session::CookieSessionBackend">CookieSessionBackend</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/actix_web/middleware/session.rs.html#542-545' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Sets the <code>max-age</code> field in the session cookie being built.</p>
</div><h4 id='method.http_only' class="method"><span id='http_only.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.http_only' class='fnname'>http_only</a>(self, value: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -&gt; <a class="struct" href="../../../actix_web/middleware/session/struct.CookieSessionBackend.html" title="struct actix_web::middleware::session::CookieSessionBackend">CookieSessionBackend</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/actix_web/middleware/session.rs.html#538-541' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Sets the <code>http_only</code> field in the session cookie being built.</p>
</div><h4 id='method.same_site' class="method"><span id='same_site.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.same_site' class='fnname'>same_site</a>(self, value: <a class="enum" href="https://docs.rs/cookie/0.11/cookie/draft/enum.SameSite.html" title="enum cookie::draft::SameSite">SameSite</a>) -&gt; <a class="struct" href="../../../actix_web/middleware/session/struct.CookieSessionBackend.html" title="struct actix_web::middleware::session::CookieSessionBackend">CookieSessionBackend</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/actix_web/middleware/session.rs.html#544-547' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Sets the <code>same_site</code> field in the session cookie being built.</p>
</div><h4 id='method.max_age' class="method"><span id='max_age.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.max_age' class='fnname'>max_age</a>(self, value: <a class="struct" href="https://doc.rust-lang.org/time/time/duration/struct.Duration.html" title="struct time::duration::Duration">Duration</a>) -&gt; <a class="struct" href="../../../actix_web/middleware/session/struct.CookieSessionBackend.html" title="struct actix_web::middleware::session::CookieSessionBackend">CookieSessionBackend</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/actix_web/middleware/session.rs.html#550-553' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Sets the <code>max-age</code> field in the session cookie being built.</p>
</div></div>
<h2 id='synthetic-implementations' class='small-section-header'>
Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a>

View File

@ -19,7 +19,7 @@
Methods<a href='#methods' class='anchor'></a>
</h2>
<h3 id='impl' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="struct" href="../../actix_web/middleware/struct.DefaultHeaders.html" title="struct actix_web::middleware::DefaultHeaders">DefaultHeaders</a></code><a href='#impl' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/middleware/defaultheaders.rs.html#43-74' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.new' class="method"><span id='new.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.new' class='fnname'>new</a>() -&gt; <a class="struct" href="../../actix_web/middleware/struct.DefaultHeaders.html" title="struct actix_web::middleware::DefaultHeaders">DefaultHeaders</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/middleware/defaultheaders.rs.html#45-47' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Construct <code>DefaultHeaders</code> middleware.</p>
</div><h4 id='method.header' class="method"><span id='header.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.header' class='fnname'>header</a>&lt;K, V&gt;(self, key: K, value: V) -&gt; Self <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;<a class="struct" href="../../actix_web/http/header/struct.HeaderName.html" title="struct actix_web::http::header::HeaderName">HeaderName</a>: <a class="trait" href="https://docs.rs/http/0.1.7/http/convert/trait.HttpTryFrom.html" title="trait http::convert::HttpTryFrom">HttpTryFrom</a>&lt;K&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;<a class="struct" href="../../actix_web/http/header/struct.HeaderValue.html" title="struct actix_web::http::header::HeaderValue">HeaderValue</a>: <a class="trait" href="https://docs.rs/http/0.1.7/http/convert/trait.HttpTryFrom.html" title="trait http::convert::HttpTryFrom">HttpTryFrom</a>&lt;V&gt;,&nbsp;</span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/middleware/defaultheaders.rs.html#52-67' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Set a header.</p>
</div><h4 id='method.header' class="method"><span id='header.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.header' class='fnname'>header</a>&lt;K, V&gt;(self, key: K, value: V) -&gt; Self <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;<a class="struct" href="../../actix_web/http/header/struct.HeaderName.html" title="struct actix_web::http::header::HeaderName">HeaderName</a>: <a class="trait" href="https://docs.rs/http/0.1.8/http/convert/trait.HttpTryFrom.html" title="trait http::convert::HttpTryFrom">HttpTryFrom</a>&lt;K&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;<a class="struct" href="../../actix_web/http/header/struct.HeaderValue.html" title="struct actix_web::http::header::HeaderValue">HeaderValue</a>: <a class="trait" href="https://docs.rs/http/0.1.8/http/convert/trait.HttpTryFrom.html" title="trait http::convert::HttpTryFrom">HttpTryFrom</a>&lt;V&gt;,&nbsp;</span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/middleware/defaultheaders.rs.html#52-67' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Set a header.</p>
</div><h4 id='method.content_type' class="method"><span id='content_type.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.content_type' class='fnname'>content_type</a>(self) -&gt; Self</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/middleware/defaultheaders.rs.html#70-73' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Set <em>CONTENT-TYPE</em> header if response does not contain this header.</p>
</div></div>
<h2 id='implementations' class='small-section-header'>

View File

@ -8,7 +8,7 @@ Default <code>Logger</code> could be created with <code>default</code> method, i
default format:</p>
<div class='information'><div class='tooltip ignore'><span class='tooltiptext'>This example is not tested</span></div></div><pre class="rust rust-example-rendered ignore">
<span class="op">%</span><span class="ident">a</span> <span class="op">%</span><span class="ident">t</span> <span class="string">&quot;%r&quot;</span> <span class="op">%</span><span class="ident">s</span> <span class="op">%</span><span class="ident">b</span> <span class="string">&quot;%{Referer}i&quot;</span> <span class="string">&quot;%{User-Agent}i&quot;</span> <span class="op">%</span><span class="ident">T</span></pre>
<span class="op">%</span><span class="ident">a</span> <span class="string">&quot;%r&quot;</span> <span class="op">%</span><span class="ident">s</span> <span class="op">%</span><span class="ident">b</span> <span class="string">&quot;%{Referer}i&quot;</span> <span class="string">&quot;%{User-Agent}i&quot;</span> <span class="op">%</span><span class="ident">T</span></pre>
<pre class="rust rust-example-rendered">
<span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">env_logger</span>;
@ -50,7 +50,7 @@ default format:</p>
<div id='implementations-list'><h3 id='impl-Default' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="../../actix_web/middleware/struct.Logger.html" title="struct actix_web::middleware::Logger">Logger</a></code><a href='#impl-Default' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/middleware/logger.rs.html#93-105' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.default' class="method"><span id='default.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default' class='fnname'>default</a>() -&gt; <a class="struct" href="../../actix_web/middleware/struct.Logger.html" title="struct actix_web::middleware::Logger">Logger</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/middleware/logger.rs.html#99-104' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Create <code>Logger</code> middleware with format:</p>
<div class='information'><div class='tooltip ignore'><span class='tooltiptext'>This example is not tested</span></div></div><pre class="rust rust-example-rendered ignore">
<span class="op">%</span><span class="ident">a</span> <span class="op">%</span><span class="ident">t</span> <span class="string">&quot;%r&quot;</span> <span class="op">%</span><span class="ident">s</span> <span class="op">%</span><span class="ident">b</span> <span class="string">&quot;%{Referer}i&quot;</span> <span class="string">&quot;%{User-Agent}i&quot;</span> <span class="op">%</span><span class="ident">T</span></pre>
<span class="op">%</span><span class="ident">a</span> <span class="string">&quot;%r&quot;</span> <span class="op">%</span><span class="ident">s</span> <span class="op">%</span><span class="ident">b</span> <span class="string">&quot;%{Referer}i&quot;</span> <span class="string">&quot;%{User-Agent}i&quot;</span> <span class="op">%</span><span class="ident">T</span></pre>
</div></div><h3 id='impl-Middleware%3CS%3E' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;S&gt; <a class="trait" href="../../actix_web/middleware/trait.Middleware.html" title="trait actix_web::middleware::Middleware">Middleware</a>&lt;S&gt; for <a class="struct" href="../../actix_web/middleware/struct.Logger.html" title="struct actix_web::middleware::Logger">Logger</a></code><a href='#impl-Middleware%3CS%3E' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/middleware/logger.rs.html#123-135' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.start' class="method"><span id='start.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../actix_web/middleware/trait.Middleware.html#method.start' class='fnname'>start</a>(&amp;self, req: &amp;<a class="struct" href="../../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>&lt;S&gt;) -&gt; <a class="type" href="../../actix_web/error/type.Result.html" title="type actix_web::error::Result">Result</a>&lt;<a class="enum" href="../../actix_web/middleware/enum.Started.html" title="enum actix_web::middleware::Started">Started</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/middleware/logger.rs.html#124-129' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Method is called when request is ready. It may return future, which should resolve before next middleware get called. <a href="../../actix_web/middleware/trait.Middleware.html#method.start">Read more</a></p>
</div><h4 id='method.finish' class="method"><span id='finish.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../actix_web/middleware/trait.Middleware.html#method.finish' class='fnname'>finish</a>(&amp;self, req: &amp;<a class="struct" href="../../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>&lt;S&gt;, resp: &amp;<a class="struct" href="../../actix_web/struct.HttpResponse.html" title="struct actix_web::HttpResponse">HttpResponse</a>) -&gt; <a class="enum" href="../../actix_web/middleware/enum.Finished.html" title="enum actix_web::middleware::Finished">Finished</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/middleware/logger.rs.html#131-134' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Method is called after body stream get sent to peer.</p>
</div><h4 id='method.response' class="method"><span id='response.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../actix_web/middleware/trait.Middleware.html#method.response' class='fnname'>response</a>(&amp;self, req: &amp;<a class="struct" href="../../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>&lt;S&gt;, resp: <a class="struct" href="../../actix_web/struct.HttpResponse.html" title="struct actix_web::HttpResponse">HttpResponse</a>) -&gt; <a class="type" href="../../actix_web/error/type.Result.html" title="type actix_web::error::Result">Result</a>&lt;<a class="enum" href="../../actix_web/middleware/enum.Response.html" title="enum actix_web::middleware::Response">Response</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/middleware/mod.rs.html#60-62' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Method is called when handler returns response, but before sending http message to peer. <a href="../../actix_web/middleware/trait.Middleware.html#method.response">Read more</a></p>