Skip to main content

DistributedCacheExtensions

Trait DistributedCacheExtensions 

Source
pub trait DistributedCacheExtensions: IDistributedCache {
    // Required methods
    fn get_string<'life0, 'life1, 'async_trait, T>(
        &'life0 self,
        key: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<T>>> + Send + 'async_trait>>
       where T: 'async_trait + DeserializeOwned + Send,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn set_string<'life0, 'life1, 'life2, 'life3, 'async_trait, T>(
        &'life0 self,
        key: &'life1 str,
        val: &'life2 T,
        opts: &'life3 DistributedCacheEntryOptions,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where T: 'async_trait + Serialize + Send + Sync,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn get_or_create<'life0, 'life1, 'life2, 'async_trait, T, F, Fut>(
        &'life0 self,
        key: &'life1 str,
        factory: F,
        opts: &'life2 DistributedCacheEntryOptions,
    ) -> Pin<Box<dyn Future<Output = Result<T>> + Send + 'async_trait>>
       where T: Serialize + DeserializeOwned + Send + Sync + Clone + 'static + 'async_trait,
             F: FnOnce() -> Fut + Send + 'async_trait,
             Fut: Future<Output = T> + Send + 'async_trait,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn get_or_try_create<'life0, 'life1, 'life2, 'async_trait, T, F, Fut, E>(
        &'life0 self,
        key: &'life1 str,
        factory: F,
        opts: &'life2 DistributedCacheEntryOptions,
    ) -> Pin<Box<dyn Future<Output = Result<T>> + Send + 'async_trait>>
       where T: Serialize + DeserializeOwned + Send + Sync + Clone + 'static + 'async_trait,
             F: FnOnce() -> Fut + Send + 'async_trait,
             Fut: Future<Output = Result<T, E>> + Send + 'async_trait,
             E: Display + 'async_trait,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}

Required Methods§

Source

fn get_string<'life0, 'life1, 'async_trait, T>( &'life0 self, key: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<T>>> + Send + 'async_trait>>
where T: 'async_trait + DeserializeOwned + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn set_string<'life0, 'life1, 'life2, 'life3, 'async_trait, T>( &'life0 self, key: &'life1 str, val: &'life2 T, opts: &'life3 DistributedCacheEntryOptions, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where T: 'async_trait + Serialize + Send + Sync, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Source

fn get_or_create<'life0, 'life1, 'life2, 'async_trait, T, F, Fut>( &'life0 self, key: &'life1 str, factory: F, opts: &'life2 DistributedCacheEntryOptions, ) -> Pin<Box<dyn Future<Output = Result<T>> + Send + 'async_trait>>
where T: Serialize + DeserializeOwned + Send + Sync + Clone + 'static + 'async_trait, F: FnOnce() -> Fut + Send + 'async_trait, Fut: Future<Output = T> + Send + 'async_trait, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn get_or_try_create<'life0, 'life1, 'life2, 'async_trait, T, F, Fut, E>( &'life0 self, key: &'life1 str, factory: F, opts: &'life2 DistributedCacheEntryOptions, ) -> Pin<Box<dyn Future<Output = Result<T>> + Send + 'async_trait>>
where T: Serialize + DeserializeOwned + Send + Sync + Clone + 'static + 'async_trait, F: FnOnce() -> Fut + Send + 'async_trait, Fut: Future<Output = Result<T, E>> + Send + 'async_trait, E: Display + 'async_trait, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§