global_cache

Function global_cache 

Source
pub fn global_cache() -> &'static DashMapCache
Expand description

Process-wide default cache singleton backed by DashMapCache.

Initialized once on first access via LazyLock. Suitable for lightweight shared caching where a dedicated instance is unnecessary.

ยงExample

use stygian_graph::adapters::cache::global_cache;

global_cache().set("session", "abc".to_string(), None).await.unwrap();
let v = global_cache().get("session").await.unwrap();
assert_eq!(v, Some("abc".to_string()));