Trait intrepid_model::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

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<Repo> CacheRepo for IntrepidConnection<Repo>
where Repo: InterpidRepo + Send + Sync,