Skip to content

Commit

Permalink
Update the documentation of Deadpool Redis section on redis_rs.
Browse files Browse the repository at this point in the history
  • Loading branch information
0rangeFox committed Jan 22, 2024
1 parent 3eb98ef commit b8b2dee
Showing 1 changed file with 4 additions and 20 deletions.
24 changes: 4 additions & 20 deletions actix-session/src/storage/redis_rs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,28 +65,12 @@ use crate::storage::{
/// # Deadpool Redis
///
/// ```no_run
/// use actix_web::{web, App, HttpServer, HttpResponse};
/// use actix_session::{SessionMiddleware, storage::RedisSessionStore};
/// use actix_web::cookie::Key;
/// use actix_session::storage::RedisSessionStore;
/// use deadpool_redis::{Config, Runtime};
///
/// #[actix_web::main]
/// async fn main() -> std::io::Result<()> {
/// let redis_cfg = Config::from_url("redis://127.0.0.1:6379");
/// let redis_pool = redis_cfg.create_pool(Some(Runtime::Tokio1)).unwrap();
/// let secret_key = Key::generate();
///
/// HttpServer::new(move ||
/// App::new()
/// .wrap(SessionMiddleware::new(
/// RedisSessionStore::new(redis_pool.clone()),
/// secret_key.clone()
/// ))
/// .default_service(web::to(|| HttpResponse::Ok())))
/// .bind(("127.0.0.1", 8080))?
/// .run()
/// .await
/// }
/// let redis_cfg = Config::from_url("redis://127.0.0.1:6379");
/// let redis_pool = redis_cfg.create_pool(Some(Runtime::Tokio1)).unwrap();
/// let store = RedisSessionStore::new(redis_pool.clone());
/// ```

Check failure on line 74 in actix-session/src/storage/redis_rs.rs

View workflow job for this annotation

GitHub Actions / doc tests

the trait bound `String: From<deadpool::managed::Pool<Manager, deadpool_redis::Connection>>` is not satisfied
///
/// # Implementation notes
Expand Down

0 comments on commit b8b2dee

Please sign in to comment.