Skip to main content

CacheBackend

Trait CacheBackend 

Source
pub trait CacheBackend: Send + Sync {
    // Required methods
    fn get<'a>(&'a self, key: &'a str) -> CacheFuture<'a, Option<String>>;
    fn set<'a>(
        &'a self,
        key: &'a str,
        value: String,
        ttl: Duration,
    ) -> CacheFuture<'a, ()>;
}
Expand description

Cache backend abstraction used for rules payload caching.

Required Methods§

Source

fn get<'a>(&'a self, key: &'a str) -> CacheFuture<'a, Option<String>>

Returns the value stored under key, or None if there is none or it has expired.

Source

fn set<'a>( &'a self, key: &'a str, value: String, ttl: Duration, ) -> CacheFuture<'a, ()>

Stores value under key for ttl.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§