Project status & info:
| License | Crates Version | Docs |
| :--------------------------------------------: | :---------------------------------------: | :----------------------------------: |
| |
|
|
Rust library built for async session store for deadpool redis
Edit Cargo.toml file to add asyncdeadpoolredis_session as dependencies
toml
[dependencies]
async_deadpool_redis_session = "0.3.0"
```rust use asyncdeadpoolredissession::{RedisSessionStore}; use asyncdeadpoolredissession::asyncsession::{Session, SessionStore}; use asyncdeadpoolredissession::deadpool_redis::{Config, Runtime};
// pool creation let config = Config::fromurl("redis://127.0.0.1:6379").unwrap(); let redispool = config.createpool(Some(Runtime::Tokio1)).unwrap(); // store and session let store = RedisSessionStore::new(redispool); let mut session = Session::new(); session.insert("key", "value").unwrap();
let cookievalue = store.storesession(session).await.unwrap().unwrap();
let session = store.loadsession(cookievalue).await.unwrap().unwrap();
assert_eq!(&session.get::