1
0
mirror of https://github.com/actix/actix-extras.git synced 2024-11-24 07:53:00 +01:00

Deploying to gh-pages from @ bf41b4cd9c 🚀

This commit is contained in:
robjtede 2022-03-21 00:50:27 +00:00
parent 1e6d909be4
commit 5ba9e5a4a4
6 changed files with 34 additions and 37 deletions

View File

@ -6,18 +6,17 @@
<img src="https://actix.rs/img/logo.png" alt="logo"></div>
</a><h2 class="location"><a href="#">CookieContentSecurity</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#variants">Variants</a></h3><ul><li><a href="#variant.Private">Private</a></li><li><a href="#variant.Signed">Signed</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#trait-implementations">Trait Implementations</a></h3><ul><li><a href="#impl-Clone">Clone</a></li><li><a href="#impl-Copy">Copy</a></li><li><a href="#impl-Debug">Debug</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul><li><a href="#impl-RefUnwindSafe">RefUnwindSafe</a></li><li><a href="#impl-Send">Send</a></li><li><a href="#impl-Sync">Sync</a></li><li><a href="#impl-Unpin">Unpin</a></li><li><a href="#impl-UnwindSafe">UnwindSafe</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#blanket-implementations">Blanket Implementations</a></h3><ul><li><a href="#impl-Any">Any</a></li><li><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a></li><li><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a></li><li><a href="#impl-From%3CT%3E">From&lt;T&gt;</a></li><li><a href="#impl-Instrument">Instrument</a></li><li><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a></li><li><a href="#impl-Same%3CT%3E">Same&lt;T&gt;</a></li><li><a href="#impl-ToOwned">ToOwned</a></li><li><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a></li><li><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></li><li><a href="#impl-VZip%3CV%3E">VZip&lt;V&gt;</a></li><li><a href="#impl-WithSubscriber">WithSubscriber</a></li></ul></div></section><h2 class="location"><a href="index.html">In actix_session</a></h2><div id="sidebar-vars" data-name="CookieContentSecurity" data-ty="enum" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../actix_session/index.html">
<img src="https://actix.rs/img/logo.png" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
<h1 class="fqn"><span class="in-band">Enum <a href="index.html">actix_session</a>::<wbr><a class="enum" href="#">CookieContentSecurity</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/actix_session/middleware.rs.html#190-203">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><pre class="rust enum"><code>pub enum CookieContentSecurity {
<h1 class="fqn"><span class="in-band">Enum <a href="index.html">actix_session</a>::<wbr><a class="enum" href="#">CookieContentSecurity</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/actix_session/middleware.rs.html#190-202">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><pre class="rust enum"><code>pub enum CookieContentSecurity {
Private,
Signed,
}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Used by <a href="struct.SessionMiddlewareBuilder.html#method.cookie_content_security" title="SessionMiddlewareBuilder::cookie_content_security"><code>SessionMiddlewareBuilder::cookie_content_security</code></a> to determine how to secure
the content of the session cookie.</p>
</div></details><h2 id="variants" class="variants small-section-header">Variants<a href="#variants" class="anchor"></a></h2><h3 id="variant.Private" class="variant small-section-header"><a href="#variant.Private" class="anchor field"></a><code>Private</code></h3><div class="docblock"><p>The cookie content is encrypted when using <code>CookieContentSecurity::Private</code>.</p>
<p>Encryption guarantees confidentiality and integrity: the client cannot
tamper with the cookie content nor decode it, as long as the encryption key remains
confidential.</p>
<p>Encryption guarantees confidentiality and integrity: the client cannot tamper with the
cookie content nor decode it, as long as the encryption key remains confidential.</p>
</div><h3 id="variant.Signed" class="variant small-section-header"><a href="#variant.Signed" class="anchor field"></a><code>Signed</code></h3><div class="docblock"><p>The cookie content is signed when using <code>CookieContentSecurity::Signed</code>.</p>
<p>Signing guarantees integrity, but it doesnt ensure confidentiality: the client
cannot tamper with the cookie content, but they can read it.</p>
<p>Signing guarantees integrity, but it doesnt ensure confidentiality: the client cannot
tamper with the cookie content, but they can read it.</p>
</div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Clone" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/actix_session/middleware.rs.html#189">source</a></span><a href="#impl-Clone" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="enum" href="enum.CookieContentSecurity.html" title="enum actix_session::CookieContentSecurity">CookieContentSecurity</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clone" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/actix_session/middleware.rs.html#189">source</a></span><a href="#method.clone" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone" class="fnname">clone</a>(&amp;self) -&gt; <a class="enum" href="enum.CookieContentSecurity.html" title="enum actix_session::CookieContentSecurity">CookieContentSecurity</a></h4></section></summary><div class='docblock'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clone_from" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133">source</a></span><a href="#method.clone_from" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from" class="fnname">clone_from</a>(&amp;mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Self)</h4></section></summary><div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Debug" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/actix_session/middleware.rs.html#189">source</a></span><a href="#impl-Debug" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="enum.CookieContentSecurity.html" title="enum actix_session::CookieContentSecurity">CookieContentSecurity</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fmt" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/actix_session/middleware.rs.html#189">source</a></span><a href="#method.fmt" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4></section></summary><div class='docblock'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>

View File

@ -4,18 +4,18 @@
</nav>
<nav class="sidebar"><a class="sidebar-logo" href="../actix_session/index.html"><div class="logo-container">
<img src="https://actix.rs/img/logo.png" alt="logo"></div>
</a><h2 class="location"><a href="#">Crate actix_session</a></h2><div class="sidebar-elems"><div class="block"><ul><li class="version">Version 0.6.0</li><li><a id="all-types" href="all.html">All Items</a></li></div></ul><section><div class="block"><ul><li><a href="#modules">Modules</a></li><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#traits">Traits</a></li></ul></div></section><div id="sidebar-vars" data-name="actix_session" data-ty="mod" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../actix_session/index.html">
</a><h2 class="location"><a href="#">Crate actix_session</a></h2><div class="sidebar-elems"><div class="block"><ul><li class="version">Version 0.6.1</li><li><a id="all-types" href="all.html">All Items</a></li></div></ul><section><div class="block"><ul><li><a href="#modules">Modules</a></li><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#traits">Traits</a></li></ul></div></section><div id="sidebar-vars" data-name="actix_session" data-ty="mod" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../actix_session/index.html">
<img src="https://actix.rs/img/logo.png" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
<h1 class="fqn"><span class="in-band">Crate <a class="mod" href="#">actix_session</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/actix_session/lib.rs.html#1-586">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Session management for Actix Web.</p>
<p>The HTTP protocol, at a first glance, is stateless: the client sends a request, the server
parses its content, performs some processing and returns a response. The outcome is only
influenced by the provided inputs (i.e. the request content) and whatever state the server
queries while performing its processing.</p>
<p>Stateless systems are easier to reason about, but they are not quite as powerful as we need them to
be - e.g. how do you authenticate a user? The user would be forced to authenticate <strong>for every
single request</strong>. That is, for example, how Basic Authentication works. While it may work for
a machine user (i.e. an API client), it is impractical for a person—you do not want a login
prompt on every single page you navigate to!</p>
<p>Stateless systems are easier to reason about, but they are not quite as powerful as we need them
to be - e.g. how do you authenticate a user? The user would be forced to authenticate <strong>for
every single request</strong>. That is, for example, how Basic Authentication works. While it may
work for a machine user (i.e. an API client), it is impractical for a person—you do not want a
login prompt on every single page you navigate to!</p>
<p>There is a solution - <strong>sessions</strong>. Using sessions the server can attach state to a set of
requests coming from the same client. They are built on top of cookies - the server sets a
cookie in the HTTP response (<code>Set-Cookie</code> header), the client (e.g. the browser) will store the

View File

@ -88,7 +88,7 @@ each configuration parameter.</p>
<p>We expose knobs to change the default to suit your needs—i.e., if you know what you are doing,
we will not stop you. But being a subject-matter expert should not be a requirement to deploy
reasonably secure implementation of sessions.</p>
</div></details><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><div id="implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/actix_session/middleware.rs.html#228-255">source</a></span><a href="#impl" class="anchor"></a><h3 class="code-header in-band">impl&lt;Store:&nbsp;<a class="trait" href="storage/trait.SessionStore.html" title="trait actix_session::storage::SessionStore">SessionStore</a>&gt; <a class="struct" href="struct.SessionMiddleware.html" title="struct actix_session::SessionMiddleware">SessionMiddleware</a>&lt;Store&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.new" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/actix_session/middleware.rs.html#236-241">source</a></span><a href="#method.new" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.new" class="fnname">new</a>(store: Store, key: <a class="struct" href="https://docs.rs/cookie/0.16/cookie/secure/key/struct.Key.html" title="struct cookie::secure::key::Key">Key</a>) -&gt; Self</h4></section></summary><div class="docblock"><p>Use <a href="struct.SessionMiddleware.html#method.new" title="SessionMiddleware::new"><code>SessionMiddleware::new</code></a> to initialize the session framework using the default
</div></details><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><div id="implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/actix_session/middleware.rs.html#227-254">source</a></span><a href="#impl" class="anchor"></a><h3 class="code-header in-band">impl&lt;Store:&nbsp;<a class="trait" href="storage/trait.SessionStore.html" title="trait actix_session::storage::SessionStore">SessionStore</a>&gt; <a class="struct" href="struct.SessionMiddleware.html" title="struct actix_session::SessionMiddleware">SessionMiddleware</a>&lt;Store&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.new" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/actix_session/middleware.rs.html#235-240">source</a></span><a href="#method.new" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.new" class="fnname">new</a>(store: Store, key: <a class="struct" href="https://docs.rs/cookie/0.16/cookie/secure/key/struct.Key.html" title="struct cookie::secure::key::Key">Key</a>) -&gt; Self</h4></section></summary><div class="docblock"><p>Use <a href="struct.SessionMiddleware.html#method.new" title="SessionMiddleware::new"><code>SessionMiddleware::new</code></a> to initialize the session framework using the default
parameters.</p>
<p>To create a new instance of <a href="struct.SessionMiddleware.html" title="SessionMiddleware"><code>SessionMiddleware</code></a> you need to provide:</p>
<ul>
@ -96,7 +96,7 @@ parameters.</p>
<a href="storage/trait.SessionStore.html" title="SessionStore">`SessionStore</a>);</li>
<li>a secret key, to sign or encrypt the content of client-side session cookie.</li>
</ul>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.builder" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/actix_session/middleware.rs.html#249-254">source</a></span><a href="#method.builder" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.builder" class="fnname">builder</a>(store: Store, key: <a class="struct" href="https://docs.rs/cookie/0.16/cookie/secure/key/struct.Key.html" title="struct cookie::secure::key::Key">Key</a>) -&gt; <a class="struct" href="struct.SessionMiddlewareBuilder.html" title="struct actix_session::SessionMiddlewareBuilder">SessionMiddlewareBuilder</a>&lt;Store&gt;</h4></section></summary><div class="docblock"><p>A fluent API to configure <a href="struct.SessionMiddleware.html" title="SessionMiddleware"><code>SessionMiddleware</code></a>.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.builder" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/actix_session/middleware.rs.html#248-253">source</a></span><a href="#method.builder" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.builder" class="fnname">builder</a>(store: Store, key: <a class="struct" href="https://docs.rs/cookie/0.16/cookie/secure/key/struct.Key.html" title="struct cookie::secure::key::Key">Key</a>) -&gt; <a class="struct" href="struct.SessionMiddlewareBuilder.html" title="struct actix_session::SessionMiddlewareBuilder">SessionMiddlewareBuilder</a>&lt;Store&gt;</h4></section></summary><div class="docblock"><p>A fluent API to configure <a href="struct.SessionMiddleware.html" title="SessionMiddleware"><code>SessionMiddleware</code></a>.</p>
<p>It takes as input the two required inputs to create a new instance of <a href="struct.SessionMiddleware.html" title="SessionMiddleware"><code>SessionMiddleware</code></a>:</p>
<ul>
<li>an instance of the session storage backend you wish to use (i.e. an implementation of
@ -105,12 +105,12 @@ parameters.</p>
</ul>
</div></details></div></details></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Clone" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/actix_session/middleware.rs.html#110">source</a></span><a href="#impl-Clone" class="anchor"></a><h3 class="code-header in-band">impl&lt;Store:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> + <a class="trait" href="storage/trait.SessionStore.html" title="trait actix_session::storage::SessionStore">SessionStore</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="struct.SessionMiddleware.html" title="struct actix_session::SessionMiddleware">SessionMiddleware</a>&lt;Store&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clone" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/actix_session/middleware.rs.html#110">source</a></span><a href="#method.clone" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone" class="fnname">clone</a>(&amp;self) -&gt; <a class="struct" href="struct.SessionMiddleware.html" title="struct actix_session::SessionMiddleware">SessionMiddleware</a>&lt;Store&gt;</h4></section></summary><div class='docblock'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clone_from" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133">source</a></span><a href="#method.clone_from" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from" class="fnname">clone_from</a>(&amp;mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Self)</h4></section></summary><div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Transform%3CS%2C%20ServiceRequest%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/actix_session/middleware.rs.html#372-392">source</a></span><a href="#impl-Transform%3CS%2C%20ServiceRequest%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;S, B, Store&gt; Transform&lt;S, ServiceRequest&gt; for <a class="struct" href="struct.SessionMiddleware.html" title="struct actix_session::SessionMiddleware">SessionMiddleware</a>&lt;Store&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: Service&lt;ServiceRequest, Response = ServiceResponse&lt;B&gt;, Error = Error&gt; + 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;S::Future: 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;B: MessageBody + 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;Store: <a class="trait" href="storage/trait.SessionStore.html" title="trait actix_session::storage::SessionStore">SessionStore</a> + 'static,&nbsp;</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Response" class="type trait-impl has-srclink"><a href="#associatedtype.Response" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.Response" class="associatedtype">Response</a> = ServiceResponse&lt;B&gt;</h4></section></summary><div class='docblock'><p>Responses produced by the service.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Transform%3CS%2C%20ServiceRequest%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/actix_session/middleware.rs.html#371-391">source</a></span><a href="#impl-Transform%3CS%2C%20ServiceRequest%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;S, B, Store&gt; Transform&lt;S, ServiceRequest&gt; for <a class="struct" href="struct.SessionMiddleware.html" title="struct actix_session::SessionMiddleware">SessionMiddleware</a>&lt;Store&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: Service&lt;ServiceRequest, Response = ServiceResponse&lt;B&gt;, Error = Error&gt; + 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;S::Future: 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;B: MessageBody + 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;Store: <a class="trait" href="storage/trait.SessionStore.html" title="trait actix_session::storage::SessionStore">SessionStore</a> + 'static,&nbsp;</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Response" class="type trait-impl has-srclink"><a href="#associatedtype.Response" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.Response" class="associatedtype">Response</a> = ServiceResponse&lt;B&gt;</h4></section></summary><div class='docblock'><p>Responses produced by the service.</p>
</div></details><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error" class="type trait-impl has-srclink"><a href="#associatedtype.Error" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a> = Error</h4></section></summary><div class='docblock'><p>Errors produced by the service.</p>
</div></details><details class="rustdoc-toggle" open><summary><section id="associatedtype.Transform" class="type trait-impl has-srclink"><a href="#associatedtype.Transform" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.Transform" class="associatedtype">Transform</a> = InnerSessionMiddleware&lt;S, Store&gt;</h4></section></summary><div class='docblock'><p>The <code>TransformService</code> value created by this factory</p>
</div></details><details class="rustdoc-toggle" open><summary><section id="associatedtype.InitError" class="type trait-impl has-srclink"><a href="#associatedtype.InitError" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.InitError" class="associatedtype">InitError</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a></h4></section></summary><div class='docblock'><p>Errors produced while building a transform service.</p>
</div></details><details class="rustdoc-toggle" open><summary><section id="associatedtype.Future" class="type trait-impl has-srclink"><a href="#associatedtype.Future" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.Future" class="associatedtype">Future</a> = Ready&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::Transform, Self::InitError&gt;&gt;</h4></section></summary><div class='docblock'><p>The future response value.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.new_transform" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/actix_session/middleware.rs.html#385-391">source</a></span><a href="#method.new_transform" class="anchor"></a><h4 class="code-header">fn <a class="fnname">new_transform</a>(&amp;self, service: S) -&gt; Self::Future</h4></section></summary><div class='docblock'><p>Creates and returns a new Transform component, asynchronously</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.new_transform" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/actix_session/middleware.rs.html#384-390">source</a></span><a href="#method.new_transform" class="anchor"></a><h4 class="code-header">fn <a class="fnname">new_transform</a>(&amp;self, service: S) -&gt; Self::Future</h4></section></summary><div class='docblock'><p>Creates and returns a new Transform component, asynchronously</p>
</div></details></div></details></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><section id="impl-RefUnwindSafe" class="impl has-srclink"><a href="#impl-RefUnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl&lt;Store&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="struct" href="struct.SessionMiddleware.html" title="struct actix_session::SessionMiddleware">SessionMiddleware</a>&lt;Store&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Store: <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>,&nbsp;</span></h3></section><section id="impl-Send" class="impl has-srclink"><a href="#impl-Send" class="anchor"></a><h3 class="code-header in-band">impl&lt;Store&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="struct" href="struct.SessionMiddleware.html" title="struct actix_session::SessionMiddleware">SessionMiddleware</a>&lt;Store&gt;</h3></section><section id="impl-Sync" class="impl has-srclink"><a href="#impl-Sync" class="anchor"></a><h3 class="code-header in-band">impl&lt;Store&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="struct" href="struct.SessionMiddleware.html" title="struct actix_session::SessionMiddleware">SessionMiddleware</a>&lt;Store&gt;</h3></section><section id="impl-Unpin" class="impl has-srclink"><a href="#impl-Unpin" class="anchor"></a><h3 class="code-header in-band">impl&lt;Store&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="struct" href="struct.SessionMiddleware.html" title="struct actix_session::SessionMiddleware">SessionMiddleware</a>&lt;Store&gt;</h3></section><section id="impl-UnwindSafe" class="impl has-srclink"><a href="#impl-UnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl&lt;Store&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="struct" href="struct.SessionMiddleware.html" title="struct actix_session::SessionMiddleware">SessionMiddleware</a>&lt;Store&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Store: <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>,&nbsp;</span></h3></section></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Any" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#132-136">source</a></span><a href="#impl-Any" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#133">source</a></span><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="fnname">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'><p>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></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#209-214">source</a></span><a href="#impl-Borrow%3CT%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211">source</a></span><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="fnname">borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>T</h4></section></summary><div class='docblock'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-222">source</a></span><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219">source</a></span><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="fnname">borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T</h4></section></summary><div class='docblock'><p>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></p>

View File

@ -6,26 +6,26 @@
<img src="https://actix.rs/img/logo.png" alt="logo"></div>
</a><h2 class="location"><a href="#">SessionMiddlewareBuilder</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#implementations">Methods</a></h3><ul><li><a href="#method.build">build</a></li><li><a href="#method.cookie_content_security">cookie_content_security</a></li><li><a href="#method.cookie_domain">cookie_domain</a></li><li><a href="#method.cookie_http_only">cookie_http_only</a></li><li><a href="#method.cookie_name">cookie_name</a></li><li><a href="#method.cookie_path">cookie_path</a></li><li><a href="#method.cookie_same_site">cookie_same_site</a></li><li><a href="#method.cookie_secure">cookie_secure</a></li><li><a href="#method.session_length">session_length</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul><li><a href="#impl-RefUnwindSafe">RefUnwindSafe</a></li><li><a href="#impl-Send">!Send</a></li><li><a href="#impl-Sync">!Sync</a></li><li><a href="#impl-Unpin">Unpin</a></li><li><a href="#impl-UnwindSafe">UnwindSafe</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#blanket-implementations">Blanket Implementations</a></h3><ul><li><a href="#impl-Any">Any</a></li><li><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a></li><li><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a></li><li><a href="#impl-From%3CT%3E">From&lt;T&gt;</a></li><li><a href="#impl-Instrument">Instrument</a></li><li><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a></li><li><a href="#impl-Same%3CT%3E">Same&lt;T&gt;</a></li><li><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a></li><li><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></li><li><a href="#impl-VZip%3CV%3E">VZip&lt;V&gt;</a></li><li><a href="#impl-WithSubscriber">WithSubscriber</a></li></ul></div></section><h2 class="location"><a href="index.html">In actix_session</a></h2><div id="sidebar-vars" data-name="SessionMiddlewareBuilder" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../actix_session/index.html">
<img src="https://actix.rs/img/logo.png" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
<h1 class="fqn"><span class="in-band">Struct <a href="index.html">actix_session</a>::<wbr><a class="struct" href="#">SessionMiddlewareBuilder</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/actix_session/middleware.rs.html#260-263">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><pre class="rust struct"><code>pub struct SessionMiddlewareBuilder&lt;Store:&nbsp;<a class="trait" href="storage/trait.SessionStore.html" title="trait actix_session::storage::SessionStore">SessionStore</a>&gt; { /* private fields */ }</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A fluent builder to construct a <a href="struct.SessionMiddleware.html" title="SessionMiddleware"><code>SessionMiddleware</code></a> instance with custom configuration
<h1 class="fqn"><span class="in-band">Struct <a href="index.html">actix_session</a>::<wbr><a class="struct" href="#">SessionMiddlewareBuilder</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/actix_session/middleware.rs.html#259-262">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><pre class="rust struct"><code>pub struct SessionMiddlewareBuilder&lt;Store:&nbsp;<a class="trait" href="storage/trait.SessionStore.html" title="trait actix_session::storage::SessionStore">SessionStore</a>&gt; { /* private fields */ }</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A fluent builder to construct a <a href="struct.SessionMiddleware.html" title="SessionMiddleware"><code>SessionMiddleware</code></a> instance with custom configuration
parameters.</p>
</div></details><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><div id="implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/actix_session/middleware.rs.html#265-370">source</a></span><a href="#impl" class="anchor"></a><h3 class="code-header in-band">impl&lt;Store:&nbsp;<a class="trait" href="storage/trait.SessionStore.html" title="trait actix_session::storage::SessionStore">SessionStore</a>&gt; <a class="struct" href="struct.SessionMiddlewareBuilder.html" title="struct actix_session::SessionMiddlewareBuilder">SessionMiddlewareBuilder</a>&lt;Store&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.cookie_name" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/actix_session/middleware.rs.html#269-272">source</a></span><a href="#method.cookie_name" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.cookie_name" class="fnname">cookie_name</a>(self, name: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>) -&gt; Self</h4></section></summary><div class="docblock"><p>Set the name of the cookie used to store the session ID.</p>
</div></details><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><div id="implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/actix_session/middleware.rs.html#264-369">source</a></span><a href="#impl" class="anchor"></a><h3 class="code-header in-band">impl&lt;Store:&nbsp;<a class="trait" href="storage/trait.SessionStore.html" title="trait actix_session::storage::SessionStore">SessionStore</a>&gt; <a class="struct" href="struct.SessionMiddlewareBuilder.html" title="struct actix_session::SessionMiddlewareBuilder">SessionMiddlewareBuilder</a>&lt;Store&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.cookie_name" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/actix_session/middleware.rs.html#268-271">source</a></span><a href="#method.cookie_name" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.cookie_name" class="fnname">cookie_name</a>(self, name: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>) -&gt; Self</h4></section></summary><div class="docblock"><p>Set the name of the cookie used to store the session ID.</p>
<p>Defaults to <code>id</code>.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.cookie_secure" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/actix_session/middleware.rs.html#280-283">source</a></span><a href="#method.cookie_secure" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.cookie_secure" class="fnname">cookie_secure</a>(self, secure: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -&gt; Self</h4></section></summary><div class="docblock"><p>Set the <code>Secure</code> attribute for the cookie used to store the session ID.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.cookie_secure" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/actix_session/middleware.rs.html#279-282">source</a></span><a href="#method.cookie_secure" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.cookie_secure" class="fnname">cookie_secure</a>(self, secure: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -&gt; Self</h4></section></summary><div class="docblock"><p>Set the <code>Secure</code> attribute for the cookie used to store the session ID.</p>
<p>If the cookie is set as secure, it will only be transmitted when the connection is secure
(using <code>https</code>).</p>
<p>Default is <code>true</code>.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.session_length" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/actix_session/middleware.rs.html#289-303">source</a></span><a href="#method.session_length" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.session_length" class="fnname">session_length</a>(self, session_length: <a class="enum" href="enum.SessionLength.html" title="enum actix_session::SessionLength">SessionLength</a>) -&gt; Self</h4></section></summary><div class="docblock"><p>Determine how long a session should last - check out <a href="enum.SessionLength.html" title="SessionLength"><code>SessionLength</code></a>s documentation for
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.session_length" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/actix_session/middleware.rs.html#288-302">source</a></span><a href="#method.session_length" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.session_length" class="fnname">session_length</a>(self, session_length: <a class="enum" href="enum.SessionLength.html" title="enum actix_session::SessionLength">SessionLength</a>) -&gt; Self</h4></section></summary><div class="docblock"><p>Determine how long a session should last - check out <a href="enum.SessionLength.html" title="SessionLength"><code>SessionLength</code></a>s documentation for
more details on the available options.</p>
<p>Default is <a href="enum.SessionLength.html#variant.BrowserSession" title="SessionLength::BrowserSession"><code>SessionLength::BrowserSession</code></a>.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.cookie_same_site" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/actix_session/middleware.rs.html#308-311">source</a></span><a href="#method.cookie_same_site" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.cookie_same_site" class="fnname">cookie_same_site</a>(self, same_site: <a class="enum" href="https://docs.rs/cookie/0.16/cookie/draft/enum.SameSite.html" title="enum cookie::draft::SameSite">SameSite</a>) -&gt; Self</h4></section></summary><div class="docblock"><p>Set the <code>SameSite</code> attribute for the cookie used to store the session ID.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.cookie_same_site" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/actix_session/middleware.rs.html#307-310">source</a></span><a href="#method.cookie_same_site" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.cookie_same_site" class="fnname">cookie_same_site</a>(self, same_site: <a class="enum" href="https://docs.rs/cookie/0.16/cookie/draft/enum.SameSite.html" title="enum cookie::draft::SameSite">SameSite</a>) -&gt; Self</h4></section></summary><div class="docblock"><p>Set the <code>SameSite</code> attribute for the cookie used to store the session ID.</p>
<p>By default, the attribute is set to <code>Lax</code>.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.cookie_path" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/actix_session/middleware.rs.html#316-319">source</a></span><a href="#method.cookie_path" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.cookie_path" class="fnname">cookie_path</a>(self, path: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>) -&gt; Self</h4></section></summary><div class="docblock"><p>Set the <code>Path</code> attribute for the cookie used to store the session ID.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.cookie_path" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/actix_session/middleware.rs.html#315-318">source</a></span><a href="#method.cookie_path" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.cookie_path" class="fnname">cookie_path</a>(self, path: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>) -&gt; Self</h4></section></summary><div class="docblock"><p>Set the <code>Path</code> attribute for the cookie used to store the session ID.</p>
<p>By default, the attribute is set to <code>/</code>.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.cookie_domain" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/actix_session/middleware.rs.html#327-330">source</a></span><a href="#method.cookie_domain" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.cookie_domain" class="fnname">cookie_domain</a>(self, domain: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>&gt;) -&gt; Self</h4></section></summary><div class="docblock"><p>Set the <code>Domain</code> attribute for the cookie used to store the session ID.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.cookie_domain" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/actix_session/middleware.rs.html#326-329">source</a></span><a href="#method.cookie_domain" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.cookie_domain" class="fnname">cookie_domain</a>(self, domain: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>&gt;) -&gt; Self</h4></section></summary><div class="docblock"><p>Set the <code>Domain</code> attribute for the cookie used to store the session ID.</p>
<p>Use <code>None</code> to leave the attribute unspecified. If unspecified, the attribute defaults
to the same host that set the cookie, excluding subdomains.</p>
<p>By default, the attribute is left unspecified.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.cookie_content_security" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/actix_session/middleware.rs.html#346-349">source</a></span><a href="#method.cookie_content_security" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.cookie_content_security" class="fnname">cookie_content_security</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;content_security: <a class="enum" href="enum.CookieContentSecurity.html" title="enum actix_session::CookieContentSecurity">CookieContentSecurity</a><br>) -&gt; Self</h4></section></summary><div class="docblock"><p>Choose how the session cookie content should be secured.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.cookie_content_security" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/actix_session/middleware.rs.html#345-348">source</a></span><a href="#method.cookie_content_security" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.cookie_content_security" class="fnname">cookie_content_security</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;content_security: <a class="enum" href="enum.CookieContentSecurity.html" title="enum actix_session::CookieContentSecurity">CookieContentSecurity</a><br>) -&gt; Self</h4></section></summary><div class="docblock"><p>Choose how the session cookie content should be secured.</p>
<ul>
<li><a href="enum.CookieContentSecurity.html#variant.Private" title="CookieContentSecurity::Private"><code>CookieContentSecurity::Private</code></a> selects encrypted cookie content.</li>
<li><a href="enum.CookieContentSecurity.html#variant.Signed" title="CookieContentSecurity::Signed"><code>CookieContentSecurity::Signed</code></a> selects signed cookie content.</li>
@ -38,11 +38,11 @@ key by accident, regardless of <a href="storage/trait.SessionStore.html" title="
to be encrypted—the whole session state is embedded in the cookie! If you are using
Redis-based storage, signed is more than enough - the cookie content is just a unique
tamper-proof session key.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.cookie_http_only" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/actix_session/middleware.rs.html#357-360">source</a></span><a href="#method.cookie_http_only" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.cookie_http_only" class="fnname">cookie_http_only</a>(self, http_only: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -&gt; Self</h4></section></summary><div class="docblock"><p>Set the <code>HttpOnly</code> attribute for the cookie used to store the session ID.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.cookie_http_only" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/actix_session/middleware.rs.html#356-359">source</a></span><a href="#method.cookie_http_only" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.cookie_http_only" class="fnname">cookie_http_only</a>(self, http_only: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -&gt; Self</h4></section></summary><div class="docblock"><p>Set the <code>HttpOnly</code> attribute for the cookie used to store the session ID.</p>
<p>If the cookie is set as <code>HttpOnly</code>, it will not be visible to any JavaScript snippets
running in the browser.</p>
<p>Default is <code>true</code>.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.build" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/actix_session/middleware.rs.html#364-369">source</a></span><a href="#method.build" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.build" class="fnname">build</a>(self) -&gt; <a class="struct" href="struct.SessionMiddleware.html" title="struct actix_session::SessionMiddleware">SessionMiddleware</a>&lt;Store&gt;</h4></section></summary><div class="docblock"><p>Finalise the builder and return a <a href="struct.SessionMiddleware.html" title="SessionMiddleware"><code>SessionMiddleware</code></a> instance.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.build" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/actix_session/middleware.rs.html#363-368">source</a></span><a href="#method.build" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.build" class="fnname">build</a>(self) -&gt; <a class="struct" href="struct.SessionMiddleware.html" title="struct actix_session::SessionMiddleware">SessionMiddleware</a>&lt;Store&gt;</h4></section></summary><div class="docblock"><p>Finalise the builder and return a <a href="struct.SessionMiddleware.html" title="SessionMiddleware"><code>SessionMiddleware</code></a> instance.</p>
</div></details></div></details></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><section id="impl-RefUnwindSafe" class="impl has-srclink"><a href="#impl-RefUnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl&lt;Store&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="struct" href="struct.SessionMiddlewareBuilder.html" title="struct actix_session::SessionMiddlewareBuilder">SessionMiddlewareBuilder</a>&lt;Store&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Store: <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>,&nbsp;</span></h3></section><section id="impl-Send" class="impl has-srclink"><a href="#impl-Send" class="anchor"></a><h3 class="code-header in-band">impl&lt;Store&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="struct" href="struct.SessionMiddlewareBuilder.html" title="struct actix_session::SessionMiddlewareBuilder">SessionMiddlewareBuilder</a>&lt;Store&gt;</h3></section><section id="impl-Sync" class="impl has-srclink"><a href="#impl-Sync" class="anchor"></a><h3 class="code-header in-band">impl&lt;Store&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="struct" href="struct.SessionMiddlewareBuilder.html" title="struct actix_session::SessionMiddlewareBuilder">SessionMiddlewareBuilder</a>&lt;Store&gt;</h3></section><section id="impl-Unpin" class="impl has-srclink"><a href="#impl-Unpin" class="anchor"></a><h3 class="code-header in-band">impl&lt;Store&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="struct" href="struct.SessionMiddlewareBuilder.html" title="struct actix_session::SessionMiddlewareBuilder">SessionMiddlewareBuilder</a>&lt;Store&gt;</h3></section><section id="impl-UnwindSafe" class="impl has-srclink"><a href="#impl-UnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl&lt;Store&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="struct" href="struct.SessionMiddlewareBuilder.html" title="struct actix_session::SessionMiddlewareBuilder">SessionMiddlewareBuilder</a>&lt;Store&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Store: <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>,&nbsp;</span></h3></section></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Any" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#132-136">source</a></span><a href="#impl-Any" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#133">source</a></span><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="fnname">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'><p>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></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#209-214">source</a></span><a href="#impl-Borrow%3CT%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211">source</a></span><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="fnname">borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>T</h4></section></summary><div class='docblock'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-222">source</a></span><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219">source</a></span><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="fnname">borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T</h4></section></summary><div class='docblock'><p>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></p>

View File

@ -598,11 +598,11 @@
<span class="doccomment">//! influenced by the provided inputs (i.e. the request content) and whatever state the server</span>
<span class="doccomment">//! queries while performing its processing.</span>
<span class="doccomment">//!</span>
<span class="doccomment">//! Stateless systems are easier to reason about, but they are not quite as powerful as we need them to</span>
<span class="doccomment">//! be - e.g. how do you authenticate a user? The user would be forced to authenticate **for every</span>
<span class="doccomment">//! single request**. That is, for example, how &#39;Basic&#39; Authentication works. While it may work for</span>
<span class="doccomment">//! a machine user (i.e. an API client), it is impractical for a person—you do not want a login</span>
<span class="doccomment">//! prompt on every single page you navigate to!</span>
<span class="doccomment">//! Stateless systems are easier to reason about, but they are not quite as powerful as we need them</span>
<span class="doccomment">//! to be - e.g. how do you authenticate a user? The user would be forced to authenticate **for</span>
<span class="doccomment">//! every single request**. That is, for example, how &#39;Basic&#39; Authentication works. While it may</span>
<span class="doccomment">//! work for a machine user (i.e. an API client), it is impractical for a person—you do not want a</span>
<span class="doccomment">//! login prompt on every single page you navigate to!</span>
<span class="doccomment">//!</span>
<span class="doccomment">//! There is a solution - **sessions**. Using sessions the server can attach state to a set of</span>
<span class="doccomment">//! requests coming from the same client. They are built on top of cookies - the server sets a</span>

View File

@ -654,7 +654,6 @@
<span id="647">647</span>
<span id="648">648</span>
<span id="649">649</span>
<span id="650">650</span>
</pre><pre class="rust"><code><span class="kw">use</span> <span class="ident">std</span>::{<span class="ident">collections::HashMap</span>, <span class="ident">convert::TryInto</span>, <span class="ident">fmt</span>, <span class="ident">future::Future</span>, <span class="ident">pin::Pin</span>, <span class="ident">rc::Rc</span>};
<span class="kw">use</span> <span class="ident">actix_utils::future</span>::{<span class="ident">ready</span>, <span class="ident">Ready</span>};
@ -847,15 +846,14 @@
<span class="kw">pub</span> <span class="kw">enum</span> <span class="ident">CookieContentSecurity</span> {
<span class="doccomment">/// The cookie content is encrypted when using `CookieContentSecurity::Private`.</span>
<span class="doccomment">///</span>
<span class="doccomment">/// Encryption guarantees confidentiality and integrity: the client cannot</span>
<span class="doccomment">/// tamper with the cookie content nor decode it, as long as the encryption key remains</span>
<span class="doccomment">/// confidential.</span>
<span class="doccomment">/// Encryption guarantees confidentiality and integrity: the client cannot tamper with the</span>
<span class="doccomment">/// cookie content nor decode it, as long as the encryption key remains confidential.</span>
<span class="ident">Private</span>,
<span class="doccomment">/// The cookie content is signed when using `CookieContentSecurity::Signed`.</span>
<span class="doccomment">///</span>
<span class="doccomment">/// Signing guarantees integrity, but it doesn&#39;t ensure confidentiality: the client</span>
<span class="doccomment">/// cannot tamper with the cookie content, but they can read it.</span>
<span class="doccomment">/// Signing guarantees integrity, but it doesn&#39;t ensure confidentiality: the client cannot</span>
<span class="doccomment">/// tamper with the cookie content, but they can read it.</span>
<span class="ident">Signed</span>,
}