Skip to main content

CacheClient

Trait CacheClient 

Source
pub trait CacheClient {
    // Required method
    fn probe(&self, key: &CacheKey) -> CacheOutcome;

    // Provided method
    fn probe_batch(&self, keys: &[CacheKey]) -> CacheReport { ... }
}
Expand description

Typed cache client. New backends (cachix, R2, S3, IPFS, …) implement this trait + plug into the engine via gen_config.

Required Methods§

Source

fn probe(&self, key: &CacheKey) -> CacheOutcome

Probe a single cache key. Implementations MUST NOT panic; transport-level errors land as Miss { TransportError }.

Provided Methods§

Source

fn probe_batch(&self, keys: &[CacheKey]) -> CacheReport

Probe a batch of keys. Default impl loops probe — override for parallel/HTTP-pipelined implementations.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§