mairie360_api_lib 0.5.0

Lib for mairie360 APIs
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use deadpool_redis::redis::AsyncCommands;
use deadpool_redis::Connection;

pub async fn delete_key(conn: &mut Connection, key: &str) -> Result<(), redis::RedisError> {
    match conn.del::<&str, i32>(key).await {
        Ok(0) => Err(redis::RedisError::from((
            redis::ErrorKind::Io,
            "Key not found",
        ))),
        Ok(_) => Ok(()),
        Err(err) => Err(err),
    }
}