Skip to main content

PackCache

Trait PackCache 

Source
pub trait PackCache {
    // Required methods
    fn get(&mut self, key: Key) -> Result<Option<&[u8]>>;
    fn put(&mut self, key: Key, pack: &[u8]) -> Result<()>;
}
Expand description

Hosts own persistence, eviction and concurrency. A failed insertion must preserve the old entry. Successful insertion publishes complete immutable bytes atomically. Returned bytes are always verified by write before use.

Required Methods§

Source

fn get(&mut self, key: Key) -> Result<Option<&[u8]>>

Source

fn put(&mut self, key: Key, pack: &[u8]) -> Result<()>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§