pub trait FileCache<V> {
// Required methods
async fn get(&self, key: &str) -> Result<Option<V>>;
async fn get_stale(&self, key: &str) -> Result<Option<V>>;
async fn set(&self, key: &str, value: &V) -> Result<()>;
async fn remove(&self, key: &str) -> Result<()>;
}Expand description
Trait for TTL-based filesystem caching.
Provides a unified interface for caching serializable data with time-to-live validation.
async_fn_in_trait is suppressed because this trait is re-exported for use by crate
consumers but is never intended to be implemented externally or used as dyn FileCache.
All known implementors are in this crate, so auto-trait bounds are not a concern.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.