Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use redis::{Client, Commands, Connection, ToRedisArgs};
- use redis::RedisResult;
- fn client() -> RedisResult<Connection> {
- let redis = Client::open(crate::REDIS_KEY)?;
- redis.get_connection()
- }
- pub fn send(val: &String) -> RedisResult<bool> {
- let mut client = client()?;
- client.rpush(&crate::ram::CONST.who, val)
- }
- pub fn exists<T : ToRedisArgs>(val : T) -> RedisResult<bool> {
- let mut client = client()?;
- client.exists(val)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement