Trait CacheFns

Source
pub trait CacheFns {
    // Required methods
    async fn set_cache_key(
        &self,
        key: String,
        value: impl Serialize,
        expire: u32,
    ) -> Result<(), Error>;
    async fn get_cache_key<T>(&self, key: String) -> Result<T, Error>
       where T: DeserializeOwned;
    async fn del_cache_key(&self, key: String) -> Result<(), Error>;
}

Required Methods§

Source

async fn set_cache_key( &self, key: String, value: impl Serialize, expire: u32, ) -> Result<(), Error>

Source

async fn get_cache_key<T>(&self, key: String) -> Result<T, Error>

Source

async fn del_cache_key(&self, key: String) -> Result<(), Error>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl CacheFns for Client

Source§

async fn set_cache_key( &self, key: String, value: impl Serialize, expire: u32, ) -> Result<(), Error>

Source§

async fn get_cache_key<T>(&self, key: String) -> Result<T, Error>

Source§

async fn del_cache_key(&self, key: String) -> Result<(), Error>

Implementors§