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

109 lines
49 KiB
HTML
Raw Normal View History

<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="A middleware for session management in Actix Web applications."><meta name="keywords" content="rust, rustlang, rust-lang, SessionMiddleware"><title>SessionMiddleware in actix_session - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceSerif4-Regular-1f7d512b176f0f72.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceSerif4-Bold-124a1ca42af929b6.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../static.files/rustdoc-c722f88035d2892e.css" id="mainThemeStyle"><link rel="stylesheet" id="themeStyle" href="../static.files/light-4743e13df3dfe8c4.css"><link rel="stylesheet" disabled href="../static.files/dark-0e1b889528bd466b.css"><link rel="stylesheet" disabled href="../static.files/ayu-65289d5d067c7c66.css"><script id="default-settings" ></script><script src="../static.files/storage-d43fa987303ecbbb.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-bc1b32400f872ddb.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-13285aec31fa243e.css"></noscript><link rel="icon" href="https://actix.rs/favicon.ico"></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="logo-container" href="../actix_session/index.html"><img src="https://actix.rs/img/logo.png" alt="logo"></a><h2></h2></nav><nav class="sidebar"><a class="logo-container" href="../actix_session/index.html">
<img src="https://actix.rs/img/logo.png" alt="logo"></a><h2 class="location"><a href="#">SessionMiddleware</a></h2><div class="sidebar-elems"><section><h3><a href="#implementations">Methods</a></h3><ul class="block"><li><a href="#method.builder">builder</a></li><li><a href="#method.new">new</a></li></ul><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block"><li><a href="#impl-Clone-for-SessionMiddleware%3CStore%3E">Clone</a></li><li><a href="#impl-Transform%3CS%2C%20ServiceRequest%3E-for-SessionMiddleware%3CStore%3E">Transform&lt;S, ServiceRequest&gt;</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block"><li><a href="#impl-RefUnwindSafe-for-SessionMiddleware%3CStore%3E">RefUnwindSafe</a></li><li><a href="#impl-Send-for-SessionMiddleware%3CStore%3E">!Send</a></li><li><a href="#impl-Sync-for-SessionMiddleware%3CStore%3E">!Sync</a></li><li><a href="#impl-Unpin-for-SessionMiddleware%3CStore%3E">Unpin</a></li><li><a href="#impl-UnwindSafe-for-SessionMiddleware%3CStore%3E">UnwindSafe</a></li></ul><h3><a href="#blanket-implementations">Blanket Implementations</a></h3><ul class="block"><li><a href="#impl-Any-for-SessionMiddleware%3CStore%3E">Any</a></li><li><a href="#impl-Borrow%3CT%3E-for-SessionMiddleware%3CStore%3E">Borrow&lt;T&gt;</a></li><li><a href="#impl-BorrowMut%3CT%3E-for-SessionMiddleware%3CStore%3E">BorrowMut&lt;T&gt;</a></li><li><a href="#impl-From%3CT%3E-for-SessionMiddleware%3CStore%3E">From&lt;T&gt;</a></li><li><a href="#impl-Instrument-for-SessionMiddleware%3CStore%3E">Instrument</a></li><li><a href="#impl-Into%3CU%3E-for-SessionMiddleware%3CStore%3E">Into&lt;U&gt;</a></li><li><a href="#impl-Same%3CT%3E-for-SessionMiddleware%3CStore%3E">Same&lt;T&gt;</a></li><li><a href="#impl-ToOwned-for-SessionMiddleware%3CStore%3E">ToOwned</a></li><li><a href="#impl-TryFrom%3CU%3E-for-SessionMiddleware%3CStore%3E">TryFrom&lt;U&gt;</a></li><li><a href="#impl-TryInto%3CU%3E-for-SessionMiddleware%3CStore%3E">TryInto&lt;U&gt;</a></li><li><a href="#impl-VZip%3CV%3E-for-SessionMiddleware%3CStore%3E">VZip&lt;V&gt;</a></li><li><a href="#impl-WithSubscriber-for-SessionMiddleware%3CStore%3E">WithSubscriber</a></li></ul></section><h2><a href="index.html">In actix_session</a></h2></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../static.files/wheel-5ec35bf9ca753509.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn">Struct <a href="index.html">actix_session</a>::<wbr><a class="struct" href="#">SessionMiddleware</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="srclink" href="../src/actix_session/middleware.rs.html#117-120">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><div class="item-decl"><pre class="rust struct"><code>pub struct SessionMiddleware&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 middleware for session management in Actix Web applications.</p>
<p><a href="struct.SessionMiddleware.html" title="SessionMiddleware"><code>SessionMiddleware</code></a> takes care of a few jobs:</p>
<ul>
<li>Instructs the session storage backend to create/update/delete/retrieve the state attached to
a session according to its status and the operations that have been performed against it;</li>
<li>Set/remove a cookie, on the client side, to enable a user to be consistently associated with
the same session across multiple HTTP requests.</li>
</ul>
<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.
To create a new instance of <a href="struct.SessionMiddleware.html" title="SessionMiddleware"><code>SessionMiddleware</code></a> you need to provide:</p>
<ul>
<li>an instance of the session storage backend you wish to use (i.e. an implementation of
<a href="storage/trait.SessionStore.html" title="SessionStore"><code>SessionStore</code></a>);</li>
<li>a secret key, to sign or encrypt the content of client-side session cookie.</li>
</ul>
<h2 id="how-did-we-choose-defaults"><a href="#how-did-we-choose-defaults">How did we choose defaults?</a></h2>
<p>You should not regret adding <code>actix-session</code> to your dependencies and going to production using
the default configuration. That is why, when in doubt, we opt to use the most secure option for
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>
<h2 id="examples"><a href="#examples">Examples</a></h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>actix_web::{web, App, HttpServer, HttpResponse, Error};
<span class="kw">use </span>actix_session::{Session, SessionMiddleware, storage::RedisActorSessionStore};
<span class="kw">use </span>actix_web::cookie::Key;
<span class="comment">// The secret key would usually be read from a configuration file/environment variables.
</span><span class="kw">fn </span>get_secret_key() -&gt; Key {
<span class="comment">// [...]
</span>}
<span class="attr">#[actix_web::main]
</span><span class="kw">async fn </span>main() -&gt; std::io::Result&lt;()&gt; {
<span class="kw">let </span>secret_key = get_secret_key();
<span class="kw">let </span>redis_connection_string = <span class="string">&quot;127.0.0.1:6379&quot;</span>;
HttpServer::new(<span class="kw">move </span>||
App::new()
<span class="comment">// Add session management to your application using Redis for session state storage
</span>.wrap(
SessionMiddleware::new(
RedisActorSessionStore::new(redis_connection_string),
secret_key.clone()
)
)
.default_service(web::to(|| HttpResponse::Ok())))
.bind((<span class="string">&quot;127.0.0.1&quot;</span>, <span class="number">8080</span>))<span class="question-mark">?
</span>.run()
.<span class="kw">await
</span>}</code></pre></div>
<p>If you want to customise use <a href="struct.SessionMiddleware.html#method.builder"><code>builder</code></a> instead of <a href="struct.SessionMiddleware.html#method.new"><code>new</code></a>:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>actix_web::{App, cookie::{Key, time}, Error, HttpResponse, HttpServer, web};
<span class="kw">use </span>actix_session::{Session, SessionMiddleware, storage::RedisActorSessionStore};
<span class="kw">use </span>actix_session::config::PersistentSession;
<span class="comment">// The secret key would usually be read from a configuration file/environment variables.
</span><span class="kw">fn </span>get_secret_key() -&gt; Key {
<span class="comment">// [...]
</span>}
<span class="attr">#[actix_web::main]
</span><span class="kw">async fn </span>main() -&gt; std::io::Result&lt;()&gt; {
<span class="kw">let </span>secret_key = get_secret_key();
<span class="kw">let </span>redis_connection_string = <span class="string">&quot;127.0.0.1:6379&quot;</span>;
HttpServer::new(<span class="kw">move </span>||
App::new()
<span class="comment">// Customise session length!
</span>.wrap(
SessionMiddleware::builder(
RedisActorSessionStore::new(redis_connection_string),
secret_key.clone()
)
.session_lifecycle(
PersistentSession::default()
.session_ttl(time::Duration::days(<span class="number">5</span>))
)
.build(),
)
.default_service(web::to(|| HttpResponse::Ok())))
.bind((<span class="string">&quot;127.0.0.1&quot;</span>, <span class="number">8080</span>))<span class="question-mark">?
</span>.run()
.<span class="kw">await
</span>}</code></pre></div>
</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-SessionMiddleware%3CStore%3E" class="impl has-srclink"><a class="srclink rightside" href="../src/actix_session/middleware.rs.html#122-150">source</a><a href="#impl-SessionMiddleware%3CStore%3E" class="anchor">§</a><h3 class="code-header">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"><a class="srclink rightside" href="../src/actix_session/middleware.rs.html#130-132">source</a><h4 class="code-header">pub fn <a href="#method.new" class="fn">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>
<li>an instance of the session storage backend you wish to use (i.e. an implementation of
<a href="storage/trait.SessionStore.html" title="SessionStore"><code>SessionStore</code></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"><a class="srclink rightside" href="../src/actix_session/middleware.rs.html#140-142">source</a><h4 class="code-header">pub fn <a href="#method.builder" class="fn">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="config/struct.SessionMiddlewareBuilder.html" title="struct actix_session::config::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
<a href="storage/trait.SessionStore.html" title="SessionStore"><code>SessionStore</code></a>);</li>
<li>a secret key, to sign or encrypt the content of client-side session cookie.</li>
</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-for-SessionMiddleware%3CStore%3E" class="impl has-srclink"><a class="srclink rightside" href="../src/actix_session/middleware.rs.html#116">source</a><a href="#impl-Clone-for-SessionMiddleware%3CStore%3E" class="anchor">§</a><h3 class="code-header">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"><a class="srclink rightside" href="../src/actix_session/middleware.rs.html#116">source</a><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="fn">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'>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></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#132-134">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="fn">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'>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></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Transform%3CS%2C%20ServiceRequest%3E-for-SessionMiddleware%3CStore%3E" class="impl has-srclink"><a class="srclink rightside" href="../src/actix_session/middleware.rs.html#152-172">source</a><a href="#impl-Transform%3CS%2C%20ServiceRequest%3E-for-SessionMiddleware%3CStore%3E" class="anchor">§</a><h3 class="code-header">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,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Response" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Response" class="anchor">§</a><h4 class="code-header">type <a cl
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Instrument-for-SessionMiddleware%3CStore%3E" class="impl has-srclink"><a class="srclink rightside" href="https://docs.rs/tracing/0.1.37/src/tracing/instrument.rs.html#276">source</a><a href="#impl-Instrument-for-SessionMiddleware%3CStore%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://docs.rs/tracing/0.1.37/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.instrument" class="method trait-impl has-srclink"><a class="srclink rightside" href="https://docs.rs/tracing/0.1.37/src/tracing/instrument.rs.html#82">source</a><a href="#method.instrument" class="anchor">§</a><h4 class="code-header">fn <a href="https://docs.rs/tracing/0.1.37/tracing/instrument/trait.Instrument.html#method.instrument" class="fn">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.37/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -&gt; <a class="struct" href="https://docs.rs/tracing/0.1.37/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a>&lt;Self&gt;</h4></section></summary><div class='docblock'>Instruments this type with the provided <a href="https://docs.rs/tracing/0.1.37/tracing/span/struct.Span.html" title="Span"><code>Span</code></a>, returning an
<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.37/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.in_current_span" class="method trait-impl has-srclink"><a class="srclink rightside" href="https://docs.rs/tracing/0.1.37/src/tracing/instrument.rs.html#121">source</a><a href="#method.in_current_span" class="anchor">§</a><h4 class="code-header">fn <a href="https://docs.rs/tracing/0.1.37/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fn">in_current_span</a>(self) -&gt; <a class="struct" href="https://docs.rs/tracing/0.1.37/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a>&lt;Self&gt;</h4></section></summary><div class='docblock'>Instruments this type with the <a href="https://docs.rs/tracing/0.1.37/tracing/span/struct.Span.html#method.current">current</a> <a href="https://docs.rs/tracing/0.1.37/tracing/span/struct.Span.html"><code>Span</code></a>, returning an
<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.37/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E-for-SessionMiddleware%3CStore%3E" class="impl has-srclink"><a class="srclink rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#717">source</a><a href="#impl-Into%3CU%3E-for-SessionMiddleware%3CStore%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.into" 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/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#725">source</a></span><a href="#method.into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into" class="fn">into</a>(self) -&gt; U</h4></section></summary><div class="docblock"><p>Calls <code>U::from(self)</code>.</p>
<p>That is, this conversion is whatever the implementation of
<code><a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="From">From</a>&lt;T&gt; for U</code> chooses to do.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Same%3CT%3E-for-SessionMiddleware%3CStore%3E" class="impl has-srclink"><a class="srclink rightside" href="https://docs.rs/typenum/1.16.0/src/typenum/type_operators.rs.html#34">source</a><a href="#impl-Same%3CT%3E-for-SessionMiddleware%3CStore%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://docs.rs/typenum/1.16.0/typenum/type_operators/trait.Same.html" title="trait typenum::type_operators::Same">Same</a>&lt;T&gt; for T</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Output" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Output" class="anchor">§</a><h4 class="code-header">type <a href="https://docs.rs/typenum/1.16.0/typenum/type_operators/trait.Same.html#associatedtype.Output" class="associatedtype">Output</a> = T</h4></section></summary><div class='docblock'>Should always be <code>Self</code></div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-ToOwned-for-SessionMiddleware%3CStore%3E" class="impl has-srclink"><a class="srclink rightside" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#82">source</a><a href="#impl-ToOwned-for-SessionMiddleware%3CStore%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> 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/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Owned" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Owned" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned" class="associatedtype">Owned</a> = T</h4></section></summary><div class='docblock'>The resulting type after obtaining ownership.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.to_owned" class="method trait-impl has-srclink"><a class="srclink rightside" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#87">source</a><a href="#method.to_owned" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned" class="fn">to_owned</a>(&amp;self) -&gt; T</h4></section></summary><div class='docblock'>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clone_into" class="method trait-impl has-srclink"><a class="srclink rightside" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#91">source</a><a href="#method.clone_into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into" class="fn">clone_into</a>(&amp;self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T)</h4></section></summary><div class='docblock'>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E-for-SessionMiddleware%3CStore%3E" class="impl has-srclink"><a class="srclink rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#775">source</a><a href="#impl-TryFrom%3CU%3E-for-Sess
<a href="https://docs.rs/tracing/0.1.37/tracing/instrument/struct.WithDispatch.html" title="WithDispatch"><code>WithDispatch</code></a> wrapper. <a href="https://docs.rs/tracing/0.1.37/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber">Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.with_current_subscriber" class="method trait-impl has-srclink"><a class="srclink rightside" href="https://docs.rs/tracing/0.1.37/src/tracing/instrument.rs.html#221">source</a><a href="#method.with_current_subscriber" class="anchor">§</a><h4 class="code-header">fn <a href="https://docs.rs/tracing/0.1.37/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber" class="fn">with_current_subscriber</a>(self) -&gt; <a class="struct" href="https://docs.rs/tracing/0.1.37/tracing/instrument/struct.WithDispatch.html" title="struct tracing::instrument::WithDispatch">WithDispatch</a>&lt;Self&gt;</h4></section></summary><div class='docblock'>Attaches the current <a href="https://docs.rs/tracing/0.1.37/tracing/dispatcher/index.html#setting-the-default-subscriber">default</a> <a href="https://docs.rs/tracing-core/0.1.22/tracing_core/subscriber/trait.Subscriber.html"><code>Subscriber</code></a> to this type, returning a
<a href="https://docs.rs/tracing/0.1.37/tracing/instrument/struct.WithDispatch.html" title="WithDispatch"><code>WithDispatch</code></a> wrapper. <a href="https://docs.rs/tracing/0.1.37/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber">Read more</a></div></details></div></details></div></section></div></main><div id="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="actix_session" data-themes="" data-resource-suffix="" data-rustdoc-version="1.68.0-nightly (61a415be5 2023-01-12)" data-search-js="search-181581080540673f.js" data-settings-js="settings-bebeae96e00e4617.js" data-settings-css="settings-58836c674e2f7bd2.css" ></div></body></html>