Expand description
§Cache Management for dioxus-provider
This module implements a global, type-erased cache for provider results, supporting:
- Expiration: Entries are removed after a configurable TTL.
- Staleness (SWR): Entries can be marked stale and revalidated in the background.
- LRU Eviction: Least-recently-used entries are evicted to maintain a size limit.
- Access/Usage Stats: Provides statistics for cache introspection and tuning.
§Example
use dioxus_provider::cache::ProviderCache;
let cache = ProviderCache::new();
cache.set("my_key".to_string(), 42);
let value: Option<i32> = cache.get("my_key");Cache management and async state types for dioxus-provider
Structs§
- Cache
Entry - A type-erased cache entry for storing provider results with timestamp and access tracking
- Cache
GetOptions - Options for cache retrieval operations
- Cache
GetResult - Result type for cache get operations with staleness information
- Cache
Maintenance Stats - Statistics for cache maintenance operations
- Cache
Stats - General cache statistics
- Provider
Cache - Global cache for provider results with automatic cleanup