Skip to main content

CacheStore

Trait CacheStore 

Source
pub trait CacheStore:
    Send
    + Sync
    + 'static {
    // Required methods
    fn get(&self, key: String) -> BoxFuture<'_, Result<Option<Value>>>;
    fn set(
        &self,
        key: String,
        value: Value,
        ttl: Option<Duration>,
    ) -> BoxFuture<'_, Result<()>>;
    fn delete(&self, key: String) -> BoxFuture<'_, Result<()>>;
    fn clear(&self) -> BoxFuture<'_, Result<()>>;
}

Required Methods§

Source

fn get(&self, key: String) -> BoxFuture<'_, Result<Option<Value>>>

Source

fn set( &self, key: String, value: Value, ttl: Option<Duration>, ) -> BoxFuture<'_, Result<()>>

Source

fn delete(&self, key: String) -> BoxFuture<'_, Result<()>>

Source

fn clear(&self) -> BoxFuture<'_, Result<()>>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§