mirror of
https://github.com/actix/actix-extras.git
synced 2024-11-28 01:32:57 +01:00
Deploying to gh-pages from @ 04f4934001
🚀
This commit is contained in:
parent
8befae2288
commit
8d2a4cfe68
@ -51,10 +51,10 @@ It takes as input the only required input to create a new instance of <a href="s
|
|||||||
connection string for Redis.</p>
|
connection string for Redis.</p>
|
||||||
</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/storage/redis_rs.rs.html#62">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="struct" href="struct.RedisSessionStore.html" title="struct actix_session::storage::RedisSessionStore">RedisSessionStore</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/storage/redis_rs.rs.html#62">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>(&self) -> <a class="struct" href="struct.RedisSessionStore.html" title="struct actix_session::storage::RedisSessionStore">RedisSessionStore</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></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/storage/redis_rs.rs.html#62">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="struct" href="struct.RedisSessionStore.html" title="struct actix_session::storage::RedisSessionStore">RedisSessionStore</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/storage/redis_rs.rs.html#62">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>(&self) -> <a class="struct" href="struct.RedisSessionStore.html" title="struct actix_session::storage::RedisSessionStore">RedisSessionStore</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#134-136">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>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</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><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#134-136">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>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</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-SessionStore" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/actix_session/storage/redis_rs.rs.html#136-240">source</a></span><a href="#impl-SessionStore" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.SessionStore.html" title="trait actix_session::storage::SessionStore">SessionStore</a> for <a class="struct" href="struct.RedisSessionStore.html" title="struct actix_session::storage::RedisSessionStore">RedisSessionStore</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.load" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/actix_session/storage/redis_rs.rs.html#137-153">source</a></span><a href="#method.load" class="anchor"></a><h4 class="code-header">fn <a href="trait.SessionStore.html#tymethod.load" class="fnname">load</a><'life0, 'life1, 'async_trait>(<br> &'life0 self, <br> session_key: &'life1 <a class="struct" href="struct.SessionKey.html" title="struct actix_session::storage::SessionKey">SessionKey</a><br>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a><Output = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.HashMap.html" title="struct std::collections::hash::map::HashMap">HashMap</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>>, <a class="enum" href="enum.LoadError.html" title="enum actix_session::storage::LoadError">LoadError</a>>> + 'async_trait>> <span class="where fmt-newline">where<br> 'life0: 'async_trait,<br> 'life1: 'async_trait,<br> Self: 'async_trait, </span></h4></section></summary><div class='docblock'><p>Loads the session state associated to a session key.</p>
|
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-SessionStore" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/actix_session/storage/redis_rs.rs.html#136-233">source</a></span><a href="#impl-SessionStore" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.SessionStore.html" title="trait actix_session::storage::SessionStore">SessionStore</a> for <a class="struct" href="struct.RedisSessionStore.html" title="struct actix_session::storage::RedisSessionStore">RedisSessionStore</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.load" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/actix_session/storage/redis_rs.rs.html#137-152">source</a></span><a href="#method.load" class="anchor"></a><h4 class="code-header">fn <a href="trait.SessionStore.html#tymethod.load" class="fnname">load</a><'life0, 'life1, 'async_trait>(<br> &'life0 self, <br> session_key: &'life1 <a class="struct" href="struct.SessionKey.html" title="struct actix_session::storage::SessionKey">SessionKey</a><br>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a><Output = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.HashMap.html" title="struct std::collections::hash::map::HashMap">HashMap</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>>, <a class="enum" href="enum.LoadError.html" title="enum actix_session::storage::LoadError">LoadError</a>>> + 'async_trait>> <span class="where fmt-newline">where<br> 'life0: 'async_trait,<br> 'life1: 'async_trait,<br> Self: 'async_trait, </span></h4></section></summary><div class='docblock'><p>Loads the session state associated to a session key.</p>
|
||||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.save" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/actix_session/storage/redis_rs.rs.html#155-180">source</a></span><a href="#method.save" class="anchor"></a><h4 class="code-header">fn <a href="trait.SessionStore.html#tymethod.save" class="fnname">save</a><'life0, 'life1, 'async_trait>(<br> &'life0 self, <br> session_state: <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.HashMap.html" title="struct std::collections::hash::map::HashMap">HashMap</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>, <br> ttl: &'life1 Duration<br>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a><Output = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="struct.SessionKey.html" title="struct actix_session::storage::SessionKey">SessionKey</a>, <a class="enum" href="enum.SaveError.html" title="enum actix_session::storage::SaveError">SaveError</a>>> + 'async_trait>> <span class="where fmt-newline">where<br> 'life0: 'async_trait,<br> 'life1: 'async_trait,<br> Self: 'async_trait, </span></h4></section></summary><div class='docblock'><p>Persist the session state for a newly created session. <a href="trait.SessionStore.html#tymethod.save">Read more</a></p>
|
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.save" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/actix_session/storage/redis_rs.rs.html#154-177">source</a></span><a href="#method.save" class="anchor"></a><h4 class="code-header">fn <a href="trait.SessionStore.html#tymethod.save" class="fnname">save</a><'life0, 'life1, 'async_trait>(<br> &'life0 self, <br> session_state: <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.HashMap.html" title="struct std::collections::hash::map::HashMap">HashMap</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>, <br> ttl: &'life1 Duration<br>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a><Output = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="struct.SessionKey.html" title="struct actix_session::storage::SessionKey">SessionKey</a>, <a class="enum" href="enum.SaveError.html" title="enum actix_session::storage::SaveError">SaveError</a>>> + 'async_trait>> <span class="where fmt-newline">where<br> 'life0: 'async_trait,<br> 'life1: 'async_trait,<br> Self: 'async_trait, </span></h4></section></summary><div class='docblock'><p>Persist the session state for a newly created session. <a href="trait.SessionStore.html#tymethod.save">Read more</a></p>
|
||||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.update" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/actix_session/storage/redis_rs.rs.html#182-226">source</a></span><a href="#method.update" class="anchor"></a><h4 class="code-header">fn <a href="trait.SessionStore.html#tymethod.update" class="fnname">update</a><'life0, 'life1, 'async_trait>(<br> &'life0 self, <br> session_key: <a class="struct" href="struct.SessionKey.html" title="struct actix_session::storage::SessionKey">SessionKey</a>, <br> session_state: <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.HashMap.html" title="struct std::collections::hash::map::HashMap">HashMap</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>, <br> ttl: &'life1 Duration<br>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a><Output = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="struct.SessionKey.html" title="struct actix_session::storage::SessionKey">SessionKey</a>, <a class="enum" href="enum.UpdateError.html" title="enum actix_session::storage::UpdateError">UpdateError</a>>> + 'async_trait>> <span class="where fmt-newline">where<br> 'life0: 'async_trait,<br> 'life1: 'async_trait,<br> Self: 'async_trait, </span></h4></section></summary><div class='docblock'><p>Updates the session state associated to a pre-existing session key.</p>
|
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.update" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/actix_session/storage/redis_rs.rs.html#179-222">source</a></span><a href="#method.update" class="anchor"></a><h4 class="code-header">fn <a href="trait.SessionStore.html#tymethod.update" class="fnname">update</a><'life0, 'life1, 'async_trait>(<br> &'life0 self, <br> session_key: <a class="struct" href="struct.SessionKey.html" title="struct actix_session::storage::SessionKey">SessionKey</a>, <br> session_state: <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.HashMap.html" title="struct std::collections::hash::map::HashMap">HashMap</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>, <br> ttl: &'life1 Duration<br>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a><Output = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="struct.SessionKey.html" title="struct actix_session::storage::SessionKey">SessionKey</a>, <a class="enum" href="enum.UpdateError.html" title="enum actix_session::storage::UpdateError">UpdateError</a>>> + 'async_trait>> <span class="where fmt-newline">where<br> 'life0: 'async_trait,<br> 'life1: 'async_trait,<br> Self: 'async_trait, </span></h4></section></summary><div class='docblock'><p>Updates the session state associated to a pre-existing session key.</p>
|
||||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.delete" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/actix_session/storage/redis_rs.rs.html#228-239">source</a></span><a href="#method.delete" class="anchor"></a><h4 class="code-header">fn <a href="trait.SessionStore.html#tymethod.delete" class="fnname">delete</a><'life0, 'life1, 'async_trait>(<br> &'life0 self, <br> session_key: &'life1 <a class="struct" href="struct.SessionKey.html" title="struct actix_session::storage::SessionKey">SessionKey</a><br>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a><Output = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://docs.rs/anyhow/1.0.56/anyhow/struct.Error.html" title="struct anyhow::Error">Error</a>>> + 'async_trait>> <span class="where fmt-newline">where<br> 'life0: 'async_trait,<br> 'life1: 'async_trait,<br> Self: 'async_trait, </span></h4></section></summary><div class='docblock'><p>Deletes a session from the store.</p>
|
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.delete" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/actix_session/storage/redis_rs.rs.html#224-232">source</a></span><a href="#method.delete" class="anchor"></a><h4 class="code-header">fn <a href="trait.SessionStore.html#tymethod.delete" class="fnname">delete</a><'life0, 'life1, 'async_trait>(<br> &'life0 self, <br> session_key: &'life1 <a class="struct" href="struct.SessionKey.html" title="struct actix_session::storage::SessionKey">SessionKey</a><br>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a><Output = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://docs.rs/anyhow/1.0.56/anyhow/struct.Error.html" title="struct anyhow::Error">Error</a>>> + 'async_trait>> <span class="where fmt-newline">where<br> 'life0: 'async_trait,<br> 'life1: 'async_trait,<br> Self: 'async_trait, </span></h4></section></summary><div class='docblock'><p>Deletes a session from the store.</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 !<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.RedisSessionStore.html" title="struct actix_session::storage::RedisSessionStore">RedisSessionStore</a></h3></section><section id="impl-Send" class="impl has-srclink"><a href="#impl-Send" class="anchor"></a><h3 class="code-header in-band">impl <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.RedisSessionStore.html" title="struct actix_session::storage::RedisSessionStore">RedisSessionStore</a></h3></section><section id="impl-Sync" class="impl has-srclink"><a href="#impl-Sync" class="anchor"></a><h3 class="code-header in-band">impl <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.RedisSessionStore.html" title="struct actix_session::storage::RedisSessionStore">RedisSessionStore</a></h3></section><section id="impl-Unpin" class="impl has-srclink"><a href="#impl-Unpin" class="anchor"></a><h3 class="code-header in-band">impl <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.RedisSessionStore.html" title="struct actix_session::storage::RedisSessionStore">RedisSessionStore</a></h3></section><section id="impl-UnwindSafe" class="impl has-srclink"><a href="#impl-UnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl !<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.RedisSessionStore.html" title="struct actix_session::storage::RedisSessionStore">RedisSessionStore</a></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<T> <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> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </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>(&self) -> <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></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 !<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.RedisSessionStore.html" title="struct actix_session::storage::RedisSessionStore">RedisSessionStore</a></h3></section><section id="impl-Send" class="impl has-srclink"><a href="#impl-Send" class="anchor"></a><h3 class="code-header in-band">impl <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.RedisSessionStore.html" title="struct actix_session::storage::RedisSessionStore">RedisSessionStore</a></h3></section><section id="impl-Sync" class="impl has-srclink"><a href="#impl-Sync" class="anchor"></a><h3 class="code-header in-band">impl <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.RedisSessionStore.html" title="struct actix_session::storage::RedisSessionStore">RedisSessionStore</a></h3></section><section id="impl-Unpin" class="impl has-srclink"><a href="#impl-Unpin" class="anchor"></a><h3 class="code-header in-band">impl <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.RedisSessionStore.html" title="struct actix_session::storage::RedisSessionStore">RedisSessionStore</a></h3></section><section id="impl-UnwindSafe" class="impl has-srclink"><a href="#impl-UnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl !<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.RedisSessionStore.html" title="struct actix_session::storage::RedisSessionStore">RedisSessionStore</a></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<T> <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> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </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>(&self) -> <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<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </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>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</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-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<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </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>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</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<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </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>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&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>
|
</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<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </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>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&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>
|
||||||
|
@ -21,5 +21,5 @@ is required for implementations, too. In particular, we use the send-optional va
|
|||||||
<p>Returns the corresponding session key.</p>
|
<p>Returns the corresponding session key.</p>
|
||||||
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.update" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/actix_session/storage/interface.rs.html#32-37">source</a></div><h4 class="code-header">fn <a href="#tymethod.update" class="fnname">update</a><'life0, 'life1, 'async_trait>(<br> &'life0 self, <br> session_key: <a class="struct" href="struct.SessionKey.html" title="struct actix_session::storage::SessionKey">SessionKey</a>, <br> session_state: <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.HashMap.html" title="struct std::collections::hash::map::HashMap">HashMap</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>, <br> ttl: &'life1 Duration<br>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a><Output = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="struct.SessionKey.html" title="struct actix_session::storage::SessionKey">SessionKey</a>, <a class="enum" href="enum.UpdateError.html" title="enum actix_session::storage::UpdateError">UpdateError</a>>> + 'async_trait>> <span class="where fmt-newline">where<br> 'life0: 'async_trait,<br> 'life1: 'async_trait,<br> Self: 'async_trait, </span></h4></div></summary><div class="docblock"><p>Updates the session state associated to a pre-existing session key.</p>
|
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.update" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/actix_session/storage/interface.rs.html#32-37">source</a></div><h4 class="code-header">fn <a href="#tymethod.update" class="fnname">update</a><'life0, 'life1, 'async_trait>(<br> &'life0 self, <br> session_key: <a class="struct" href="struct.SessionKey.html" title="struct actix_session::storage::SessionKey">SessionKey</a>, <br> session_state: <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.HashMap.html" title="struct std::collections::hash::map::HashMap">HashMap</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>, <br> ttl: &'life1 Duration<br>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a><Output = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="struct.SessionKey.html" title="struct actix_session::storage::SessionKey">SessionKey</a>, <a class="enum" href="enum.UpdateError.html" title="enum actix_session::storage::UpdateError">UpdateError</a>>> + 'async_trait>> <span class="where fmt-newline">where<br> 'life0: 'async_trait,<br> 'life1: 'async_trait,<br> Self: 'async_trait, </span></h4></div></summary><div class="docblock"><p>Updates the session state associated to a pre-existing session key.</p>
|
||||||
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.delete" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/actix_session/storage/interface.rs.html#40">source</a></div><h4 class="code-header">fn <a href="#tymethod.delete" class="fnname">delete</a><'life0, 'life1, 'async_trait>(<br> &'life0 self, <br> session_key: &'life1 <a class="struct" href="struct.SessionKey.html" title="struct actix_session::storage::SessionKey">SessionKey</a><br>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a><Output = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://docs.rs/anyhow/1.0.56/anyhow/struct.Error.html" title="struct anyhow::Error">Error</a>>> + 'async_trait>> <span class="where fmt-newline">where<br> 'life0: 'async_trait,<br> 'life1: 'async_trait,<br> Self: 'async_trait, </span></h4></div></summary><div class="docblock"><p>Deletes a session from the store.</p>
|
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.delete" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/actix_session/storage/interface.rs.html#40">source</a></div><h4 class="code-header">fn <a href="#tymethod.delete" class="fnname">delete</a><'life0, 'life1, 'async_trait>(<br> &'life0 self, <br> session_key: &'life1 <a class="struct" href="struct.SessionKey.html" title="struct actix_session::storage::SessionKey">SessionKey</a><br>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a><Output = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://docs.rs/anyhow/1.0.56/anyhow/struct.Error.html" title="struct anyhow::Error">Error</a>>> + 'async_trait>> <span class="where fmt-newline">where<br> 'life0: 'async_trait,<br> 'life1: 'async_trait,<br> Self: 'async_trait, </span></h4></div></summary><div class="docblock"><p>Deletes a session from the store.</p>
|
||||||
</div></details></div><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"><section id="impl-SessionStore" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/actix_session/storage/cookie.rs.html#55-95">source</a></span><a href="#impl-SessionStore" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.SessionStore.html" title="trait actix_session::storage::SessionStore">SessionStore</a> for <a class="struct" href="struct.CookieSessionStore.html" title="struct actix_session::storage::CookieSessionStore">CookieSessionStore</a></h3></section><section id="impl-SessionStore-1" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/actix_session/storage/redis_actor.rs.html#123-258">source</a></span><a href="#impl-SessionStore-1" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.SessionStore.html" title="trait actix_session::storage::SessionStore">SessionStore</a> for <a class="struct" href="struct.RedisActorSessionStore.html" title="struct actix_session::storage::RedisActorSessionStore">RedisActorSessionStore</a></h3></section><section id="impl-SessionStore-2" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/actix_session/storage/redis_rs.rs.html#136-240">source</a></span><a href="#impl-SessionStore-2" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.SessionStore.html" title="trait actix_session::storage::SessionStore">SessionStore</a> for <a class="struct" href="struct.RedisSessionStore.html" title="struct actix_session::storage::RedisSessionStore">RedisSessionStore</a></h3></section></div><script type="text/javascript" src="../../implementors/actix_session/storage/trait.SessionStore.js" async></script></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="actix_session" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.61.0-nightly (63b8f01bb 2022-03-24)" ></div>
|
</div></details></div><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"><section id="impl-SessionStore" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/actix_session/storage/cookie.rs.html#55-95">source</a></span><a href="#impl-SessionStore" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.SessionStore.html" title="trait actix_session::storage::SessionStore">SessionStore</a> for <a class="struct" href="struct.CookieSessionStore.html" title="struct actix_session::storage::CookieSessionStore">CookieSessionStore</a></h3></section><section id="impl-SessionStore-1" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/actix_session/storage/redis_actor.rs.html#123-258">source</a></span><a href="#impl-SessionStore-1" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.SessionStore.html" title="trait actix_session::storage::SessionStore">SessionStore</a> for <a class="struct" href="struct.RedisActorSessionStore.html" title="struct actix_session::storage::RedisActorSessionStore">RedisActorSessionStore</a></h3></section><section id="impl-SessionStore-2" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/actix_session/storage/redis_rs.rs.html#136-233">source</a></span><a href="#impl-SessionStore-2" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.SessionStore.html" title="trait actix_session::storage::SessionStore">SessionStore</a> for <a class="struct" href="struct.RedisSessionStore.html" title="struct actix_session::storage::RedisSessionStore">RedisSessionStore</a></h3></section></div><script type="text/javascript" src="../../implementors/actix_session/storage/trait.SessionStore.js" async></script></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="actix_session" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.61.0-nightly (63b8f01bb 2022-03-24)" ></div>
|
||||||
</body></html>
|
</body></html>
|
@ -302,9 +302,41 @@
|
|||||||
<span id="295">295</span>
|
<span id="295">295</span>
|
||||||
<span id="296">296</span>
|
<span id="296">296</span>
|
||||||
<span id="297">297</span>
|
<span id="297">297</span>
|
||||||
|
<span id="298">298</span>
|
||||||
|
<span id="299">299</span>
|
||||||
|
<span id="300">300</span>
|
||||||
|
<span id="301">301</span>
|
||||||
|
<span id="302">302</span>
|
||||||
|
<span id="303">303</span>
|
||||||
|
<span id="304">304</span>
|
||||||
|
<span id="305">305</span>
|
||||||
|
<span id="306">306</span>
|
||||||
|
<span id="307">307</span>
|
||||||
|
<span id="308">308</span>
|
||||||
|
<span id="309">309</span>
|
||||||
|
<span id="310">310</span>
|
||||||
|
<span id="311">311</span>
|
||||||
|
<span id="312">312</span>
|
||||||
|
<span id="313">313</span>
|
||||||
|
<span id="314">314</span>
|
||||||
|
<span id="315">315</span>
|
||||||
|
<span id="316">316</span>
|
||||||
|
<span id="317">317</span>
|
||||||
|
<span id="318">318</span>
|
||||||
|
<span id="319">319</span>
|
||||||
|
<span id="320">320</span>
|
||||||
|
<span id="321">321</span>
|
||||||
|
<span id="322">322</span>
|
||||||
|
<span id="323">323</span>
|
||||||
|
<span id="324">324</span>
|
||||||
|
<span id="325">325</span>
|
||||||
|
<span id="326">326</span>
|
||||||
|
<span id="327">327</span>
|
||||||
|
<span id="328">328</span>
|
||||||
|
<span id="329">329</span>
|
||||||
</pre><pre class="rust"><code><span class="kw">use</span> <span class="ident">std::sync::Arc</span>;
|
</pre><pre class="rust"><code><span class="kw">use</span> <span class="ident">std::sync::Arc</span>;
|
||||||
|
|
||||||
<span class="kw">use</span> <span class="ident">redis</span>::{<span class="ident">aio::ConnectionManager</span>, <span class="ident">AsyncCommands</span>, <span class="ident">Value</span>};
|
<span class="kw">use</span> <span class="ident">redis</span>::{<span class="ident">aio::ConnectionManager</span>, <span class="ident">Cmd</span>, <span class="ident">FromRedisValue</span>, <span class="ident">RedisResult</span>, <span class="ident">Value</span>};
|
||||||
<span class="kw">use</span> <span class="ident">time</span>::{<span class="self">self</span>, <span class="ident">Duration</span>};
|
<span class="kw">use</span> <span class="ident">time</span>::{<span class="self">self</span>, <span class="ident">Duration</span>};
|
||||||
|
|
||||||
<span class="kw">use</span> <span class="ident"><span class="kw">super</span>::SessionKey</span>;
|
<span class="kw">use</span> <span class="ident"><span class="kw">super</span>::SessionKey</span>;
|
||||||
@ -440,10 +472,9 @@
|
|||||||
<span class="kw">impl</span> <span class="ident">SessionStore</span> <span class="kw">for</span> <span class="ident">RedisSessionStore</span> {
|
<span class="kw">impl</span> <span class="ident">SessionStore</span> <span class="kw">for</span> <span class="ident">RedisSessionStore</span> {
|
||||||
<span class="kw">async</span> <span class="kw">fn</span> <span class="ident">load</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">session_key</span>: <span class="kw-2">&</span><span class="ident">SessionKey</span>) -> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">SessionState</span><span class="op">></span>, <span class="ident">LoadError</span><span class="op">></span> {
|
<span class="kw">async</span> <span class="kw">fn</span> <span class="ident">load</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">session_key</span>: <span class="kw-2">&</span><span class="ident">SessionKey</span>) -> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">SessionState</span><span class="op">></span>, <span class="ident">LoadError</span><span class="op">></span> {
|
||||||
<span class="kw">let</span> <span class="ident">cache_key</span> <span class="op">=</span> (<span class="self">self</span>.<span class="ident">configuration</span>.<span class="ident">cache_keygen</span>)(<span class="ident">session_key</span>.<span class="ident">as_ref</span>());
|
<span class="kw">let</span> <span class="ident">cache_key</span> <span class="op">=</span> (<span class="self">self</span>.<span class="ident">configuration</span>.<span class="ident">cache_keygen</span>)(<span class="ident">session_key</span>.<span class="ident">as_ref</span>());
|
||||||
|
|
||||||
<span class="kw">let</span> <span class="ident">value</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">String</span><span class="op">></span> <span class="op">=</span> <span class="self">self</span>
|
<span class="kw">let</span> <span class="ident">value</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">String</span><span class="op">></span> <span class="op">=</span> <span class="self">self</span>
|
||||||
.<span class="ident">client</span>
|
.<span class="ident">execute_command</span>(<span class="ident">redis::cmd</span>(<span class="string">"GET"</span>).<span class="ident">arg</span>(<span class="kw-2">&</span>[<span class="kw-2">&</span><span class="ident">cache_key</span>]))
|
||||||
.<span class="ident">clone</span>()
|
|
||||||
.<span class="ident">get</span>(<span class="ident">cache_key</span>)
|
|
||||||
.<span class="kw">await</span>
|
.<span class="kw">await</span>
|
||||||
.<span class="ident">map_err</span>(<span class="ident">Into::into</span>)
|
.<span class="ident">map_err</span>(<span class="ident">Into::into</span>)
|
||||||
.<span class="ident">map_err</span>(<span class="ident">LoadError::Other</span>)<span class="question-mark">?</span>;
|
.<span class="ident">map_err</span>(<span class="ident">LoadError::Other</span>)<span class="question-mark">?</span>;
|
||||||
@ -467,18 +498,16 @@
|
|||||||
<span class="kw">let</span> <span class="ident">session_key</span> <span class="op">=</span> <span class="ident">generate_session_key</span>();
|
<span class="kw">let</span> <span class="ident">session_key</span> <span class="op">=</span> <span class="ident">generate_session_key</span>();
|
||||||
<span class="kw">let</span> <span class="ident">cache_key</span> <span class="op">=</span> (<span class="self">self</span>.<span class="ident">configuration</span>.<span class="ident">cache_keygen</span>)(<span class="ident">session_key</span>.<span class="ident">as_ref</span>());
|
<span class="kw">let</span> <span class="ident">cache_key</span> <span class="op">=</span> (<span class="self">self</span>.<span class="ident">configuration</span>.<span class="ident">cache_keygen</span>)(<span class="ident">session_key</span>.<span class="ident">as_ref</span>());
|
||||||
|
|
||||||
<span class="ident">redis::cmd</span>(<span class="string">"SET"</span>)
|
<span class="self">self</span>.<span class="ident">execute_command</span>(<span class="ident">redis::cmd</span>(<span class="string">"SET"</span>).<span class="ident">arg</span>(<span class="kw-2">&</span>[
|
||||||
.<span class="ident">arg</span>(<span class="kw-2">&</span>[
|
<span class="kw-2">&</span><span class="ident">cache_key</span>,
|
||||||
<span class="kw-2">&</span><span class="ident">cache_key</span>,
|
<span class="kw-2">&</span><span class="ident">body</span>,
|
||||||
<span class="kw-2">&</span><span class="ident">body</span>,
|
<span class="string">"NX"</span>, <span class="comment">// NX: only set the key if it does not already exist</span>
|
||||||
<span class="string">"NX"</span>, <span class="comment">// NX: only set the key if it does not already exist</span>
|
<span class="string">"EX"</span>, <span class="comment">// EX: set expiry</span>
|
||||||
<span class="string">"EX"</span>, <span class="comment">// EX: set expiry</span>
|
<span class="kw-2">&</span><span class="macro">format!</span>(<span class="string">"{}"</span>, <span class="ident">ttl</span>.<span class="ident">whole_seconds</span>()),
|
||||||
<span class="kw-2">&</span><span class="macro">format!</span>(<span class="string">"{}"</span>, <span class="ident">ttl</span>.<span class="ident">whole_seconds</span>()),
|
]))
|
||||||
])
|
.<span class="kw">await</span>
|
||||||
.<span class="ident">query_async</span>(<span class="kw-2">&mut</span> <span class="self">self</span>.<span class="ident">client</span>.<span class="ident">clone</span>())
|
.<span class="ident">map_err</span>(<span class="ident">Into::into</span>)
|
||||||
.<span class="kw">await</span>
|
.<span class="ident">map_err</span>(<span class="ident">SaveError::Other</span>)<span class="question-mark">?</span>;
|
||||||
.<span class="ident">map_err</span>(<span class="ident">Into::into</span>)
|
|
||||||
.<span class="ident">map_err</span>(<span class="ident">SaveError::Other</span>)<span class="question-mark">?</span>;
|
|
||||||
|
|
||||||
<span class="prelude-val">Ok</span>(<span class="ident">session_key</span>)
|
<span class="prelude-val">Ok</span>(<span class="ident">session_key</span>)
|
||||||
}
|
}
|
||||||
@ -495,15 +524,14 @@
|
|||||||
|
|
||||||
<span class="kw">let</span> <span class="ident">cache_key</span> <span class="op">=</span> (<span class="self">self</span>.<span class="ident">configuration</span>.<span class="ident">cache_keygen</span>)(<span class="ident">session_key</span>.<span class="ident">as_ref</span>());
|
<span class="kw">let</span> <span class="ident">cache_key</span> <span class="op">=</span> (<span class="self">self</span>.<span class="ident">configuration</span>.<span class="ident">cache_keygen</span>)(<span class="ident">session_key</span>.<span class="ident">as_ref</span>());
|
||||||
|
|
||||||
<span class="kw">let</span> <span class="ident">v</span>: <span class="ident">redis::Value</span> <span class="op">=</span> <span class="ident">redis::cmd</span>(<span class="string">"SET"</span>)
|
<span class="kw">let</span> <span class="ident">v</span>: <span class="ident">redis::Value</span> <span class="op">=</span> <span class="self">self</span>
|
||||||
.<span class="ident">arg</span>(<span class="kw-2">&</span>[
|
.<span class="ident">execute_command</span>(<span class="ident">redis::cmd</span>(<span class="string">"SET"</span>).<span class="ident">arg</span>(<span class="kw-2">&</span>[
|
||||||
<span class="kw-2">&</span><span class="ident">cache_key</span>,
|
<span class="kw-2">&</span><span class="ident">cache_key</span>,
|
||||||
<span class="kw-2">&</span><span class="ident">body</span>,
|
<span class="kw-2">&</span><span class="ident">body</span>,
|
||||||
<span class="string">"XX"</span>, <span class="comment">// XX: Only set the key if it already exist.</span>
|
<span class="string">"XX"</span>, <span class="comment">// XX: Only set the key if it already exist.</span>
|
||||||
<span class="string">"EX"</span>, <span class="comment">// EX: set expiry</span>
|
<span class="string">"EX"</span>, <span class="comment">// EX: set expiry</span>
|
||||||
<span class="kw-2">&</span><span class="macro">format!</span>(<span class="string">"{}"</span>, <span class="ident">ttl</span>.<span class="ident">whole_seconds</span>()),
|
<span class="kw-2">&</span><span class="macro">format!</span>(<span class="string">"{}"</span>, <span class="ident">ttl</span>.<span class="ident">whole_seconds</span>()),
|
||||||
])
|
]))
|
||||||
.<span class="ident">query_async</span>(<span class="kw-2">&mut</span> <span class="self">self</span>.<span class="ident">client</span>.<span class="ident">clone</span>())
|
|
||||||
.<span class="kw">await</span>
|
.<span class="kw">await</span>
|
||||||
.<span class="ident">map_err</span>(<span class="ident">Into::into</span>)
|
.<span class="ident">map_err</span>(<span class="ident">Into::into</span>)
|
||||||
.<span class="ident">map_err</span>(<span class="ident">UpdateError::Other</span>)<span class="question-mark">?</span>;
|
.<span class="ident">map_err</span>(<span class="ident">UpdateError::Other</span>)<span class="question-mark">?</span>;
|
||||||
@ -531,10 +559,7 @@
|
|||||||
|
|
||||||
<span class="kw">async</span> <span class="kw">fn</span> <span class="ident">delete</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">session_key</span>: <span class="kw-2">&</span><span class="ident">SessionKey</span>) -> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">anyhow::Error</span><span class="op">></span> {
|
<span class="kw">async</span> <span class="kw">fn</span> <span class="ident">delete</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">session_key</span>: <span class="kw-2">&</span><span class="ident">SessionKey</span>) -> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">anyhow::Error</span><span class="op">></span> {
|
||||||
<span class="kw">let</span> <span class="ident">cache_key</span> <span class="op">=</span> (<span class="self">self</span>.<span class="ident">configuration</span>.<span class="ident">cache_keygen</span>)(<span class="ident">session_key</span>.<span class="ident">as_ref</span>());
|
<span class="kw">let</span> <span class="ident">cache_key</span> <span class="op">=</span> (<span class="self">self</span>.<span class="ident">configuration</span>.<span class="ident">cache_keygen</span>)(<span class="ident">session_key</span>.<span class="ident">as_ref</span>());
|
||||||
|
<span class="self">self</span>.<span class="ident">execute_command</span>(<span class="ident">redis::cmd</span>(<span class="string">"DEL"</span>).<span class="ident">arg</span>(<span class="kw-2">&</span>[<span class="kw-2">&</span><span class="ident">cache_key</span>]))
|
||||||
<span class="self">self</span>.<span class="ident">client</span>
|
|
||||||
.<span class="ident">clone</span>()
|
|
||||||
.<span class="ident">del</span>(<span class="kw-2">&</span><span class="ident">cache_key</span>)
|
|
||||||
.<span class="kw">await</span>
|
.<span class="kw">await</span>
|
||||||
.<span class="ident">map_err</span>(<span class="ident">Into::into</span>)
|
.<span class="ident">map_err</span>(<span class="ident">Into::into</span>)
|
||||||
.<span class="ident">map_err</span>(<span class="ident">UpdateError::Other</span>)<span class="question-mark">?</span>;
|
.<span class="ident">map_err</span>(<span class="ident">UpdateError::Other</span>)<span class="question-mark">?</span>;
|
||||||
@ -543,6 +568,45 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<span class="kw">impl</span> <span class="ident">RedisSessionStore</span> {
|
||||||
|
<span class="doccomment">/// Execute Redis command and retry once in certain cases.</span>
|
||||||
|
<span class="doccomment">///</span>
|
||||||
|
<span class="doccomment">/// `ConnectionManager` automatically reconnects when it encounters an error talking to Redis.</span>
|
||||||
|
<span class="doccomment">/// The request that bumped into the error, though, fails.</span>
|
||||||
|
<span class="doccomment">///</span>
|
||||||
|
<span class="doccomment">/// This is generally OK, but there is an unpleasant edge case: Redis client timeouts. The</span>
|
||||||
|
<span class="doccomment">/// server is configured to drop connections who have been active longer than a pre-determined</span>
|
||||||
|
<span class="doccomment">/// threshold. `redis-rs` does not proactively detect that the connection has been dropped - you</span>
|
||||||
|
<span class="doccomment">/// only find out when you try to use it.</span>
|
||||||
|
<span class="doccomment">///</span>
|
||||||
|
<span class="doccomment">/// This helper method catches this case (`.is_connection_dropped`) to execute a retry. The</span>
|
||||||
|
<span class="doccomment">/// retry will be executed on a fresh connection, therefore it is likely to succeed (or fail for</span>
|
||||||
|
<span class="doccomment">/// a different more meaningful reason).</span>
|
||||||
|
<span class="kw">async</span> <span class="kw">fn</span> <span class="ident">execute_command</span><span class="op"><</span><span class="ident">T</span>: <span class="ident">FromRedisValue</span><span class="op">></span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">cmd</span>: <span class="kw-2">&mut</span> <span class="ident">Cmd</span>) -> <span class="ident">RedisResult</span><span class="op"><</span><span class="ident">T</span><span class="op">></span> {
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">can_retry</span> <span class="op">=</span> <span class="bool-val">true</span>;
|
||||||
|
|
||||||
|
<span class="kw">loop</span> {
|
||||||
|
<span class="kw">match</span> <span class="ident">cmd</span>.<span class="ident">query_async</span>(<span class="kw-2">&mut</span> <span class="self">self</span>.<span class="ident">client</span>.<span class="ident">clone</span>()).<span class="kw">await</span> {
|
||||||
|
<span class="prelude-val">Ok</span>(<span class="ident">value</span>) => <span class="kw">return</span> <span class="prelude-val">Ok</span>(<span class="ident">value</span>),
|
||||||
|
<span class="prelude-val">Err</span>(<span class="ident">err</span>) => {
|
||||||
|
<span class="kw">if</span> <span class="ident">can_retry</span> <span class="op">&&</span> <span class="ident">err</span>.<span class="ident">is_connection_dropped</span>() {
|
||||||
|
<span class="macro">tracing::debug!</span>(
|
||||||
|
<span class="string">"Connection dropped while trying to talk to Redis. Retrying."</span>
|
||||||
|
);
|
||||||
|
|
||||||
|
<span class="comment">// Retry at most once</span>
|
||||||
|
<span class="ident">can_retry</span> <span class="op">=</span> <span class="bool-val">false</span>;
|
||||||
|
|
||||||
|
<span class="kw">continue</span>;
|
||||||
|
} <span class="kw">else</span> {
|
||||||
|
<span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">err</span>);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
|
<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
|
||||||
<span class="kw">mod</span> <span class="ident">test</span> {
|
<span class="kw">mod</span> <span class="ident">test</span> {
|
||||||
<span class="kw">use</span> <span class="ident">std::collections::HashMap</span>;
|
<span class="kw">use</span> <span class="ident">std::collections::HashMap</span>;
|
||||||
|
Loading…
Reference in New Issue
Block a user