pub trait CacheBackend: Send + Sync {
// Required methods
fn check<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
task: &'life1 IRTask,
digest: &'life2 str,
policy: CachePolicy,
) -> Pin<Box<dyn Future<Output = BackendResult<CacheLookupResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn store<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
task: &'life1 IRTask,
digest: &'life2 str,
entry: &'life3 CacheEntry,
policy: CachePolicy,
) -> Pin<Box<dyn Future<Output = BackendResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn restore_outputs<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
task: &'life1 IRTask,
digest: &'life2 str,
workspace: &'life3 Path,
) -> Pin<Box<dyn Future<Output = BackendResult<Vec<CacheOutput>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn get_logs<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
task: &'life1 IRTask,
digest: &'life2 str,
) -> Pin<Box<dyn Future<Output = BackendResult<(Option<String>, Option<String>)>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn name(&self) -> &'static str;
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = BackendResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Cache backend trait for pluggable cache implementations
Implementations must be thread-safe (Send + Sync) for concurrent task execution.
Required Methods§
Sourcefn check<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
task: &'life1 IRTask,
digest: &'life2 str,
policy: CachePolicy,
) -> Pin<Box<dyn Future<Output = BackendResult<CacheLookupResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn check<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
task: &'life1 IRTask,
digest: &'life2 str,
policy: CachePolicy,
) -> Pin<Box<dyn Future<Output = BackendResult<CacheLookupResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Sourcefn store<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
task: &'life1 IRTask,
digest: &'life2 str,
entry: &'life3 CacheEntry,
policy: CachePolicy,
) -> Pin<Box<dyn Future<Output = BackendResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn store<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
task: &'life1 IRTask,
digest: &'life2 str,
entry: &'life3 CacheEntry,
policy: CachePolicy,
) -> Pin<Box<dyn Future<Output = BackendResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Sourcefn restore_outputs<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
task: &'life1 IRTask,
digest: &'life2 str,
workspace: &'life3 Path,
) -> Pin<Box<dyn Future<Output = BackendResult<Vec<CacheOutput>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn restore_outputs<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
task: &'life1 IRTask,
digest: &'life2 str,
workspace: &'life3 Path,
) -> Pin<Box<dyn Future<Output = BackendResult<Vec<CacheOutput>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Sourcefn get_logs<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
task: &'life1 IRTask,
digest: &'life2 str,
) -> Pin<Box<dyn Future<Output = BackendResult<(Option<String>, Option<String>)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_logs<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
task: &'life1 IRTask,
digest: &'life2 str,
) -> Pin<Box<dyn Future<Output = BackendResult<(Option<String>, Option<String>)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Sourcefn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = BackendResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = BackendResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Check if the backend is available/connected