How javalsai/rs-ezcache works
Key Components to Include:
Core Library Components
• Basic Cache Traits (fallible/infallible variants)
• Generative Cache Traits
Storage Backends
• Memory Store
• File Store (under 'file-stores' feature)
Thread-Safe Layer
• How it wraps around both core traits and storage implementations
Feature Flags
• std (default)
• thread-safe (default)
• file-stores (default)
• nightly (optional)
Core Layer (Bottom)
┌─────────────────────────────────────┐
• Core Traits │
• ┌──────────┐ ┌──────────┐ │
• Cache │ │Generative│ │
• Traits │───────▶│ Cache │ │
• ┘ └──────────┘ │
• ┘
Storage Layer (Middle)
┌─────────────────────────────────────┐
• Storage Implementations │
• ┌──────────┐ ┌──────────┐ │
• Memory │ │ File │ │
• Store │ │ Store │ │
• ┘ └──────────┘ │
• ┘
┌ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┐
• Thread-Safe Variants
• ┌──────────┐ ┌──────────┐ │
• TS Memory │ │TS File │
• Store │ │ Store │ │
• ┘ └──────────┘
• ┘
Important Elements to Include:
• From storage implementations to core traits
• From thread-safe variants to their base implementations
Data Flow
• Cache miss/hit paths
Interface Points
• Public API entry points
• Where custom implementations can plug in
Recommendations: