mirror of
https://github.com/actix/actix-extras.git
synced 2025-09-02 21:16:37 +02:00
Deploying to gh-pages from @ 8fd166435f
🚀
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<!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="Source of the Rust file `actix-session/src/storage/redis_actor.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>redis_actor.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" href="../../../normalize.css"><link rel="stylesheet" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" href="../../../ayu.css" disabled><link rel="stylesheet" href="../../../dark.css" disabled><link rel="stylesheet" href="../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../storage.js"></script><script defer src="../../../source-script.js"></script><script defer src="../../../source-files.js"></script><script defer src="../../../main.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" href="https://actix.rs/favicon.ico"></head><body class="rustdoc source"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><div class="width-limiter"><nav class="sub"><a class="sub-logo-container" href="../../../actix_session/index.html">
|
||||
<img src="https://actix.rs/img/logo.png" alt="logo"></a><form class="search-form"><span></span><input class="search-input" name="search" 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="../../../wheel.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><pre class="src-line-numbers"><span id="1">1</span>
|
||||
<!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="Source of the Rust file `actix-session/src/storage/redis_actor.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>redis_actor.rs - source</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-ef244fc9943488f7.css" id="mainThemeStyle"><link rel="stylesheet" id="themeStyle" href="../../../static.files/light-c11f492748536797.css"><link rel="stylesheet" disabled href="../../../static.files/dark-a78f946771c40031.css"><link rel="stylesheet" disabled href="../../../static.files/ayu-70b683d68cb31790.css"><script id="default-settings" ></script><script src="../../../static.files/storage-d43fa987303ecbbb.js"></script><script defer src="../../../static.files/source-script-74087aa2e88f4475.js"></script><script defer src="../../../source-files.js"></script><script defer src="../../../static.files/main-0dede64717b247ca.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-201a7e04dc4c6fce.css"></noscript><link rel="icon" href="https://actix.rs/favicon.ico"></head><body class="rustdoc source"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><div class="width-limiter"><nav class="sub"><a class="sub-logo-container" href="../../../actix_session/index.html">
|
||||
<img src="https://actix.rs/img/logo.png" alt="logo"></a><form class="search-form"><span></span><input class="search-input" name="search" 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="example-wrap"><pre class="src-line-numbers"><span id="1">1</span>
|
||||
<span id="2">2</span>
|
||||
<span id="3">3</span>
|
||||
<span id="4">4</span>
|
||||
@@ -369,7 +369,7 @@
|
||||
/// Redis. Use [`RedisSessionStore`] if you need TLS support.
|
||||
///
|
||||
/// [`RedisSessionStore`]: crate::storage::RedisSessionStore
|
||||
</span><span class="attribute">#[cfg_attr(docsrs, doc(cfg(feature = <span class="string">"redis-actor-session"</span>)))]
|
||||
</span><span class="attr">#[cfg_attr(docsrs, doc(cfg(feature = <span class="string">"redis-actor-session"</span>)))]
|
||||
</span><span class="kw">pub struct </span>RedisActorSessionStore {
|
||||
configuration: CacheConfiguration,
|
||||
addr: Addr<RedisActor>,
|
||||
@@ -409,7 +409,7 @@
|
||||
|
||||
<span class="doccomment">/// A fluent builder to construct a [`RedisActorSessionStore`] instance with custom configuration
|
||||
/// parameters.
|
||||
</span><span class="attribute">#[cfg_attr(docsrs, doc(cfg(feature = <span class="string">"redis-actor-session"</span>)))]
|
||||
</span><span class="attr">#[cfg_attr(docsrs, doc(cfg(feature = <span class="string">"redis-actor-session"</span>)))]
|
||||
#[must_use]
|
||||
</span><span class="kw">pub struct </span>RedisActorSessionStoreBuilder {
|
||||
connection_string: String,
|
||||
@@ -427,7 +427,7 @@
|
||||
</span>}
|
||||
|
||||
<span class="doccomment">/// Finalise the builder and return a [`RedisActorSessionStore`] instance.
|
||||
</span><span class="attribute">#[must_use]
|
||||
</span><span class="attr">#[must_use]
|
||||
</span><span class="kw">pub fn </span>build(<span class="self">self</span>) -> RedisActorSessionStore {
|
||||
RedisActorSessionStore {
|
||||
configuration: <span class="self">self</span>.configuration,
|
||||
@@ -436,7 +436,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
<span class="attribute">#[async_trait::async_trait(<span class="question-mark">?</span>Send)]
|
||||
<span class="attr">#[async_trait::async_trait(<span class="question-mark">?</span>Send)]
|
||||
</span><span class="kw">impl </span>SessionStore <span class="kw">for </span>RedisActorSessionStore {
|
||||
<span class="kw">async fn </span>load(<span class="kw-2">&</span><span class="self">self</span>, session_key: <span class="kw-2">&</span>SessionKey) -> <span class="prelude-ty">Result</span><<span class="prelude-ty">Option</span><SessionState>, LoadError> {
|
||||
<span class="kw">let </span>cache_key = (<span class="self">self</span>.configuration.cache_keygen)(session_key.as_ref());
|
||||
@@ -592,7 +592,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
<span class="attribute">#[cfg(test)]
|
||||
<span class="attr">#[cfg(test)]
|
||||
</span><span class="kw">mod </span>tests {
|
||||
<span class="kw">use </span>std::collections::HashMap;
|
||||
|
||||
@@ -605,19 +605,19 @@
|
||||
RedisActorSessionStore::new(<span class="string">"127.0.0.1:6379"</span>)
|
||||
}
|
||||
|
||||
<span class="attribute">#[actix_web::test]
|
||||
<span class="attr">#[actix_web::test]
|
||||
</span><span class="kw">async fn </span>test_session_workflow() {
|
||||
acceptance_test_suite(redis_actor_store, <span class="bool-val">true</span>).<span class="kw">await</span>;
|
||||
}
|
||||
|
||||
<span class="attribute">#[actix_web::test]
|
||||
<span class="attr">#[actix_web::test]
|
||||
</span><span class="kw">async fn </span>loading_a_missing_session_returns_none() {
|
||||
<span class="kw">let </span>store = redis_actor_store();
|
||||
<span class="kw">let </span>session_key = generate_session_key();
|
||||
<span class="macro">assert!</span>(store.load(<span class="kw-2">&</span>session_key).<span class="kw">await</span>.unwrap().is_none());
|
||||
}
|
||||
|
||||
<span class="attribute">#[actix_web::test]
|
||||
<span class="attr">#[actix_web::test]
|
||||
</span><span class="kw">async fn </span>updating_of_an_expired_state_is_handled_gracefully() {
|
||||
<span class="kw">let </span>store = redis_actor_store();
|
||||
<span class="kw">let </span>session_key = generate_session_key();
|
||||
@@ -630,4 +630,4 @@
|
||||
}
|
||||
}
|
||||
</code></pre></div>
|
||||
</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.66.0-nightly (5e9772042 2022-10-29)" ></div></body></html>
|
||||
</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.67.0-nightly (73c9eaf21 2022-11-07)" data-search-js="search-39ee4160c7dc16c9.js" data-settings-js="settings-3a0b9947ba1bd99a.js" data-settings-css="settings-a66f7524084a489a.css" ></div></body></html>
|
Reference in New Issue
Block a user