Crates.io | ntex-redis |
lib.rs | ntex-redis |
version | 2.0.0 |
source | src |
created_at | 2021-03-10 14:12:46.04183 |
updated_at | 2024-05-28 15:12:07.344226 |
description | Redis client |
homepage | |
repository | https://github.com/ntex-rs/ntex-redis.git |
max_upload_size | |
id | 366792 |
size | 153,756 |
redis client for ntex framework
use ntex_redis::{cmd, RedisConnector};
#[ntex::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let redis = RedisConnector::new("127.0.0.1:6379").connect().await?;
// create list with one value
redis.exec(cmd::LPush("test", "value"));
// get value by index
let value = redis.exec(cmd::LIndex("test", 0)).await?;
assert_eq!(value.unwrap(), "value");
// remove key
redis.exec(cmd::Del("test")).await?;
Ok(())
}
This project is licensed under