<!DOCTYPE html><htmllang="en"><head><metacharset="utf-8"><metaname="viewport"content="width=device-width, initial-scale=1.0"><metaname="generator"content="rustdoc"><metaname="description"content="A session key, the string stored in a client-side cookie to associate a user with its session state on the backend."><metaname="keywords"content="rust, rustlang, rust-lang, SessionKey"><title>SessionKey in actix_session::storage - Rust</title><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../../SourceSerif4-Regular.ttf.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../../FiraSans-Regular.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../../FiraSans-Medium.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../../SourceCodePro-Regular.ttf.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../../SourceSerif4-Bold.ttf.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../../SourceCodePro-Semibold.ttf.woff2"><linkrel="stylesheet"type="text/css"href="../../normalize.css"><linkrel="stylesheet"type="text/css"href="../../rustdoc.css"id="mainThemeStyle"><linkrel="stylesheet"type="text/css"href="../../ayu.css"disabled><linkrel="stylesheet"type="text/css"href="../../dark.css"disabled><linkrel="stylesheet"type="text/css"href="../../light.css"id="themeStyle"><scriptid="default-settings"></script><scriptsrc="../../storage.js"></script><scriptdefersrc="sidebar-items.js"></script><scriptdefersrc="../../main.js"></script><noscript><linkrel="stylesheet"href="../../noscript.css"></noscript><linkrel="icon"href="https://actix.rs/favicon.ico"></head><bodyclass="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><navclass="mobile-topbar"><buttonclass="sidebar-menu-toggle">☰</button><aclass="sidebar-logo"href="../../actix_session/index.html"><divclass="logo-container"><imgsrc="https://actix.rs/img/logo.png"alt="logo"></div></a><h2class="location"></h2></nav><navclass="sidebar"><aclass="sidebar-logo"href="../../actix_session/index.html"><divclass="logo-container">
<imgsrc="https://actix.rs/img/logo.png"alt="logo"></a><navclass="sub"><formclass="search-form"><divclass="search-container"><span></span><inputclass="search-input"name="search"autocomplete="off"spellcheck="false"placeholder="Click or press ‘S’ to search, ‘?’ for more options…"type="search"><divid="help-button"title="help"tabindex="-1"><buttontype="button">?</button></div><divid="settings-menu"tabindex="-1"><ahref="../../settings.html"title="settings"><imgwidth="22"height="22"alt="Change settings"src="../../wheel.svg"></a></div></div></form></nav></div><sectionid="main-content"class="content"><divclass="main-heading"><h1class="fqn"><spanclass="in-band">Struct <ahref="../index.html">actix_session</a>::<wbr><ahref="index.html">storage</a>::<wbr><aclass="struct"href="#">SessionKey</a><buttonid="copy-path"onclick="copy_path(this)"title="Copy item path to clipboard"><imgsrc="../../clipboard.svg"width="19"height="18"alt="Copy item path"></button></span></h1><spanclass="out-of-band"><aclass="srclink"href="../../src/actix_session/storage/session_key.rs.html#21">source</a> · <aid="toggle-all-docs"href="javascript:void(0)"title="collapse all docs">[<spanclass="inner">−</span>]</a></span></div><divclass="docblock item-decl"><preclass="rust struct"><code>pub struct SessionKey(_);</code></pre></div><detailsclass="rustdoc-toggle top-doc"open><summaryclass="hideme"><span>Expand description</span></summary><divclass="docblock"><p>A session key, the string stored in a client-side cookie to associate a user with its session
</div></details><h2id="trait-implementations"class="small-section-header">Trait Implementations<ahref="#trait-implementations"class="anchor"></a></h2><divid="trait-implementations-list"><detailsclass="rustdoc-toggle implementors-toggle"open><summary><sectionid="impl-AsRef%3Cstr%3E-for-SessionKey"class="impl has-srclink"><spanclass="rightside"><aclass="srclink"href="../../src/actix_session/storage/session_key.rs.html#38-42">source</a></span><ahref="#impl-AsRef%3Cstr%3E-for-SessionKey"class="anchor"></a><h3class="code-header in-band">impl <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html"title="trait core::convert::AsRef">AsRef</a><<aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>> for <aclass="struct"href="struct.SessionKey.html"title="struct actix_session::storage::SessionKey">SessionKey</a></h3></section></summary><divclass="impl-items"><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.as_ref"class="method trait-impl has-srclink"><spanclass="rightside"><aclass="srclink"href="../../src/actix_session/storage/session_key.rs.html#39-41">source</a></span><ahref="#method.as_ref"class="anchor"></a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html#tymethod.as_ref"class="fnname">as_ref</a>(&self) ->&<aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></h4></section></summary><divclass='docblock'><p>Converts this type into a shared reference of the (usually inferred) input type.</p>
</div></details></div></details><detailsclass="rustdoc-toggle implementors-toggle"open><summary><sectionid="impl-Debug-for-SessionKey"class="impl has-srclink"><spanclass="rightside"><aclass="srclink"href="../../src/actix_session/storage/session_key.rs.html#20">source</a></span><ahref="#impl-Debug-for-SessionKey"class="anchor"></a><h3class="code-header in-band">impl <aclass="trait"href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html"title="trait core::fmt::Debug">Debug</a> for <aclass="struct"href="struct.SessionKey.html"title="struct actix_session::storage::SessionKey">SessionKey</a></h3></section></summary><divclass="impl-items"><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.fmt"class="method trait-impl has-srclink"><spanclass="rightside"><aclass="srclink"href="../../src/actix_session/storage/session_key.rs.html#20">source</a></span><ahref="#method.fmt"class="anchor"></a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt"class="fnname">fmt</a>(&self, f: &mut <aclass="struct"href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html"title="struct core::fmt::Formatter">Formatter</a><'_>) -><aclass="type"href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html"title="type core::fmt::Result">Result</a></h4></section></summary><divclass='docblock'><p>Formats the value using the given formatter. <ahref="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
</div></details></div></details><detailsclass="rustdoc-toggle implementors-toggle"open><summary><sectionid="impl-From%3CSessionKey%3E-for-String"class="impl has-srclink"><spanclass="rightside"><aclass="srclink"href="../../src/actix_session/storage/session_key.rs.html#44-48">source</a></span><ahref="#impl-From%3CSessionKey%3E-for-String"class="anchor"></a><h3class="code-header in-band">impl <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html"title="trait core::convert::From">From</a><<aclass="struct"href="struct.SessionKey.html"title="struct actix_session::storage::SessionKey">SessionKey</a>> for <aclass="struct"href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html"title="struct alloc::string::String">String</a></h3></section></summary><divclass="impl-items"><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.from"class="method trait-impl has-srclink"><spanclass="rightside"><aclass="srclink"href="../../src/actix_session/storage/session_key.rs.html#45-47">source</a></span><ahref="#method.from"class="anchor"></a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from"class="fnname">from</a>(key: <aclass="struct"href="struct.SessionKey.html"title="struct actix_session::storage::SessionKey">SessionKey</a>) -> Self</h4></section></summary><divclass='docblock'><p>Converts to this type from the input type.</p>
</div></details></div></details><detailsclass="rustdoc-toggle implementors-toggle"open><summary><sectionid="impl-PartialEq%3CSessionKey%3E-for-SessionKey"class="impl has-srclink"><spanclass="rightside"><aclass="srclink"href="../../src/actix_session/storage/session_key.rs.html#20">source</a></span><ahref="#impl-PartialEq%3CSessionKey%3E-for-SessionKey"class="anchor"></a><h3class="code-header in-band">impl <aclass="trait"href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html"title="trait core::cmp::PartialEq">PartialEq</a><<aclass="struct"href="struct.SessionKey.html"title="struct actix_session::storage::SessionKey">SessionKey</a>> for <aclass="struct"href="struct.SessionKey.html"title="struct actix_session::storage::SessionKey">SessionKey</a></h3></section></summary><divclass="impl-items"><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.eq"class="method trait-impl has-srclink"><spanclass="rightside"><aclass="srclink"href="../../src/actix_session/storage/session_key.rs.html#20">source</a></span><ahref="#method.eq"class="anchor"></a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq"class="fnname">eq</a>(&self, other: &<aclass="struct"href="struct.SessionKey.html"title="struct actix_session::storage::SessionKey">SessionKey</a>) -><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><divclass='docblock'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used
</div></details></div></details><detailsclass="rustdoc-toggle implementors-toggle"open><summary><sectionid="impl-TryFrom%3CString%3E-for-SessionKey"class="impl has-srclink"><spanclass="rightside"><aclass="srclink"href="../../src/actix_session/storage/session_key.rs.html#23-36">source</a></span><ahref="#impl-TryFrom%3CString%3E-for-SessionKey"class="anchor"></a><h3class="code-header in-band">impl <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><<aclass="struct"href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html"title="struct alloc::string::String">String</a>> for <aclass="struct"href="struct.SessionKey.html"title="struct actix_session::storage::SessionKey">SessionKey</a></h3></section></summary><divclass="impl-items"><detailsclass="rustdoc-toggle"open><summary><sectionid="associatedtype.Error"class="associatedtype trait-impl has-srclink"><ahref="#associatedtype.Error"class="anchor"></a><h4class="code-header">type <ahref="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error"class="associatedtype">Error</a> = InvalidSessionKeyError</h4></section></summary><divclass='docblock'><p>The type returned in the event of a conversion error.</p>
</div></details></div></details><detailsclass="rustdoc-toggle implementors-toggle"><summary><sectionid="impl-Instrument-for-SessionKey"class="impl has-srclink"><spanclass="rightside"><aclass="srclink"href="https://docs.rs/tracing/0.1.36/src/tracing/instrument.rs.html#276">source</a></span><ahref="#impl-Instrument-for-SessionKey"class="anchor"></a><h3class="code-header in-band">impl<T><aclass="trait"href="https://docs.rs/tracing/0.1.36/tracing/instrument/trait.Instrument.html"title="trait tracing::instrument::Instrument">Instrument</a> for T</h3></section></summary><divclass="impl-items"><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.instrument"class="method trait-impl has-srclink"><spanclass="rightside"><aclass="srclink"href="https://docs.rs/tracing/0.1.36/src/tracing/instrument.rs.html#82">source</a></span><ahref="#method.instrument"class="anchor"></a><h4class="code-header">fn <ahref="https://docs.rs/tracing/0.1.36/tracing/instrument/trait.Instrument.html#method.instrument"class="fnname">instrument</a>(self, span: <aclass="struct"href="https://docs.rs/tracing/0.1.36/tracing/span/struct.Span.html"title="struct tracing::span::Span">Span</a>) -><aclass="struct"href="https://docs.rs/tracing/0.1.36/tracing/instrument/struct.Instrumented.html"title="struct tracing::instrument::Instrumented">Instrumented</a><Self></h4></section></summary><divclass='docblock'><p>Instruments this type with the provided <ahref="https://docs.rs/tracing/0.1.36/tracing/span/struct.Span.html"title="Span"><code>Span</code></a>, returning an
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.in_current_span"class="method trait-impl has-srclink"><spanclass="rightside"><aclass="srclink"href="https://docs.rs/tracing/0.1.36/src/tracing/instrument.rs.html#121">source</a></span><ahref="#method.in_current_span"class="anchor"></a><h4class="code-header">fn <ahref="https://docs.rs/tracing/0.1.36/tracing/instrument/trait.Instrument.html#method.in_current_span"class="fnname">in_current_span</a>(self) -><aclass="struct"href="https://docs.rs/tracing/0.1.36/tracing/instrument/struct.Instrumented.html"title="struct tracing::instrument::Instrumented">Instrumented</a><Self></h4></section></summary><divclass='docblock'><p>Instruments this type with the <ahref="https://docs.rs/tracing/0.1.36/tracing/span/struct.Span.html#method.current">current</a><ahref="https://docs.rs/tracing/0.1.36/tracing/span/struct.Span.html"><code>Span</code></a>, returning an
</div></details></div></details><detailsclass="rustdoc-toggle implementors-toggle"><summary><sectionid="impl-TryFrom%3CU%3E-for-SessionKey"class="impl has-srclink"><spanclass="rightside"><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#598">source</a></span><ahref="#impl-TryFrom%3CU%3E-for-SessionKey"class="anchor"></a><h3class="code-header in-band">impl<T, U><aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><U> for T <spanclass="where fmt-newline">where<br> U: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><T>, </span></h3></section></summary><divclass="impl-items"><detailsclass="rustdoc-toggle"open><summary><sectionid="associatedtype.Error-2"class="associatedtype trait-impl has-srclink"><ahref="#associatedtype.Error-2"class="anchor"></a><h4class="code-header">type <ahref="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error"class="associatedtype">Error</a> = <aclass="enum"href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html"title="enum core::convert::Infallible">Infallible</a></h4></section></summary><divclass='docblock'><p>The type returned in the event of a conversion error.</p>
</div></details></div></details><detailsclass="rustdoc-toggle implementors-toggle"><summary><sectionid="impl-TryInto%3CU%3E-for-SessionKey"class="impl has-srclink"><spanclass="rightside"><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#583">source</a></span><ahref="#impl-TryInto%3CU%3E-for-SessionKey"class="anchor"></a><h3class="code-header in-band">impl<T, U><aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html"title="trait core::convert::TryInto">TryInto</a><U> for T <spanclass="where fmt-newline">where<br> U: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>, </span></h3></section></summary><divclass="impl-items"><detailsclass="rustdoc-toggle"open><summary><sectionid="associatedtype.Error-1"class="associatedtype trait-impl has-srclink"><ahref="#associatedtype.Error-1"class="anchor"></a><h4class="code-header">type <ahref="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error"class="associatedtype">Error</a> = <U as <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>>::<aclass="associatedtype"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error"title="type core::convert::TryFrom::Error">Error</a></h4></section></summary><divclass='docblock'><p>The type returned in the event of a conversion error.</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.with_current_subscriber"class="method trait-impl has-srclink"><spanclass="rightside"><aclass="srclink"href="https://docs.rs/tracing/0.1.36/src/tracing/instrument.rs.html#221">source</a></span><ahref="#method.with_current_subscriber"class="anchor"></a><h4class="code-header">fn <ahref="https://docs.rs/tracing/0.1.36/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber"class="fnname">with_current_subscriber</a>(self) -><aclass="struct"href="https://docs.rs/tracing/0.1.36/tracing/instrument/struct.WithDispatch.html"title="struct tracing::instrument::WithDispatch">WithDispatch</a><Self></h4></section></summary><divclass='docblock'><p>Attaches the current <ahref="https://docs.rs/tracing/0.1.36/tracing/dispatcher/index.html#setting-the-default-subscriber">default</a><ahref="https://docs.rs/tracing-core/0.1.22/tracing_core/subscriber/trait.Subscriber.html"><code>Subscriber</code></a> to this type, returning a