mairie360_api_lib 0.8.0

Lib for mairie360 APIs
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use crate::redis::simple_key::key_exist;

pub async fn handle_check_key(
    mut conn: deadpool_redis::Connection,
    key: &str,
) -> Result<(), anyhow::Error> {
    match key_exist(&mut conn, key).await {
        Ok(true) => Ok(()),
        Ok(false) => Err(anyhow::anyhow!("Key does not exist")),
        Err(e) => Err(anyhow::anyhow!(format!("{}", e))),
    }
}