Skip to main content

CacheStore

Trait CacheStore 

Source
pub trait CacheStore: Send + Sync {
    // Required methods
    fn get(&self, key: &CacheKey) -> Result<Option<Value>>;
    fn put(&self, key: &CacheKey, value: &Value) -> Result<()>;
    fn exists(&self, key: &CacheKey) -> Result<bool>;
    fn remove(&self, key: &CacheKey) -> Result<()>;
    fn metadata(&self, key: &CacheKey) -> Result<Option<EntryMeta>>;
}
Expand description

The K/V cache store interface.

Implementations may be in-memory, on-disk (RocksDB/sled), or remote (S3). The tiered cache composes multiple stores.

Required Methods§

Source

fn get(&self, key: &CacheKey) -> Result<Option<Value>>

Source

fn put(&self, key: &CacheKey, value: &Value) -> Result<()>

Source

fn exists(&self, key: &CacheKey) -> Result<bool>

Source

fn remove(&self, key: &CacheKey) -> Result<()>

Source

fn metadata(&self, key: &CacheKey) -> Result<Option<EntryMeta>>

Implementors§