whatsapp_rust/cache.rs
1//! Unified cache type that dispatches to moka or the portable implementation
2//! depending on the `moka-cache` feature flag.
3//!
4//! When `moka-cache` is enabled (default), [`Cache`] is `moka::future::Cache`.
5//! When disabled, [`Cache`] is [`PortableCache`](crate::portable_cache::PortableCache).
6
7#[cfg(feature = "moka-cache")]
8mod inner {
9 pub type Cache<K, V> = moka::future::Cache<K, V>;
10}
11
12#[cfg(not(feature = "moka-cache"))]
13mod inner {
14 pub type Cache<K, V> = crate::portable_cache::PortableCache<K, V>;
15}
16
17pub use inner::Cache;