Skip to main content

Cache

Trait Cache 

Source
pub trait Cache: Send + Sync {
    // Required methods
    fn delete(&self, key: &str) -> Result<(), String>;
    fn get(&self, key: &str) -> Result<Option<CacheRecord>, String>;
    fn set(&self, key: String, record: CacheRecord) -> Result<(), String>;
}

Required Methods§

Source

fn delete(&self, key: &str) -> Result<(), String>

Source

fn get(&self, key: &str) -> Result<Option<CacheRecord>, String>

Source

fn set(&self, key: String, record: CacheRecord) -> Result<(), String>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§