Skip to main content

GithubReadCacheStore

Trait GithubReadCacheStore 

Source
pub trait GithubReadCacheStore: Send + Sync {
    // Required methods
    fn lookup(
        &self,
        key: &GithubReadCacheKey,
    ) -> Result<Option<GithubReadCacheEntry>, String>;
    fn upsert(
        &self,
        key: &GithubReadCacheKey,
        canonical_text: &str,
        fetched_at_ms: i64,
    ) -> Result<(), String>;
    fn invalidate(
        &self,
        kind: GithubResourceKind,
        repository: &str,
        number: u64,
        authentication_identity: Option<&str>,
    ) -> Result<usize, String>;
}
Expand description

A cache persistence seam. The production implementation stores canonical text in AFT’s existing aft.db; tests can use an in-memory fixture store.

Required Methods§

Source

fn lookup( &self, key: &GithubReadCacheKey, ) -> Result<Option<GithubReadCacheEntry>, String>

Source

fn upsert( &self, key: &GithubReadCacheKey, canonical_text: &str, fetched_at_ms: i64, ) -> Result<(), String>

Source

fn invalidate( &self, kind: GithubResourceKind, repository: &str, number: u64, authentication_identity: Option<&str>, ) -> Result<usize, String>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§