pub trait ChunkCache: Send + Sync {
// Required methods
fn get(&self, addr: &str) -> Option<Bytes>;
fn put(&self, addr: &str, body: &[u8]);
fn remove(&self, addr: &str);
fn retain(&self, live: &HashSet<String>);
}Expand description
Chunk bodies by content address. Every method is best effort: a cache that cannot read or write costs requests, never correctness, so nothing here returns an error.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".