Skip to main content

CacheStore

Trait CacheStore 

Source
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§

Source

fn get(&self, key: &str) -> Option<CachedEntry>

Look up an entry by key. None is a miss.

Source

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".

Implementors§