Trait CacheRepo

Source
pub trait CacheRepo {
    // Required methods
    fn get_memo<'life0, 'async_trait>(
        &'life0 self,
        uri: impl 'async_trait + AsRef<str> + Send,
    ) -> Pin<Box<dyn Future<Output = Result<Cache<CacheRecord>, CacheRepoError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn set_memo<'life0, 'async_trait, CacheCandidate>(
        &'life0 self,
        record: CacheCandidate,
    ) -> Pin<Box<dyn Future<Output = Result<CacheRecord, CacheRepoError>> + Send + 'async_trait>>
       where CacheCandidate: IntoCache + Send + 'async_trait,
             Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

The trait for a cache repository. Implement this trait to provide a cache repository interface for any given cache implementation.

Required Methods§

Source

fn get_memo<'life0, 'async_trait>( &'life0 self, uri: impl 'async_trait + AsRef<str> + Send, ) -> Pin<Box<dyn Future<Output = Result<Cache<CacheRecord>, CacheRepoError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get a memo by URI

Source

fn set_memo<'life0, 'async_trait, CacheCandidate>( &'life0 self, record: CacheCandidate, ) -> Pin<Box<dyn Future<Output = Result<CacheRecord, CacheRepoError>> + Send + 'async_trait>>
where CacheCandidate: IntoCache + Send + 'async_trait, Self: 'async_trait, 'life0: 'async_trait,

Set a memo with any type that implements IntoCache

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.

Implementors§