athena_rs 1.1.0

Database gateway API
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use once_cell::sync::OnceCell;
use serde_json::Value;
use tokio::sync::Mutex;

// Minimal async Redis-like client trait with only methods used here.
pub struct DummyRedisClient;

impl DummyRedisClient {
    pub async fn get(&self, _key: &str) -> Result<Value, ()> {
        Ok(Value::Null)
    }

    pub async fn set_with_ttl(&self, _key: &str, _value: &Value, _ttl_secs: u64) -> Result<(), ()> {
        Ok(())
    }
}

pub static GLOBAL_REDIS: OnceCell<Mutex<DummyRedisClient>> = OnceCell::new();