pub trait CacheStore:
Send
+ Sync
+ Debug {
// Required methods
fn get(&self, key: &str) -> Option<CachedEntry>;
fn put(&self, key: String, value: CachedEntry);
}Expand description
Backing store for CacheMiddleware.
Synchronous on purpose — see the module docs.
Required Methods§
Sourcefn get(&self, key: &str) -> Option<CachedEntry>
fn get(&self, key: &str) -> Option<CachedEntry>
Look up an entry by key. None is a miss.
Sourcefn put(&self, key: String, value: CachedEntry)
fn put(&self, key: String, value: CachedEntry)
Store an entry. Overwrites any existing value for key.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".