Skip to main content

rskit_cache/
lib.rs

1//! Cache abstraction with local core stores and opt-in remote stores.
2//!
3//! The core crate exports [`CacheStore`], [`CacheRegistry`], [`MemoryCache`],
4//! and [`TypedStore`]. Local, infrastructure-free adapters live in this crate:
5//! memory is always available, and filesystem storage is available with the
6//! `fs` feature. Remote infrastructure stores live in `contrib/` adapter
7//! crates and must be registered explicitly.
8//!
9//! No store is registered by default; construct and inject a registry at the
10//! composition boundary.
11
12#![warn(missing_docs)]
13
14/// Built-in cache adapters.
15pub mod adapters;
16/// Cache store configuration and store-specific options.
17pub mod config;
18/// Explicit store registry and config-driven selection.
19pub mod registry;
20/// Generic JSON-serialised typed store backed by a [`CacheStore`].
21pub mod typed_store;
22
23/// Compatibility exports for the original in-memory adapter module path.
24pub mod memory {
25    pub use crate::adapters::memory::{MemoryCache, register_memory};
26}
27
28#[cfg(feature = "fs")]
29pub use adapters::fs::{FileCache, FileCacheConfig, register_file_cache};
30pub use adapters::memory::{MemoryCache, register_memory};
31pub use config::{CacheConfig, MemoryConfig};
32pub use registry::{CacheRegistry, CacheStore, CacheStoreFactory};
33pub use typed_store::TypedStore;