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§
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<()>>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".